/*
Theme Name: Colab
Theme URI: https://colab.org
Author: Colab Studio
Description: Custom dark editorial portfolio theme for Colab architecture studio.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: Private
Text Domain: colab
*/

/* ─────────────────────────────────────────
   TOKEN SYSTEM  (default = dark)
───────────────────────────────────────── */
:root {
  --bg:          transparent;
  --bg-2:        rgba(30,27,24,0.55);
  --bg-3:        rgba(46,46,46,0.6);
  --line:        #444444;
  --line-2:      #333333;
  --text:        #f0ede6;
  --text-muted:  #888888;
  --text-dim:    #555555;
  --accent:      #85D6B6;
  --accent-dark: #2C6F6F;

  --font-display: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:    'Inter', sans-serif;
  --ease:      cubic-bezier(.19,1,.22,1);
  --pad-x:     clamp(24px, 5vw, 80px);
  --pad-y:     clamp(40px, 6vw, 80px);
  --max-w:     1400px;
  --radius-sm: 2px;
  --radius-md: 4px;
}

/* ── Light — segue il sistema ── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg:          transparent;
    --bg-2:        rgba(222,222,222,0.55);
    --bg-3:        rgba(212,212,212,0.6);
    --line:        #c0c0c0;
    --line-2:      #b0b0b0;
    --text:        #161412;
    --text-muted:  #444444;
    --text-dim:    #888888;
    --accent:      #2C6F6F;
    --accent-dark: #85D6B6;
  }
}

/* ── Dark forzato ── */
[data-theme="dark"] {
  --bg:          transparent;
  --bg-2:        rgba(30,27,24,0.55);
  --bg-3:        rgba(46,46,46,0.6);
  --line:        #444444;
  --line-2:      #333333;
  --text:        #f0ede6;
  --text-muted:  #888888;
  --text-dim:    #555555;
  --accent:      #85D6B6;
  --accent-dark: #2C6F6F;
}

/* ── Light forzato ── */
[data-theme="light"] {
  --bg:          transparent;
  --bg-2:        rgba(222,222,222,0.55);
  --bg-3:        rgba(212,212,212,0.6);
  --line:        #c0c0c0;
  --line-2:      #b0b0b0;
  --text:        #161412;
  --text-muted:  #444444;
  --text-dim:    #888888;
  --accent:      #2C6F6F;
  --accent-dark: #85D6B6;
}

/* ── Logo cerchi ── */
[data-theme="light"] .site-logo circle,
[data-theme="light"] #colab-logo circle { fill: #161412; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .site-logo circle,
  :root:not([data-theme]) #colab-logo circle { fill: #161412; }
}

/* ── Transizioni ── */
html { transition: color .35s; }
*, *::before, *::after { transition: background-color .35s, border-color .35s, color .3s; }

/* ─────────────────────────────────────────
   WEBGL CANVAS BACKGROUND
───────────────────────────────────────── */
#gl-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* ─────────────────────────────────────────
   RESET + BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { background: transparent; color: var(--text); font-family: var(--font-body); font-weight: 300; line-height: 1.6; overflow-x: hidden; cursor: none; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: none; background: none; border: none; }
ul, ol { list-style: none; }

/* ─────────────────────────────────────────
   CUSTOM CURSOR
───────────────────────────────────────── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width .3s var(--ease), height .3s var(--ease), background .3s, border .3s;
  will-change: transform;
}
.cursor.is-hovering {
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--text);
  mix-blend-mode: difference;
}
.cursor.is-link {
  width: 52px; height: 52px;
  background: transparent;
  border: 1px solid var(--text);
}

/* ─────────────────────────────────────────
   TYPOGRAPHY HELPERS
───────────────────────────────────────── */
.t-eyebrow  { font-family: var(--font-body); font-size: 11px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.t-display  { font-family: var(--font-display); font-weight: 800; line-height: .92; letter-spacing: -.03em; color: var(--text); }
.t-display--xl { font-size: clamp(52px, 9vw, 120px); }
.t-display--lg { font-size: clamp(36px, 6vw, 72px); }
.t-display--md { font-size: clamp(24px, 4vw, 48px); }
.t-body-lg  { font-size: 16px; color: var(--text-muted); line-height: 1.8; }
.t-body     { font-size: 14px; color: var(--text-muted); line-height: 1.8; }
.t-label    { font-size: 11px; color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; }

.border-top    { border-top: 1px solid var(--line); }
.border-bottom { border-bottom: 1px solid var(--line); }

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
.site-header {
  position: relative;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--pad-x);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, background .4s;
}
.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(22,20,18,.72);
  backdrop-filter: blur(16px);
}
[data-theme="light"] .site-header.is-scrolled { background: rgba(234,234,234,.72); }

