/* ==========================================================================
   Sara Darwich Chamas — portfolio
   Black & gold editorial system. Static HTML first, WebGL as enhancement.
   ========================================================================== */

:root {
  --gold-hi: #f1d38a;
  --gold-lo: #8a6420;
  --gold-glow: rgba(201, 162, 74, .35);
  --grad: linear-gradient(120deg, #8a6420, #c9a24a 40%, #f1d38a);
  --paper: #f4efe6;
  --paper-ink: #0a0a0a;

  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --text: "Lora", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --pad-x: clamp(18px, 6vw, 96px);
  --pad-y: clamp(84px, 11vw, 160px);
  --max: 1280px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 68px;
}

/* Dark is the default; .island sections (Work, Pipeline, Experience, Contact)
   stay dark in both themes so the WebGL scenes keep their glow. */
:root, [data-theme="dark"], .island, [data-top="island"] .nav:not(.scrolled) {
  --bg: #050505;
  --bg-2: #0b0a08;
  --surface: #111009;
  --surface-2: #17150f;
  --ink: #f4efe6;
  --ink-2: rgba(244, 239, 230, .74);
  --muted: rgba(244, 239, 230, .52);
  --line: rgba(244, 239, 230, .12);
  --line-2: rgba(244, 239, 230, .22);
  --gold: #c9a24a;
  --accent: #f1d38a;
  --sheen: #f1d38a;
  --glass: rgba(5, 5, 5, .72);
  --glass-soft: rgba(5, 5, 5, .4);
  --card-bg: linear-gradient(160deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .005));
  --grain: .06;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f2ea;
  --bg-2: #eee7da;
  --surface: #fffdf8;
  --surface-2: #f3ece0;
  --ink: #16130d;
  --ink-2: rgba(22, 19, 13, .76);
  --muted: rgba(22, 19, 13, .64);
  --line: rgba(22, 19, 13, .13);
  --line-2: rgba(22, 19, 13, .24);
  --gold: #86601c;
  --accent: #7d5411;
  --sheen: #c08f3a;
  --glass: rgba(246, 242, 234, .8);
  --glass-soft: rgba(246, 242, 234, .55);
  --card-bg: linear-gradient(160deg, #fffdf8, rgba(255, 253, 248, .4));
  --grain: .035;
  color-scheme: light;
}
.island { background-color: var(--bg); color: var(--ink) }

*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h) }
body {
  margin: 0;
  transition: background-color .5s var(--ease), color .5s var(--ease);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden }
img, svg, canvas { display: block; max-width: 100% }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.04; letter-spacing: -.015em }
p { margin: 0 }
ul, ol { margin: 0; padding: 0; list-style: none }
a { color: var(--accent); text-decoration: none }
a:hover { color: var(--gold) }
em { font-style: italic }
button { font: inherit; color: inherit }
::selection { background: var(--gold); color: #000 }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }
.skip { position: fixed; left: 16px; top: -60px; z-index: 300; background: var(--gold); color: #000; padding: 10px 16px; font-family: var(--sans); font-size: 13px; transition: top .2s }
.skip:focus { top: 12px; color: #000 }

/* ── atmosphere ─────────────────────────────────────────────── */
.grain {
  position: fixed; inset: -50%; z-index: 200; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0) } 20% { transform: translate(-3%, 2%) } 40% { transform: translate(2%, -4%) }
  60% { transform: translate(-4%, -1%) } 80% { transform: translate(3%, 3%) } 100% { transform: translate(0, 0) }
}
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi), var(--gold)) }

/* custom cursor (fine pointers only, enabled by JS) */
.cursor, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 250; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .3s }
.cursor { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--gold) }
.cursor-ring { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(241, 211, 138, .55); transition: opacity .3s, width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, border-color .35s }
.has-cursor .cursor, .has-cursor .cursor-ring { opacity: 1 }
.has-cursor.cursor-hover .cursor-ring { width: 74px; height: 74px; margin: -37px 0 0 -37px; background: rgba(201, 162, 74, .1); border-color: var(--gold) }
.has-cursor.cursor-drag .cursor-ring { width: 86px; height: 86px; margin: -43px 0 0 -43px; border-style: dashed }
.cursor-label { position: fixed; top: 0; left: 0; z-index: 251; pointer-events: none; font-family: var(--sans); font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); opacity: 0; transform: translate(-50%, -50%); transition: opacity .25s }
.has-cursor.cursor-drag .cursor-label { opacity: 1 }


/* ── type helpers ───────────────────────────────────────────── */
.eyebrow { font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: var(--gold) }
.meta { font-family: var(--sans); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums }
.lede { font-family: var(--serif); font-style: italic; font-size: clamp(21px, 2.5vw, 32px); line-height: 1.3; color: var(--ink-2); max-width: 760px }
.display { font-weight: 300; font-size: clamp(40px, 6.6vw, 96px); letter-spacing: -.025em }
.display em, .h2 em { color: var(--accent); font-weight: 400 }
.h2 { font-weight: 300; font-size: clamp(34px, 4.8vw, 66px); letter-spacing: -.02em }
.gold-text { background: linear-gradient(100deg, var(--gold-lo) 0%, var(--sheen) 35%, var(--gold) 55%, var(--sheen) 75%, var(--gold-lo) 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 7s linear infinite }
@keyframes sheen { to { background-position: -220% 0 } }

/* ── layout ─────────────────────────────────────────────────── */
.section { position: relative; padding: var(--pad-y) var(--pad-x); overflow-x: clip }
html, body { overflow-x: clip }
.wrap { max-width: var(--max); margin: 0 auto; position: relative }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line) }
.section-head .num { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 15px; margin-right: 10px; letter-spacing: 0; text-transform: none }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(36px, 5vw, 84px); align-items: center; margin-top: clamp(36px, 5vw, 64px) }
.gl { position: relative; overflow: hidden }
.gl canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important }
.gl[data-drag] { cursor: grab; touch-action: pan-y }
.gl[data-drag]:active { cursor: grabbing }
.gl-hint { position: absolute; left: 16px; bottom: 14px; z-index: 2; pointer-events: none; font-family: var(--sans); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted) }
.surface { background: var(--bg-2) }

