/* ============================================================
   Pixelskit — design tokens
   Warm = human. Cool = machine. Ink = everything else.
   ============================================================ */
:root {
  --bg: #F4F1EA;
  --bg-2: #EAE6DC;
  --surface: rgba(255, 255, 255, 0.8);
  --ink: #121116;
  --ink-2: #55525E;
  --ink-3: #8A8794;
  --line: rgba(18, 17, 22, 0.12);
  --warm: #D98200;
  --warm-ink: #121116;
  --cool: #4F4FD1;
  --shadow: 0 20px 60px -20px rgba(18, 17, 22, 0.25);
  --scene-ink: #121116;
  --scene-cool: #4F4FD1;
  --scene-warm: #E08A00;
  --scene-dark: 0;

  --f-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 22px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0D;
    --bg-2: #131318;
    --surface: rgba(20, 20, 26, 0.74);
    --ink: #EDEAE3;
    --ink-2: #A3A0AB;
    --ink-3: #6F6C78;
    --line: rgba(237, 234, 227, 0.12);
    --warm: #FFB547;
    --warm-ink: #17120A;
    --cool: #8D8EFF;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
    --scene-ink: #EDEAE3;
    --scene-cool: #8D8EFF;
    --scene-warm: #FFB547;
    --scene-dark: 1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0D;
  --bg-2: #131318;
  --surface: rgba(20, 20, 26, 0.74);
  --ink: #EDEAE3;
  --ink-2: #A3A0AB;
  --ink-3: #6F6C78;
  --line: rgba(237, 234, 227, 0.12);
  --warm: #FFB547;
  --warm-ink: #17120A;
  --cool: #8D8EFF;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  --scene-ink: #EDEAE3;
  --scene-cool: #8D8EFF;
  --scene-warm: #FFB547;
  --scene-dark: 1;
  color-scheme: dark;
}

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--warm); }
::selection { background: var(--warm); color: var(--warm-ink); }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 3px; border-radius: 6px; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .footer { position: relative; z-index: 2; }

/* ============================================================ loader */
.loader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--bg); transition: opacity .7s var(--ease), visibility .7s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-pixels { width: 44px; height: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.loader-pixels i { background: var(--ink); border-radius: 3px; animation: roll 1.4s var(--ease) infinite; }
.loader-pixels i:nth-child(2) { animation-delay: .12s; } .loader-pixels i:nth-child(3) { animation-delay: .24s; }
.loader-pixels i:nth-child(4) { animation-delay: .36s; background: var(--warm); }
@keyframes roll { 50% { border-radius: 50%; transform: scale(.82); } }
.mark-human { fill: var(--warm); }

/* ============================================================ topbar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 14px;
  pointer-events: none;
}
.topbar::before {
  content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--bg) 35%, transparent);
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; color: var(--ink); }
.brand-word { font-weight: 600; font-size: 19px; letter-spacing: -0.03em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.pi-progress { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); letter-spacing: .02em; min-width: 9ch; text-align: right; }
.pi-progress span:last-child { color: var(--warm); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .3s var(--ease), border-color .3s;
}
.icon-btn:hover { transform: scale(1.06); border-color: var(--ink-3); }

/* ============================================================ type */
.eyebrow, .kicker {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 18px; display: flex; align-items: center; gap: 10px;
}
.kicker .num { color: var(--warm); }
.kicker.cool .num, .kicker.cool { color: var(--cool); }
.kicker.warm { color: var(--warm); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warm) 25%, transparent); }
.display {
  font-size: clamp(3.1rem, 10.5vw, 9rem); line-height: .92; letter-spacing: -0.055em; font-weight: 500; margin: 0;
}
.display em { letter-spacing: -0.03em; }
.title { font-size: clamp(2.3rem, 4.4vw, 4.2rem); line-height: .98; letter-spacing: -0.045em; font-weight: 500; margin: 0 0 22px; }
.mono-title { font-family: var(--f-mono); font-weight: 400; letter-spacing: -0.06em; color: var(--cool); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-2); max-width: 30ch; margin: 28px 0 34px; }
.body { color: var(--ink-2); max-width: 42ch; margin: 0; }