.site-logo { display: flex; align-items: center; width: 40px; height: 40px; }
.site-logo svg { overflow: visible; }

/* ─────────────────────────────────────────
   NAV PRIMARY
───────────────────────────────────────── */
.nav-primary { display: flex; gap: 36px; align-items: center; }
.nav-primary a {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
  transition: color .25s;
}
.nav-primary a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--accent); transition: width .3s var(--ease);
}
.nav-primary a:hover, .nav-primary a.current-menu-item { color: var(--text); }
.nav-primary a:hover::after, .nav-primary a.current-menu-item::after { width: 100%; }

/* WordPress wraps menu items in <ul><li><a> */
.nav-primary ul { display: flex; gap: 36px; align-items: center; list-style: none; }
.nav-primary li { margin: 0; }

.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-cta {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); padding: 9px 22px;
  border-radius: var(--radius-sm);
  transition: background .25s, color .25s, border-color .25s;
  color: var(--text);
}
.nav-cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ─────────────────────────────────────────
   THEME TOGGLE
───────────────────────────────────────── */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  transition: border-color .25s, background .25s;
  position: relative;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); background: var(--accent); }
.theme-toggle:hover .toggle-icon { color: var(--bg); transform: rotate(20deg); }

.toggle-icon {
  font-size: 14px; color: var(--text-muted);
  transition: color .25s, transform .4s var(--ease);
  user-select: none; pointer-events: none; display: block;
}
.toggle-badge {
  position: absolute; bottom: -5px; right: -5px;
  font-size: 7px; font-family: var(--font-body);
  background: var(--bg-3); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 1px 3px; line-height: 1.4;
  pointer-events: none; letter-spacing: .04em; text-transform: uppercase;
}