/* ── buttons ────────────────────────────────────────────────── */
.btn { position: relative; display: inline-flex; background: transparent; cursor: pointer; align-items: center; gap: 12px; padding: 15px 28px; border-radius: 999px; font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--ink); overflow: hidden; isolation: isolate; transition: color .45s var(--ease), border-color .45s var(--ease), transform .4s var(--ease) }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--ink); transform: translateY(101%); transition: transform .5s var(--ease-out) }
.btn:hover { color: var(--bg); border-color: var(--ink) }
.btn:hover::before { transform: none }
.btn--gold { background: var(--grad); border-color: transparent; color: #0a0a0a; box-shadow: 0 10px 40px -12px var(--gold-glow) }
.btn--gold::before { background: var(--ink) }
.btn--gold:hover { color: var(--bg) }
.btn svg { width: 14px; height: 14px; transition: transform .4s var(--ease) }
.btn:hover svg { transform: translateX(4px) }

/* ── nav ────────────────────────────────────────────────────── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 var(--pad-x); transition: background .4s, border-color .4s, transform .5s var(--ease); border-bottom: 1px solid transparent }
.nav.scrolled { background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-color: var(--line) }
.nav.hide { transform: translateY(-100%) }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--serif); font-size: 20px; letter-spacing: .16em }
.brand:hover { color: var(--ink) }
.brand__mark { width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; display: grid; place-items: center; font-size: 13px; letter-spacing: .04em; color: var(--accent); font-style: italic }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); font-family: var(--sans); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase }
.nav__links a { color: var(--ink-2); position: relative; padding: 4px 0 }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: 100% 50%; transition: transform .45s var(--ease) }
.nav__links a:hover, .nav__links a.active { color: var(--ink) }
.nav__links a:hover::after, .nav__links a.active::after { transform: scaleX(1); transform-origin: 0 50% }
.nav__cta { padding: 10px 20px !important; border: 1px solid var(--gold); border-radius: 999px; color: var(--accent) !important }
.nav__cta::after { display: none }
.nav__cta:hover { background: var(--gold); color: #000 !important }
.menu-btn { display: none; width: 46px; height: 46px; border: 1px solid var(--line-2); border-radius: 50%; background: transparent; cursor: pointer; position: relative }
.menu-btn span { position: absolute; left: 14px; right: 14px; height: 1px; background: var(--ink); transition: transform .4s var(--ease), top .4s var(--ease) }
.menu-btn span:nth-child(1) { top: 19px } .menu-btn span:nth-child(2) { top: 26px }
.menu-open .menu-btn span:nth-child(1) { top: 22.5px; transform: rotate(45deg) }
.menu-open .menu-btn span:nth-child(2) { top: 22.5px; transform: rotate(-45deg) }

.drawer { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; justify-content: center; padding: 90px var(--pad-x) 40px; clip-path: circle(0 at calc(100% - 44px) 34px); transition: clip-path .8s var(--ease-out); visibility: hidden }
.menu-open .drawer { clip-path: circle(150% at calc(100% - 44px) 34px); visibility: visible }
.drawer a { display: flex; align-items: baseline; gap: 16px; font-family: var(--serif); font-size: clamp(36px, 9vw, 60px); font-weight: 300; color: var(--ink); line-height: 1.25; opacity: 0; transform: translateY(24px); transition: opacity .5s, transform .6s var(--ease-out), color .3s }
.drawer a small { font-family: var(--sans); font-size: 11px; letter-spacing: .2em; color: var(--gold) }
.drawer a:hover { color: var(--accent) }
.menu-open .drawer a { opacity: 1; transform: none }
.drawer__foot { margin-top: 40px; font-family: var(--sans); font-size: 12px; letter-spacing: .14em; color: var(--muted) }

@media (max-width: 980px) {
  .nav__links { display: none }
  .menu-btn { display: block }
}

/* ── theme toggle ───────────────────────────────────────────── */
.theme-btn { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; cursor: pointer; display: grid; place-items: center; overflow: hidden; transition: border-color .3s, background .3s; flex: none }
.theme-btn:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent) }
.theme-btn svg { position: absolute; width: 18px; height: 18px; color: var(--accent); transition: transform .7s var(--ease-out), opacity .4s }
.theme-btn .sun { transform: translateY(140%) rotate(-90deg); opacity: 0 }
[data-theme="light"] .theme-btn .sun { transform: none; opacity: 1 }
[data-theme="light"] .theme-btn .moon { transform: translateY(-140%) rotate(90deg); opacity: 0 }
.nav__right { display: flex; align-items: center; gap: 12px }
html.theme-swap *, html.theme-swap *::before, html.theme-swap *::after { transition-duration: .5s !important; transition-property: background-color, color, border-color, fill, stroke !important }

/* ── hero ───────────────────────────────────────────────────── */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: calc(var(--nav-h) + 40px) var(--pad-x) 140px; overflow: hidden; isolation: isolate }
.hero__gl { position: absolute; inset: 0; z-index: -2 }
.hero__gl::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 45%, transparent 35%, color-mix(in srgb, var(--bg) 85%, transparent) 100%), linear-gradient(180deg, transparent 70%, var(--bg)); pointer-events: none }
.hero__aura { position: absolute; z-index: -3; inset: 0; background: radial-gradient(45% 40% at 70% 40%, rgba(201, 162, 74, .14), transparent 70%), radial-gradient(35% 35% at 20% 70%, rgba(138, 100, 32, .12), transparent 70%) }
.hero__content { max-width: var(--max); margin: 0 auto; width: 100% }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--glass-soft); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px) }
.hero__eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: #5bd38a; box-shadow: 0 0 0 0 rgba(91, 211, 138, .6); animation: ping 2.2s infinite }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(91, 211, 138, 0) } 100% { box-shadow: 0 0 0 0 rgba(91, 211, 138, 0) } }
.hero h1 { margin-top: 30px; font-weight: 300; font-size: clamp(56px, 11.5vw, 188px); line-height: .9; letter-spacing: -.045em }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em }
.hero h1 .line--2 { padding-left: clamp(0px, 12vw, 220px); font-style: italic; font-weight: 400 }
.hero h1 .line > span { display: inline-block; animation: line-up 1.1s var(--ease-out) both }
.hero h1 .line--2 > span { animation-delay: .12s }
@keyframes line-up { from { transform: translateY(45%) } }
.hero__row { display: grid; gap: 30px; max-width: 640px; margin-top: clamp(30px, 4vw, 54px) }
.hero__role { font-family: var(--sans); font-size: clamp(11px, 1.1vw, 13px); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 14px }
.hero__role::before { content: ""; width: 46px; height: 1px; background: var(--gold) }
.hero__tag { font-family: var(--serif); font-size: clamp(22px, 2.5vw, 34px); line-height: 1.25; color: var(--ink-2); margin-top: 16px; max-width: 30ch }
.hero__tag em { color: var(--ink) }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px }
.hero__stats { position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-right: 90px; gap: 18px; align-items: end; border-top: 1px solid var(--line); padding-top: 18px; max-width: var(--max); margin: 0 auto }
.hero__stats dt { font-family: var(--sans); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted) }
.hero__stats dd { margin: 4px 0 0; font-family: var(--serif); font-size: clamp(26px, 3vw, 40px); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums }
.scroll-cue { position: absolute; right: var(--pad-x); bottom: 40px; display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted) }
.scroll-cue span { width: 1px; height: 44px; background: var(--line); position: relative; overflow: hidden }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--gold); animation: drip 2s var(--ease) infinite }
@media (max-width: 860px) {
  .hero { padding-bottom: 220px }
  .hero__gl::after { background: linear-gradient(180deg, transparent 18%, color-mix(in srgb, var(--bg) 60%, transparent) 42%, color-mix(in srgb, var(--bg) 25%, transparent) 70%, var(--bg)) }
  .hero__stats { grid-template-columns: repeat(2, 1fr); padding-right: 0 }
  .scroll-cue { display: none }
}