/* ============================================================ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 999px; font-weight: 500; font-size: 16px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .35s var(--ease), background-color .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warm); }
.btn-ghost { background: var(--surface); border-color: var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn.wide { width: 100%; }

/* ============================================================ the space
   One fixed 3D stage. JS sets `perspective` to match the WebGL camera,
   then places every .layer with translate3d at its depth. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.space { position: fixed; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.css3d, .css3d > div { pointer-events: none; }
.layer { opacity: 0; pointer-events: none !important; backface-visibility: hidden; }
.layer.is-active { pointer-events: auto !important; }

/* header wordmark: the vector logo as a mask, so it follows the theme */
.brand-logo {
  display: block; height: 22px; aspect-ratio: 932.96 / 229.32; background: var(--ink);
  -webkit-mask: url(../img/pixelskit-wordmark.svg) center / contain no-repeat; mask: url(../img/pixelskit-wordmark.svg) center / contain no-repeat;
}
.brand-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* no WebGL: fall back to a plain readable page */
.no-3d body, .no-3d { height: auto; overflow: auto; }
.no-3d .space { position: static; overflow: visible; pointer-events: auto; padding: 100px 16px 120px; display: grid; gap: 64px; justify-items: center; }
.no-3d .layer { position: static !important; opacity: 1; pointer-events: auto !important; transform: none !important; }
.layer.is-active { pointer-events: auto; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 40%, color-mix(in srgb, var(--bg) 75%, transparent) 100%);
}

/* hero */
.l-hero { width: min(1180px, calc(100vw - 2 * var(--gutter))); }
.l-hero .lede { max-width: 46ch; }
.layer { text-shadow: 0 2px 24px rgba(4, 5, 10, .8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.display-poem { font-size: clamp(2.6rem, 6.4vw, 6rem); line-height: .98; max-width: 14ch; }
.display-2 { font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .95; letter-spacing: -0.05em; font-weight: 500; margin: 0 0 22px; }

/* text stations */
.l-text { width: min(520px, calc(100vw - 32px)); }
.l-head { width: min(900px, calc(100vw - 32px)); text-align: center; }
.l-head .kicker { justify-content: center; }
.l-head .display-poem { font-size: clamp(2.6rem, 6.4vw, 6rem); line-height: .98; max-width: 14ch; }
.display-2 { margin: 0; }

/* each station's copy rises slightly as it arrives */
.layer > * { transition: transform 1s var(--ease); }
.layer:not(.is-active) > * { transform: translateY(14px); }

.terminal {
  margin-top: 26px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden;
  background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-family: var(--f-mono); font-size: 12.5px;
}
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.terminal-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.terminal-bar span { margin-left: 8px; }
.terminal pre { margin: 0; padding: 14px 16px; min-height: 150px; white-space: pre-wrap; color: var(--ink-2); line-height: 1.7; }
.terminal pre .ok { color: var(--cool); }
.terminal pre .hu { color: var(--warm); }
.caret { display: inline-block; width: 7px; height: 14px; background: var(--cool); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.signoff {
  margin-top: 26px; display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 16px;
  padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.signoff strong { display: block; font-weight: 600; }
.signoff span { font-size: 14px; color: var(--ink-2); }
.signature { width: 120px; height: 40px; }
.signature path { fill: none; stroke: var(--warm); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 600; stroke-dashoffset: 600; }
.layer.is-active .signature path { animation: sign 2.2s .3s var(--ease) forwards; }
@keyframes sign { to { stroke-dashoffset: 0; } }
.check { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--warm); color: var(--warm-ink); font-weight: 700; font-size: 15px; }

/* services */
.orbit-card {
  width: min(350px, 28vw); padding: 28px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column; min-height: 400px;
}
.orbit-card h3 { font-size: 2.4rem; letter-spacing: -0.04em; font-weight: 500; margin: 4px 0 12px; }
.orbit-card p { color: var(--ink-2); margin: 0 0 20px; }
.orbit-n { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3) !important; margin: 0 !important; }
.orbit-icon { width: 44px; height: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 28px; }
.orbit-icon span { background: var(--ink); border-radius: 3px; transition: border-radius .6s var(--ease); }
.orbit-icon span:last-child { background: var(--warm); border-radius: 50%; }
.orbit-icon.create span:nth-child(1) { border-radius: 50%; }
.orbit-icon.grow span:nth-child(2) { border-radius: 50%; }
.orbit-card:hover .orbit-icon span { border-radius: 50%; }
.tags { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 13px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.orbit-link { margin-top: 18px; font-family: var(--f-mono); font-size: 13px; text-decoration: none; color: var(--ink); display: inline-flex; gap: 6px; }
.orbit-link span { color: var(--warm); transition: transform .3s var(--ease); }
.orbit-link:hover span { transform: translate(3px, -3px); }

/* work */
.work-card {
  width: min(430px, 34vw, 48vh); aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
}
.work-art {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 70% 30%, hsl(var(--h1) 90% 62% / .95), transparent 55%),
    radial-gradient(circle at 20% 80%, hsl(var(--h2) 80% 55% / .9), transparent 60%),
    linear-gradient(160deg, hsl(var(--h2) 30% 14%), hsl(var(--h1) 30% 8%));
  transition: transform 1.2s var(--ease);
}
.work-art::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,0,0,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.35) 1px, transparent 1px);
  background-size: 14px 14px; mix-blend-mode: overlay;
}
.work-card:hover .work-art { transform: scale(1.06); }
.work-meta {
  position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 16px 18px; border-radius: 16px;
  background: rgba(10, 10, 13, .5); color: #EDEAE3;
}
.work-meta span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.work-meta h3 { margin: 4px 0 0; font-weight: 500; font-size: 1.35rem; letter-spacing: -0.03em; }

