/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { display: block; max-width: 100%; }

/* ─── TOKENS ─── */
:root {
  --gold:      #C9952A;
  --yellow:    #e4c153;
  --orange:    #cd6d37;
  --amber:     #D4903A;
  --teal:      #2B4744;
  --teal-dark: #1A2E2B;
  --green-dark:#3a4b46;
  --cream:     #eae5d7;
  --cream-mid: rgba(234,229,215,.6);
  --cream-dim: rgba(234,229,215,.22);
  --dark:      #09090B;
  --black:     #000000;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --mono:  'DM Mono', 'Courier New', monospace;
}

/* ─── LENIS ─── */
html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ─── BASE ─── */
body {
  font-family: var(--serif);
  background: var(--dark);
  color: var(--cream);
  overflow-x: hidden;
}

/* ─── GRAIN ─── */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  opacity: .042;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ══════════════════════════════════════
   LOADER
══════════════════════════════════════ */
#loader {
  position: fixed; inset: 0; z-index: 9000;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 0 52px 0 52px;
  background: #09090b; /* solid fallback — prevents hero bleed-through before image loads */
  overflow: hidden;    /* clips the rotated bg on mobile */
  transition: opacity .7s ease, visibility .7s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-bg {
  position: absolute; inset: 0; z-index: 0;
  background: url('../images/loader/loader-background-2560w.webp') center center / cover no-repeat;
}
.loader-bg::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(9,9,11,.38);
}

/* ── LEFT: logo + acronym centered, footer at bottom ── */
.loader-left {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  height: 100%; padding: 48px 0;
}
/* Logo + acronym side by side, vertically centered */
.loader-tgf-block {
  display: flex; flex-direction: row;
  align-items: center; gap: 20px;
  margin: auto 0;
}
.loader-tgf-logo {
  height: 88px; width: auto;
  object-fit: contain;
}
.loader-tgf-acronym {
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  letter-spacing: .14em; color: #eae5d7;
  text-transform: uppercase; line-height: 1;
}
.loader-footer-left {
  display: flex; flex-direction: column; gap: 3px;
}
.loader-footer-left span {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: #eae5d7; opacity: .85;
}

/* ── CENTER: logo + lines + brand ── */
.loader-center {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
}
.loader-mark {
  width: 88px; height: auto;
  animation: pulseOpacity 1.4s ease-in-out infinite;
}
@keyframes pulseOpacity { 0%,100% { opacity: .7; } 50% { opacity: 1; } }

/* Lines bar — narrow, between logo and brand name */
.loader-lines {
  display: flex; align-items: flex-end;
  gap: 2.5px; height: 14px;
  width: 180px; /* roughly same as "GAZE & NOISE LAB" text width */
}
.loader-line {
  flex: 1; height: 100%;
  background: #eae5d7;
  transform: scaleY(0);
  transform-origin: bottom;
  border-radius: 1px;
  opacity: .75;
}
.loader-brand {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  letter-spacing: .3em; text-transform: uppercase;
  color: #eae5d7; white-space: nowrap;
}

/* ── RIGHT: spacer / text (centered) / footer ── */
.loader-right {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: flex-end;
  height: 100%; padding: 48px 0;
  text-align: right;
}
.loader-right-spacer { visibility: hidden; height: 1px; }
.loader-loading-text {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: #eae5d7;
  line-height: 1.9; opacity: .85;
}
.loader-footer-right {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-end;
}
.loader-footer-right span {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: #eae5d7; opacity: .85;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   PROGRESS BAR (top segmented)
══════════════════════════════════════ */
#progress-wrap {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 2000; pointer-events: none;
}
#progress {
  height: 100%; width: 0%;
  background: linear-gradient(to right, var(--orange), var(--gold));
  transition: width .06s linear;
}

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center;
  padding: 40px 40px 20px;
  transition: padding .4s, border-color .5s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  padding: 20px 40px;
  border-bottom-color: rgba(201,149,42,.1);
}

.nav-left {
  flex: 1;
  display: flex; align-items: center; gap: 14px;
}
/* Clickable home link — logo + brand name */
.nav-home-link {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none;
}
.nav-mark {
  width: 44px; height: auto;
  object-fit: contain;
}
.nav-brand {
  font-family: var(--mono); font-size: 13px; letter-spacing: .16em;
  text-transform: uppercase; color: #eae5d7;
  transition: color .3s;
}
.nav-home-link:hover .nav-brand { color: var(--gold); }
/* Center: natural width, perfectly centred between two equal flex-1 siblings */
.nav-center {
  flex-shrink: 0;
  display: flex; align-items: center;
}