/* ── reveal ─────────────────────────────────────────────────── */
.js [data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s) }
.js [data-reveal].in { opacity: 1; transform: none }
.js [data-reveal="mask"] { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease-out) }
.js [data-reveal="mask"].in { clip-path: inset(0 0 0 0) }

/* ── profile ────────────────────────────────────────────────── */
.profile__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(36px, 6vw, 96px); margin-top: clamp(40px, 5vw, 70px) }
.facts { margin-top: 36px; font-family: var(--sans); font-size: 13.5px; font-variant-numeric: tabular-nums }
.facts div { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line) }
.facts div:last-child { border-bottom: 1px solid var(--line) }
.facts dt { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: 10.5px; padding-top: 2px }
.facts dd { margin: 0; color: var(--ink); text-align: right }
.prose { display: flex; flex-direction: column; gap: 22px; font-size: clamp(16px, 1.3vw, 18.5px); color: var(--ink-2) }
.prose p:first-child { color: var(--ink) }
.dropcap::first-letter { float: left; font-family: var(--serif); font-size: 5.2em; line-height: .78; padding: 6px 14px 0 0; color: var(--accent) }

/* ── services / tilt cards ──────────────────────────────────── */
.card__icon { width: 54px; height: 54px; margin: 22px 0 26px; color: var(--accent); transform: translateZ(40px) }

/* ── project sections ───────────────────────────────────────── */
.project__title { margin-top: clamp(30px, 4vw, 46px) }
.project__gl { height: clamp(360px, 60vh, 640px); margin: clamp(36px, 5vw, 64px) 0 0; border-block: 1px solid var(--line) }
.phase-strip { display: flex; justify-content: space-between; gap: 10px; padding: 14px 0 0; font-family: var(--sans); font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); flex-wrap: wrap }
.phase-strip span:first-child { color: var(--gold) }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(28px, 3.4vw, 48px); margin-top: clamp(44px, 6vw, 80px) }
.feature { border-top: 1px solid var(--line); padding-top: 22px; position: relative }
.feature::before { content: ""; position: absolute; top: -1px; left: 0; width: 0; height: 1px; background: var(--gold); transition: width 1.2s var(--ease-out) .2s }
.feature.in::before, html:not(.js) .feature::before { width: 100% }
.feature :is(h2, h3) { font-family: var(--serif); font-weight: 600; font-size: 23px; margin-bottom: 12px }
.feature p { font-size: 15px; color: var(--ink-2) }

.stack__gl { height: clamp(360px, 54vh, 560px); border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(80% 70% at 50% 40%, var(--surface-2), var(--bg-2)) }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: linear-gradient(90deg, var(--gold) var(--v, 18%), var(--line-2) var(--v, 18%)); margin: 18px 0 28px; border-radius: 2px; cursor: pointer }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--gold-hi); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--gold) }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold-hi); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--gold) }
.layers { border-bottom: 1px solid var(--line) }
.layer { display: flex; gap: 18px; width: 100%; text-align: left; padding: 16px 12px; border: 0; border-top: 1px solid var(--line); background: transparent; cursor: pointer; transition: background .3s, padding .4s var(--ease) }
.layer:hover, .layer:focus-visible, .layer.on { background: rgba(201, 162, 74, .07); padding-left: 20px }
.layer > span { font-family: var(--sans); font-size: 12px; color: var(--gold); padding-top: 5px; font-variant-numeric: tabular-nums }
.layer__t { display: block; font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.2 }
.layer p { font-size: 14px; color: var(--ink-2) }

@keyframes blink { 50% { opacity: 0 } }

/* ── experience ─────────────────────────────────────────────── */
.exp { position: relative; background: #000 !important }
.exp__gl { position: sticky; top: 0; height: 100svh; z-index: 0 }
.exp__body { position: relative; z-index: 1; margin-top: -100svh; padding: var(--pad-y) var(--pad-x) }
.jobs { display: flex; flex-direction: column; gap: clamp(60px, 9vw, 130px); margin-top: clamp(50px, 7vw, 100px) }
.job { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: clamp(20px, 4vw, 60px) }
.job__when { font-family: var(--serif); font-size: clamp(34px, 4vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; position: sticky; top: calc(var(--nav-h) + 30px); align-self: start }
.job__where { font-family: var(--sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 12px }
.job__card { padding: clamp(24px, 3vw, 40px); border: 1px solid var(--line); border-radius: 18px; background: rgba(5, 5, 5, .62); color: var(--ink); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px) }
.job__card h3 { font-family: var(--serif); font-weight: 600; font-size: clamp(25px, 2.6vw, 34px) }
.job__org { font-family: var(--sans); font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin: 10px 0 20px }
.job__card .stack { display: flex; flex-direction: column; gap: 14px; font-size: 15px; color: var(--ink-2) }
.job__card em { color: var(--ink); font-style: normal; font-weight: 600 }
@media (max-width: 760px) {
  .job { grid-template-columns: 1fr; gap: 12px }
  .job__when { position: static }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: clamp(22px, 3vw, 40px); margin-top: clamp(24px, 3vw, 36px) }
.stat { border-top: 1px solid var(--line); padding-top: 18px }
.stat b { display: block; font-family: var(--serif); font-weight: 300; font-size: clamp(48px, 5vw, 68px); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink) }
.stat b { color: var(--accent) }
.stat p { margin-top: 10px; font-size: 14px; color: var(--ink-2) }

/* ── skills ─────────────────────────────────────────────────── */
.skill-table { font-size: 14.5px }
.skill-table div { display: grid; grid-template-columns: minmax(100px, .5fr) 1fr; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line) }
.skill-table div:last-child { border-bottom: 1px solid var(--line) }
.skill-table dt { font-family: var(--sans); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); padding-top: 4px }
.skill-table dd { margin: 0; color: var(--ink-2) }