/* studio */
.portrait {
  margin: 0; width: min(380px, 30vw); aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
}
.portrait-pixels {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--warm) 55%, transparent) 0 18%, transparent 19%),
    radial-gradient(ellipse at 50% 95%, color-mix(in srgb, var(--warm) 40%, transparent) 0 38%, transparent 39%),
    linear-gradient(var(--bg-2), var(--bg));
  filter: blur(2px);
}
.portrait-pixels::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--bg) 2px, transparent 2px), linear-gradient(90deg, var(--bg) 2px, transparent 2px);
  background-size: 22px 22px;
}
.portrait figcaption { position: absolute; left: 18px; bottom: 14px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.principle {
  width: min(560px, calc(100vw - 32px)); display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start;
}
.principle > span { font-family: var(--f-mono); color: var(--warm); font-size: clamp(3.4rem, 8vw, 6rem); line-height: .8; letter-spacing: -0.06em; }
.principle p { margin: 0; color: var(--ink-2); font-size: clamp(1.05rem, 1.8vw, 1.3rem); }
.principle strong { display: block; color: var(--ink); font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 8px; }

/* final */
.l-final { width: min(760px, calc(100vw - 32px)); text-align: center; display: flex; flex-direction: column; align-items: center; }
.l-final .kicker { justify-content: center; }
.quick { display: flex; gap: 10px; margin: 8px 0 22px; flex-wrap: wrap; justify-content: center; }
.quick-btn {
  min-width: 160px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line); text-decoration: none;
  background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; flex-direction: column; text-align: left; transition: transform .35s var(--ease), border-color .3s;
}
.quick-btn:hover { transform: translateY(-3px); border-color: var(--warm); }
.quick-btn b { font-weight: 600; }
.quick-btn span { font-size: 13px; color: var(--ink-2); }
.fineprint { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin: 0; }
.fineprint a { color: var(--ink-2); text-decoration: none; }

/* HUD */
.hud {
  position: fixed; z-index: 20; left: var(--gutter); bottom: calc(30px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: .08em; text-transform: uppercase;
}
.hud-value { color: var(--ink); min-width: 4ch; }
.hud-bar { width: 80px; height: 1px; background: var(--line); position: relative; }
.hud-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--warm); }
.scroll-cue {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom));
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity .6s var(--ease);
}
.scroll-cue.gone { opacity: 0; }
.scroll-cue span { width: 1px; height: 36px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--warm); animation: drip 1.8s var(--ease) infinite; }
@keyframes drip { to { top: 100%; } }

/* shared page bits (brand sheet) */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px var(--gutter); font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--warm); }

/* ============================================================ dock */
.dock {
  position: fixed; z-index: 30; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
}
.dock-item {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 999px;
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-2); border: 0; background: none; cursor: pointer;
  transition: background-color .3s, color .3s;
}
.dock-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.dock-item:hover { color: var(--ink); }
.dock-item.is-active { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.dock-talk { background: var(--ink); color: var(--bg); }
.dock-talk:hover { color: var(--bg); }
.live { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; position: relative; flex: none; }
.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #3DDC84; opacity: 0; animation: ping 2s var(--ease) infinite; }
@keyframes ping { 0% { opacity: .8; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.4); } }

