/* ==========================================================================
   1st Private Capital, Inc. - Shared Design System (Dark / Amber rebuild)
   All pages link this file. Page-specific rules go in a small inline <style>
   block in each page's <head> - do not fork this file.

   Contract for sibling pages (unchanged from v1):
   - Wrap page content in <main id="main"> ... </main>
   - Use .container for horizontal rhythm, .section for vertical rhythm
   - Use .reveal on blocks that should fade in (safe without JS)
   - Paste partials/header.html, partials/footer.html, partials/chat.html
     verbatim (header at top of <body>, footer + chat at the bottom)

   NEW shared hooks added in this rebuild (available to every page):
   - Dark theme is now the site-wide ground. Token NAMES are unchanged
     (--paper is now near-black, --ink is now warm off-white, etc.) so
     existing page-level rules that reference tokens keep working.
   - New tokens: --surface-2, --accent-bright, --accent-ink, --steel.
   - .canvas-hero            full-bleed animated hero shell (position:relative,
                             min-height, centers its .container). Children:
                             .hero-bg (CSS gradient + CSS-drawn grid fallback),
                             canvas.hero-canvas, .hero-scrim (text-protection
                             gradient). JS adds .canvas-live to .canvas-hero
                             when the canvas is running. Content never depends
                             on the canvas.
   - .hero-intro             wrapper for hero copy; its direct children get a
                             staggered rise-in (pure CSS keyframes, no-JS safe,
                             reduced-motion safe).
   - .spec-block[data-print] opts a spec block into the "term sheet printing
                             line by line" reveal (shared JS in the footer
                             partial). Rows get .is-printed; the last row gets
                             .print-cursor (blinking mono cursor). Without JS
                             or with reduced motion, rows are simply visible.
   - [data-count="N"]        count-up numeral. Markup text must already hold
                             the final value (no-JS fallback). Optional
                             data-prefix / data-suffix attributes. Animated by
                             shared JS in the footer partial on first view.
   - .ticker / .ticker-track / .ticker-group / .ticker-item
                             slow amber keyword ticker (lives in the footer
                             partial, above the footer). aria-hidden, pauses
                             on hover, removed under reduced motion.
   - .site-header.is-scrolled  added by shared JS past 8px of scroll
                             (darker glass + hairline). Style-only hook.
   - .btn magnetic hover     shared JS sets --mx / --my custom props on every
                             .btn (fine pointers only, reduced-motion off).
                             No markup changes needed on pages.
   - Staggered reveals: children of .grid-2.reveal, .grid-3.reveal,
     .steps.reveal and .rule-list.reveal cascade in automatically.
   - Glassmorphism layer (section 15): .tile, .spec-block, .cta-final,
     the scrolled header, and the chat shell render as dark glass when
     backdrop-filter is supported; solid surfaces otherwise (see the
     @supports not block). Helpers for sibling pages:
       .ambient-wash   put on a wrapping .container to paint a faint
                       amber/steel wash BEHIND glass children so the
                       blur has content to refract.
       .hero-ambient   put on an interior page's opening section for the
                       CSS perspective grid + washes (no canvas runtime).
     .cta-final is shared here now - pages should not restyle it.
     Keep glass off elements that animate transform continuously
     (.btn, .ticker) and never stack more than two glass layers.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color: graphite ground, warm off-white type, high-voltage amber signal */
  --ink: #ECEAE3;            /* warm off-white, primary text */
  --ink-2: #C8CACF;          /* secondary text */
  --muted: #A6ABB4;          /* muted body text, AA on graphite */
  --faint: #868C97;          /* micro labels, AA at small sizes on graphite */
  --paper: #0B0C0F;          /* page ground (near-black graphite) */
  --surface: #12141A;        /* cards, panels */
  --surface-2: #171A21;      /* raised panels, hovers */
  --line: #1F2229;           /* hairlines */
  --line-strong: #2C303A;    /* form borders, emphasized rules */
  --accent: #FFB224;         /* high-voltage amber - CTAs, live data, signal */
  --accent-bright: #FFC24A;  /* hover / lit state */
  --accent-deep: #D99512;    /* pressed / dense amber */
  --accent-ink: #17120A;     /* text on amber surfaces */
  --accent-tint: rgba(255, 178, 36, 0.08);  /* faint amber wash */
  --steel: #8FA3BF;          /* cool support tone: grid lines, chart strokes */
  --inverse-text: #A6ABB4;   /* body text on the footer's deeper ground */

  /* Glass (glassmorphism layer, section 15) */
  --glass-bg: rgba(18, 20, 26, 0.6);         /* standard dark glass */
  --glass-bg-deep: rgba(14, 16, 21, 0.7);    /* denser glass (chat panel) */
  --glass-bg-raised: rgba(23, 26, 33, 0.66); /* hover / lifted glass */
  --glass-border: rgba(255, 255, 255, 0.09); /* hairline on glass */
  --glass-border-strong: rgba(255, 255, 255, 0.12);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass-blur: blur(18px) saturate(1.2);
  --glass-blur-sm: blur(14px) saturate(1.2);
  --field-bg: rgba(11, 13, 18, 0.55);        /* translucent form fields */

  /* Type */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Radii: crisp, term-sheet feel */
  --radius: 2px;

  /* Rhythm */
  --section-pad: clamp(4.5rem, 10vw, 8rem);
  --container-max: 72rem;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);       /* expo-out */
  --ease-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 200ms;
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1,
.h1 {
  font-size: clamp(2.625rem, 1rem + 6vw, 5.25rem);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h2,
.h2 {
  font-size: clamp(1.875rem, 1.3rem + 2.4vw, 2.875rem);
  font-weight: 630;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h3,
.h3 {
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.375rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h4,
.h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.55vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 38em;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.text-muted {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   4. Layout + section rhythm
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-pad);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.section-head p {
  margin-top: 1rem;
  color: var(--muted);
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 1px;
  /* Faint amber/steel washes under the line ground: glass tiles sitting
     on these grids get ambient content behind them to refract. */
  background:
    radial-gradient(44rem 26rem at 84% -8%, rgba(255, 178, 36, 0.07), transparent 62%),
    radial-gradient(40rem 24rem at 4% 108%, rgba(143, 163, 190, 0.07), transparent 60%),
    var(--line);
  border: 1px solid var(--line);
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   5. Buttons (magnetic-ready: shared JS drives --mx / --my)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: background-color var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    color var(--speed) var(--ease),
    box-shadow 260ms var(--ease),
    transform 220ms var(--ease);
}

.btn:active {
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(255, 178, 36, 0.25), 0 4px 24px rgba(255, 178, 36, 0.16);
}

.btn-primary:hover {
  background: var(--accent-bright);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(255, 178, 36, 0.45), 0 6px 34px rgba(255, 178, 36, 0.3);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  border-color: rgba(236, 234, 227, 0.24);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 178, 36, 0.2);
}

.btn-lg {
  padding: 1rem 1.875rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5625rem 1.0625rem;
  font-size: 0.875rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   6. Forms (shared by request-term-sheet, contact, login, tools)
   -------------------------------------------------------------------------- */
.field {
  margin-bottom: 1.375rem;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 0.5rem;
}

.field .field-hint {
  font-size: 0.8125rem;
  color: var(--faint);
  margin-top: 0.375rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--field-bg); /* translucent: picks up glass-card tint */
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 178, 36, 0.18); /* soft amber ring on glass */
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0 0 1.375rem;
}

legend {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-inline: 0.5rem;
}

.form-grid {
  display: grid;
  gap: 0 1.25rem;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid .field-full {
    grid-column: 1 / -1;
  }
}

.form-note {
  font-size: 0.8125rem;
  color: var(--faint);
  max-width: 40em;
}

/* --------------------------------------------------------------------------
   7. Term-sheet furniture (spec blocks, data rows, rule lists, tiles)
   -------------------------------------------------------------------------- */
.spec-block {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.spec-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 0.25rem;
  border-bottom: 2px solid var(--ink);
}

.spec-block-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spec-block-stamp {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.spec-rows {
  display: block;
}

.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.6875rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.spec-row:last-child {
  border-bottom: 0;
}

.spec-row dt {
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.6875rem;
  white-space: nowrap;
}

.spec-row dd {
  text-align: right;
  color: var(--ink);
  font-weight: 500;
}

.spec-row dd.is-accent {
  color: var(--accent);
}

/* Print-on reveal: opt in with data-print on the .spec-block. Shared JS in
   the footer partial adds .is-printed row by row + .print-cursor to the last
   row. No JS or reduced motion = rows simply visible. */
html.js .spec-block[data-print] .spec-row {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 340ms var(--ease), transform 340ms var(--ease);
}

html.js .spec-block[data-print] .spec-row.is-printed {
  opacity: 1;
  transform: none;
}

.spec-block[data-print] .spec-row.print-cursor dd::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.95em;
  margin-left: 0.45em;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: cursor-blink 1.1s steps(1) infinite;
}

@keyframes cursor-blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js .spec-block[data-print] .spec-row {
    opacity: 1;
    transform: none;
  }

  .spec-block[data-print] .spec-row.print-cursor dd::after {
    animation: none;
  }
}