/* Right: mirrors nav-left → equal weights keep centre at true 50% */
.nav-right {
  flex: 1;
  display: flex; justify-content: flex-end; align-items: center;
}

.nav-tgf-logo { height: 40px; width: auto; object-fit: contain; }

/* All section labels visible at once */
.nav-sections {
  display: flex; align-items: center;
  gap: 20px;
  list-style: none;
}
.nav-section-link {
  font-family: var(--mono); font-size: 9px; letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(234,229,215,.55);
  text-decoration: none; cursor: pointer;
  transition: color .35s;
  white-space: nowrap;
  position: relative;
}
.nav-section-link::after {
  content: '';
  position: absolute; bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}
.nav-section-link:hover { color: var(--cream); }
.nav-section-link.active {
  color: var(--cream);
}
.nav-section-link.active::after {
  transform: scaleX(1);
}
/* ── Language toggle ── */
.lang-toggle {
  display: flex; align-items: center; gap: 5px;
  margin-right: 22px;
}
.lang-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(234,229,215,.38);
  transition: color .3s;
}
.lang-btn.active { color: var(--cream); }
.lang-btn:hover  { color: var(--cream-mid); }
.lang-sep {
  font-family: var(--mono); font-size: 9px;
  color: rgba(234,229,215,.25);
  pointer-events: none;
}

.nav-cta {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); text-decoration: none;
  border: 1px solid rgba(201,149,42,.4); padding: 11px 26px;
  border-radius: 99px;
  /* blur backdrop only — no tint */
  background: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background .3s, border-color .3s;
  white-space: nowrap;
}
.nav-cta:hover { background: rgba(201,149,42,.15); border-color: var(--gold); }

/* ── SOCIAL FIXED LINKS — horizontal, vertically centered ── */
.social-link {
  position: fixed; top: 50%; z-index: 900;
  transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: #eae5d7;
  text-decoration: underline; text-underline-offset: 3px;
  transition: color .3s;
}
.social-link:hover { color: var(--gold); }
.social-left  { left: 24px; }
.social-right { right: 24px; }

/* ══════════════════════════════════════
   HERO — bg image + centered text image
══════════════════════════════════════ */
#hero {
  position: relative; height: 100vh;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hero-bg-full {
  position: absolute; inset: 0; z-index: 0;
  background: url('../images/hero/hero-background.webp') center center / cover no-repeat;
}
.hero-text-img {
  position: absolute; inset: 0; z-index: 5;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; /* faded in via JS after loader */
}
.hero-subtitle {
  position: absolute; left: 50%; z-index: 6;
  transform: translateX(-50%);
  bottom: 26%;
  font-family: 'Times New Roman', Times, serif;
  font-weight: bold;
  font-size: 13pt;
  letter-spacing: 0.04em;
  color: var(--cream);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
}

/* ══════════════════════════════════════
   GOLDENFRACTAL — 4 PILLARS
══════════════════════════════════════ */
#goldenfractal {
  position: relative; height: 100vh;
  overflow: hidden;
}

/* Full-bleed backgrounds */
.gf-bg-wrap { position: absolute; inset: 0; z-index: 0; }
.gf-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .9s ease;
}
.gf-bg.active { opacity: 1; }
/* Dark overlay — applied to all pillars including Transmedia */
.gf-bg::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(9,9,11,.45);
}

/* Pills — frosted glass, lower + bigger + more spaced */
.pillars-nav {
  position: absolute; top: 120px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 16px; z-index: 10;
  opacity: 0; /* faded in via JS on goldenfractal enter */
}
.pillar-pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--cream-mid);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(237,229,212,.2);
  padding: 11px 26px; cursor: pointer;
  border-radius: 99px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background .3s, color .3s, border-color .3s;
  white-space: nowrap;
}
.pillar-pill:hover { color: var(--cream); border-color: var(--cream-mid); }
.pillar-pill.active {
  background: rgba(201,149,42,.18);
  border-color: var(--gold); color: var(--gold);
}

/* Panels wrap */
.gf-panels-wrap { position: absolute; inset: 0; z-index: 5; }

/* Each panel: 2-col grid — left (title), right (body), bottom sub */
.gf-panel {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: 1fr auto;
  padding: 140px 52px 72px;
  pointer-events: none;
}
.gf-panel.active { pointer-events: auto; }

/* Left: num at top, title pushed to bottom */
.gf-panel-left {
  grid-column: 1; grid-row: 1;
  display: flex; flex-direction: column;
  justify-content: flex-end; padding-bottom: 8px;
}

/* Right: body text, bottom-aligned to match title baseline */
.gf-panel-right {
  grid-column: 2; grid-row: 1;
  display: flex; align-items: flex-end;
  padding: 0 0 8px 20px;
}