/* ============================================================ talk sheet */
.sheet {
  width: min(520px, 100vw); max-height: min(88svh, 760px); margin: auto; padding: 30px 28px 26px;
  border: 1px solid var(--line); border-radius: 28px; background: var(--bg); color: var(--ink); box-shadow: var(--shadow);
  overflow-y: auto;
}
.sheet::backdrop { background: rgba(5, 5, 8, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet[open] { animation: sheet-in .5s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(30px) scale(.98); } }
.sheet-grip { display: none; }
.sheet-close-form { position: absolute; top: 18px; right: 18px; margin: 0; }
.sheet-title { font-size: 2.4rem; letter-spacing: -0.045em; font-weight: 500; line-height: 1; margin: 0 0 22px; }
.quick.compact { margin: 0 0 22px; justify-content: stretch; flex-wrap: nowrap; }
.quick.compact .quick-btn { min-width: 0; flex: 1; text-align: center; align-items: center; padding: 12px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.talk-form { display: grid; gap: 14px; }
.chips { border: 0; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; padding: 0; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; transition: all .25s var(--ease); }
.chips input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips input:focus-visible + span { outline: 2px solid var(--warm); outline-offset: 2px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.field i { color: var(--ink-3); font-style: normal; }
.field input, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg-2); border: 1px solid transparent;
  border-radius: 14px; padding: 13px 14px; resize: none; transition: border-color .25s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--warm); }