/* ── credentials list ─────────────────────────────────────── */
.creds { display: grid; gap: 12px; margin-top: 28px }
.cred-item { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-bg) }
.cred-item .meta { color: var(--gold); letter-spacing: .18em }
.cred-item p:last-child { margin-top: 6px; font-size: 14.5px; color: var(--ink-2) }

/* ── FAQ ────────────────────────────────────────────────────── */
.faq { margin-top: clamp(36px, 5vw, 60px); border-bottom: 1px solid var(--line) }
.faq details { border-top: 1px solid var(--line) }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0; font-family: var(--serif); font-size: clamp(21px, 2.2vw, 28px); transition: color .3s }
.faq summary::-webkit-details-marker { display: none }
.faq summary:hover { color: var(--accent) }
.faq summary i { flex: none; width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 50%; position: relative; transition: transform .5s var(--ease), border-color .3s }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1px; background: var(--accent); transform: translate(-50%, -50%) }
.faq summary i::after { transform: translate(-50%, -50%) rotate(90deg) }
.faq details[open] summary i { transform: rotate(45deg); border-color: var(--gold) }
.faq details > div { padding: 0 0 26px; max-width: 76ch; color: var(--ink-2); font-size: 15.5px }

/* ── contact ────────────────────────────────────────────────── */
.contact { position: relative; overflow: hidden; padding: var(--pad-y) var(--pad-x) 48px; background: radial-gradient(70% 60% at 50% 0%, rgba(201, 162, 74, .14), transparent 70%), #000; isolation: isolate }
.contact__gl { position: absolute; inset: 0; z-index: -1; opacity: .9 }
.contact :is(h1, h2) { font-weight: 300; font-size: clamp(48px, 9.5vw, 150px); line-height: .92; letter-spacing: -.04em; margin-top: 24px }
.contact :is(h1, h2) em { color: var(--accent) }
.contact__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(36px, 5vw, 56px) }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 26px; margin-top: clamp(56px, 7vw, 96px) }
.links div { border-top: 1px solid var(--line); padding-top: 16px }
.links dt { font-family: var(--sans); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px }
.links dd { margin: 0; font-size: 16.5px }
.links a { color: var(--ink); background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease), color .3s }
.links a:hover { color: var(--accent); background-size: 100% 1px }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: clamp(56px, 7vw, 100px); padding-top: 22px; border-top: 1px solid var(--line); font-family: var(--sans); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted) }
.to-top { color: var(--ink-2) }

/* ── reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important }
  .grain { display: none }
}
@media print {
  .grain, .nav, .drawer, .cursor, .cursor-ring, .gl, .progress, .ai, .story, .palette { display: none !important }
  body { background: #fff; color: #000 }
}

/* ── stories rail ───────────────────────────────────────────── */
.stories { padding: clamp(28px, 4vw, 44px) var(--pad-x); border-bottom: 1px solid var(--line) }
html:not(.js) .stories { display: none }
.stories__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px }
.stories__head h2 { font-size: 11px; line-height: 1.6 }
.story-ring, .story__ring { width: 76px; height: 76px; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, var(--gold-lo), var(--gold-hi), var(--gold), var(--gold-lo)); transition: transform .4s var(--ease) }
.story-ring > span, .story__ring > span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--bg); background: radial-gradient(circle at 30% 25%, var(--surface-2), var(--bg-2)); font-family: var(--serif); font-size: 21px; font-style: italic; color: var(--accent) }