/* Bottom subtitle — full width, centered, gold */
.gf-sub {
  grid-column: 1 / -1; grid-row: 2;
  text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--gold);
  padding-top: 32px;
  border-top: 1px solid rgba(201,149,42,.2);
}

.gf-num {
  font-family: var(--mono); font-size: 9px; letter-spacing: .22em;
  color: var(--gold); text-transform: uppercase;
  margin-bottom: 24px;
}
.gf-title {
  font-size: clamp(52px, 7.5vw, 108px); font-weight: 300; font-style: italic;
  line-height: .92; color: var(--cream);
}
.gf-body {
  font-family: var(--mono); font-size: 11px; line-height: 1.85;
  color: var(--cream-mid); max-width: 380px;
}

/* ── Transmedia panel: serif body ── */
.gf-body--serif {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.06em;
  color: var(--cream);
}

/* ── Enter animations — long enough to still be running on scroll-in ── */
.gf-num,
.gf-title,
.gf-body,
.gf-sub {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 1.6s ease, transform 1.6s cubic-bezier(.16,1,.3,1);
}
.gf-panel.active .gf-num   { opacity: 1; transform: translateY(0); transition-delay: 0s; }
.gf-panel.active .gf-title { opacity: 1; transform: translateY(0); transition-delay: .22s; }
.gf-panel.active .gf-body  { opacity: 1; transform: translateY(0); transition-delay: .44s; }
.gf-panel.active .gf-sub   { opacity: 1; transform: translateY(0); transition-delay: .66s; }

/* Panels 1–3: shorter duration (0.75s). Panel 0 (Transmedia) keeps 1.6s. */
.gf-panel:not([data-panel="0"]) .gf-num,
.gf-panel:not([data-panel="0"]) .gf-title,
.gf-panel:not([data-panel="0"]) .gf-body,
.gf-panel:not([data-panel="0"]) .gf-sub {
  transition-duration: 0.75s;
}

/* ══════════════════════════════════════
   CHALLENGE — grid + zoom
══════════════════════════════════════ */
#challenge {
  position: relative;
  height: 500vh; /* extra room for 2-phase: slide-in + zoom */
  overflow: clip;
}

/* Single sticky shell — everything pinned together, grid zooms, overlay stays still */
.challenge-sticky {
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden; /* clips the taller-than-viewport grid + scaled overflow */
}

/* Grid — taller than the viewport so it scrolls in from below (phase 1)
   then zooms once the video is centered (phase 2).
   4 equal columns: top/bottom rows span 2+2 (50/50),
   middle row spans 1+2+1 (25/50/25).
   Rows 1 & 2 = 50vh each → at 1920×1080 a 50vw-wide cell is exactly 16:9.
   Total grid height ≈ 50+50+20 + gaps = ~122vh (taller than viewport). */
.challenge-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: 50vh 50vh 20vh;
  gap: 8px;
  background: #09090B;
  padding: 8px;
  will-change: transform;
  transform-origin: center center; /* overridden by JS */
}

/* Rounded-corner cells */
.grid-cell {
  position: relative; overflow: hidden;
  border-radius: 12px;
}
.cell-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.video-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--cream-dim);
}

/* Grid cell placement — 4-col grid
   Top/bottom: two 50% halves. Middle: 25 / 50 / 25. */
.cell-top-left  { grid-column: 1 / 3; grid-row: 1; }  /* cols 1–2 = 50% */
.cell-top-right { grid-column: 3 / 5; grid-row: 1; }  /* cols 3–4 = 50% */
.cell-mid-left  { grid-column: 1 / 2; grid-row: 2; }  /* col  1   = 25% */
.cell-mid-center{ grid-column: 2 / 4; grid-row: 2; }  /* cols 2–3 = 50% */
.cell-mid-right { grid-column: 4 / 5; grid-row: 2; }  /* col  4   = 25% */
.cell-bot-left  { grid-column: 1 / 3; grid-row: 3; }  /* cols 1–2 = 50% */
.cell-bot-right { grid-column: 3 / 5; grid-row: 3; }  /* cols 3–4 = 50% */

/* Grid cell images */
.grid-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Center cell video */
#grid-center { z-index: 2; }
#grid-center video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.cell-video-placeholder { background: linear-gradient(160deg,#1A2E2B,#2B4744,rgba(201,149,42,.2)); }

/* ── Challenge content overlay — sibling of grid inside .challenge-sticky ── */
/* Gradient background: transparent at top so the video bleeds through as it
   fills the viewport, then darkens toward the bottom for text readability.
   This creates the seamless grid-zoom → video-as-background transition. */
