/* =========================================================================
   GTEX/STUDIO — Locked design system
   Every token here is part of the contract. Nothing in section-styles.css
   is allowed to override; per-section CSS only composes these tokens.
   ========================================================================= */

:root {
  /* Palette ---------------------------------------------------------------- */
  --bg:            #0A0A0F;
  --bg-elevated:   #12121A;
  --bg-raised:     #1A1A24;
  --surface:       rgba(255, 255, 255, 0.03);
  --surface-hi:    rgba(255, 255, 255, 0.06);

  --text:          #F5F5F7;
  --text-muted:    #A0A0B0;
  --text-dim:      #60606F;
  --text-faint:    #3A3A45;

  --border:        rgba(255, 255, 255, 0.08);
  --border-hi:     rgba(255, 255, 255, 0.16);

  --violet:        #7C5CFF;
  --violet-hi:     #9B82FF;
  --cyan:          #00E5FF;
  --cyan-hi:       #5EF1FF;
  --magenta:       #FF4DD8;

  --glow-violet:   rgba(124, 92, 255, 0.40);
  --glow-cyan:     rgba(0, 229, 255, 0.35);

  --grad-vc:       linear-gradient(135deg, #7C5CFF 0%, #00E5FF 100%);
  --grad-vc-soft:  linear-gradient(135deg, rgba(124,92,255,0.18) 0%, rgba(0,229,255,0.18) 100%);

  --success:       #3DDC97;
  --warn:          #FFB454;
  --danger:        #FF5C7A;

  /* Typography scale ------------------------------------------------------- */
  --font-display:  'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:     'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --fs-display:    clamp(56px, 9.2vw, 144px);
  --fs-h1:         clamp(40px, 5.6vw, 80px);
  --fs-h2:         clamp(32px, 4vw, 56px);
  --fs-h3:         clamp(22px, 2.2vw, 32px);
  --fs-eyebrow:    13px;
  --fs-body-lg:    18px;
  --fs-body:       16px;
  --fs-caption:    13px;
  --fs-micro:      11px;
  --fs-code:       13px;

  --lh-tight:      1.04;
  --lh-snug:       1.18;
  --lh-body:       1.6;

  --tracking-tight:-0.025em;
  --tracking-wide: 0.18em;

  /* Grid ------------------------------------------------------------------- */
  --grid-cols:     12;
  --grid-gutter:   24px;
  --grid-margin:   96px;

  /* Safe zones ------------------------------------------------------------- */
  --safe-top:      120px;
  --safe-bottom:   80px;
  --gap-text:      64px;

  /* Motion (locked) -------------------------------------------------------- */
  --ease-smooth:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-elastic:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-linear:   cubic-bezier(0, 0, 1, 1);
  --dur-entry:     800ms;
  --dur-exit:      400ms;
  --dur-micro:     200ms;
  --stagger:       80ms;

  /* Z-index discipline (locked) ------------------------------------------- */
  --z-bg:          0;
  --z-motion:      1;
  --z-text:        10;
  --z-controls:    20;
  --z-overlay:     50;
  --z-persistent:  100;
  --z-cursor:      200;

  /* Shape ------------------------------------------------------------------ */
  --r-sm:          8px;
  --r-md:          14px;
  --r-lg:          22px;
  --r-pill:        999px;

  --shadow-soft:   0 6px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow:   0 0 60px rgba(124, 92, 255, 0.25);
}

@media (max-width: 1024px) { :root { --grid-margin: 48px; --safe-top: 96px; } }
@media (max-width: 640px)  { :root { --grid-margin: 24px; --safe-top: 80px; --safe-bottom: 56px; } }

/* =========================================================================
   Reset
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  cursor: none;
}
@media (pointer: coarse) { body { cursor: auto; } }
body.loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: transparent; border: 0; padding: 0; cursor: none; }
@media (pointer: coarse) { button { cursor: pointer; } }
input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
canvas { display: block; }

::selection { background: var(--violet); color: var(--bg); }

/* =========================================================================
   Type primitives
   ========================================================================= */
.t-display { font-family: var(--font-display); font-size: var(--fs-display); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); font-weight: 600; margin: 0; }
.t-h1      { font-family: var(--font-display); font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); font-weight: 600; margin: 0; }
.t-h2      { font-family: var(--font-display); font-size: var(--fs-h2); line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); font-weight: 600; margin: 0; }
.t-h3      { font-family: var(--font-display); font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: -0.015em; font-weight: 600; margin: 0; }
.t-eyebrow { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.t-body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body); color: var(--text-muted); }
.t-body    { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-muted); }
.t-caption { font-size: var(--fs-caption); line-height: 1.45; color: var(--text-muted); }
.t-micro   { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.t-mono    { font-family: var(--font-mono); }

.grad-text,
.grad-text .word,
.grad-text .char {
  background: var(--grad-vc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =========================================================================
   Section frame (every section is 100vw × 100vh, grid-aware)
   ========================================================================= */
.section {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
}
.section--tall { height: auto; min-height: 100vh; }
.section--pinned { height: 300vh; }

.section__bg     { position: absolute; inset: 0; z-index: var(--z-bg); pointer-events: none; }
.section__motion { position: absolute; inset: 0; z-index: var(--z-motion); pointer-events: none; }
.section__text   { position: relative; z-index: var(--z-text); }
.section__ctrls  { position: relative; z-index: var(--z-controls); }

.section__inner {
  position: relative;
  z-index: var(--z-text);
  width: 100%;
  height: 100%;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--grid-margin);
  padding-right: var(--grid-margin);
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  column-gap: var(--grid-gutter);
}

.col-1-12 { grid-column: 1 / -1; }
.col-2-10 { grid-column: 2 / 11; }
.col-2-6  { grid-column: 2 / 7; }
.col-2-5  { grid-column: 2 / 6; }
.col-7-12 { grid-column: 7 / 13; }
.col-7-11 { grid-column: 7 / 12; }
.col-1-6  { grid-column: 1 / 7; }
.col-6-12 { grid-column: 6 / 13; }
.col-11-12{ grid-column: 11 / 13; }
.col-9-12 { grid-column: 9 / 13; }

.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--text-muted);
}
.section__eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--text-dim);
}