/* ── story viewer (always dark) ─────────────────────────────── */
.story { position: fixed; inset: 0; z-index: 320; display: grid; place-items: center; background: rgba(0, 0, 0, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); opacity: 0; transition: opacity .3s }
.story.on { opacity: 1 }
.story[hidden] { display: none }
.story__card { position: relative; width: min(420px, 100vw); height: min(780px, 100svh); border-radius: clamp(0px, 3vw, 22px); overflow: hidden; color: #f4efe6; display: flex; flex-direction: column; user-select: none; touch-action: none; background: radial-gradient(120% 70% at 20% 0%, rgba(201, 162, 74, .5), transparent 55%), radial-gradient(90% 60% at 100% 100%, rgba(138, 100, 32, .55), transparent 60%), #0b0906; box-shadow: 0 40px 120px -40px rgba(201, 162, 74, .45) }
.story__card[data-tone="1"] { background: radial-gradient(110% 70% at 100% 0%, rgba(241, 211, 138, .4), transparent 55%), radial-gradient(90% 70% at 0% 100%, rgba(201, 162, 74, .4), transparent 60%), #0a0806 }
.story__card[data-tone="2"] { background: linear-gradient(160deg, #2a1f0c, #0a0806 55%), #0a0806 }
.story__card::before { content: attr(data-mark); position: absolute; top: 12%; right: -6%; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 230px; line-height: 1; letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1px rgba(241, 211, 138, .28); pointer-events: none; transition: transform .8s var(--ease-out) }
.swap.story__card::before { animation: mark-in 1.1s var(--ease-out) both }
@keyframes mark-in { from { opacity: 0; transform: translateX(30px) } }
.story__card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px) }
.story__bars { display: flex; gap: 4px; padding: 14px 14px 0; position: relative; z-index: 3 }
.story__bars i { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(244, 239, 230, .25); overflow: hidden }
.story__bars b { display: block; height: 100%; background: #f4efe6; transform: scaleX(0); transform-origin: 0 50% }
.story__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; position: relative; z-index: 3 }
.story__head .story__ring { width: 38px; height: 38px; padding: 2px }
.story__head .story__ring > span { font-size: 13px; border-width: 2px; background: #0b0906; color: #f1d38a }
.story__head strong { display: block; font-family: var(--sans); font-size: 13.5px; font-weight: 600 }
.story__head small { display: block; font-family: var(--sans); font-size: 11px; color: rgba(244, 239, 230, .6) }
.story__close { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(244, 239, 230, .1); color: #f4efe6; font-size: 24px; line-height: 1; cursor: pointer }
.story__body { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding: 24px 26px 48px; pointer-events: none }
.story__body a { pointer-events: auto; align-self: flex-start; margin-top: 8px }
.story__k { font-family: var(--sans); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: #f1d38a }
.story__big { font-family: var(--serif); font-weight: 300; font-size: clamp(88px, 26vw, 130px); line-height: .85; letter-spacing: -.04em; background: linear-gradient(120deg, #f1d38a, #c9a24a 50%, #fff3cf); -webkit-background-clip: text; background-clip: text; color: transparent }
.story__h { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 8.4vw, 42px); line-height: 1.05; color: #f4efe6 }
.story__p { font-size: 16px; line-height: 1.6; color: rgba(244, 239, 230, .78) }
.swap .story__body > * { animation: story-in .6s var(--ease-out) both }
.swap .story__body > *:nth-child(2) { animation-delay: .06s } .swap .story__body > *:nth-child(3) { animation-delay: .12s } .swap .story__body > *:nth-child(4) { animation-delay: .18s } .swap .story__body > *:nth-child(5) { animation-delay: .24s }
@keyframes story-in { from { opacity: 0; transform: translateY(22px) } }
.story__prev, .story__next { position: absolute; top: 90px; bottom: 0; z-index: 1; border: 0; background: transparent; cursor: pointer }
.story__prev { left: 0; width: 35% } .story__next { right: 0; width: 65% }
.story.paused .story__bars { opacity: .5 }

/* ── AI assistant ───────────────────────────────────────────── */
.ai-orb { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #fff6dc, #f1d38a 30%, #c9a24a 60%, #8a6420); box-shadow: 0 0 12px rgba(241, 211, 138, .8); animation: orb 3s ease-in-out infinite }
.ai-orb--lg { width: 34px; height: 34px }
@keyframes orb { 50% { box-shadow: 0 0 22px rgba(241, 211, 138, 1); transform: scale(1.08) } }
.btn .ai-orb { margin-right: 2px }
.ai { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 150; display: none; flex-direction: column; align-items: flex-end; gap: 12px }
.js .ai { display: flex }
.ai-launch { display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px 13px 16px; border-radius: 999px; border: 1px solid rgba(201, 162, 74, .5); background: #0b0906; color: #f4efe6; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6), 0 0 0 0 rgba(201, 162, 74, .4); transition: transform .3s var(--ease), box-shadow .3s }
.ai-launch:hover { transform: translateY(-2px); box-shadow: 0 22px 50px -16px rgba(201, 162, 74, .5) }
.ai.open .ai-launch { opacity: .0; pointer-events: none; transform: scale(.9) }
.ai-panel { width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100svh - 110px)); display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .55); transform-origin: 100% 100%; transform: translateY(16px) scale(.96); opacity: 0; visibility: hidden; transition: transform .45s var(--ease-out), opacity .3s, visibility 0s .45s; position: absolute; right: 0; bottom: 0 }
.ai.open .ai-panel { transform: none; opacity: 1; visibility: visible; transition: transform .45s var(--ease-out), opacity .3s }
.ai-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 14%, transparent), transparent) }
.ai-head strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.1 }
.ai-head small { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted) }
.ai-close { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain }
.ai-msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-family: var(--sans); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; animation: story-in .35s var(--ease-out) both }
.ai-msg--bot { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-bottom-left-radius: 5px }
.ai-msg--user { align-self: flex-end; background: var(--grad); color: #0a0a0a; border-bottom-right-radius: 5px }
.ai-msg a { unicode-bidi: isolate; color: var(--accent); text-decoration: underline; text-underline-offset: 2px }
.ai-typing { display: flex; gap: 5px; padding: 15px 16px }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: dot 1s ease-in-out infinite }
.ai-typing i:nth-child(2) { animation-delay: .15s } .ai-typing i:nth-child(3) { animation-delay: .3s }
@keyframes dot { 50% { transform: translateY(-5px); opacity: .5 } }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px }
.ai-chips[hidden] { display: none }
.ai-chips button { border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 7px 12px; font-family: var(--sans); font-size: 12px; cursor: pointer; transition: border-color .25s, color .25s }
.ai-chips button:hover { border-color: var(--gold); color: var(--ink) }
.ai-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line) }
.ai-form input { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); color: var(--ink); padding: 11px 16px; font: 14px var(--sans) }
.ai-form input:focus { outline: none; border-color: var(--gold) }
.ai-form button { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--grad); color: #0a0a0a; display: grid; place-items: center; cursor: pointer }
.ai-form button svg { width: 16px; height: 16px }
.ai-note { padding: 0 16px 12px; font-family: var(--sans); font-size: 10.5px; color: var(--muted); text-align: center }
@media (max-width: 600px) { .ai-launch span:last-child { display: none } .ai-launch { padding: 14px } }

/* ── nav: command palette button ───────────────────────────── */
.kbd-btn { height: 46px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font: 600 12px var(--sans); letter-spacing: .08em; cursor: pointer; transition: border-color .3s, color .3s }
.kbd-btn:hover { border-color: var(--gold); color: var(--ink) }
@media (max-width: 600px) { .kbd-btn { display: none } }
.hero__touch { position: absolute; right: var(--pad-x); top: calc(var(--nav-h) + 40px); color: var(--accent); animation: float 3s ease-in-out infinite }
@keyframes float { 50% { transform: translateY(-6px) } }
@media (max-width: 900px) { .hero__touch { display: none } }