.challenge-content {
  position: absolute; inset: 0; height: 100vh;
  display: flex; flex-direction: column;
  /* 42vh top → label sits just above centre; 120px left clears the Instagram link */
  padding: 36vh 52px 64px 120px;
  opacity: 0; pointer-events: none;
  z-index: 20;
  background: linear-gradient(
    to bottom,
    rgba(9,9,11,0)    0%,
    rgba(9,9,11,.18) 20%,
    rgba(9,9,11,.52) 50%,
    rgba(9,9,11,.78) 75%,
    rgba(9,9,11,.88) 100%
  );
}
.challenge-content.visible { pointer-events: auto; }

/* Label — left side, sits just above the title */
.challenge-label {
  align-self: flex-start;
  margin-bottom: 20px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 14px;
}
.challenge-label::before { content: ''; width: 26px; height: 1px; background: var(--gold); }

/* Main title — flows directly below label */
.challenge-hl {
  font-size: clamp(32px, 4.5vw, 62px); font-weight: 300; line-height: 1.0;
  max-width: 720px;
}
.challenge-hl em { font-style: italic; color: var(--yellow); }

/* Inter paragraph below the title */
.challenge-para {
  font-family: 'Inter', sans-serif;
  font-size: 23px; font-weight: 300;
  line-height: 1.7; color: var(--cream);
  max-width: 680px; margin-top: 18px;
}
.split-line  { display: block; overflow: hidden; padding-bottom: 0.14em; }
/* transform is driven entirely by GSAP scrub — no CSS transition needed */
.split-inner { display: block; transform: translateY(110%); }

/* Subtitle — tighter gap to title */
.challenge-sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(201,149,42,.25);
}

/* Bridge text */
.challenge-bridge {
  font-family: 'Inter', sans-serif; font-size: 13px;
  font-weight: 300; line-height: 1.9;
  color: var(--cream); max-width: 520px;
  margin-top: 16px;
}

.label {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold); display: flex; align-items: center; gap: 14px;
  margin-bottom: 52px;
}
.label::before { content: ''; width: 26px; height: 1px; background: var(--gold); }

/* ══════════════════════════════════════
   MODEL
══════════════════════════════════════ */
#model {
  background: var(--black);
  min-height: 100vh; display: flex; align-items: center;
  padding: 130px 52px; position: relative;
}
.model-inner { width: 100%; }
.model-title {
  font-size: clamp(38px, 5vw, 72px); font-weight: 300; line-height: 1.1;
  color: var(--cream); margin-bottom: 80px; max-width: 600px;
}
.model-title em { font-style: italic; color: var(--gold); }
.model-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1px; background: rgba(237,229,212,.06);
}
.model-item {
  background: var(--black); padding: 40px 28px;
}
.model-num {
  display: block;
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em;
  color: rgba(201,149,42,.4); text-transform: uppercase; margin-bottom: 20px;
}
.model-name {
  font-size: 22px; font-style: italic; font-weight: 300;
  color: var(--gold); margin-bottom: 14px; line-height: 1.2;
}
.model-desc {
  font-family: var(--mono); font-size: 10px; line-height: 1.8; color: var(--cream-mid);
}
.tx-tags { display: flex; gap: 12px; flex-wrap: wrap; }
.tx-tag {
  font-family: var(--mono); font-size: 8px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid rgba(201,149,42,.3); padding: 7px 16px;
}

/* ══════════════════════════════════════
   STRUCTURE (Hub Alliance)
══════════════════════════════════════ */
#structure {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 120px 52px 100px;
  overflow: hidden;
}

/* Full-bleed background video */
.structure-bg-video {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: .85;
}

/* Section label — top left */
.structure-label {
  position: relative; z-index: 2;
  align-self: flex-start;
  margin-bottom: 64px;
}

/* 3-column layout: left text | centre image | right text */
.structure-layout {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;          /* tighter gap → texts sit closer to the image */
  width: 100%;
  max-width: 1400px;
}

/* Left text: right-aligned, pushed toward centre */
.structure-left {
  display: flex; flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding-left: 18%;
}

.structure-center {
  display: flex; justify-content: center; align-items: center;
}

/* Right text: left-aligned, pushed toward centre */
.structure-right {
  display: flex; flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding-right: 14%;
}

.structure-img {
  width: clamp(380px, 48vw, 700px); height: auto;
  object-fit: contain;
  filter: drop-shadow(0 40px 100px rgba(201,149,42,.2));
  animation: float 5s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0px); }
  50%      { transform: translateY(-16px); }
}

.structure-h2 {
  font-size: clamp(26px, 2.6vw, 42px); font-weight: 300;
  line-height: 1.1; color: var(--cream);
}
.structure-h2 em { font-style: italic; }