/* Numbered rule list (e.g. Built to Move, process steps) */
.rule-list {
  border-top: 1px solid var(--line);
}

.rule-list > li {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--line);
}

.rule-list .rule-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  min-width: 2rem;
}

.rule-list .rule-text {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
}

/* Linked tiles (What We Fund, Tools, Partners) */
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  padding: 1.5rem;
  min-height: 100%;
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--speed) var(--ease),
    box-shadow 260ms var(--ease);
}

.tile:hover {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 2px 0 var(--accent);
}

.tile-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.tile-arrow {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  transition: transform var(--speed) var(--ease);
}

.tile:hover .tile-arrow {
  transform: translateX(4px);
}

.tile-desc {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.5;
}

.tile-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.25rem;
}

/* --------------------------------------------------------------------------
   8. Header + navigation (dark glass; .is-scrolled added by shared JS)
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 560;
}

.skip-link:focus-visible {
  left: 0.75rem;
  top: 0.75rem;
  color: var(--accent-ink);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 12, 15, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 320ms var(--ease), border-color 320ms var(--ease);
}

.site-header.is-scrolled {
  background: rgba(9, 10, 12, 0.88);
  border-bottom-color: var(--line-strong);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius);
  line-height: 1;
}

.brand-name {
  font-weight: 630;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.nav-toggle-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-list a:not(.btn) {
  position: relative;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.25rem;
  transition: color var(--speed) var(--ease);
}

.nav-list a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 360ms var(--ease);
}

.nav-list a:not(.btn):hover {
  color: var(--ink);
}

.nav-list a:not(.btn):hover::after {
  transform: scaleX(1);
}

.nav-list a[aria-current="page"] {
  color: var(--ink);
}

.nav-list a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Mobile collapse: only when JS is present; without JS the nav stays visible */
@media (max-width: 859px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: calc(-1 * var(--container-pad));
    right: calc(-1 * var(--container-pad));
    background: #0C0D11;
    border-bottom: 1px solid var(--line-strong);
    padding: 0.75rem var(--container-pad) 1.25rem;
  }

  html.js .site-nav {
    display: none;
  }

  html.js .site-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list li {
    border-bottom: 1px solid var(--line);
  }

  .nav-list li.nav-cta {
    border-bottom: 0;
    padding-top: 1rem;
  }

  .nav-list a:not(.btn) {
    display: block;
    padding: 0.875rem 0.25rem;
  }

  .nav-list a:not(.btn)::after {
    display: none;
  }

  .nav-list .btn {
    width: 100%;
  }
}