/* ── AI solutions: 3D flip cards ───────────────────────────── */
.flips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(16px, 2vw, 24px); margin-top: clamp(36px, 5vw, 60px); perspective: 1600px }
.flip { position: relative; height: 380px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; perspective: 1400px }
.flip__in { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transition: transform .9s var(--ease-out) }
.flip[aria-pressed="true"] .flip__in { transform: rotateY(180deg) }
@media (hover: hover) and (pointer: fine) { .flip:hover .flip__in { transform: rotateY(180deg) } .flip[aria-pressed="true"]:hover .flip__in { transform: rotateY(180deg) } }
.flip__face { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(24px, 2.6vw, 34px); border-radius: 20px; border: 1px solid var(--line); background: var(--card-bg); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden }
.flip__front::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 26%, transparent), transparent 70%); pointer-events: none }
.flip__front .card__icon { margin: 0 0 auto; transform: none }
.flip__t { display: block; font-family: var(--serif); font-size: clamp(26px, 2.4vw, 32px); line-height: 1.08; margin-top: 26px }
.flip__p { display: block; margin-top: 10px; color: var(--ink-2); font-size: 15px }
.flip__hint { display: block; margin-top: 20px; font: 600 11px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold) }
.flip__back { transform: rotateY(180deg); border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface)) }
.flip__k { font: 600 11px var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--gold) }
.flip__steps { display: grid; gap: 8px; margin-top: 16px; counter-reset: s }
.flip__steps span { position: relative; padding-left: 30px; font-size: 14.5px; line-height: 1.45; color: var(--ink) }
.flip__steps span::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 600 10.5px var(--sans); color: var(--bg); background: var(--gold) }
.flip__stack { display: block; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font: 12px var(--sans); letter-spacing: .04em; color: var(--ink-2) }
.flip__proof { display: block; margin-top: 8px; font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--accent) }

/* ── AI Lab ────────────────────────────────────────────────── */
.lab { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(20px, 3vw, 40px); margin-top: clamp(36px, 5vw, 60px); align-items: stretch }
@media (max-width: 960px) { .lab { grid-template-columns: minmax(0, 1fr) } }
.lab > *, .lab__stage > * { min-width: 0 }
.lab__console { display: flex; flex-direction: column; gap: 18px }
.lab__form { display: flex; flex-wrap: wrap; gap: 10px }
.lab__form input { flex: 1 1 220px }
.lab__form input { flex: 1; min-width: 0; height: 54px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(244, 239, 230, .04); color: var(--ink); font: 15px var(--sans) }
.lab__form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 162, 74, .15) }
.lab__form .btn { flex: none }
.lab.running .lab__form .btn, .lab__form .btn:disabled { opacity: .5; pointer-events: none }
.lab__presets { display: flex; flex-wrap: wrap; gap: 8px }
.lab__presets button { border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 8px 14px; font: 12.5px var(--sans); cursor: pointer; transition: border-color .25s, color .25s, background .25s }
.lab__presets button:hover { border-color: var(--gold); color: var(--ink); background: rgba(201, 162, 74, .08) }
.lab__phases { display: grid; gap: 8px }
.lab__phases li { display: grid; grid-template-columns: 14px 1fr auto; grid-template-rows: auto 3px; column-gap: 12px; row-gap: 8px; align-items: center; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(244, 239, 230, .02); transition: border-color .4s, background .4s }
.lab__phases li > b { font-family: var(--serif); font-size: 19px; font-weight: 600 }
.lab__phases li small { font: 11.5px var(--sans); color: var(--muted); letter-spacing: .04em }
.lab__phases li i { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden }
.lab__phases li i b { display: block; height: 100%; background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; transition: transform .4s var(--ease) }
.lab__dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line-2) }
.lab__phases li.active { border-color: var(--gold); background: rgba(201, 162, 74, .08) }
.lab__phases li.active .lab__dot { border-color: var(--gold-hi); background: var(--gold-hi); box-shadow: 0 0 12px var(--gold-hi); animation: orb 1s ease-in-out infinite }
.lab__phases li.done .lab__dot { border-color: #7fd69b; background: #7fd69b }
.lab__status { font: 13.5px var(--sans); color: var(--ink-2); min-height: 1.6em }
.lab__approve { padding: 18px; border-radius: 16px; border: 1px solid var(--gold); background: linear-gradient(160deg, rgba(201, 162, 74, .16), rgba(201, 162, 74, .04)); animation: story-in .5s var(--ease-out) both }
.lab__approve p { font-size: 15px; color: var(--ink) }
.lab__approve div { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px }
.lab__approve[hidden] { display: none }
.lab__stage { display: grid; grid-template-rows: minmax(260px, 1fr) auto; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: #000 }
.lab__gl { min-height: 340px }
.lab__out { border-top: 1px solid var(--line); background: #0a0907 }
.lab__tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line) }
.lab__tab { flex: none; padding: 11px 16px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; cursor: pointer }
.lab__tab[aria-selected="true"] { color: var(--gold-hi); border-bottom-color: var(--gold) }
.lab__code { margin: 0; height: 230px; overflow: auto; padding: 16px 18px; font: 12.5px/1.75 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: rgba(244, 239, 230, .86); white-space: pre-wrap }
.lab__note { margin-top: 18px; font: 12px var(--sans); color: var(--muted) }

/* ── command palette ───────────────────────────────────────── */
.palette { position: fixed; inset: 0; z-index: 330; display: grid; justify-items: center; align-items: start; padding: 14vh 16px 16px; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .2s }
.palette.on { opacity: 1 }
.palette[hidden] { display: none }
.palette__box { width: min(560px, 100%); border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .6); transform: translateY(-10px) scale(.98); transition: transform .3s var(--ease-out) }
.palette.on .palette__box { transform: none }
.palette__search { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line) }
.palette__search svg { width: 18px; height: 18px; color: var(--muted); flex: none }
.palette__search input { flex: 1; min-width: 0; height: 58px; border: 0; background: none; color: var(--ink); font: 16px var(--sans) }
.palette__search input:focus { outline: none }
.palette kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); font: 11px var(--sans); color: var(--muted); text-align: center }
.palette ul { max-height: 50vh; overflow-y: auto; padding: 8px }
.palette li { padding: 12px 14px; border-radius: 10px; font: 14.5px var(--sans); color: var(--ink-2); cursor: pointer }
.palette li[aria-selected="true"] { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--ink) }
.palette li.empty { cursor: default; color: var(--muted) }
.palette__foot { padding: 10px 16px; border-top: 1px solid var(--line); font: 11.5px var(--sans); color: var(--muted) }

/* ── scroll-driven 3D for headings (Chromium; others keep the reveal) ── */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .js .display, .js .h2 { animation: tilt-in linear both; animation-timeline: view(); animation-range: entry 0% cover 32% }
    @keyframes tilt-in { from { transform: perspective(900px) rotateX(38deg) translateY(40px) } to { transform: none } }
  }
}

