/*
 * docs/_shared/landing.css — Hero / landing page styles
 *
 * Extracted from docs/index.html on 2026-05-12 (Phase 7 Lighthouse
 * perf pass). Previously inlined in a render-blocking <style> block
 * directly under <head>; the inline approach added ~1000 lines to
 * every parsed-HTML byte budget and prevented browser cache reuse
 * across landing-page visits. Moving to a linked stylesheet lets the
 * browser cache the rules and lets the loader use rel="preload" as=style
 * + the critical-CSS hint pattern.
 *
 * Color tokens, body background, atmosphere layers, and the unified
 * theme toggle are owned by docs/_shared/public-theme.css. This file
 * holds only the LANDING-page-specific layout (hero, eyebrow, surface
 * grid, metric ticker, pattern-of-day card, fade-in animation, mobile
 * scroll-snap nav). Selectors here are intentionally low-specificity
 * so public-theme.css always wins for color values.
 */

    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    /* ──────────────────────────────────────────────────────────────
       Stonewall public landing page.

       Three-section layout: hero / routes strip / pattern of the day /
       footer. Stylesheet inlined so the file is single-asset
       deployable. Shared chart primitives loaded above for the metric
       ticker count-up animation only.
       ────────────────────────────────────────────────────────────── */

    /*
     * Color tokens, body background, and atmosphere layers are owned
     * by ``docs/_shared/public-theme.css``. The shared sheet defines
     * dark and light variants via ``html[data-theme="dark"|"light"]``
     * selectors that always cascade-win over this file's
     * component-level rules. Per-page inline ``:root`` blocks are
     * intentionally absent so the unified toggle is decisive on first
     * paint and never fights its own host.
     */

    * { box-sizing: border-box; }

    html { scroll-behavior: smooth; }

    body {
      margin: 0;
      font-family: var(--font-ui);
      line-height: 1.6;
      min-height: 100vh;
      overflow-x: hidden;
    }

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

    /*
     * Hero "archive-screen" component layout. These rules describe the
     * editorial preview tile on the right of the hero (mini-cards,
     * evidence chain, node-map, tempo-bars) and are layout-only —
     * tokens like ``--ink`` / ``--line`` come from the shared theme.
     * Restored to ``docs/index.html`` after the broader inline-``:root``
     * sweep so the visual surface matches its intent.
     */

    .hero-copy {
      position: relative;
      z-index: 2;
      min-width: 0;
    }

    .archive-screen {
      position: relative;
      z-index: 2;
      overflow: hidden;
      border: 1px solid var(--line-strong, var(--line));
      border-radius: 8px;
      background: linear-gradient(180deg, rgba(22, 17, 14, 0.96), rgba(13, 10, 8, 0.98));
      box-shadow: var(--shadow-strong, var(--shadow));
      padding: 18px;
      min-width: 0;
    }

    .archive-screen::before {
      content: "";
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(rgba(255, 244, 221, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 244, 221, 0.04) 1px, transparent 1px);
      background-size: 24px 24px;
      opacity: 0.35;
      pointer-events: none;
    }

    .screen-bar,
    .screen-grid,
    .screen-chain,
    .screen-graph {
      position: relative;
      z-index: 1;
    }

    .screen-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--line);
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }

    .screen-bar-primary {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
      flex: 1;
      min-width: 0;
      text-decoration: none;
      color: inherit;
      transition: color 160ms ease, transform 160ms ease;
    }

    .screen-bar-primary:hover,
    .screen-bar-primary:focus-visible {
      color: var(--accent-bright);
      transform: translateX(3px);
      outline: none;
    }

    .screen-bar-primary:focus-visible {
      border-radius: 6px;
      box-shadow: 0 0 0 2px var(--accent);
    }

    .screen-bar-cta {
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      color: var(--accent-bright);
      text-transform: uppercase;
    }

    .screen-bar-hint {
      flex-shrink: 0;
      max-width: 42%;
      text-align: right;
      line-height: 1.35;
    }

    .screen-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .mini-card,
    .graph-panel {
      border-radius: 8px;
    }

    .mini-card {
      min-height: 78px;
      border: 1px solid var(--line);
      background: rgba(255, 244, 221, 0.035);
      padding: 14px;
    }

    /*
     * Linked variant: the four mini-cards in the live archive-screen
     * preview are anchors into the public portal. Hover/focus pull the
     * card up and warm the border to the ember accent so the surface
     * reads as a real navigation control, not a static stat tile.
     */
    a.mini-card--linked {
      display: flex;
      flex-direction: column;
      gap: 6px;
      text-decoration: none;
      color: inherit;
      transition: transform 180ms ease, border-color 180ms ease,
                  background 180ms ease, box-shadow 180ms ease;
    }

    a.mini-card--linked:hover,
    a.mini-card--linked:focus-visible {
      transform: translateY(-2px);
      border-color: var(--line-strong);
      background: linear-gradient(165deg, rgba(192, 69, 26, 0.10), rgba(14, 31, 74, 0.18));
      box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
    }

    a.mini-card--linked:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .mini-card__cta {
      margin-top: auto;
      color: var(--accent-bright);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      opacity: 0;
      transform: translateY(2px);
      transition: opacity 180ms ease, transform 180ms ease;
    }

    a.mini-card--linked:hover .mini-card__cta,
    a.mini-card--linked:focus-visible .mini-card__cta {
      opacity: 1;
      transform: translateY(0);
    }

    @media (prefers-reduced-motion: reduce) {
      a.mini-card--linked,
      .mini-card__cta {
        transition: none;
      }
    }

    .mini-card span {
      display: block;
      color: var(--muted);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .mini-card strong {
      display: block;
      margin-top: 4px;
      font-family: var(--font-serif);
      font-size: 28px;
      line-height: 1;
      color: var(--ink);
    }

    /* Macabre tweak (5.13.26): every mini-card numeral paints in
       ember, not just the first child. Both archive-theme and light
       counterparts in public-theme.css carry the same rule. */
    .mini-card strong {
      color: var(--accent-warm);
    }

    .screen-chain {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
      border: 1px solid var(--line);
      background: rgba(255, 244, 221, 0.025);
      border-radius: 8px;
      padding: 12px 10px;
    }

    .screen-chip {
      border: 1px solid var(--line-strong);
      border-radius: 999px;
      padding: 7px 11px;
      color: var(--accent-bright);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      text-decoration: none;
      transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
    }

    a.screen-chip:hover,
    a.screen-chip:focus-visible {
      background: var(--accent-soft);
      color: var(--ink-deep, var(--ink));
      border-color: var(--accent);
      outline: none;
    }

    a.screen-chip:focus-visible {
      box-shadow: 0 0 0 2px var(--navy-glow);
    }

    /* Macabre tweak (5.13.26): the terminal OUTPUT pill in the
       evidence chain reads as a filled ember, signalling the chain
       resolves into the analyst's output. The first four chips stay
       outlined so the chain reads as input → transformation. */
    .screen-chip.screen-chip--output {
      background: linear-gradient(180deg, var(--accent-warm), var(--accent));
      color: #fffaf4;
      border-color: rgba(184, 92, 47, 0.65);
      box-shadow: 0 0 18px rgba(184, 92, 47, 0.32);
    }

    .mini-card--static {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .mini-card--static .mini-card__cta {
      opacity: 0.72;
      transform: none;
    }

    .screen-arrow {
      color: rgba(120, 152, 198, 0.88);
      font-size: 14px;
    }

    .screen-graph {
      display: grid;
      grid-template-columns: 1.05fr 0.95fr;
      gap: 12px;
      margin-top: 14px;
    }

    .graph-panel {
      min-height: 168px;
      border: 1px solid var(--line);
      background: rgba(255, 244, 221, 0.035);
      padding: 14px;
    }

    /*
     * Linked variant for the two graph panels at the bottom of the
     * archive-screen preview. Same warm-pull-up affordance as
     * ``.mini-card--linked`` so the entire preview reads as
     * navigable.
     */
    a.graph-panel--linked {
      display: block;
      text-decoration: none;
      color: inherit;
      transition: transform 180ms ease, border-color 180ms ease,
                  background 180ms ease, box-shadow 180ms ease;
    }

    a.graph-panel--linked:hover,
    a.graph-panel--linked:focus-visible {
      transform: translateY(-2px);
      border-color: var(--line-strong);
      background: linear-gradient(165deg, rgba(192, 69, 26, 0.08), rgba(14, 31, 74, 0.16));
      box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
      outline: none;
    }

    a.graph-panel--linked:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    /*
     * Top-types list inside the left graph panel. Replaces the dummy
     * node-map with a real top-N artifact-type density list driven by
     * ``site-data.json``. Visually compact: monospaced count on the
     * right, type label on the left, ember rule between rows.
     */
    .type-list {
      list-style: none;
      margin: 12px 0 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .type-list li {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      padding: 4px 0;
      border-bottom: 1px dashed rgba(232, 226, 212, 0.06);
      color: var(--ink);
      font-size: 12px;
    }

    .type-list li:last-child {
      border-bottom: 0;
    }

    .type-list li span {
      color: var(--ink);
      font-weight: 600;
      letter-spacing: 0.02em;
    }

    .type-list li em {
      color: var(--accent-bright);
      font-style: normal;
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 700;
    }

    .graph-title {
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .node-map {
      position: relative;
      height: 116px;
      margin-top: 10px;
    }

    .node-map::before,
    .node-map::after {
      content: "";
      position: absolute;
      height: 1px;
      background: rgba(160, 123, 202, 0.36);
      transform-origin: left center;
    }

    .node-map::before {
      left: 72px;
      top: 74px;
      width: 210px;
      transform: rotate(-18deg);
    }

    .node-map::after {
      left: 98px;
      top: 102px;
      width: 188px;
      transform: rotate(22deg);
    }

    .node {
      position: absolute;
      display: grid;
      place-items: center;
      width: 42px;
      height: 42px;
      border: 1px solid var(--accent);
      border-radius: 50%;
      background: #fff4dd;
      color: #1a100b;
      font-size: 11px;
      font-weight: 800;
      box-shadow: 0 0 0 5px rgba(192, 69, 26, 0.08);
    }

    .node.n1 { left: 44px; top: 58px; }
    .node.n2 { left: 156px; top: 16px; width: 50px; height: 50px; }
    .node.n3 { right: 42px; top: 54px; }
    .node.n4 { left: 128px; bottom: 4px; width: 34px; height: 34px; }

    @keyframes tempoBarPulse {
      0%, 100% {
        opacity: 0.52;
        filter: brightness(0.88);
      }
      50% {
        opacity: 1;
        filter: brightness(1.14);
      }
    }

    .tempo-bars {
      display: grid;
      align-items: end;
      /* Macabre 13-bar tempo (5.13.26): three teal "history" bars on
         the left + nine ember "active" bars + one brighter "current"
         bar on the right. Update both this grid count and the markup
         in docs/index.html together. */
      grid-template-columns: repeat(13, 1fr);
      gap: 4px;
      height: 116px;
      margin-top: 12px;
    }

    .tempo-bars span {
      display: block;
      min-height: 16px;
      border-radius: 4px 4px 0 0;
      background: linear-gradient(180deg, var(--accent-warm), var(--accent));
      opacity: 0.88;
      transform-origin: bottom center;
      animation: tempoBarPulse 2.8s ease-in-out infinite backwards;
    }

    /* History bars — first three columns. Cool baby-blue teal gradient
       so the chart reads "the history fades, the present burns." */
    .tempo-bars span.tempo-bars__history {
      background: linear-gradient(180deg, var(--teal, #48b8b0), var(--rm-chart-5, #5ba8a0));
      opacity: 0.78;
    }

    .tempo-bars span:nth-child(1)  { animation-delay: 0s;    }
    .tempo-bars span:nth-child(2)  { animation-delay: 0.12s; }
    .tempo-bars span:nth-child(3)  { animation-delay: 0.24s; }
    .tempo-bars span:nth-child(4)  { animation-delay: 0.36s; }
    .tempo-bars span:nth-child(5)  { animation-delay: 0.48s; }
    .tempo-bars span:nth-child(6)  { animation-delay: 0.60s; }
    .tempo-bars span:nth-child(7)  { animation-delay: 0.72s; }
    .tempo-bars span:nth-child(8)  { animation-delay: 0.84s; }
    .tempo-bars span:nth-child(9)  { animation-delay: 0.96s; }
    .tempo-bars span:nth-child(10) { animation-delay: 1.08s; }
    .tempo-bars span:nth-child(11) { animation-delay: 1.20s; }
    .tempo-bars span:nth-child(12) { animation-delay: 1.32s; }
    .tempo-bars span:nth-child(13) { animation-delay: 1.44s; }

    .tempo-bars span.tempo-bars__current {
      background: linear-gradient(180deg, var(--accent-bright), var(--accent-warm));
      opacity: 1;
      animation-duration: 2s;
    }

    @media (prefers-reduced-motion: reduce) {
      .tempo-bars span {
        animation: none;
        opacity: 0.88;
      }

      .tempo-bars span.tempo-bars__current {
        opacity: 1;
      }
    }

    .shell {
      width: min(1200px, calc(100% - 32px));
      margin: 0 auto;
      position: relative;
    }

    /* ── Topbar ───────────────────────────────────────────────── */
    /* viewport-fit=cover in docs/index.html lets env(safe-area-inset-*)
       reach this rule so the topbar respects the iOS notch instead of
       slamming into the system status bar. Top padding only — the
       .shell width formula already accounts for horizontal margins. */
    nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: max(18px, env(safe-area-inset-top)) 0 14px;
      margin-bottom: 0;
    }

    .nav-left { display: flex; align-items: center; gap: 14px; }

    .nav-brand {
      font-family: var(--font-serif);
      font-size: 22px;
      font-weight: 700;
      color: var(--ink);
      text-decoration: none;
      letter-spacing: -0.02em;
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      background: rgba(31, 26, 23, 0.06);
      color: var(--muted);
      transition: background 300ms ease, color 300ms ease;
    }

    .status-badge .status-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--muted);
      transition: background 300ms ease, box-shadow 300ms ease;
    }

    .status-badge.connected { background: rgba(72, 184, 176, 0.12); color: #48b8b0; }
    .status-badge.connected .status-dot {
      background: #48b8b0;
      box-shadow: 0 0 0 3px rgba(72, 184, 176, 0.14);
    }

    .status-badge.offline { background: rgba(179, 58, 58, 0.10); color: var(--offline); }
    .status-badge.offline .status-dot { background: var(--offline); }

    /* .nav-links flex container — the per-link chrome (padding, color,
       hover, focus, active, external-pill treatment) lives in the
       shared rule in docs/_shared/public-theme.css under
       html[data-public-theme="archive"] .nav-links a so the hero
       and the portal stay byte-identical. Layout-only here. */
    .nav-links { display: flex; gap: 4px; flex-wrap: wrap; }

    /*
     * Mobile nav: replace flex-wrap (which wraps 6-10 pills onto 2-3
     * lines and produced visible overlap on iPhone width) with a
     * single-row horizontal scroll-snap strip. Same approach as
     * web/components/MobileNav.tsx in the cockpit. Scrollbar hidden,
     * touch-momentum on iOS, active link scroll-snapped center on first
     * paint.
     */
    @media (max-width: 720px) {
      nav { flex-wrap: wrap; gap: 10px; row-gap: 12px; align-items: center; }
      .nav-links {
        order: 3;
        flex-basis: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 2px 8px;
        margin: 0 -4px;
        gap: 6px;
        /* Right-edge mask: signals scrollability to operators who
           otherwise see "Home Artifacts Patterns Graph Engineering↗ C..."
           and read it as a clipped/broken navbar. The strip already hid
           the scrollbar so the affordance had to come from the fade. */
        -webkit-mask-image: linear-gradient(
          to right,
          black calc(100% - 28px),
          transparent
        );
                mask-image: linear-gradient(
          to right,
          black calc(100% - 28px),
          transparent
        );
      }
      .nav-links::-webkit-scrollbar { display: none; }
      .nav-links a {
        flex: 0 0 auto;
        scroll-snap-align: start;
        padding: 7px 12px;
        font-size: 13px;
      }
      .nav-links a.active { scroll-snap-align: center; }
    }

    /* Landing status pill compaction at phone width — mirrors the
       portal rule in docs/portal/style.css below 540px. Dot survives;
       label drops; the row that previously read 'Stonewall ·
       CONNECTED' recovers its breathing room. */
    @media (max-width: 540px) {
      .status-badge {
        width: 14px;
        height: 14px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
        gap: 0;
      }
      .status-badge #statusLabel {
        display: none;
      }
      .status-badge .status-dot {
        width: 8px;
        height: 8px;
      }
    }

    /* ── Hero ─────────────────────────────────────────────────── */
    .hero {
      position: relative;
      padding: 96px 0 56px;
      min-height: calc(100vh - 88px);
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .hero::before {
      content: "";
      position: absolute;
      inset: 5% 0 auto auto;
      width: 480px;
      height: 480px;
      background:
        radial-gradient(circle, rgba(192, 69, 26, 0.18) 0%, transparent 60%),
        radial-gradient(circle, rgba(224, 114, 57, 0.10) 30%, transparent 75%);
      pointer-events: none;
      filter: blur(8px);
    }

    /* Hero eyebrow — lifted to gold-standard tier B teal-ink-soft
       on a tinted accent-soft pill background, with the canonical
       --gold-eyebrow-spacing and a status dot rim that uses
       --teal-rim instead of green to read as cool-ambient. */
    .hero-eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 7px 14px;
      background: var(--accent-soft);
      border: 1px solid var(--line-strong);
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: var(--gold-eyebrow-spacing);
      text-transform: uppercase;
      color: #5cb0a8;
      backdrop-filter: blur(6px);
      margin-bottom: 26px;
      box-shadow: var(--gold-rim);
    }

    .hero-eyebrow::before {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #48b8b0;
      box-shadow: 0 0 0 3px rgba(72, 184, 176, 0.30);
    }

    /* Hero wordmark — Newsreader at the gold-standard headline scale,
       with --gold-headline-spacing tightening the negative
       letter-spacing to match the engineering-page rhythm. */
    h1 {
      font-family: var(--font-serif);
      margin: 0;
      font-weight: 800;
      font-size: clamp(64px, 12vw, 148px);
      line-height: 0.90;
      letter-spacing: var(--gold-headline-spacing);
      color: var(--accent-warm);
      max-width: 14ch;
    }

    .hero-tagline {
      margin: 14px 0 0;
      font-family: var(--font-ui);
      font-size: clamp(13px, 1.05vw, 15px);
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--ink-deep);
    }

    /* Single-line corpus motto under the ticker — small, ink-coloured,
       sits in the same column as the ticker so it visually anchors the
       row below. */
    .hero-motto {
      margin: 18px 0 0;
      font-family: var(--font-serif);
      font-style: italic;
      font-size: clamp(16px, 1.4vw, 20px);
      letter-spacing: -0.005em;
      color: var(--ink-deep);
    }

    .hero-sub {
      max-width: 60ch;
      font-size: clamp(18px, 1.6vw, 22px);
      color: var(--muted);
      margin: 28px 0 36px;
      line-height: 1.55;
    }

    /* ── Hero pull-quote ───────────────────────────────────────
       Macabre tweak (5.13.26). Italic Newsreader leading line over a
       roman-serif tail, with a thin ember left rule. Sits between the
       hero subhead and the CTA stack. The italic em renders the
       canonical Latin opener; the prose explains the move. */
    .hero-pullquote {
      margin: 0 0 28px;
      padding: 6px 0 6px 18px;
      border-left: 3px solid var(--line-strong);
      max-width: 56ch;
    }

    .hero-pullquote p {
      margin: 0;
      font-family: var(--font-serif);
      font-size: clamp(15px, 1.2vw, 17px);
      line-height: 1.55;
      color: var(--muted);
      font-style: normal;
    }

    .hero-pullquote em {
      font-style: italic;
      color: var(--ink-deep);
    }

    .hero-motto-arrow {
      display: inline-block;
      margin-left: 4px;
      color: var(--accent-bright);
      transform: translateY(0.05em);
    }

    .hero-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-bottom: 56px;
    }

    .btn, .btn-ghost {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 14px 22px;
      border-radius: 999px;
      text-decoration: none;
      font-weight: 700;
      font-size: 15px;
      letter-spacing: -0.005em;
      transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
      border: 1px solid transparent;
    }

    .btn {
      background: var(--ink);
      color: #fffaf4;
      box-shadow: var(--shadow);
    }

    .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-strong); }

    .btn-accent {
      background: var(--accent);
      color: #fffaf4;
      box-shadow: 0 14px 34px rgba(192, 69, 26, 0.30);
    }

    .btn-accent:hover { background: var(--accent-warm); }

    .btn-ghost {
      color: var(--ink);
      border-color: var(--line-strong);
      background: rgba(255, 251, 245, 0.7);
    }

    .btn-ghost:hover { background: rgba(255, 251, 245, 0.95); transform: translateY(-2px); }

    .btn:focus-visible,
    .btn-ghost:focus-visible {
      outline: none;
      box-shadow: var(--shadow), 0 0 0 2px #48b8b0, 0 0 0 4px rgba(72, 184, 176, 0.14);
    }

    .btn .btn-arrow { transition: transform 160ms ease; }
    .btn:hover .btn-arrow { transform: translateX(3px); }

    /* ── Metric ticker — gold-standard rim card ──────────────────
       Lifted from a flat flex row of <span> pairs to a teal-rim card
       per Phase 4 of the May 2026 visual unification. The numbers
       carry the engineering-page typographic rhythm (Newsreader,
       --gold-headline-spacing); the labels match the eyebrow
       letter-spacing so they read as inline captions, not free text. */
    .metric-ticker {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 20px 28px;
      padding: 22px 26px;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: var(--gold-radius);
      box-shadow: var(--gold-shadow-elite);
      backdrop-filter: blur(8px);
      max-width: 980px;
    }

    .metric {
      display: inline-flex;
      align-items: baseline;
      gap: 10px;
      font-family: var(--font-serif);
    }

    .metric strong {
      font-size: clamp(28px, 3.2vw, 44px);
      font-weight: 700;
      color: var(--ink-deep);
      letter-spacing: var(--gold-headline-spacing);
      font-variant-numeric: tabular-nums;
      line-height: 1;
    }

    .metric span {
      font-family: var(--font-ui);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: var(--gold-eyebrow-spacing);
      text-transform: uppercase;
      color: #6aa89e;
    }

    .metric-divider {
      width: 1px;
      height: 22px;
      background: rgba(72, 184, 176, 0.32);
      align-self: center;
    }

    @media (max-width: 720px) {
      .metric-divider { display: none; }
      .metric-ticker { gap: 14px 22px; padding: 18px 20px; }
      .metric strong { font-size: clamp(24px, 6vw, 32px); }
    }

    /* ── Routes strip ─────────────────────────────────────────── */
    .routes {
      padding: 64px 0 40px;
      position: relative;
    }

    .section-header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 16px;
      margin-bottom: 28px;
    }

    /* Section header — gold-standard ember→teal underline gradient
       under the h2, matching the engineering page. The ::after is
       structural: 64px → 96px on hover so the section reads as a
       deliberate punctuation, not just a heading. */
    .section-header h2 {
      font-family: var(--font-serif);
      font-weight: 700;
      font-size: clamp(28px, 3.4vw, 38px);
      letter-spacing: var(--gold-section-spacing);
      line-height: 1.05;
      margin: 0 0 14px;
      color: var(--ink-deep);
      position: relative;
      padding-bottom: 10px;
    }

    .section-header h2::after {
      content: "";
      position: absolute;
      left: 0;
      bottom: 0;
      width: 64px;
      height: 2px;
      border-radius: 2px;
      background: var(--gold-underline-grad);
      transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .section-header:hover h2::after,
    .section-header:focus-within h2::after {
      width: 96px;
    }

    .section-header p {
      max-width: 56ch;
      margin: 0;
      color: var(--muted);
      font-size: 16px;
    }

    /* Macabre section ornaments (5.13.26): leading sparkle in
       --accent, italicized last word in --accent-warm, and a small
       Roman-numeral sublabel in italic Newsreader so the section
       reads as a deliberate punctuation rather than a generic
       headline. Coexists with the gold-standard ember→teal→navy
       underline gradient already on .section-header h2::after. */
    .section-header h2 .section-ornament {
      display: inline-block;
      margin-right: 8px;
      font-size: 0.72em;
      color: var(--accent);
      transform: translateY(-0.05em);
      letter-spacing: 0;
    }

    .section-header h2 em {
      font-family: var(--font-serif);
      font-style: italic;
      font-weight: 500;
      color: var(--accent-warm);
    }

    .section-header .section-numerals {
      max-width: none;
      font-family: var(--font-serif);
      font-style: italic;
      font-size: 13px;
      letter-spacing: 0.08em;
      color: var(--muted);
      margin: -2px 0 14px;
    }

    .routes-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
    }

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

    @media (max-width: 600px) {
      .routes-grid { grid-template-columns: 1fr; }
    }

    /* Route tile + surface card — gold-standard card chrome shared
       with the engineering page. --gold-radius for canonical card
       radius (22px), --gold-shadow baseline, --gold-shadow-hover
       lift. Color reset lives in public-theme.css (Phase 1.1). */
    .route-tile,
    .surface-card {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 26px 24px 22px;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: var(--gold-radius);
      box-shadow: var(--gold-shadow);
      backdrop-filter: blur(6px);
      text-decoration: none;
      color: inherit;
      transition:
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 220ms ease,
        border-color 220ms ease,
        background 220ms ease;
      overflow: hidden;
    }

    .route-tile::after {
      content: "";
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at 100% 0%, rgba(192, 69, 26, 0.12), transparent 50%);
      opacity: 0;
      transition: opacity 240ms ease;
      pointer-events: none;
    }

    .route-tile:hover,
    .route-tile:focus-visible,
    .surface-card:hover,
    .surface-card:focus-visible {
      transform: translateY(-3px);
      box-shadow: var(--gold-shadow-hover), 0 0 48px rgba(72, 184, 176, 0.16);
      border-color: var(--line-strong);
      background: var(--card-strong);
      outline: none;
    }

    .route-tile:focus-visible,
    .surface-card:focus-visible {
      box-shadow: var(--gold-shadow-hover), 0 0 0 2px #48b8b0, 0 0 0 4px rgba(72, 184, 176, 0.14);
    }

    .route-tile:hover::after,
    .route-tile:focus-visible::after { opacity: 1; }

    .route-kicker {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent);
    }

    .route-kicker .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent);
    }

    .route-tile h3 {
      font-family: var(--font-serif);
      font-size: 26px;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin: 0;
      color: var(--ink-deep);
      line-height: 1.1;
    }

    .route-copy {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.55;
      max-width: 36ch;
    }

    .route-trail {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-top: auto;
      padding-top: 6px;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.02em;
      color: var(--accent);
      transition: transform 200ms ease;
    }

    .route-tile:hover .route-trail,
    .route-tile:focus-visible .route-trail {
      transform: translateX(3px);
      color: var(--accent-warm);
    }

    /* ── Pattern of the day ───────────────────────────────────── */
    .daily {
      padding: 48px 0 64px;
      display: flex;
      justify-content: center;
    }

    /* Pattern-of-the-day card — gold-standard chrome plus the
       --gold-rim-ember left inset so the day's pattern reads as a
       pulled quote rather than another generic tile. */
    .daily-card {
      width: min(720px, 100%);
      padding: 28px 32px 30px 36px;
      background: var(--card);
      border: 1px solid var(--line-strong);
      border-left: 3px solid var(--accent-warm);
      border-radius: var(--gold-radius);
      box-shadow: var(--gold-shadow-elite);
      position: relative;
      overflow: hidden;
    }

    .daily-card::before {
      content: "";
      position: absolute;
      inset: 0 -28% -38% auto;
      width: 280px;
      height: 280px;
      background: radial-gradient(circle, rgba(192, 69, 26, 0.16), transparent 70%);
      pointer-events: none;
    }

    .daily-eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 14px;
    }

    .daily-num {
      padding: 3px 10px;
      border: 1px solid rgba(192, 69, 26, 0.32);
      border-radius: 999px;
      font-family: var(--font-serif);
      font-size: 13px;
      letter-spacing: 0;
    }

    .daily-title {
      font-family: var(--font-serif);
      font-weight: 700;
      font-size: clamp(26px, 3.4vw, 36px);
      line-height: 1.1;
      letter-spacing: var(--gold-section-spacing);
      margin: 0 0 12px;
      color: var(--ink-deep);
      max-width: 18ch;
    }

    .daily-body {
      margin: 0 0 18px;
      font-size: 16px;
      line-height: 1.65;
      color: var(--muted);
      max-width: 56ch;
    }

    .daily-foot {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--muted-soft);
    }

    /* ── Operational surface nav strip ─────────────────────── */
    .ops-nav {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px 10px;
      margin-top: 28px;
      padding-top: 20px;
      border-top: 1px solid var(--line);
    }

    .ops-nav a {
      font-size: 13px;
      font-weight: 600;
      color: var(--accent);
      text-decoration: none;
      transition: color 160ms ease;
    }

    .ops-nav a:hover { color: var(--accent-warm); }

    .ops-nav-dot {
      color: var(--muted-soft);
      font-size: 14px;
      line-height: 1;
    }

    /* ── Footer ──────────────────────────────────────────────── */
    footer {
      padding: 28px 0 36px;
      border-top: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
      row-gap: 10px;
      color: var(--muted);
      font-size: 14px;
    }

    footer > span:last-child {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 6px 10px;
      align-items: center;
    }

    footer a {
      color: var(--accent);
      text-decoration: none;
      white-space: nowrap;
      transition: color 160ms ease;
    }

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

    @media (max-width: 540px) {
      footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
      }

      footer > span:last-child {
        gap: 4px 12px;
      }
    }

    .sync-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 999px;
      background: rgba(72, 184, 176, 0.10);
      color: #48b8b0;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .sync-badge::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #48b8b0;
    }

    /* ── Hero rise-up ─────────────────────────────────────────────
     * Animates ``transform`` only — content is visible from the
     * moment the H1 lays out, so Chrome's FCP / LCP measurements fire
     * on the real paint instead of waiting out a 0.6 s opacity
     * transition. The earlier ``opacity: 0`` start hid every
     * above-the-fold element until the animation finished, which was
     * the public site's Speed Insights regression: hero text was in
     * the DOM but invisible for ~0.7 s after CSS parsed, so
     * Lighthouse / Speed Insights never counted the initial paint.
     * ─────────────────────────────────────────────────────────── */
    @keyframes fadeUp {
      from { transform: translateY(14px); }
      to   { transform: translateY(0); }
    }

    .fade-in {
      animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .fade-in.delay-1 { animation-delay: 0.05s; }
    .fade-in.delay-2 { animation-delay: 0.12s; }
    .fade-in.delay-3 { animation-delay: 0.20s; }
    .fade-in.delay-4 { animation-delay: 0.28s; }
    .fade-in.delay-5 { animation-delay: 0.36s; }

    @media (prefers-reduced-motion: reduce) {
      .fade-in { animation: none; }
    }

    /* ═══════════════════════════════════════════════════════════
       Corpus sections — Artifacts, Patterns, Graph, Engineering
       Rob Macabre design language (5.13.26)
       ═══════════════════════════════════════════════════════════ */

    .corpus-section {
      padding: 72px 0 48px;
      position: relative;
      scroll-margin-top: 72px;
    }

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

    /* ── Section header ornament pattern ── */
    .section-ornament {
      display: block;
      font-size: 16px;
      letter-spacing: 0.3em;
      color: var(--accent);
      margin-bottom: 12px;
    }

    .corpus-section .section-header h2 {
      font-family: var(--font-sans);
      font-size: clamp(28px, 4vw, 42px);
      font-weight: 800;
      letter-spacing: var(--gold-headline-spacing);
      color: var(--ink-deep);
      margin: 0 0 4px;
    }

    .corpus-section .section-header h2 em {
      font-family: var(--font-serif);
      font-style: italic;
      font-weight: 400;
      color: var(--accent-warm);
    }

    .section-rule {
      border: 0;
      height: 2px;
      width: 48px;
      background: var(--accent);
      margin: 12px 0;
    }

    .section-counter {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 5px 14px;
      background: var(--accent-soft);
      border: 1px solid var(--line-strong);
      border-radius: 999px;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: var(--gold-eyebrow-spacing);
      text-transform: uppercase;
      color: #5cb0a8;
      margin-bottom: 16px;
    }

    .corpus-section .section-header p {
      max-width: 540px;
      font-size: 15px;
      line-height: 1.6;
      color: var(--muted);
      margin: 8px 0 0;
    }

    /* ── Grid layouts ── */
    .corpus-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
      margin-top: 28px;
    }

    .corpus-grid--4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .corpus-grid--stats {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      margin-top: 20px;
    }

    @media (max-width: 960px) {
      .corpus-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .corpus-grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 600px) {
      .corpus-grid,
      .corpus-grid--4,
      .corpus-grid--stats { grid-template-columns: 1fr; }
    }

    /* ── Panel card ── */
    .corpus-panel {
      padding: 22px 20px;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: var(--gold-radius);
      box-shadow: var(--gold-shadow);
      backdrop-filter: blur(6px);
    }

    .corpus-panel-label {
      display: block;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 16px;
    }

    /* ── Monospace chip ── */
    .corpus-chip {
      display: inline-block;
      padding: 3px 8px;
      border: 1px solid var(--line-strong);
      border-radius: 999px;
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 700;
      color: #6aa89e;
      letter-spacing: 0.02em;
      white-space: nowrap;
    }

    /* ── Artifact category rows ── */
    .corpus-categories {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .corpus-cat-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding-bottom: 10px;
      border-bottom: 1px dashed var(--line);
    }

    .corpus-cat-row:last-child { border-bottom: 0; padding-bottom: 0; }

    .corpus-cat-name {
      flex: 0 0 auto;
      min-width: 140px;
      font-size: 13px;
      font-weight: 600;
      color: var(--ink-deep);
    }

    .corpus-cat-chips {
      flex: 1;
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }

    .corpus-cat-count {
      flex: 0 0 auto;
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 700;
      color: var(--accent-bright);
      text-align: right;
      min-width: 40px;
    }

    /* ── Density bars ── */
    .corpus-density-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .corpus-density-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px 12px;
      align-items: center;
    }

    .corpus-density-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--ink-deep);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .corpus-density-count {
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 700;
      color: var(--accent-bright);
      text-align: right;
    }

    .corpus-density-bar {
      grid-column: 1 / -1;
      height: 4px;
      background: var(--line);
      border-radius: 2px;
      overflow: hidden;
    }

    .corpus-density-fill {
      height: 100%;
      border-radius: 2px;
      background: linear-gradient(90deg, var(--accent), var(--accent-warm));
    }

    /* ── Pattern rows ── */
    .corpus-pattern-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .corpus-pattern-row {
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding-bottom: 10px;
      border-bottom: 1px dashed var(--line);
    }

    .corpus-pattern-row:last-child { border-bottom: 0; padding-bottom: 0; }

    .corpus-pattern-num {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 700;
      color: var(--accent-bright);
      letter-spacing: 0.04em;
    }

    .corpus-pattern-row > span:nth-child(2) {
      font-size: 13px;
      font-weight: 600;
      color: var(--ink-deep);
      letter-spacing: -0.005em;
    }

    .corpus-freq-bar {
      height: 3px;
      border-radius: 2px;
      background: linear-gradient(90deg, var(--accent), #48b8b0);
      margin-top: 2px;
    }

    /* ── Co-occurrence rows ── */
    .corpus-cooccurrence-list {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .corpus-cooccurrence-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 6px 12px;
      align-items: center;
    }

    .corpus-cooccurrence-pair {
      font-size: 13px;
      font-weight: 600;
      color: var(--ink-deep);
      line-height: 1.3;
    }

    .corpus-cooccurrence-score {
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 700;
      color: #5cb0a8;
      text-align: right;
    }

    .corpus-cooccurrence-score--strong {
      color: var(--accent-bright);
    }

    .corpus-cooccurrence-bar {
      grid-column: 1 / -1;
      height: 3px;
      background: var(--line);
      border-radius: 2px;
      overflow: hidden;
    }

    .corpus-cooccurrence-fill {
      height: 100%;
      border-radius: 2px;
      background: linear-gradient(90deg, #48b8b0, #5cb0a8);
    }

    .corpus-cooccurrence-fill--strong {
      background: linear-gradient(90deg, var(--accent), var(--accent-warm));
    }

    /* ── Surface panels ── */
    .corpus-panel--surface {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .corpus-surface-url {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 700;
      color: #6aa89e;
      letter-spacing: 0.02em;
    }

    .corpus-surface-desc {
      margin: 0;
      font-size: 13px;
      line-height: 1.55;
      color: var(--muted);
      flex: 1;
    }

    .corpus-stack-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: auto;
      padding-top: 8px;
    }

    /* ── Stats row ── */
    .corpus-stat {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      padding: 20px 12px;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: var(--gold-radius);
      box-shadow: var(--gold-shadow);
    }

    .corpus-stat-value {
      font-family: var(--font-serif);
      font-size: clamp(28px, 3vw, 38px);
      font-weight: 700;
      color: var(--accent-warm);
      letter-spacing: var(--gold-headline-spacing);
      line-height: 1;
    }

    .corpus-stat-label {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: var(--gold-eyebrow-spacing);
      text-transform: uppercase;
      color: #6aa89e;
    }

    /* ── Corpus foot ornament ── */
    .corpus-foot {
      text-align: center;
      padding: 48px 0 32px;
      color: var(--muted-soft);
      font-size: 14px;
      border-top: 1px solid var(--line);
      margin-top: 24px;
    }

    .corpus-foot-ornament {
      display: block;
      font-size: 18px;
      letter-spacing: 0.4em;
      color: var(--accent);
      margin-bottom: 12px;
    }

    .corpus-foot p { margin: 4px 0; }

    .corpus-foot em {
      font-family: var(--font-serif);
      color: var(--ink-deep);
      font-size: 15px;
    }

    .corpus-foot-year {
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: #6aa89e;
    }

    .corpus-foot-email a {
      color: var(--accent);
      text-decoration: none;
      font-size: 13px;
      letter-spacing: 0.04em;
      transition: color 160ms ease;
    }

    .corpus-foot-email a:hover { color: var(--accent-warm); }

    /* Macabre foot ornament rules live in docs/_shared/public-theme.css
       so every public surface (including the portal SPA shell, which
       does not load landing.css) carries the same chrome. */