/* ─────────────────────────────────────────
   MOBILE NAV
───────────────────────────────────────── */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; padding: 4px;
}
.nav-toggle span { display: block; width: 24px; height: 1px; background: var(--text); transition: transform .3s, opacity .3s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-mobile {
  display: none; position: fixed; inset: 0;
  background: rgba(22,20,18,.96); backdrop-filter: blur(20px);
  z-index: 99; flex-direction: column; justify-content: center;
  padding: var(--pad-x);
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  font-family: var(--font-display); font-size: clamp(36px,8vw,64px);
  font-weight: 800; color: var(--text-dim); line-height: 1.2; transition: color .2s;
}
.nav-mobile a:hover { color: var(--accent); }
/* WP list wrapper in mobile nav */
.nav-mobile ul { display: flex; flex-direction: column; list-style: none; gap: 0; }
.nav-mobile li { margin: 0; }

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto;
  padding-top: 100px;
  border-bottom: 1px solid var(--line);
}
.hero__content { display: grid; grid-template-columns: 1fr 1fr; align-items: end; padding: var(--pad-y) var(--pad-x); gap: 40px; }
.hero__title { margin-top: 24px; }
.hero__title em { font-style: italic; color: var(--accent); }
.hero__right { display: flex; flex-direction: column; justify-content: flex-end; gap: 32px; }
.hero__scroll { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; }
.hero__scroll-line { flex: 1; max-width: 60px; height: 1px; background: var(--line); transition: max-width .4s var(--ease), background .3s; }
.hero__scroll:hover .hero__scroll-line { max-width: 120px; background: var(--accent); }
.hero__reel { border-top: 1px solid var(--line); overflow: hidden; }
.hero__reel-ticker {
  white-space: nowrap;
  font-family: var(--font-display); font-size: clamp(32px,6vw,80px); font-weight: 800;
  color: var(--line); padding: 16px 0;
  animation: ticker 18s linear infinite;
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ─────────────────────────────────────────
   FEATURED PROJECT
───────────────────────────────────────── */
.featured { padding: var(--pad-y) var(--pad-x); border-bottom: 1px solid var(--line); }
.featured__inner {
  position: relative; aspect-ratio: 16/7;
  background: var(--bg-3); border-radius: var(--radius-md);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  text-decoration: none; display: block;
}
.featured__inner img { width: 100%; height: 100%; object-fit: cover; }
.featured__placeholder {
  font-family: var(--font-display); font-size: clamp(40px,8vw,100px); font-weight: 800;
  color: rgba(240,237,230,0.5); pointer-events: none; user-select: none;
}
.featured__meta {
  position: absolute; inset: 0; padding: 28px 36px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.featured__index { font-family: var(--font-display); font-size: 80px; font-weight: 800; color: rgba(240,237,230,0.5); line-height: 1; }
.featured__bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.featured__progress { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--accent); width: 0; transition: width 5s linear; }

/* ─────────────────────────────────────────
   WORKS GRID
───────────────────────────────────────── */
.works-header { display: flex; justify-content: space-between; align-items: baseline; padding: 40px var(--pad-x) 20px; }
.works-grid { display: grid; gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.works-grid--cols-3 { grid-template-columns: repeat(3,1fr); }
.works-grid--cols-2 { grid-template-columns: repeat(2,1fr); }

.work-card {
  background: var(--bg-2); padding: 32px var(--pad-x);
  position: relative; overflow: hidden; transition: background .3s;
}
.work-card::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--accent); transition: width .45s var(--ease); }
.work-card:hover { background: var(--bg-3); }
.work-card:hover::after { width: 100%; }
.work-card__img { aspect-ratio: 4/3; background: var(--bg-3); border-radius: var(--radius-sm); margin-bottom: 20px; overflow: hidden; }
.work-card__img img { width: 100%; height: 100%; object-fit: cover; }
.work-card__cat { font-size: 10px; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.work-card__title { font-family: var(--font-display); font-size: clamp(18px,2.5vw,26px); font-weight: 700; color: var(--text); line-height: 1.1; margin-bottom: 8px; }
.work-card__year { font-size: 11px; color: var(--text-dim); }
.work-card__arrow { position: absolute; bottom: 28px; right: 24px; font-size: 18px; color: var(--line); transition: color .25s, transform .3s var(--ease); }
.work-card:hover .work-card__arrow { color: var(--accent); transform: translate(4px,-4px); }

.work-row {
  display: grid; grid-template-columns: 60px 1fr auto auto;
  align-items: center; gap: 24px;
  padding: 24px var(--pad-x);
  border-bottom: 1px solid var(--line);
  transition: background .25s;
  text-decoration: none;
}
.work-row:hover { background: var(--bg-2); }
.work-row__num  { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.work-row__name { font-family: var(--font-display); font-size: clamp(18px,2.5vw,28px); font-weight: 700; }
.work-row:hover .work-row__name { color: var(--accent); }
.work-row__cat  { font-size: 11px; color: var(--text-muted); text-align: right; letter-spacing: .06em; }
.work-row__year { font-size: 11px; color: var(--text-dim); width: 40px; text-align: right; }

/* ─────────────────────────────────────────
   ABOUT STRIP
───────────────────────────────────────── */
.about-strip { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.about-strip__col { padding: var(--pad-y) var(--pad-x); }
.about-strip__col:first-child { border-right: 1px solid var(--line); }

/* ─────────────────────────────────────────
   STATS
───────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { background: var(--bg-2); padding: 40px var(--pad-x); }
.stat__number { font-family: var(--font-display); font-size: clamp(40px,6vw,80px); font-weight: 800; line-height: 1; margin-bottom: 8px; color: var(--accent); }

/* ─────────────────────────────────────────
   FILTER BAR (archive)
───────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 20px var(--pad-x); border-bottom: 1px solid var(--line); }
.filter-btn {
  font-size: 11px; padding: 6px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim);
  letter-spacing: .06em; text-transform: uppercase;
  transition: border-color .2s, color .2s, background .2s;
}
.filter-btn.is-active  { border-color: var(--accent); color: var(--accent); }
.filter-btn:hover:not(.is-active) { border-color: var(--text-dim); color: var(--text); }

/* ─────────────────────────────────────────
   PROJECT PAGES
───────────────────────────────────────── */
.project-header {
  padding: var(--pad-y) var(--pad-x) 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end;
  border-bottom: 1px solid var(--line);
}
.project-cover { width: 100%; aspect-ratio: 16/9; background: var(--bg-3); overflow: hidden; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }

.project-meta-row {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 1px;
  background: var(--line); border-bottom: 1px solid var(--line);
  padding: 0 var(--pad-x);
}
.project-meta-item { padding: 24px 0; border-right: 1px solid var(--line); padding-right: 24px; }
.project-meta-item:last-child { border-right: 0; }

.project-body { padding: var(--pad-y) var(--pad-x); display: grid; grid-template-columns: 1fr 2fr; gap: 80px; }
.project-text { font-size: 16px; color: var(--text-muted); line-height: 1.9; }

.project-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); margin: 0 var(--pad-x) var(--pad-y); }
.project-gallery img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }

