/* Shared design language + declarative effects for every page and scene.
   Scenes: build on these classes and tokens; put scene-specific rules in assets/scenes/<name>.css */

:root {
  /* palette: dusk. Deep navy night, sky blue light, a warm sunrise on the horizon */
  --night: #04050C;
  --navy: #071233;
  --navy-2: #0B1C4A;
  --sky: #7CCBEC;
  --sky-2: #36ADE0;
  --sky-3: #0297DE;
  --sun: #FC734D;
  --sun-2: #FA8C5D;
  --peach: #F3C2B3;
  --bloom: #C978C4;
  --brand: #36ADE0;
  --brand-dark: #7CCBEC;   /* the stronger variant on dark backgrounds is the lighter one */
  --brand-light: #7CCBEC;
  --brand-soft: rgba(54, 173, 224, .14);
  --violet: #B98CEB;
  --mint: #5FD49A;
  --amber: #F7B955;
  --rose: #E85678;
  --ink: #FCFFFF;
  --ink-2: #9DB0CC;
  --ink-3: #7083A6;
  --muted: #9DB0CC;
  --line: rgba(124, 203, 236, .13);
  --line-2: rgba(124, 203, 236, .26);
  --bg: #050A1E;
  --bg-alt: #081232;
  --surface: rgba(11, 22, 56, .62);       /* dark glass card */
  --surface-solid: #0A1636;
  --surface-2: rgba(124, 203, 236, .06);  /* fields and wells inside a card */
  --dark: #04050C;
  --dark-2: #0A1430;
  --dark-line: rgba(124, 203, 236, .14);
  --spectrum: linear-gradient(92deg, #7CCBEC 0%, #F3C2B3 55%, #FC734D 100%);
  /* type */
  --f-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* labels and figures: the same face as the text (no monospace), with even-width numbers */
  --f-mono: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* one accent word per headline */
  --f-serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  /* shape + motion */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 60px -28px rgba(0, 0, 0, .7);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 90px -36px rgba(2, 151, 222, .45);
  --glass: blur(18px) saturate(140%);
  --e-out: cubic-bezier(.2, .7, .2, 1);
  --e-spring: cubic-bezier(.34, 1.56, .64, 1);
  --header-h: 72px;
  --gutter: 24px;
}
@media (max-width: 520px) { :root { --gutter: 16px; } }

html { scroll-behavior: smooth; }
body { color: var(--ink); overflow-x: clip; }
main { overflow-x: clip; }
::selection { background: var(--sun); color: #fff; }

/* ---------- type helpers ---------- */
.tag { font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: 0; color: var(--brand); display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.tag::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; color: var(--ink); margin: 0 0 .45em; text-wrap: balance; }
.h1 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); font-weight: 500; line-height: 1.05; letter-spacing: -.035em; color: var(--ink); margin: 0 0 .4em; text-wrap: balance; }
.lede { font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.6; color: var(--ink-2); max-width: 56ch; margin: 0 0 1.4em; }
.grad { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
:is(h1, h2, .h1, .h2, .ph-title, .fin-title) .grad { --grad: linear-gradient(100deg, #fff 0%, #fff 40%, var(--peach) 100%); font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.mono { font-family: var(--f-mono); }
.hud { font-family: var(--f-mono); font-size: .68rem; letter-spacing: 0; color: var(--ink-3); line-height: 1.5; }
.hud b { color: var(--ink); font-weight: 600; }

/* ---------- surfaces ---------- */
.bay { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.bay-head { max-width: 760px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.bay-head .tag { justify-content: center; }
.bay-head .lede { margin-inline: auto; }
.card { background: var(--surface); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: .7rem; letter-spacing: 0; padding: 7px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); white-space: nowrap; }
.chip.ok { background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint); border-color: color-mix(in srgb, var(--mint) 35%, transparent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { animation: fx-pulse 1.4s ease-in-out infinite; }

/* dark bay: a deeper band with a dusk glow (the whole site is dark, so it no longer flips tokens) */
.darkbay { color: var(--ink-2); background: radial-gradient(900px 420px at 85% -10%, rgba(54, 173, 224, .22), transparent 70%), radial-gradient(700px 380px at 0% 110%, rgba(201, 120, 196, .16), transparent 70%), var(--night); }
.darkbay .tag { color: var(--brand-light); }
.darkbay .card { background: color-mix(in srgb, var(--dark-2) 80%, transparent); box-shadow: none; }
.bay.darkbay.inset { margin: 0 clamp(8px, 1.4vw, 20px); border-radius: var(--r-xl); overflow: clip; border: 1px solid var(--line); }

/* ---------- buttons: lift + sheen ---------- */
.btn { position: relative; overflow: hidden; transition: transform .25s var(--e-out), box-shadow .25s ease, background .2s ease, color .2s ease, border-color .2s ease; will-change: transform; }
.btn-primary { box-shadow: 0 8px 28px -10px rgba(124, 203, 236, .55); }
.btn-primary:hover { box-shadow: 0 12px 36px -10px rgba(124, 203, 236, .75); }
.btn-primary::after, .btn-light::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(124, 203, 236, .35) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
.btn-primary:hover::after, .btn-light:hover::after { transform: translateX(120%); transition: transform .7s ease; }
.btn:active { transform: scale(.97); }

/* ---------- header polish ---------- */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 80; pointer-events: none; }
.scroll-progress i { display: block; height: 100%; background: var(--spectrum); transform-origin: 0 50%; transform: scaleX(0); }
.utility-bar { background: transparent; }
.site-header { transition: box-shadow .3s ease, background .3s ease; }
.site-header.scrolled { box-shadow: 0 1px 0 var(--line), 0 14px 40px rgba(0, 0, 0, .35); }
.logo-mark { color: var(--navy); }
.logo-mark svg { display: block; }
.nav-toggle { width: 44px; height: 44px; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 1080px) { .nav-toggle { display: flex; } }
.dropdown { transition: opacity .2s ease, transform .25s var(--e-out), visibility .2s; }

/* ---------- declarative effects ---------- */
/* reveal: only hidden when JS is running, so content never disappears without it */
.js [data-reveal], .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s var(--e-out); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-reveal="left"] { transform: translateX(-32px); }
.js [data-reveal="right"] { transform: translateX(32px); }
.js [data-reveal="scale"] { transform: scale(.92); }
.js [data-reveal="blur"] { filter: blur(8px); transition-property: opacity, transform, filter; }
.js [data-reveal].in, .js .reveal.in { opacity: 1; transform: none; filter: none; }

/* decode: words rise and sharpen in sequence */
/* Safari will not paint a parent's gradient text through the word spans below (they are inline-blocks that
   move and blur), so the accent words came out invisible on iPhones. Once split, each word carries the gradient. */
.js [data-decode].words .grad { background: none; }
:where(.js [data-decode].words .grad) .w { background: var(--grad, var(--spectrum)); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 .08em .12em 0; margin: 0 -.08em -.12em 0; }
.js [data-decode] .w { display: inline-block; opacity: 0; transform: translateY(.5em); filter: blur(6px); transition: opacity .6s ease, transform .7s var(--e-out), filter .6s ease; transition-delay: calc(var(--i, 0) * 55ms); }
.js [data-decode].shown .w { opacity: 1; transform: none; filter: none; }

/* tilt */
[data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--e-out); transform-style: preserve-3d; }
[data-tilt].tilting { transition: transform .08s linear; }
[data-tilt] > .glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease; background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .5), transparent 60%); mix-blend-mode: soft-light; }
[data-tilt].tilting > .glare { opacity: 1; }

/* pointer spotlight */
.glow { position: relative; }
.glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--brand-light) 22%, transparent), transparent 65%); }
.glow:hover::before { opacity: 1; }

/* pin wrapper: height is set by fx.pin(); never put overflow:hidden on it or its ancestors */
.pin { position: relative; }

@keyframes fx-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal], .js .reveal, .js [data-decode] .w { opacity: 1; transform: none; filter: none; transition: none; }
  [data-tilt] { transform: none; }
  .btn::after { display: none; }
}

/* product screens that stay light inside the dark site (a phone's Messages app, for example):
   put .light-ui on the screen and everything inside it gets the light tokens back */
.light-ui {
  --ink: #0a0f1a; --ink-2: #4b575e; --ink-3: #78828a; --muted: #4b575e;
  --line: #dfe5e9; --line-2: #cfd9e6; --bg: #ffffff; --bg-alt: #f3f6fa;
  --surface: #ffffff; --surface-solid: #ffffff; --surface-2: #f3f6fa;
  --brand: #0297DE; --brand-dark: #0277B5; --brand-light: #36ADE0; --brand-soft: #e3f4fc;
  color: var(--ink);
}
