/* Global foundations: reset, background layers, type system, reveal system, buttons, nav, footer.
   Section-specific styles live in css/sections/; the app reproduction lives in app-ui.css. */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg-0); color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg-0); color: var(--tx); font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img, svg, video { display: block; }
img, video { max-width: 100%; height: auto; }
svg { width: 1em; height: 1em; }
button { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: rgba(108, 255, 192, .3); color: #fff; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; border-radius: 8px; }
.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: 12px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--tx); color: var(--bg-0); font-size: 14px; font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform 200ms var(--ease-out); }
.skip:focus-visible { transform: none; }

/* ---------- background layers (the field itself is drawn by js/background.js) ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.no-gl #bg { background: var(--bg-fallback); }
.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
main { position: relative; z-index: 2; }

/* ---------- type ---------- */
.display { margin: 0; font-family: var(--display); font-weight: 340; font-optical-sizing: auto; font-variation-settings: "opsz" 72;
  line-height: .96; letter-spacing: -0.034em; color: var(--tx); }
.display .em { font-style: italic; font-weight: 320; color: var(--mint-hi); letter-spacing: -0.03em; }
.display .em.up { font-style: normal; font-weight: 340; letter-spacing: -0.034em; }

/* Line reveal: each .ln clips its inner span, which rises into place when the heading gets .in */
.ln { display: block; overflow: hidden; padding: 0 .12em .1em .04em; margin: 0 -.12em -.1em -.04em; }
.ln > span { display: inline-block; text-wrap: balance; transform: translateY(108%); transition: transform 1100ms var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + var(--d, 0ms)); }
.display.in .ln > span { transform: none; }

/* Generic reveal: anything with data-r fades up when it enters the viewport (--d = delay) */
[data-r] { opacity: 0; transform: translateY(18px); transition: opacity 900ms var(--ease-out), transform 1000ms var(--ease-out); transition-delay: var(--d, 0ms); }
[data-r].in { opacity: 1; transform: none; }

.kicker { margin: 0; display: inline-flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--brass-hi); }
.kicker::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: var(--mint); }
.pro { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; letter-spacing: .16em; color: var(--volt); background: rgba(108, 255, 192, .1); box-shadow: 0 0 0 1px rgba(108, 255, 192, .32) inset; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 30px; padding: 7px 15px 7px 12px; border-radius: 999px;
  background: rgba(243, 238, 227, .06); box-shadow: 0 0 0 1px var(--hair) inset; font-size: 13px; font-weight: 500; color: var(--tx-2); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--volt); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 26px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease-out), box-shadow 300ms ease, background-color 300ms ease, color 300ms ease; }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; transition: transform 300ms var(--ease-out); }
.btn-volt { background: var(--volt); color: var(--volt-ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45) inset, 0 12px 40px -10px rgba(108, 255, 192, .6); }
.btn-quiet { color: var(--tx); background: rgba(243, 238, 227, .05); box-shadow: 0 0 0 1px var(--hair) inset; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn-ivory { background: var(--tx); color: #0A2F29; }
.btn-emerald { background: linear-gradient(100deg, var(--emerald), var(--teal) 55%, var(--emerald-deep)); color: var(--surface); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 12px 24px -12px rgba(13, 91, 79, .8); }
.btn-lg { height: 62px; padding: 0 34px; font-size: 17px; }
@media (hover: hover) and (pointer: fine) {
  .btn-volt:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .6) inset, 0 16px 56px -8px rgba(108, 255, 192, .85); }
  .btn-volt:hover svg { transform: translateX(3px); }
  .btn-quiet:hover { background: rgba(243, 238, 227, .1); }
  .btn-ivory:hover { background: #fff; }
}

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; height: 72px; display: flex; align-items: center; gap: 40px; padding: 0 var(--gutter);
  transition: background-color 400ms ease, box-shadow 400ms ease, -webkit-backdrop-filter 400ms ease, backdrop-filter 400ms ease; }
.nav.scrolled { background: rgba(4, 25, 21, .6); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); box-shadow: 0 1px 0 var(--hair); }
.wordmark { display: inline-flex; align-items: center; gap: 14px; font-size: 13px; font-weight: 600; letter-spacing: .42em; color: var(--brass-hi); text-decoration: none; }
.wordmark::after { content: ""; width: 32px; height: 1px; background: currentColor; opacity: .7; }
.nav-links { display: flex; gap: 30px; margin-left: auto; }
.nav-links a { color: var(--tx-2); font-size: 14px; font-weight: 500; text-decoration: none; transition: color 200ms ease; }
.nav-links a:hover { color: var(--tx); }
.nav-cta { height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- sections ---------- */
section { position: relative; padding: clamp(96px, 13vh, 150px) var(--gutter); }
.sec-head { max-width: 1240px; margin: 0 auto clamp(40px, 6vh, 72px); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 22px 56px; }
.sec-head .kicker { grid-column: 1 / -1; }
.sec-head.center { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.h2 { font-size: clamp(44px, 5.6vw, 96px); }
.h3 { font-size: clamp(40px, 4.2vw, 68px); }
.sec-note { margin: 0 0 .5em; max-width: 21em; color: var(--tx-2); font-size: 17px; line-height: 1.55; }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px 28px; flex-wrap: wrap; padding: 40px 0 32px; margin-top: 60px; border-top: 1px solid var(--hair); font-size: 13px; color: var(--tx-3); }
.foot-links { display: flex; gap: 22px; }
.foot-links a { color: var(--tx-2); text-decoration: none; transition: color 200ms ease; }
.foot-links a:hover { color: var(--tx); }

/* ---------- mobile (one breakpoint across the site: 900px, mirrored as MOBILE_MAX in js/core.js) ---------- */
@media (max-width: 900px) {
  .nav { gap: 16px; height: 64px; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; height: 38px; padding: 0 16px; font-size: 13.5px; }
  section { padding-top: 88px; padding-bottom: 88px; }
  .sec-head { grid-template-columns: 1fr; gap: 18px; }
  .foot { justify-content: center; text-align: center; }
}

/* ---------- reduced motion (html.rm, set by js/boot.js): final states, fades only ---------- */
.rm .ln > span, .rm [data-r] { transform: none !important; translate: none !important; transition-property: opacity; transition-duration: 400ms; }
.rm .ln > span { transition: none; }
.rm .pulse { animation: none; }