.project-next {
  padding: 40px var(--pad-x);
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.project-next:hover .t-display { color: var(--accent); }

/* ─────────────────────────────────────────
   ENTRY CONTENT (WP wysiwyg)
───────────────────────────────────────── */
.entry-content p  { margin-bottom: 1.4em; }
.entry-content h2 { font-family: var(--font-display); margin-bottom: .6em; }
.entry-content a  { color: var(--accent); text-decoration: underline; }

/* ─────────────────────────────────────────
   CONTACT PAGE
───────────────────────────────────────── */
.contact-section { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100svh - 80px); }
.contact-info { padding: var(--pad-y) var(--pad-x); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.contact-form-col { padding: var(--pad-y) var(--pad-x); }

.form-field { margin-bottom: 32px; }
.form-field label { display: block; font-size: 10px; color: var(--text-dim); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.form-field input,
.form-field textarea {
  width: 100%; background: transparent; border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  outline: none; transition: border-color .25s; resize: none;
}
.form-field input:focus,
.form-field textarea:focus { border-color: var(--accent); }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-dim); }

.btn-submit {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); background: transparent;
  transition: background .25s, color .25s, border-color .25s;
}
.btn-submit:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-submit:disabled { opacity: .5; }

.form-status.is-success { color: var(--accent); }
.form-status.is-error   { color: #F0997B; }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 20px var(--pad-x); display: flex; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 28px; }
.footer-links a,
.footer-links li a { font-size: 11px; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; transition: color .2s; }
.footer-links a:hover,
.footer-links li a:hover { color: var(--accent); }
.footer-links ul { display: flex; gap: 28px; list-style: none; }
.footer-links li { margin: 0; }

/* ─────────────────────────────────────────
   SCROLL REVEAL
───────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ─────────────────────────────────────────
   LIGHTBOX
───────────────────────────────────────── */
.lightbox { display: none; position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.92); align-items: center; justify-content: center; }
.lightbox.is-open { display: flex; }
.lightbox__inner { position: relative; max-width: 90vw; max-height: 90vh; }
.lightbox__inner img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
.lightbox__close { position: absolute; top: -40px; right: 0; font-size: 20px; color: #fff; opacity: .7; transition: opacity .2s; }
.lightbox__close:hover { opacity: 1; }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-primary, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav-mobile.is-open { display: flex; }

  .hero__content,
  .about-strip,
  .contact-section,
  .project-header,
  .project-body { grid-template-columns: 1fr; }

  .about-strip__col:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .contact-info { border-right: 0; border-bottom: 1px solid var(--line); }
  .works-grid--cols-3 { grid-template-columns: 1fr 1fr; }
  .works-grid--cols-2 { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: 1fr auto; }
  .work-row__num, .work-row__year { display: none; }
  .hero__right { display: none; }
  .project-meta-row { grid-template-columns: 1fr 1fr; padding: 0 var(--pad-x); }
  .stats { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .works-grid--cols-3,
  .works-grid--cols-2 { grid-template-columns: 1fr; }
  .project-gallery,
  .project-meta-row { grid-template-columns: 1fr; }
  .hero__reel-ticker { font-size: clamp(24px, 10vw, 48px); }
}