/* Spanish alliance title: one word per line, bolder, slightly larger */
[data-lang="es"] .structure-h2 {
  font-size: clamp(32px, 3.2vw, 52px);
  font-weight: 500;
  line-height: 1.15;
}

/* Tagline below h2 on the left */
.structure-tagline {
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px, 1.4vw, 20px); font-weight: 300;
  color: var(--cream-mid); line-height: 1.3;
  margin-top: 14px;
  text-align: right;
}

/* Quote on the right — Inter */
.structure-quote {
  font-family: 'Inter', sans-serif;
  font-size: clamp(16px, 1.6vw, 24px); font-weight: 300;
  line-height: 1.65; color: var(--cream);
  font-style: normal;
}

/* CTA — centred further below */
.structure-cta-wrap {
  position: relative; z-index: 2;
  display: flex; justify-content: center;
  margin-top: 112px;  /* extra space between image and button */
}
.alliance-cta {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--cream);
  background: rgba(0,0,0,.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(234,229,215,.3);
  padding: 14px 36px; text-decoration: none;
  border-radius: 99px;
  transition: background .3s, border-color .3s;
}
.alliance-cta:hover { background: rgba(0,0,0,.25); border-color: var(--cream); }

/* ══════════════════════════════════════
   TIERS
══════════════════════════════════════ */
#tiers {
  background:
    linear-gradient(rgba(0,0,0,.2), rgba(0,0,0,.2)),
    url('../images/tiers/tiers-bg-15.webp') center / cover no-repeat;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 130px 52px; position: relative; overflow: hidden;
}
.tiers-intro {
  font-size: clamp(34px, 4vw, 56px); font-weight: 300; font-style: italic;
  color: var(--cream); max-width: 620px; margin-bottom: 80px; line-height: 1.2;
}
.reveal { opacity: 0; transform: translateY(28px); }
.tiers-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  grid-auto-rows: auto;           /* rows size to tallest cell */
  align-items: stretch;
  gap: 20px; position: relative; z-index: 1;
  max-width: 900px; margin-left: auto; margin-right: auto;
}
.tier {
  background: rgba(58,75,70,1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 48px 28px;
  display: flex; flex-direction: column; /* stretch all boxes to row height */
  position: relative; overflow: hidden;
  transition: border-color .35s, transform .35s ease, box-shadow .35s ease;
}
.tier:hover {
  border-color: rgba(228,193,83,.35);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.tier-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.tier-icon {
  width: 44px; height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.tier.featured::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--gold);
}
.tier-num {
  font-family: var(--mono); font-size: 12px; letter-spacing: .2em;
  color: var(--yellow); text-transform: uppercase;
}
.tier-name {
  font-size: 26px; font-style: normal; font-weight: 300;
  color: var(--cream); margin-bottom: 20px; line-height: 1.1;
}
.tier-body {
  font-family: 'Inter', sans-serif; font-size: 13px;
  font-weight: 300; line-height: 1.85; color: var(--cream-mid);
}
.tier-price {
  margin-top: 28px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--yellow);
  border-top: 1px solid rgba(228,193,83,.2);
  padding-top: 18px;
}
.tier-note {
  grid-column: 1 / span 2;  /* span both columns to keep phrase on one line */
  white-space: nowrap;
  margin-top: 8px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .08em; color: var(--cream-mid);
  align-self: start;
}

/* ══════════════════════════════════════
   CTA
══════════════════════════════════════ */
#cta {
  background:
    linear-gradient(rgba(0,0,0,.2), rgba(0,0,0,.2)),
    url('../images/tiers/CTA-bg-15.webp') center / cover no-repeat;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 130px 52px; text-align: center;
}
.cta-pre {
  font-family: var(--mono); font-size: 9px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--cream); margin-bottom: 36px;
}
.cta-h2 {
  font-size: clamp(44px, 6.5vw, 92px); font-weight: 300; line-height: .95;
  color: var(--cream); max-width: 800px; margin: 0 auto 52px;
}
.cta-h2 em { font-style: italic; color: var(--orange); }
.cta-body {
  font-family: 'Inter', sans-serif; font-size: 13px;
  font-weight: 300; line-height: 1.9;
  color: var(--cream); max-width: 440px; margin: 0 auto 64px;
}
.cta-btn {
  display: inline-flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--cream);
  background: rgba(0,0,0,.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(234,229,215,.3);
  padding: 16px 40px;
  text-decoration: none; border-radius: 99px;
  transition: background .3s, border-color .3s;
}
.cta-btn:hover { background: rgba(0,0,0,.25); border-color: var(--cream); }
.cta-btn svg { width: 14px; height: 14px; transition: transform .3s; }
.cta-btn:hover svg { transform: translateX(4px); }