@media (min-width: 860px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   9. Canvas hero (shared shell; the drawing script is page-level)
   Markup pattern:
     <section class="hero canvas-hero">
       <div class="hero-bg" aria-hidden="true"></div>
       <canvas class="hero-canvas" id="hero-canvas" aria-hidden="true"></canvas>
       <div class="hero-scrim" aria-hidden="true"></div>
       <div class="container ..."> content (use .hero-intro on copy) </div>
     </section>
   -------------------------------------------------------------------------- */
.canvas-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(30rem, 86vh, 54rem);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(100rem 44rem at 50% 28%, rgba(255, 178, 36, 0.07), transparent 62%),
    var(--paper);
}

/* CSS-drawn fallback grid: shows when JS is off, canvas fails, or
   reduced motion is on. Hidden once the canvas is live. */
.hero-bg::before {
  content: "";
  position: absolute;
  left: -25%;
  right: -25%;
  top: 32%;
  bottom: -12%;
  background-image:
    linear-gradient(rgba(143, 163, 190, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 163, 190, 0.09) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(70rem) rotateX(56deg);
  transform-origin: 50% 0;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 80%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 80%, transparent);
}

.canvas-hero.canvas-live .hero-bg::before {
  display: none;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1200ms var(--ease);
}

.canvas-hero.canvas-live .hero-canvas {
  opacity: 1;
}