/* ============================================================ responsive */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .pi-progress { font-size: 11px; min-width: 0; }
  .hud { display: none; }
  .scroll-cue { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .l-text { padding: 18px; margin: 0; border-radius: 22px; background: color-mix(in srgb, var(--bg) 55%, transparent); }
  .terminal pre { min-height: 132px; font-size: 11.5px; padding: 12px 14px; }
  .signoff { grid-template-columns: 90px 1fr auto; }
  .signature { width: 90px; }
  .orbit-card { width: calc(100vw - 40px); min-height: 0; }
  .work-card { width: min(78vw, 48vh); }
  .portrait { width: min(80vw, 46vh); }
  .quick { width: 100%; flex-wrap: nowrap; }
  .quick-btn { min-width: 0; flex: 1; align-items: center; text-align: center; padding: 12px 8px; }
  .quick-btn span { display: none; }
  .dock { width: calc(100% - 24px); justify-content: space-between; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .dock-item { flex-direction: column; gap: 2px; height: 52px; padding: 0 10px; font-size: 11px; flex: 1; justify-content: center; }
  .dock-talk { flex-direction: row; gap: 6px; font-size: 14px; }
  .sheet {
    width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 28px 28px 0 0; border-bottom: 0;
    padding: 14px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 92svh;
  }
  .sheet[open] { animation: sheet-up .5s var(--ease); }
  .sheet-grip { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 18px; }
  .sheet-close-form { top: 14px; right: 14px; }
  .sheet-title { font-size: 2rem; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================ more-info buttons + the wide info sheet */
.btn-info { margin-top: 16px; align-self: flex-start; padding: 9px 14px; font-size: 13px; gap: 10px; }
.btn-info span { color: var(--warm); font-size: 16px; line-height: 1; }
.work-more {
  margin-top: 10px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(237, 234, 227, .25); background: rgba(237, 234, 227, .08);
  color: #EDEAE3; font: 500 12px var(--f-sans); display: inline-flex; gap: 8px; align-items: center; cursor: pointer;
}
.work-more span { color: var(--warm); font-size: 14px; line-height: 1; }
.work-more:hover { background: rgba(237, 234, 227, .16); }
.sheet-wide { width: min(980px, calc(100vw - 32px)); padding: 34px 36px 30px; }
.info-body .sheet-title { font-size: clamp(2rem, 3.6vw, 2.9rem); max-width: 18ch; }
.info-body .sheet-title em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--warm); }
.info-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; }
.info-body h3 { font: 500 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 10px; }
.info-cols > div > h3:first-child { margin-top: 0; }
.info-body p { color: var(--ink-2); line-height: 1.6; margin: 0; }
.info-lede { color: var(--ink) !important; font-size: 1.05rem; }
.info-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.info-steps li { counter-increment: s; position: relative; padding-left: 30px; color: var(--ink-2); line-height: 1.5; }
.info-steps li::before { content: counter(s); position: absolute; left: 0; top: 3px; font: 500 12px var(--f-mono); color: var(--warm); }
.info-steps b { color: var(--ink); font-weight: 500; }
.info-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.info-list li { font-size: 14px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.info-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.info-art {
  height: 180px; border-radius: 18px; margin: 4px 0 24px;
  background: radial-gradient(circle at 70% 30%, hsl(var(--h1) 90% 62% / .95), transparent 55%), radial-gradient(circle at 20% 80%, hsl(var(--h2) 80% 55% / .9), transparent 60%), linear-gradient(160deg, hsl(var(--h2) 30% 14%), hsl(var(--h1) 30% 8%));
}

/* ============================================================ the web studio, written live */
/* Code writes itself in open space, centred; then it moves aside into its own editor window, and each
   line it writes switches on a piece of the section beside it (fx-* classes, set by app.js). */
.studio-live { width: min(1180px, calc(100vw - 48px)); display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; }
.sl-copy > * { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.sl-title em { font-style: normal; font-family: inherit; color: inherit; transition: color .6s; }
.sl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.sl-actions .btn-next { margin-top: 0; }   /* sits in the row, not below a block */
.sl-actions > * { opacity: 0; transition: opacity .5s var(--ease), border-radius .6s, padding .6s, background .6s, color .6s; }
.sl-btn { border-radius: 4px; padding: 10px 14px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.sl-btn::before { display: none; }

.sl-editor {
  height: min(500px, 64vh); display: flex; flex-direction: column; border-radius: 20px; border: 1px solid transparent; background: transparent;
  transform: translateX(calc(-50% - 24px));                     /* centred on screen until the window forms */
  transition: transform 1s var(--ease), border-color .8s var(--ease), background .8s var(--ease), box-shadow .8s var(--ease);
}
.sl-bar {
  display: flex; align-items: center; gap: 7px; height: 0; padding: 0 16px; overflow: hidden; opacity: 0;
  border-bottom: 1px solid var(--line); transition: height .7s var(--ease) .15s, opacity .7s var(--ease) .15s;
}
.sl-bar i { width: 10px; height: 10px; border-radius: 50%; }
.sl-bar i:first-child { background: #FF5F57; } .sl-bar i:nth-child(2) { background: #FEBC2E; } .sl-bar i:nth-child(3) { background: #28C840; }
.sl-file { margin-left: 10px; font: 12px var(--f-mono); color: var(--ink-3); }
.sl-code {
  flex: 1; margin: 0; padding: 22px 24px; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  font: 13.5px/1.75 var(--f-mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; text-shadow: 0 0 18px rgba(4, 5, 10, .9);
  transition: justify-content .8s;
}
.sl-code code { display: block; max-width: 100%; }
.studio-live:not(.fx-frame) .sl-code { align-items: center; }   /* the open-space lines sit in the middle */
.sl-code .t { color: #8D8EFF; } .sl-code .a { color: #5FE0FF; } .sl-code .v { color: #FFB547; } .sl-code .x { color: var(--ink); }
.sl-code .caret { display: inline-block; width: .6ch; height: 1.15em; vertical-align: -.2em; background: var(--warm); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.studio-live.fx-frame .sl-editor {
  transform: none; border-color: var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.studio-live.fx-frame .sl-bar { height: 44px; opacity: 1; }
.studio-live.fx-frame .sl-code { justify-content: flex-start; }
.studio-live.fx-frame.fx-kicker .sl-kicker,
.studio-live.fx-frame.fx-title .sl-title,
.studio-live.fx-frame.fx-text .sl-text,
.studio-live.fx-frame.fx-link .sl-actions { opacity: 1; transform: none; }
.studio-live.fx-frame.fx-link .sl-btn { opacity: 1; }
.studio-live.fx-em .sl-title em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--warm); }
.studio-live.fx-bg .sl-title { text-shadow: 0 0 60px rgba(141, 142, 255, .45); }
.studio-live.fx-bg .sl-kicker { color: var(--warm); }
.studio-live.fx-btn .sl-btn { border-radius: 999px; padding: 14px 22px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.studio-live.fx-btn .sl-btn::before { display: block; }
.studio-live.fx-js .sl-next { opacity: 1; }
.studio-live.fx-js .sl-btn { animation: sl-pulse 2.4s var(--ease) infinite; }
@keyframes sl-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 181, 71, 0); } 50% { box-shadow: 0 0 0 8px rgba(255, 181, 71, .18); } }

/* ============================================================ 3 → 3.1 → 3.14 */
/* one number, held on screen; each principle adds its digits (positioned by app.js) */
.principle { display: block; }
.pi-hold {
  position: absolute; left: 50%; top: 50%; display: flex; align-items: baseline; visibility: hidden; pointer-events: none;
  font-family: var(--f-mono); font-size: clamp(3.4rem, 8vw, 6.4rem); line-height: .9; letter-spacing: -0.06em; white-space: nowrap;
}
.pi-hold b { font-weight: 400; color: var(--warm); text-shadow: 0 0 30px rgba(255, 181, 71, .45); display: inline-block; will-change: transform, opacity; transition: color .8s, text-shadow .8s; }
.pi-hold b.old { color: color-mix(in srgb, var(--warm) 50%, transparent); text-shadow: none; }
.pi-tail { position: relative; width: min(46vw, 560px); height: 1em; overflow: hidden; margin-left: .05em; -webkit-mask: linear-gradient(90deg, #000 30%, transparent); mask: linear-gradient(90deg, #000 30%, transparent); }
.pi-tail::after {
  content: attr(data-digits); position: absolute; left: 0; top: 0; white-space: nowrap; color: color-mix(in srgb, var(--warm) 38%, transparent);
  font-size: .42em; line-height: 2.3; letter-spacing: .02em; animation: pi-run 40s linear infinite;
}
@keyframes pi-run { to { transform: translateX(-50%); } }
.pi-note { margin-top: 16px !important; max-width: 46ch; color: var(--ink-2) !important; font-size: clamp(1rem, 1.5vw, 1.15rem) !important; line-height: 1.55; }

/* the talk and info sheets scroll without showing a scrollbar */
.sheet { scrollbar-width: none; }
.sheet::-webkit-scrollbar { display: none; }

@media (max-width: 720px) {
  .sheet-wide { width: 100vw; padding: 14px 18px calc(22px + env(safe-area-inset-bottom)); }
  .info-cols { grid-template-columns: 1fr; gap: 6px; }
  .info-art { height: 120px; }
  .studio-live { width: calc(100vw - 32px); grid-template-columns: 1fr; gap: 18px; align-items: start; }
  .sl-editor { order: -1; height: 34svh; transform: translateY(18svh); }
  .sl-code { font-size: 10.5px; line-height: 1.6; padding: 12px 14px; }
  .studio-live:not(.fx-frame) .sl-code { font-size: 12px; }
  .sl-copy .display-2 { font-size: 2.1rem; }
  .sl-copy .body { font-size: 15px; }
  .sl-actions { margin-top: 14px; gap: 8px; }
  .sl-actions .btn, .studio-live.fx-btn .sl-btn { padding: 11px 16px; font-size: 14px; }
  .pi-tail { width: 40vw; }
}
.no-anim, .no-anim * { transition: none !important; }

[hidden] { display: none !important; }

/* copy sits on the screen, in front of the 3D world */
.copy-layer { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.copy-layer .layer { position: absolute; left: 50%; top: 50%; visibility: hidden; will-change: transform, opacity; }

/* words that fly past around the props */
.fly-word {
  font: 600 clamp(54px, 6vw, 110px) / 1 var(--f-sans); letter-spacing: -0.045em; white-space: nowrap;
  color: rgba(237, 234, 227, .92); text-shadow: 0 0 28px rgba(140, 180, 255, .35); pointer-events: none;
}
.fly-word--serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: var(--warm); text-shadow: 0 0 28px rgba(255, 181, 71, .35); }
.btn-next { margin-top: 18px; padding: 10px 16px; font-size: 13px; gap: 10px; }
.btn-next span { color: var(--warm); transition: transform .3s; }
.btn-next:hover span { transform: translateX(4px); }
.fly-word--phrase { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; font-size: clamp(30px, 5vw, 92px); color: var(--ink); text-shadow: 0 0 32px rgba(95, 224, 255, .45); }
.no-anim, .no-anim * { transition: none !important; }