/* ── Mobile floating CTA — visual styles live here; display toggled per breakpoint ── */
#mobile-cta {
  display: none;
  align-items: center;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 990;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(9,9,11,.20);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201,149,42,.4);
  padding: 13px 28px;
  border-radius: 99px;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
#mobile-cta.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Nav brand long/short — desktop default: long visible ── */
.nav-brand-short { display: none; }
.nav-brand-long  { display: inline; }

/* ── Loader mobile footer — desktop: hidden ── */
.loader-mobile-footer { display: none; }

/* ── Spanish subtitle line-break — only visible on mobile ── */
.sub-break { display: none; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   Base (no query) = desktop default styles above.
   Mobile overrides   →  max-width: 767 px
   Tablet tweaks      →  min-width: 768 px
   Nav sections       →  min-width: 1024 px
   Structure 3-col    →  min-width: 1200 px
   Large-desktop      →  min-width: 1440 px
═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   MOBILE  (≤ 767 px / iPhone 390 px)
───────────────────────────────────────── */
@media (max-width: 767px) {

  /* LOADER — single centered column with bottom label */
  #loader {
    grid-template-columns: 1fr;
    padding: 0 24px;
    justify-items: center;
  }
  .loader-left,
  .loader-right { display: none; }
  /* 100vh is unreliable on iOS Safari (shrinks with browser chrome).
     A 150vmax square is always large enough to cover any portrait viewport
     after 90° rotation, and the viewport itself clips the overflow. */
  .loader-bg {
    inset: auto;
    width: 150vmax;
    height: 150vmax;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
  }
  .loader-mobile-footer {
    display: block;
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #eae5d7;
    opacity: .75;
    white-space: nowrap;
    z-index: 1;
  }

  /* NAV — compact bar, show short brand name, hide sections & nav CTA */
  #nav { padding: 16px 20px; }
  #nav.scrolled { padding: 12px 20px; }
  .nav-center { display: none; }
  .nav-cta    { display: none; }
  .nav-brand-long  { display: none; }
  .nav-brand-short { display: inline; }

  /* HERO — fill hero without cropping, zoom independent of GSAP transform */
  .hero-text-img {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    zoom: 1.4;
  }
  .hero-subtitle {
    white-space: normal;
    padding: 0 24px;
    font-size: 11pt;
    width: 100%;
    text-align: center;
  }

  /* SOCIAL — mid-screen, away from both pills and CTA button */
  .social-link {
    display: block;
    top: 43%;
    transform: translateY(-50%);
    font-size: 9px;
  }
  .social-left  { left: 20px; }
  .social-right { right: 20px; }

  /* MOBILE CTA — activate (visual styles live in base rule above) */
  #mobile-cta { display: inline-flex; }

  /* Spanish subtitle — two-line break on mobile */
  .sub-break { display: block; }

  /* GOLDENFRACTAL — single column, pills wrap */
  .pillars-nav {
    top: 112px;
    left: 0;
    transform: none;
    width: 100%;
    padding: 0 12px;
    gap: 6px;
    flex-wrap: nowrap;          /* force single row */
    justify-content: center;
  }
  .pillar-pill { padding: 8px 10px; font-size: 9px; }

  .gf-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto;
    padding: 80px 24px 84px; /* 84px bottom → gf-sub sits ~16px above the fixed CTA button */
  }
  .gf-panel-right {
    grid-column: 1;
    grid-row: 2;
    padding: 20px 0 0;
    align-items: flex-start;
  }
  .gf-sub { grid-row: 3; }
  .gf-body         { max-width: 100%; }
  .gf-body--serif  { font-size: 13px; }

  /* CHALLENGE — label pinned at top, title+body pushed to bottom */
  .challenge-content {
    padding: 110px 24px 80px;
    justify-content: flex-start;
    overflow: hidden; /* prevent text escaping container on scroll-up */
  }
  /* margin-bottom: auto on label absorbs free space → pushes hl+body to bottom */
  .challenge-label { margin-bottom: auto; }
  .challenge-hl    { margin-top: 0; }
  .challenge-para    { font-size: 16px; }
  .challenge-bridge  { font-size: 12px; }
  .challenge-hl      { font-size: clamp(28px, 7vw, 40px); }

  /* STRUCTURE — vertical stack, image first then title then quote */
  #structure { padding: 80px 24px 80px; }
  .structure-label   { margin-bottom: 40px; }
  .structure-layout  {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 24px;
    justify-items: start;
  }
  .structure-center { order: 1; width: 100%; }
  .structure-left   {
    order: 2;
    align-items: flex-start;
    text-align: left;
    padding-left: 0;
  }
  .structure-right  {
    order: 3;
    align-items: flex-start;
    text-align: left;
    padding-right: 0;
  }
  .structure-img {
    width: 100%;
    max-width: 320px;
    margin: 0;          /* left-aligned image */
  }
  .structure-h2       { text-align: left; }
  .structure-tagline  { text-align: left; }
  .structure-quote    { text-align: left; }
  .structure-cta-wrap { margin-top: 48px; }

  /* MODEL (reserved for future HTML) */
  #model { padding: 80px 24px; }
  .model-grid  { grid-template-columns: 1fr; }
  .model-title { margin-bottom: 48px; }

  /* TIERS — single column, narrower so boxes don't touch edges */
  #tiers { padding: 80px 24px; }
  .tiers-grid {
    grid-template-columns: 1fr;
    max-width: 310px;
    margin-left: auto;
    margin-right: auto;
  }
  .tier { padding: 32px 20px; }
  .tier-note,
  [data-lang="es"] .tier-note {
    white-space: normal;
    grid-column: 1;
  }

  /* CTA — reduce heading size and padding */
  #cta { padding: 80px 24px; }
  .cta-h2  { font-size: clamp(32px, 8vw, 44px); }
  .cta-btn { padding: 14px 28px; }

  /* FOOTER */
  footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 24px;
  }
}