/* ── multi-page: page tops, active nav, page transitions ───── */
.page-top { padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 110px)) }
.page-top h1.display { font-size: clamp(46px, 7.4vw, 112px) }
.nav__links a[aria-current="page"] { color: var(--ink) }
.nav__links a[aria-current="page"]::after { transform: scaleX(1) }
.drawer a[aria-current="page"] { color: var(--accent) }
@view-transition { navigation: auto }
.nav { view-transition-name: nav }
.site-foot { view-transition-name: foot }
::view-transition-old(root) { animation: vt-out .32s var(--ease) both }
::view-transition-new(root) { animation: vt-in .5s var(--ease-out) both }
@keyframes vt-out { to { opacity: 0; transform: perspective(1200px) rotateX(4deg) translateY(-18px) scale(.985) } }
@keyframes vt-in { from { opacity: 0; transform: perspective(1200px) rotateX(-6deg) translateY(30px) } }

/* ── footer ─────────────────────────────────────────────────── */
.site-foot { padding: 34px var(--pad-x) 28px; border-top: 1px solid var(--line); background: var(--bg) }
.site-foot__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font: 12px var(--sans); letter-spacing: .18em; text-transform: uppercase }
.site-foot nav a { color: var(--ink-2) }
.site-foot nav a:hover, .site-foot nav a[aria-current="page"] { color: var(--accent) }
.site-foot__meta { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font: 12px var(--sans); color: var(--muted) }
.site-foot__meta a { color: var(--ink-2) }