.section__index {
  position: absolute;
  bottom: 28px;
  right: var(--grid-margin);
  z-index: var(--z-text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  pointer-events: none;
}

/* =========================================================================
   Buttons / pills
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
  border: 1px solid var(--border-hi);
  color: var(--text);
  background: var(--surface);
  backdrop-filter: blur(8px);
  transition: border-color var(--dur-micro) var(--ease-smooth),
              background var(--dur-micro) var(--ease-smooth),
              transform var(--dur-micro) var(--ease-smooth);
}
.btn:hover { border-color: rgba(255,255,255,0.32); background: var(--surface-hi); }
.btn--primary {
  background: var(--grad-vc);
  background-origin: border-box;
  background-clip: border-box;
  backdrop-filter: none;
  border-color: transparent;
  color: #FFFFFF;
  font-weight: 600;
}
.btn--primary:hover {
  background: var(--grad-vc);
  background-origin: border-box;
  background-clip: border-box;
  color: #FFFFFF;
  box-shadow: 0 8px 32px rgba(124,92,255,0.35);
  transform: translateY(-1px);
}
.btn--ghost { background: transparent; }
.btn .arrow {
  display: inline-block;
  transition: transform var(--dur-micro) var(--ease-smooth);
}
.btn:hover .arrow { transform: translateX(4px); }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pill--accent { border-color: rgba(124,92,255,0.5); color: var(--violet-hi); background: rgba(124,92,255,0.08); }

/* =========================================================================
   Glass card
   ========================================================================= */
.glass {
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* =========================================================================
   Persistent: top nav
   ========================================================================= */
.nav {
  position: fixed;
  top: 16px; left: 24px; right: 24px;
  height: 72px;
  z-index: var(--z-persistent);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 24px;
  border-radius: 18px;
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  transition: background var(--dur-micro) var(--ease-smooth),
              border-color var(--dur-micro) var(--ease-smooth);
}
.nav.is-scrolled {
  background: rgba(10, 10, 15, 0.82);
  border-color: var(--border-hi);
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.nav__brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--grad-vc);
  position: relative;
  box-shadow: 0 0 18px rgba(124,92,255,0.35);
}
.nav__brand-mark::after {
  content:""; position:absolute; inset:5px; border-radius:3px;
  background: var(--bg);
}
.nav__cta { justify-self: end; }

@media (max-width: 900px) {
  .nav { padding: 0 14px; }
}
@media (max-width: 520px) {
  .nav {
    top: 12px; left: 12px; right: 12px;
    height: 56px;
    padding: 0 12px;
    border-radius: 14px;
  }
  .nav__brand { font-size: 13px; gap: 8px; }
  .nav__brand-mark { width: 18px; height: 18px; }
  .nav__cta .btn { padding: 9px 14px; font-size: 12px; }
  .nav__cta .btn .arrow { display: none; }
}
@media (max-height: 500px) {
  .nav { top: 8px; left: 12px; right: 12px; height: 52px; padding: 0 12px; border-radius: 12px; }
  .nav__brand { font-size: 13px; }
  .nav__cta .btn { padding: 8px 14px; font-size: 12px; }
}

/* =========================================================================
   Persistent: side progress rail
   ========================================================================= */
.rail {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  height: 60vh;
  width: 4px;
  z-index: var(--z-persistent);
  pointer-events: none;
}
.rail__track {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}
.rail__fill {
  position: absolute; top: 0; left: 0; right: 0;
  background: var(--grad-vc);
  border-radius: 2px;
  height: 0%;
  transition: height 80ms linear;
  box-shadow: 0 0 12px rgba(124,92,255,0.4);
}
.rail__markers {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
}
.rail__dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform var(--dur-micro) var(--ease-smooth),
              background var(--dur-micro) var(--ease-smooth),
              box-shadow var(--dur-micro) var(--ease-smooth);
}
.rail__dot.is-active {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  transform: scale(2);
}