/* Text protection: holds AA over the brightest canvas state */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(64rem 42rem at 24% 40%, rgba(11, 12, 15, 0.8), transparent 64%),
    linear-gradient(180deg, rgba(11, 12, 15, 0.6), rgba(11, 12, 15, 0.08) 45%, rgba(11, 12, 15, 0.72));
}

/* Hero copy entrance: pure CSS keyframes so it runs with or without JS
   and never gates visibility on a class. */
.hero-intro > * {
  animation: hero-rise 900ms var(--ease) backwards;
}

.hero-intro > :nth-child(1) { animation-delay: 60ms; }
.hero-intro > :nth-child(2) { animation-delay: 140ms; }
.hero-intro > :nth-child(3) { animation-delay: 260ms; }
.hero-intro > :nth-child(4) { animation-delay: 380ms; }
.hero-intro > :nth-child(5) { animation-delay: 480ms; }

.canvas-hero .spec-block {
  background: rgba(15, 17, 22, 0.9);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: hero-rise 900ms var(--ease) 420ms backwards;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}

/* --------------------------------------------------------------------------
   10. Ticker (lives in the footer partial, above the footer; aria-hidden)
   -------------------------------------------------------------------------- */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #0A0B0E;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-move 46s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-group {
  display: inline-flex;
  align-items: center;
  padding-block: 0.8125rem;
}

.ticker-item {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent);
  padding-right: 3.25rem;
}

.ticker-item::after {
  content: "/";
  position: absolute;
  right: 1.35rem;
  color: #4A505B;
}

@keyframes ticker-move {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
    will-change: auto;
  }
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: #07080B;
  color: var(--inverse-text);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}

.footer-top {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #1A1D23;
}

@media (min-width: 720px) {
  .footer-top {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand .brand-mark {
  background: var(--accent);
  color: var(--accent-ink);
}

.footer-tagline {
  margin-top: 1rem;
  font-size: 1.0625rem;
  font-weight: 560;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #79808B;
  margin-bottom: 1rem;
}

.footer-links li + li {
  margin-top: 0.625rem;
}

.footer-links a {
  color: var(--inverse-text);
  text-decoration: none;
  font-size: 0.9375rem;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom {
  padding-top: 2rem;
  display: grid;
  gap: 0.75rem;
}

.footer-note {
  font-size: 0.8125rem;
  color: #79808B;
  max-width: 46em;
}

.footer-closing {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--inverse-text);
}

/* --------------------------------------------------------------------------
   12. Chat shell
   -------------------------------------------------------------------------- */
.chat-shell {
  display: none; /* progressive enhancement: shown only when JS is present */
}

html.js .chat-shell {
  display: block;
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 150;
}

.chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 178, 36, 0.28);
  transition: background-color var(--speed) var(--ease),
    box-shadow 260ms var(--ease),
    transform var(--speed) var(--ease);
}

.chat-launcher:hover {
  background: var(--accent-bright);
  box-shadow: 0 8px 32px rgba(255, 178, 36, 0.4);
  transform: translateY(-1px);
}

.chat-launcher-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-ink);
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(21rem, calc(100vw - 2.5rem));
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.chat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #0E1015;
}

.chat-panel-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chat-close {
  background: transparent;
  border: 0;
  padding: 0.25rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--radius);
}

.chat-close:hover {
  color: var(--ink);
}

.chat-panel-body {
  padding: 1rem;
}

.chat-greeting {
  font-size: 0.9375rem;
  color: var(--ink-2);
  margin-bottom: 0.875rem;
}

.chat-links li + li {
  margin-top: 0.375rem;
}

.chat-links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}