/* ─────────────────────────────────────────
   TABLET  (768 px +  /  iPad 768 px)
───────────────────────────────────────── */
@media (min-width: 768px) {

  /* LOADER — restore 3-column layout */
  #loader {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0 40px;
    justify-items: initial;
  }
  .loader-left,
  .loader-right { display: flex; }

  /* NAV — restore CTA button, tighter padding until 1024px */
  #nav { padding: 28px 32px 16px; }
  #nav.scrolled { padding: 16px 32px; }
  .nav-cta { display: inline-flex; font-size: 9px; padding: 9px 20px; }
  /* nav-center stays hidden until 1024px — too many links to fit */

  /* HERO */
  .hero-subtitle { white-space: nowrap; padding: 0; }

  /* GOLDENFRACTAL — restore 2-col panel layout */
  .pillars-nav {
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    padding: 0;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .pillar-pill { padding: 10px 22px; font-size: 10px; }

  .gf-panel {
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: 1fr auto;
    padding: 130px 40px 64px;
  }
  .gf-panel-right {
    grid-column: 2;
    grid-row: 1;
    padding: 0 0 8px 16px;
    align-items: flex-end;
  }
  .gf-sub { grid-row: 2; }
  .gf-body        { max-width: 380px; }
  .gf-body--serif { font-size: 14px; }

  /* CHALLENGE */
  .challenge-content { padding: 80px 40px 40px; }
  .challenge-para    { font-size: 20px; }
  .challenge-bridge  { font-size: 13px; }
  .challenge-hl      { font-size: clamp(32px, 4.5vw, 62px); }

  /* STRUCTURE — single column, image first, all left-aligned */
  #structure { padding: 100px 40px; }
  .structure-label   { margin-bottom: 52px; }
  .structure-layout  { max-width: 100%; gap: 28px; justify-items: start; }
  .structure-center { order: 1; width: 100%; }
  .structure-left   { order: 2; align-items: flex-start; text-align: left; padding-left: 0; }
  .structure-right  { order: 3; align-items: flex-start; text-align: left; padding-right: 0; }
  .structure-img { width: 100%; max-width: 460px; margin: 0; }
  .structure-h2    { text-align: left; }
  .structure-quote { text-align: left; }
  .structure-cta-wrap { margin-top: 80px; }

  /* NAV brand: show long name from tablet up */
  .nav-brand-long  { display: inline; }
  .nav-brand-short { display: none; }

  /* SOCIAL — restore to 50% vertical center */
  .social-link { display: block; top: 50%; transform: translateY(-50%); font-size: 10px; }

  /* MODEL */
  #model { padding: 100px 40px; }
  .model-grid  { grid-template-columns: repeat(2, 1fr); }
  .model-title { margin-bottom: 80px; }

  /* TIERS — 2 columns on tablet, constrained width */
  #tiers { padding: 100px 40px; }
  .tiers-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
  }
  .tier { padding: 40px 24px; }
  .tier-note,
  [data-lang="es"] .tier-note {
    white-space: nowrap;
    grid-column: 1 / span 2;
  }

  /* CTA */
  #cta { padding: 100px 40px; }
  .cta-h2  { font-size: clamp(44px, 6.5vw, 92px); }
  .cta-btn { padding: 16px 36px; }

  /* (social already restored above in STRUCTURE block) */

  /* FOOTER */
  footer {
    flex-direction: row;
    gap: 0;
    text-align: initial;
    padding: initial;
  }
}