/* ── home: next-step tiles and CTA band ─────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; margin-top: clamp(32px, 4vw, 52px); perspective: 1200px }
.tile { position: relative; display: grid; gap: 10px; align-content: start; min-height: 210px; padding: 26px 24px; border-radius: 20px; border: 1px solid var(--line); background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(201, 162, 74, .16), transparent 70%), var(--card-bg); color: var(--ink); transform-style: preserve-3d; transition: transform .5s var(--ease), border-color .4s }
.tile:hover { border-color: var(--gold); color: var(--ink) }
.tile__n { font: italic 15px var(--serif); color: var(--gold) }
.tile b { font: 400 clamp(26px, 2.4vw, 32px)/1.05 var(--serif); transform: translateZ(30px) }
.tile span:not(.tile__n) { font-size: 15px; color: var(--ink-2); transform: translateZ(18px) }
.tile i { position: absolute; right: 22px; bottom: 18px; font-style: normal; font-size: 22px; color: var(--gold); transition: transform .4s var(--ease) }
.tile:hover i { transform: translateX(6px) }
.cta-band { text-align: left; background: radial-gradient(60% 80% at 80% 100%, rgba(201, 162, 74, .2), transparent 70%), #000 !important }
.cta-band .display { font-size: clamp(42px, 7vw, 104px) }

/* ── stories: 3D ring ───────────────────────────────────────── */
.ring { --cw: clamp(170px, 20vw, 240px); position: relative; height: calc(var(--cw) * 1.62); margin-top: clamp(26px, 4vw, 48px); perspective: 1000px; perspective-origin: 50% 40%; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none }
.ring.dragging { cursor: grabbing }
.ring__stage { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transform-style: preserve-3d; transform: rotateX(-7deg) }
.ring__track { position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); transform-style: preserve-3d }
.ring__card { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 18px; border-radius: 22px; border: 1px solid rgba(241, 211, 138, .22); text-align: left; color: #f4efe6; cursor: pointer; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: radial-gradient(120% 80% at 20% 0%, rgba(201, 162, 74, .5), transparent 60%), linear-gradient(170deg, #1b140a, #070605); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); transition: border-color .4s, box-shadow .4s }
.ring__card[data-tone="1"] { background: radial-gradient(110% 80% at 100% 0%, rgba(241, 211, 138, .38), transparent 60%), linear-gradient(170deg, #17110a, #060504) }
.ring__card[data-tone="2"] { background: radial-gradient(100% 70% at 50% 110%, rgba(201, 162, 74, .45), transparent 60%), linear-gradient(170deg, #241a0b, #070605) }
.ring__card.front, .ring__card:focus-visible { border-color: #f1d38a; box-shadow: 0 30px 80px -24px rgba(201, 162, 74, .6) }
.ring__card .art { position: absolute; top: 14%; left: 50%; --s: calc(var(--cw) * .5); margin-left: calc(var(--s) / -2) }
.ring__mark { position: absolute; top: 14px; left: 16px; font: italic 300 22px var(--serif); color: #f1d38a }
.ring__txt b { display: block; font: 400 24px/1.1 var(--serif) }
.ring__txt small { display: block; margin-top: 4px; font: 12.5px var(--sans); letter-spacing: .04em; color: rgba(244, 239, 230, .7) }
.ring-sec { overflow: hidden }

/* ── stories: CSS-3D art (decorative) ───────────────────────── */
.art { --s: 160px; --c: #f1d38a; width: var(--s); height: var(--s); perspective: 600px; pointer-events: none }
.art__in { position: absolute; inset: 0; transform-style: preserve-3d; animation: art-spin 14s linear infinite }
.art i { position: absolute; display: block }
@keyframes art-spin { to { transform: rotateY(360deg) } }
/* orbit: a core with three tilted rings */
.art--orbit .art__in { transform: rotateX(68deg); animation-name: art-orbit; animation-duration: 9s }
@keyframes art-orbit { to { transform: rotateX(68deg) rotateZ(360deg) } }
.art--orbit i { inset: 0; border-radius: 50%; border: 1.5px solid var(--c) }
.art--orbit i:nth-child(1) { inset: 34%; border: 0; background: radial-gradient(circle at 35% 30%, #fff3cf, #c9a24a 55%, #6b4c14); transform: rotateX(-68deg); box-shadow: 0 0 30px rgba(241, 211, 138, .6) }
.art--orbit i:nth-child(2) { transform: rotateY(60deg); opacity: .8 }
.art--orbit i:nth-child(3) { transform: rotateY(-60deg); opacity: .6 }
.art--orbit i:nth-child(4) { inset: 8%; border-style: dashed; opacity: .5 }
.art--orbit i:nth-child(5) { width: 12%; height: 12%; left: 44%; top: -6%; border: 0; border-radius: 50%; background: #fff3cf; box-shadow: 0 0 14px #f1d38a }
/* stack: floating layers, like an exploded app */
.art--stack .art__in { transform: rotateX(58deg) rotateZ(-40deg); animation: art-stack 5s var(--ease) infinite alternate }
@keyframes art-stack { to { transform: rotateX(58deg) rotateZ(-40deg) translateZ(10px) } }
.art--stack i { inset: 16%; border-radius: 14%; border: 1.5px solid var(--c); background: rgba(201, 162, 74, .14) }
.art--stack i:nth-child(1) { transform: translateZ(-30px) } .art--stack i:nth-child(2) { transform: translateZ(-6px) }
.art--stack i:nth-child(3) { transform: translateZ(18px) } .art--stack i:nth-child(4) { transform: translateZ(42px); background: linear-gradient(135deg, rgba(241, 211, 138, .6), rgba(201, 162, 74, .1)) }
/* bars: an isometric chart that grows */
.art--bars .art__in { transform: rotateX(-18deg) rotateY(-28deg); animation: none }
.art--bars i { bottom: 12%; width: 12%; border-radius: 3px 3px 0 0; background: linear-gradient(#fff3cf, #c9a24a 60%, #6b4c14); transform-origin: 50% 100%; animation: art-grow 2.4s var(--ease-out) infinite alternate }
.art--bars i:nth-child(1) { left: 10%; height: 30% } .art--bars i:nth-child(2) { left: 27%; height: 46%; animation-delay: .15s }
.art--bars i:nth-child(3) { left: 44%; height: 38%; animation-delay: .3s } .art--bars i:nth-child(4) { left: 61%; height: 62%; animation-delay: .45s }
.art--bars i:nth-child(5) { left: 78%; height: 80%; animation-delay: .6s }
@keyframes art-grow { from { transform: scaleY(.2) } }
/* cube */
.art--cube .art__in { inset: 25%; transform: rotateX(-24deg); animation-name: art-cube; animation-duration: 10s }
@keyframes art-cube { to { transform: rotateX(-24deg) rotateY(360deg) } }
.art--cube i { inset: 0; border: 1.5px solid var(--c); background: rgba(201, 162, 74, .16); --h: calc(var(--s) * .25) }
.art--cube i:nth-child(1) { transform: translateZ(var(--h)) } .art--cube i:nth-child(2) { transform: rotateY(180deg) translateZ(var(--h)) }
.art--cube i:nth-child(3) { transform: rotateY(90deg) translateZ(var(--h)) } .art--cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(var(--h)) }
.art--cube i:nth-child(5) { transform: rotateX(90deg) translateZ(var(--h)); background: rgba(241, 211, 138, .45) } .art--cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(var(--h)) }
/* wave: live audio */
.art--wave .art__in { transform: rotateY(-24deg); animation: none }
.art--wave i { top: 50%; width: 6%; height: 60%; margin-top: -30%; border-radius: 99px; background: linear-gradient(#fff3cf, #c9a24a); animation: art-wave 1.1s var(--ease) infinite alternate }
.art--wave i:nth-child(1) { left: 4% } .art--wave i:nth-child(2) { left: 15%; animation-delay: -.2s } .art--wave i:nth-child(3) { left: 26%; animation-delay: -.5s }
.art--wave i:nth-child(4) { left: 37%; animation-delay: -.1s } .art--wave i:nth-child(5) { left: 48%; animation-delay: -.7s } .art--wave i:nth-child(6) { left: 59%; animation-delay: -.3s }
.art--wave i:nth-child(7) { left: 70%; animation-delay: -.6s } .art--wave i:nth-child(8) { left: 81%; animation-delay: -.15s } .art--wave i:nth-child(9) { left: 92%; animation-delay: -.45s }
@keyframes art-wave { from { transform: scaleY(.18) } }
/* code: stacked editor windows */
.art--code .art__in { transform: rotateY(-28deg) rotateX(12deg); animation: art-code 6s var(--ease) infinite alternate }
@keyframes art-code { to { transform: rotateY(-8deg) rotateX(6deg) } }
.art--code i { inset: 14% 6% 22%; border-radius: 8px; border: 1px solid var(--c); background: repeating-linear-gradient(180deg, transparent 0 9px, rgba(241, 211, 138, .45) 9px 11px) 12px 18px / 60% 100% no-repeat, linear-gradient(rgba(241, 211, 138, .35) 0 9px, transparent 9px), #0b0906 }
.art--code i:nth-child(1) { transform: translate3d(-12%, -10%, -40px); opacity: .5 } .art--code i:nth-child(2) { transform: translate3d(-4%, -2%, -10px); opacity: .8 }
.art--code i:nth-child(3) { transform: translate3d(6%, 8%, 26px) }
/* cards: a fanned deck flying out */
.art--cards .art__in { animation: none; transform: rotateX(16deg) }
.art--cards i { inset: 18% 28%; border-radius: 10px; border: 1.5px solid var(--c); background: linear-gradient(160deg, rgba(241, 211, 138, .4), rgba(11, 9, 6, .9)); transform-origin: 50% 120%; animation: art-fan 3s var(--ease) infinite alternate }
.art--cards i:nth-child(1) { --r: -36deg } .art--cards i:nth-child(2) { --r: -18deg } .art--cards i:nth-child(3) { --r: 0deg } .art--cards i:nth-child(4) { --r: 18deg } .art--cards i:nth-child(5) { --r: 36deg }
@keyframes art-fan { from { transform: rotate(0) } to { transform: rotate(var(--r)) rotateY(calc(var(--r) * -1.2)) } }

/* the art inside the open story */
.story__art { position: absolute; top: 9%; right: 8%; --s: min(46vw, 190px); opacity: .95 }
.story__card::before { display: none }
.swap .story__body > .story__art { animation: art-in 1s var(--ease-out) both }
@keyframes art-in { from { opacity: 0; transform: scale(.6) rotate(-20deg) } }
/* a new story turns in like the face of a cube */
.story { perspective: 1400px }
.story__card.cube-next { animation: cube-next .7s var(--ease-out) both; transform-origin: 0% 50% }
.story__card.cube-prev { animation: cube-prev .7s var(--ease-out) both; transform-origin: 100% 50% }
@keyframes cube-next { from { transform: translateX(60%) rotateY(-80deg); filter: brightness(.4) } }
@keyframes cube-prev { from { transform: translateX(-60%) rotateY(80deg); filter: brightness(.4) } }

@media (prefers-reduced-motion: reduce) {
  .art__in, .art i { animation: none !important }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none }
}