.chat-links a:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.chat-links .tile-arrow {
  font-size: 0.8125rem;
}

.chat-soon {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   13. Scroll reveal (safe without JS; JS adds html.js + .is-visible)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 1;
  transform: none;
}

html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered child cascade for grid-shaped reveals */
html.js .grid-2.reveal > *,
html.js .grid-3.reveal > *,
html.js .steps.reveal > *,
html.js .rule-list.reveal > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

html.js .grid-2.reveal > :nth-child(2),
html.js .grid-3.reveal > :nth-child(2),
html.js .steps.reveal > :nth-child(2),
html.js .rule-list.reveal > :nth-child(2) { transition-delay: 70ms; }

html.js .grid-2.reveal > :nth-child(3),
html.js .grid-3.reveal > :nth-child(3),
html.js .steps.reveal > :nth-child(3),
html.js .rule-list.reveal > :nth-child(3) { transition-delay: 140ms; }

html.js .grid-2.reveal > :nth-child(4),
html.js .grid-3.reveal > :nth-child(4),
html.js .rule-list.reveal > :nth-child(4) { transition-delay: 210ms; }

html.js .grid-2.reveal > :nth-child(5),
html.js .grid-3.reveal > :nth-child(5),
html.js .rule-list.reveal > :nth-child(5) { transition-delay: 280ms; }

html.js .grid-2.reveal > :nth-child(6),
html.js .grid-3.reveal > :nth-child(6),
html.js .rule-list.reveal > :nth-child(6) { transition-delay: 350ms; }

html.js .grid-2.reveal > :nth-child(7),
html.js .grid-3.reveal > :nth-child(7),
html.js .rule-list.reveal > :nth-child(7) { transition-delay: 420ms; }

html.js .grid-2.reveal > :nth-child(8),
html.js .grid-3.reveal > :nth-child(8),
html.js .rule-list.reveal > :nth-child(8) { transition-delay: 490ms; }

html.js .grid-2.reveal.is-visible > *,
html.js .grid-3.reveal.is-visible > *,
html.js .steps.reveal.is-visible > *,
html.js .rule-list.reveal.is-visible > * {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal,
  html.js .grid-2.reveal > *,
  html.js .grid-3.reveal > *,
  html.js .steps.reveal > *,
  html.js .rule-list.reveal > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   14. Utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* --------------------------------------------------------------------------
   15. Glassmorphism layer
   Dark glass over the graphite ground. Rules of the language:
   - Surfaces: --glass-bg family + backdrop-filter blur(14-20px)
     saturate(1.2) (with -webkit- prefix), 1px borders in
     rgba(255,255,255,0.08-0.12), an inner top-edge highlight
     (--glass-highlight), restrained shadow depth.
   - Glass needs content behind it: grids carry faint washes in their
     ground, .ambient-wash puts a wash behind glass inside a container,
     .hero-ambient gives interior pages the CSS perspective grid.
   - AA on glass: micro labels lift from --faint to --muted on glass
     surfaces; alphas were chosen against the lightest plausible
     backdrop (see build notes).
   - Performance: no glass on continuously-transforming elements
     (.btn magnetic hover, .ticker); at most two glass layers overlap
     (glass card + translucent field, and the field carries no blur).
   - Fallback: browsers without backdrop-filter keep solid surfaces via
     the @supports blocks below.
   -------------------------------------------------------------------------- */

/* Ambient wash: paint BEHIND glass children so the blur has something to
   refract. Apply to the wrapping .container (not the glass element). */
.ambient-wash {
  position: relative;
}

.ambient-wash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46rem 24rem at 74% 6%, rgba(255, 178, 36, 0.08), transparent 64%),
    radial-gradient(38rem 22rem at 8% 94%, rgba(143, 163, 190, 0.06), transparent 60%);
}

/* Interior-page hero ambience: the CSS perspective grid + washes, no
   canvas runtime. Related to the homepage hero, at a fraction of the cost. */