/* ─────────────────────────────────────────
   TABLET ONLY  (768 px → 1023 px)
   Prevent nav overlap; keep hero clear of social links
───────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {

  /* NAV — tighter padding, short brand name, no CTA button (floats at bottom) */
  #nav { padding: 20px 24px 14px; }
  #nav.scrolled { padding: 14px 24px; }
  .nav-brand { white-space: nowrap; font-size: 11px; letter-spacing: .12em; }
  .nav-brand-long  { display: none; }
  .nav-brand-short { display: inline; }
  .nav-cta   { display: none; }
  .nav-home-link { gap: 6px; }   /* tighten logo → brand text gap */
  .lang-toggle { margin-right: 14px; }

  /* FLOATING CTA — same bottom pill as mobile */
  #mobile-cta { display: inline-flex; }

  /* HERO text image — contained, centered, slightly zoomed */
  .hero-text-img {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    zoom: 1.15;
  }

  /* HERO subtitle — smaller to fit inside image bracket columns, moved up */
  .hero-subtitle { font-size: 10pt; bottom: 30%; }

  /* HERO subtitle — Spanish sits lower (longer text needs more room) */
  [data-lang="es"] .hero-subtitle { top: 67%; bottom: auto; }

  /* HERO panel — extra bottom clearance for the floating CTA button */
  .gf-panel { padding-bottom: 104px; }

  /* CHALLENGE — label pinned at top, title + body group near bottom */
  .challenge-content {
    padding: 80px 52px 72px;
    justify-content: flex-start;
    overflow: hidden;
  }
  .challenge-label { margin-bottom: auto; }
  .challenge-hl    { margin-top: 0; }

  /* TIERS — center The Full Fractal (3rd box) on its own row */
  .tiers-grid .tier:nth-child(3) {
    grid-column: 1 / -1;
    max-width: calc(50% - 10px);
    margin-left: auto;
    margin-right: auto;
  }
}

/* ─────────────────────────────────────────
   NAV SECTIONS  (1024 px +)
   5 mono labels fit comfortably from here
───────────────────────────────────────── */
@media (min-width: 1024px) {
  .nav-center { display: flex; }
  #nav { padding: 40px 40px 20px; }
  #nav.scrolled { padding: 20px 40px; }
  /* Restore challenge text position (tablet rule used 80px top, breaking desktop) */
  .challenge-content { padding: 36vh 52px 64px 120px; justify-content: flex-start; }
  /* Label pinned at top, title + body pushed to bottom */
  .challenge-label { margin-bottom: auto; }
  .challenge-hl    { margin-top: 0; }
}

/* ─────────────────────────────────────────
   STRUCTURE 3-COL  (1200 px +)
   Image is large enough for flanking text
───────────────────────────────────────── */
@media (min-width: 1200px) {
  .structure-layout {
    grid-template-columns: 1fr auto 1fr;
    max-width: 1400px;
    justify-items: initial;
  }
  /* Reset order so 3-col grid places items correctly */
  .structure-center { order: unset; }
  .structure-left   { order: unset; align-items: flex-end; text-align: right; padding-left: 12%; }
  .structure-right  { order: unset; align-items: flex-start; text-align: left; padding-right: 8%; }
  .structure-h2    { text-align: right; }
  .structure-quote { text-align: left; }
  .structure-img { width: clamp(300px, 36vw, 600px); max-width: none; margin: 0; }
  .structure-tagline { text-align: right; }
}

/* ─────────────────────────────────────────
   LARGE DESKTOP  (1440 px +)
   Restore original spacious values
───────────────────────────────────────── */
@media (min-width: 1440px) {

  /* STRUCTURE — full 3-col with original padding */
  #structure { padding: 120px 52px 100px; }
  .structure-left { padding-left: 18%; }
  .structure-right { padding-right: 14%; }
  .structure-img { width: clamp(380px, 48vw, 700px); }
  .structure-cta-wrap { margin-top: 112px; }

  /* TIERS — restore 3-col grid */
  #tiers { padding: 130px 52px; }
  .tiers-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 900px;
  }
  .tier { padding: 48px 28px; }
  .tier-note,
  [data-lang="es"] .tier-note { grid-column: 1 / span 2; }

  /* CTA / MODEL */
  #cta   { padding: 130px 52px; }
  #model { padding: 130px 52px; }
  .model-grid { grid-template-columns: repeat(4, 1fr); }
}