@media (max-width: 720px) { .rail { display: none; } }

/* =========================================================================
   Persistent: custom cursor
   ========================================================================= */
.cursor {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-cursor);
  top: 0; left: 0;
  mix-blend-mode: difference;
}
.cursor__dot {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #FFFFFF;
  transform: translate(-50%, -50%);
  transition: transform 120ms var(--ease-smooth);
}
.cursor__ring {
  position: absolute;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  transition: width 240ms var(--ease-smooth), height 240ms var(--ease-smooth),
              border-color 240ms var(--ease-smooth);
}
.cursor.is-hover .cursor__ring { width: 56px; height: 56px; border-color: rgba(255,255,255,0.95); }
.cursor.is-hover .cursor__dot  { transform: translate(-50%, -50%) scale(0.5); }

@media (pointer: coarse) { .cursor { display: none; } }

/* =========================================================================
   Loading screen
   ========================================================================= */
.loader {
  position: fixed; inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 600ms var(--ease-smooth);
}
.loader.is-done { opacity: 0; pointer-events: none; }
.loader__inner { text-align: center; }
.loader__mark {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--grad-vc);
  position: relative;
  box-shadow: 0 0 36px rgba(124,92,255,0.5);
  animation: loader-pulse 1.6s var(--ease-smooth) infinite;
}
.loader__mark::after {
  content: ""; position: absolute; inset: 12px;
  border-radius: 6px; background: var(--bg);
}
.loader__pct {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}
@keyframes loader-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(0.92); }
}

/* =========================================================================
   Reveal helpers (scroll-triggered)
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-entry) var(--ease-smooth), transform var(--dur-entry) var(--ease-smooth); }
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal--lg { transform: translateY(40px); }
.reveal[data-stagger="1"] { transition-delay: calc(1 * var(--stagger)); }
.reveal[data-stagger="2"] { transition-delay: calc(2 * var(--stagger)); }
.reveal[data-stagger="3"] { transition-delay: calc(3 * var(--stagger)); }
.reveal[data-stagger="4"] { transition-delay: calc(4 * var(--stagger)); }
.reveal[data-stagger="5"] { transition-delay: calc(5 * var(--stagger)); }
.reveal[data-stagger="6"] { transition-delay: calc(6 * var(--stagger)); }
.reveal[data-stagger="7"] { transition-delay: calc(7 * var(--stagger)); }
.reveal[data-stagger="8"] { transition-delay: calc(8 * var(--stagger)); }

.char-reveal { display: inline-flex; flex-wrap: wrap; overflow: hidden; }
.char-reveal .word { display: inline-flex; overflow: hidden; margin-right: 0.28em; }
.char-reveal .char {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 800ms var(--ease-smooth);
  will-change: transform;
}
.char-reveal.is-in .char { transform: translateY(0); }

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}
.btn--breathe { animation: breathe 3s var(--ease-smooth) infinite; }

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .char-reveal .char { transform: none; }
  .btn--breathe { animation: none; }
  body { cursor: auto; }
  .cursor { display: none; }
}

/* =========================================================================
   Footer
   ========================================================================= */
.footer {
  position: relative;
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 48px var(--grid-margin) 32px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gutter);
  row-gap: 32px;
  z-index: var(--z-text);
}
.footer__col h5 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-weight: 500;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer__col a { color: var(--text-muted); font-size: 14px; transition: color 200ms var(--ease-smooth); }
.footer__col a:hover { color: var(--text); }
.footer__brand { grid-column: 1 / 5; }
.footer__c1 { grid-column: 5 / 7; }
.footer__c2 { grid-column: 7 / 9; }
.footer__c3 { grid-column: 9 / 11; }
.footer__c4 { grid-column: 11 / 13; }
.footer__bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--font-mono);
}

@media (max-width: 900px) {
  .footer__brand, .footer__c1, .footer__c2, .footer__c3, .footer__c4 { grid-column: 1 / -1; }
}