.hero-ambient {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-ambient::before {
  content: "";
  position: absolute;
  left: -25%;
  right: -25%;
  top: 36%;
  bottom: -14%;
  z-index: -2;
  background-image:
    linear-gradient(rgba(143, 163, 190, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 163, 190, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(70rem) rotateX(56deg);
  transform-origin: 50% 0;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 24%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 24%, #000 78%, transparent);
}

.hero-ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(64rem 30rem at 16% -10%, rgba(255, 178, 36, 0.06), transparent 62%),
    radial-gradient(46rem 24rem at 92% 96%, rgba(143, 163, 190, 0.05), transparent 64%);
}

/* Final CTA band: full-width glass slab over a faint amber wash. Pages
   wrap it as <div class="container ambient-wash"> so the blur has a wash
   to refract. Shared here now - pages should not restyle it. */
.cta-final {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border-strong);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--glass-bg);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
  box-shadow: var(--glass-highlight), 0 20px 48px rgba(0, 0, 0, 0.35);
}

.cta-final .lead {
  margin-top: 1rem;
}

.cta-final .btn {
  margin-top: 2rem;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tile {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur-sm);
    backdrop-filter: var(--glass-blur-sm);
    box-shadow: var(--glass-highlight);
  }

  .tile:hover {
    background: var(--glass-bg-raised);
    box-shadow: var(--glass-highlight), inset 0 2px 0 var(--accent);
  }

  .spec-block {
    background: var(--glass-bg);
    border-color: var(--glass-border-strong);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: var(--glass-highlight), 0 14px 36px rgba(0, 0, 0, 0.32);
  }

  /* Micro labels lift one step on glass so AA holds over the lightest
     plausible backdrop. */
  .spec-block .spec-row dt {
    color: var(--muted);
  }

  /* The money shot: the hero term sheet floats as true glass over the
     live canvas - the animated grid glows through the panel. Its
     entrance is a one-shot rise, not a continuous transform. */
  .canvas-hero .spec-block {
    background: rgba(15, 17, 22, 0.64);
    border-color: var(--glass-border-strong);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-highlight), 0 24px 60px rgba(0, 0, 0, 0.5);
  }

  .site-header {
    background: rgba(13, 15, 19, 0.55);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  .site-header.is-scrolled {
    background: rgba(10, 11, 15, 0.78);
    border-bottom-color: var(--glass-border);
    box-shadow: var(--glass-highlight), 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  /* Nav links lift a step while content scrolls beneath the glass bar */
  .site-header.is-scrolled .nav-list a:not(.btn) {
    color: var(--ink-2);
  }

  .site-header.is-scrolled .nav-list a[aria-current="page"] {
    color: var(--ink);
  }

  .cta-final {
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }

  .chat-panel {
    background: var(--glass-bg-deep);
    border-color: var(--glass-border-strong);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-highlight), 0 16px 50px rgba(0, 0, 0, 0.6);
  }

  .chat-panel-head {
    background: rgba(10, 12, 16, 0.55);
  }

  /* Chat launcher becomes a glass pill; amber stays the signal (text,
     dot, border) and holds AA against the darkened glass. Its hover
     lift is a one-shot transition, and it is not a magnetic .btn. */
  .chat-launcher {
    background: var(--glass-bg);
    color: var(--accent);
    border-color: rgba(255, 178, 36, 0.45);
    -webkit-backdrop-filter: var(--glass-blur-sm);
    backdrop-filter: var(--glass-blur-sm);
    box-shadow: var(--glass-highlight), 0 8px 28px rgba(0, 0, 0, 0.5);
  }

  .chat-launcher:hover {
    background: var(--glass-bg-raised);
    color: var(--accent-bright);
    border-color: var(--accent);
    box-shadow: var(--glass-highlight), 0 8px 30px rgba(255, 178, 36, 0.22);
  }

  .chat-launcher-dot {
    background: var(--accent);
  }
}

/* Solid-surface fallback: no backdrop-filter support (either prefix).
   Translucent-by-default surfaces return to opaque equivalents. */
@supports (not (backdrop-filter: blur(1px))) and (not (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(9, 10, 12, 0.96);
  }

  .site-header.is-scrolled {
    background: #0A0B0D;
  }

  .cta-final {
    background:
      radial-gradient(48rem 24rem at 50% -20%, rgba(255, 178, 36, 0.1), transparent 70%),
      var(--surface);
    border-color: var(--line-strong);
    border-top-color: var(--accent);
  }
}
