/* =========================================================================
   SMACSS categories map onto CSS cascade layers, declared here in the
   order they should win. A layer listed later always beats one listed
   earlier, regardless of selector specificity.

   Token conventions:
   - --space-* tokens are for margin/padding/gap only. Widths, heights,
     and grid track sizes use direct rem values instead.
   - Numeric-magnitude scales (space, font-size, letter-spacing) use
     t-shirt sizing (xs/sm/md/lg/xl/2xl/...) rather than numbered steps.
     Color palette shades
     (ink-900, ange-700, etc.) keep their numeric scale, since that's
     the conventional way to name a tint/shade progression.
   - Primitives only keep a slot if the value is genuinely reused;
     off-scale or single-use values are hardcoded at their one call site.
   - Semantic tokens are for colors (theme-ability) or for values shared
     by 2+ call sites with a real, intended relationship. One-off
     components reach for a primitive directly instead of getting a
     semantic name that documents a "role" nothing else shares.
   - Every spacing value (margin/padding/gap) resolves through a
     --space-* primitive or semantic token — no ad-hoc numbers.
   ========================================================================= */

/* Newsreader (SIL Open Font License) is self-hosted rather than loaded
   from Google Fonts: it carries the brand's signature accent role, so it
   should not depend on a third-party CDN. Both files are the variable
   builds, subsetted to Latin + Latin Extended + punctuation + currency
   (₺ included) — the two axes, wght 200–800 and opsz 6–72, are intact,
   so `font-optical-sizing: auto` still adjusts the cut to the size. */
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/Newsreader-roman.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/Newsreader-italic.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

@layer tokens.primitive, tokens.semantic, base, layout, modules, states, themes;

@layer tokens.primitive {
  /* =========================================================================
     0a. TOKENS — PRIMITIVE
     ========================================================================= */

  :root {
    /* --- colour: Ink (neutral ramp, 000 = pure white, 050 = Paper) ------ */
    --palette-ink-000: #ffffff;
    --palette-ink-050: #fafaf7;
    --palette-ink-100: #f1f1ec;
    --palette-ink-400: #8a8a85;
    --palette-ink-700: #2a2a2a;
    --palette-ink-800: #1c1c1c;
    --palette-ink-900: #141414;
    --palette-ink-950: #0a0a0a;

    --palette-ink-950-a08: rgba(10, 10, 10, 0.08);
    --palette-ink-950-a10: rgba(10, 10, 10, 0.1);
    --palette-ink-050-a10: rgba(250, 250, 247, 0.1);

    /* --- colour: Ange (single accent ramp) ------------------------------
       The full six-step ramp from the brand guide is kept intact as the
       canonical palette, including steps no module consumes yet. */
    --palette-ange-100: #dcfce7;
    --palette-ange-400: #4ade80;
    --palette-ange-500: #22c55e;
    --palette-ange-700: #16a34a;
    --palette-ange-900: #14532d;
    --palette-ange-950: #052e16;

    --palette-ange-500-a20: rgba(34, 197, 94, 0.2);
    --palette-ange-700-a08: rgba(22, 163, 74, 0.08);
    --palette-ange-400-a10: rgba(74, 222, 128, 0.1);
    --palette-ange-400-a16: rgba(74, 222, 128, 0.16);
    --palette-ange-500-a12: rgba(34, 197, 94, 0.12);
    --palette-ange-400-a12: rgba(74, 222, 128, 0.12);

    /* Reporting a failure is the one thing the green accent ramp cannot say. Two
       shades because the semantic that uses them is re-pointed per theme. */
    --palette-rose-400: #f87171;
    --palette-rose-600: #dc2626;

    --palette-transparent: transparent;

    /* --- space (rem-based, 4px increments where the scale calls for it) - */
    --space-xs: 0.25rem; /* 4px */
    --space-sm: 0.5rem; /* 8px */
    --space-md: 0.75rem; /* 12px */
    --space-lg: 1rem; /* 16px */
    --space-xl: 1.5rem; /* 24px */
    --space-2xl: 2rem; /* 32px */
    --space-3xl: 3rem; /* 48px */
    --space-4xl: 4rem; /* 64px */
    --space-5xl: 6rem; /* 96px */

    /* --- type ----------------------------------------------------------
       Host Grotesk carries display (h1/h2): a contemporary grotesque with
       the tail-less 'a' of the mockups' headline face, and narrower than
       Inter, so headlines set tighter. Newsreader carries the accent role:
       the serif italic fragment inside a sans headline, and large data
       numerals. Both are SIL OFL; nothing here is licence-encumbered. */
    --font-family-display: 'Host Grotesk', 'Inter', system-ui, sans-serif;
    --font-family-sans: 'Inter', system-ui, sans-serif;
    --font-family-serif: 'Newsreader', Georgia, serif;
    --font-family-mono: 'JetBrains Mono', ui-monospace, monospace;

    --font-size-xs: 0.68rem; /* small labels/captions */
    --font-size-sm: 0.74rem; /* labels */
    --font-size-md: 0.82rem; /* data/mono readouts */
    --font-size-lg: 0.93rem; /* small body copy */
    --font-size-xl: 1.12rem; /* lede/action copy */
    --font-size-2xl: 1.25rem; /* panel titles */
    --font-size-3xl: 1.6rem; /* subheadings */

    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    --line-height-flat: 1;
    --line-height-tight: 1.15;
    --line-height-normal: 1.6;

    --tracking-xs: 0.01em;
    --tracking-md: 0.06em;
    --tracking-lg: 0.09em;
    --tracking-xl: 0.14em;

    /* negative tracking is for large display type only (h1/h2/h3) —
       positive tracking above is for the caption/label/mono role */
    --tracking-display-h1: -0.01em;
    --tracking-display-h2: -0.005em;
    --tracking-display-h3: 0em;

    /* --- line, shape, motion ------------------------------------------ */
    --border-width-hairline: 1px;
    --border-width-thin: 1.5px;
    --border-width-thick: 2px;

    --radius-card: 4px;
    --radius-tile: 12px;
    --radius-panel: 20px;
    --radius-pill: 999px;
    --icon-stroke-width: 2px;
    --icon-stroke-width-thin: 1.5px;

    --duration-fast: 120ms;
    --duration-base: 250ms;
    --duration-slow: 450ms;
    --duration-reveal: 900ms;
    --easing-standard: ease;
    --easing-out: cubic-bezier(0.22, 0.61, 0.36, 1);

    --measure-text: 46ch;
  }
}

@layer tokens.semantic {
  /* =========================================================================
     0b. TOKENS — SEMANTIC
     ========================================================================= */

  :root {
    /* --- surfaces & text ------------------------------------------------
       Light theme is the default: Paper (ink-050) is the primary surface.
       Cards sit on pure white so they lift off the paper ground without
       needing a shadow. */
    --color-surface-page: var(--palette-ink-050);
    --color-surface-card: var(--palette-ink-000);
    --color-surface-hover: var(--palette-ange-700-a08);

    --color-text-primary: var(--palette-ink-950);
    --color-text-secondary: var(--palette-ink-400);

    --color-border-hairline: var(--palette-ink-950-a10);

    /* --- alternate/highlight surface --------------------------------
       Independent of the light/dark theme toggle below: a section can
       opt into "alt" to alternate against the page's current primary
       surface. Each theme decides what "alt" resolves to — here (light
       theme) alt points darker; .theme-dark repoints it lighter. */
    --color-surface-alt: var(--palette-ink-950);
    --color-surface-alt-raised: var(--palette-ink-900);
    --color-text-on-alt: var(--palette-ink-050);
    --color-text-on-alt-muted: var(--palette-ink-400);
    --color-border-alt: var(--palette-ink-050-a10);
    --color-accent-on-alt: var(--palette-ange-400);

    /* --- actions & signals -------------------------------------------- */
    --color-action-primary-bg: var(--palette-ink-950);
    --color-action-primary-text: var(--palette-ink-050);
    --color-action-primary-bg-hover: var(--palette-ink-800);
    --color-action-secondary-bg: var(--palette-ink-000);
    --color-action-secondary-text: var(--palette-ink-950);
    --color-action-secondary-bg-hover: var(--palette-ink-100);
    --color-action-accent-bg: var(--palette-ange-500);
    --color-action-accent-text: var(--palette-ink-950);
    --color-action-accent-bg-hover: var(--palette-ange-400);

    /* Bright green on light grounds — deliberately keeps the brand's
       energetic accent rather than the deeper forest green the mockups
       use, so "ileri / sonraki / yeni" reads as forward motion. */
    --color-accent: var(--palette-ange-700);
    --color-accent-surface: var(--palette-ange-700-a08);
    --color-focus-ring: var(--palette-ange-700);
    --color-status-success: var(--palette-ange-700);
    --color-status-danger: var(--palette-rose-600);

    --color-link-underline: var(--palette-ink-400);
    --color-link-underline-hover: var(--palette-ange-700);

    /* --- ambient wash ---------------------------------------------------
       A deliberate, signed-off exception to the brand guide's "no
       gradients" rule (principle 1, Sade): the mockups use a soft green
       radial wash at the top-right of the hero, the intelligence panel,
       and the dark employee section, and it's what lets those layouts
       carry their empty space. Kept to a single low-alpha radial per
       surface — no gradients anywhere else. */
    --wash-page: radial-gradient(
      60rem 34rem at 100% 0%,
      var(--palette-ange-500-a12),
      transparent 60%
    );
    --wash-alt: radial-gradient(
      48rem 28rem at 100% 0%,
      var(--palette-ange-400-a12),
      transparent 60%
    );

    /* --- borders ------------------------------------------------------- */
    --border-hairline: var(--border-width-hairline) solid var(--color-border-hairline);
    --border-alt: var(--border-width-hairline) solid var(--color-border-alt);

    /* --- space: inset (padding inside a component) --------------------- */
    --space-inset-panel: var(--space-xl);
    --space-inset-control: var(--space-md) var(--space-xl);

    /* --- space: stack (vertical rhythm) -------------------------------- */
    --space-stack-xs: var(--space-xs);
    --space-stack-sm: var(--space-sm);
    --space-stack-md: var(--space-md);
    --space-stack-lg: var(--space-xl);
    --space-stack-xl: var(--space-2xl);

    /* --- space: inline (horizontal gaps) ------------------------------- */
    --space-inline-xs: var(--space-sm);
    --space-inline-sm: var(--space-md);
    --space-inline-md: var(--space-lg);
    --space-inline-lg: var(--space-2xl);
    --space-none: 0;

    /* --- type: families ------------------------------------------------ */
    --font-display: var(--font-family-display);
    --font-body: var(--font-family-sans);
    --font-accent: var(--font-family-serif);
    --font-utility: var(--font-family-mono);

    /* --- type: sizes by role ------------------------------------------- */
    --text-subheading: var(--font-size-3xl);
    --text-panel-title: var(--font-size-2xl);
    --text-lede: var(--font-size-xl);
    --text-body: 1rem;
    --text-body-sm: var(--font-size-lg);
    --text-data: var(--font-size-md);
    --text-label: var(--font-size-sm);
    --text-caption: var(--font-size-xs);

    /* --- type: weight, leading, tracking by role ----------------------- */
    --weight-display: var(--font-weight-extrabold);
    --weight-heading: var(--font-weight-bold);
    --weight-emphasis: var(--font-weight-semibold);
    --weight-label: var(--font-weight-medium);

    --leading-heading: var(--line-height-tight);

    /* --- elevation & motion -------------------------------------------- */
    --motion-press: var(--duration-fast) var(--easing-standard);
    --motion-theme: var(--duration-base) var(--easing-standard);
    --motion-reveal: var(--duration-reveal) var(--easing-out);
  }
}

@layer base {
  /* =========================================================================
     1. BASE
     ========================================================================= */

  * {
    box-sizing: border-box;
  }

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

  body {
    margin: var(--space-none);
    background: var(--color-surface-page);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
    transition:
      background-color var(--motion-theme),
      color var(--motion-theme);
  }

  /* Weight steps down with the level, per the brand guide's scale:
     h1 800 / h2 700 / h3 600. Only the shared properties live here —
     each level sets its own weight below. */
  h1,
  h2,
  h3,
  h4 {
    margin: var(--space-none);
    font-family: var(--font-display);
    line-height: var(--leading-heading);
  }

  h1 {
    font-size: clamp(2.75rem, 7vw, 5rem);
    font-weight: var(--weight-display);
    letter-spacing: var(--tracking-display-h1);
  }
  h2 {
    font-size: clamp(2rem, 4.4vw, 3.25rem);
    font-weight: var(--weight-heading);
    letter-spacing: var(--tracking-display-h2);
  }
  h3 {
    font-family: var(--font-body);
    font-size: var(--text-panel-title);
    font-weight: var(--weight-emphasis);
    letter-spacing: var(--tracking-display-h3);
  }
  h4 {
    font-family: var(--font-body);
    font-size: var(--text-label);
    font-weight: var(--weight-emphasis);
    letter-spacing: var(--tracking-lg);
    text-transform: uppercase;
  }

  p {
    margin: var(--space-none);
  }

  a {
    color: inherit;
    text-decoration-color: var(--color-link-underline);
    text-underline-offset: 0.2em;
  }
  a:hover {
    text-decoration-color: var(--color-link-underline-hover);
  }

  ul {
    margin: var(--space-none);
    padding: var(--space-none);
    list-style: none;
  }

  button {
    font: inherit;
    color: inherit;
  }

  :focus-visible {
    outline: var(--border-width-thick) solid var(--color-focus-ring);
    outline-offset: 0.125rem;
    border-radius: var(--radius-card);
  }
}

@layer layout {
  /* =========================================================================
     2. LAYOUT
     ========================================================================= */

  .l-container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: clamp(var(--space-lg), 4vw, var(--space-3xl));
  }

  .l-header {
    position: sticky;
    top: var(--space-none);
    z-index: 20;
    background: var(--color-surface-page);
    border-bottom: var(--border-hairline);
  }

  .l-header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-inline-md);
    min-height: 4.5rem;
  }

  .l-header-nav {
    margin-left: auto;
  }

  /* Sections carry their rhythm on the block-end only, so two adjacent
     sections don't stack padding into a dead gap. The opening section of
     a run re-adds its block-start. */
  .l-section {
    padding-block: var(--space-none) clamp(var(--space-4xl), 7vw, var(--space-5xl));
  }
  .l-section-open {
    padding-block-start: clamp(var(--space-4xl), 7vw, var(--space-5xl));
  }
  .l-section-tight {
    padding-block: var(--space-none) var(--space-3xl);
  }

  .l-hero {
    padding-block: clamp(var(--space-3xl), 7vw, var(--space-5xl)) var(--space-2xl);
  }

  /* Full-bleed band so the wash reaches the viewport edge rather than
     stopping at the container's max-width. */
  .l-wash {
    background-image: var(--wash-page);
    background-repeat: no-repeat;
  }

  .l-split {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(var(--space-2xl), 5vw, var(--space-4xl));
    align-items: center;
  }

  .l-split-top {
    align-items: start;
  }

  .l-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .l-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }

  .l-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
  }

  .l-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
  }

  .l-footer {
    background: var(--color-surface-alt);
    color: var(--color-text-on-alt);
    padding-block: var(--space-4xl) var(--space-2xl);
  }

  .l-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: var(--space-2xl);
  }

  .l-footer-base {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-inline-md);
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    border-top: var(--border-alt);
  }

  @media (max-width: 900px) {
    .l-split {
      grid-template-columns: 1fr;
    }
    .l-grid-3,
    .l-grid-4 {
      grid-template-columns: repeat(2, 1fr);
    }
    .l-grid-5 {
      grid-template-columns: repeat(3, 1fr);
    }
    .l-footer-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 640px) {
    .l-header-inner {
      flex-wrap: wrap;
      min-height: 4rem;
    }
    .l-header-nav {
      order: 3;
      flex-basis: 100%;
      display: none;
      padding-bottom: var(--space-stack-lg);
    }
    .l-grid-2,
    .l-grid-3,
    .l-grid-4 {
      grid-template-columns: 1fr;
    }
    .l-grid-5 {
      grid-template-columns: repeat(2, 1fr);
    }
    .l-footer-grid {
      grid-template-columns: 1fr;
    }
  }
}

@layer modules {
  /* --- wordmark ----------------------------------------------------------
     Single two-color wordmark: the first part stays the current text
     color, the second part (.mark-accent) carries the accent. Clear
     space on every side should be at least the cap-height of the first
     letter; minimum size is 96px digital / 22mm print — both are usage
     rules for exported lockups/assets, not enforceable on inline text. */
  .mark {
    display: inline-flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-tile);
    background: var(--color-surface-alt);
    color: var(--color-text-on-alt);
    font-family: var(--font-display);
    font-size: var(--text-label);
    font-weight: var(--weight-display);
    letter-spacing: var(--tracking-xs);
    text-decoration: none;
  }
  .mark-accent {
    color: var(--color-accent-on-alt);
  }
  .mark-lg {
    font-size: var(--text-body);
    padding: var(--space-md) var(--space-lg);
  }
}

@layer modules {
  /* --- nav -------------------------------------------------------------- */
  .nav {
    display: flex;
    align-items: center;
    gap: var(--space-inline-md);
  }
  .nav-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-pill);
    font-size: var(--text-body-sm);
    text-decoration: none;
    transition: background-color var(--motion-press);
  }
  .nav-link:hover {
    background: var(--color-surface-hover);
  }

  @media (max-width: 640px) {
    .nav {
      flex-direction: column;
      align-items: stretch;
      gap: var(--space-stack-xs);
    }
  }
}

@layer modules {
  /* --- buttons (pill; the arrow is the brand's "next step" motif) -------- */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-inline-xs);
    padding: var(--space-inset-control);
    border: var(--border-width-hairline) solid var(--palette-transparent);
    border-radius: var(--radius-pill);
    background: var(--color-action-primary-bg);
    color: var(--color-action-primary-text);
    font-size: var(--text-body-sm);
    font-weight: var(--weight-label);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
      background-color var(--motion-press),
      border-color var(--motion-press);
  }
  .btn:hover {
    background: var(--color-action-primary-bg-hover);
  }

  .btn-arrow {
    transition: transform var(--motion-press);
  }
  .btn:hover .btn-arrow {
    transform: translateX(var(--space-xs));
  }

  .btn-secondary {
    background: var(--color-action-secondary-bg);
    color: var(--color-action-secondary-text);
    border-color: var(--color-border-hairline);
  }
  .btn-secondary:hover {
    background: var(--color-action-secondary-bg-hover);
  }

  .btn-accent {
    background: var(--color-action-accent-bg);
    color: var(--color-action-accent-text);
  }
  .btn-accent:hover {
    background: var(--color-action-accent-bg-hover);
  }

  .btn-block {
    width: 100%;
    justify-content: center;
  }

  .btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-label);
  }
}

@layer modules {
  /* --- house-lights toggle ---------------------------------------------- */
  .lights {
    display: inline-flex;
    align-items: center;
    gap: var(--space-inline-xs);
    padding: var(--space-sm) var(--space-md);
    border: var(--border-hairline);
    border-radius: var(--radius-pill);
    background: var(--palette-transparent);
    cursor: pointer;
    font-family: var(--font-utility);
    font-size: var(--text-caption);
    letter-spacing: var(--tracking-md);
    text-transform: uppercase;
    white-space: nowrap;
  }
  .lights:hover {
    background: var(--color-surface-hover);
  }
  svg.lights-icon-sun {
    display: none;
  }
}

@layer modules {
  /* --- eyebrow (green label that opens a section) ------------------------
     Sans, not mono: the mockups set these in Inter, and at this size the
     mono cut read as a code artefact rather than a section opener. Mono
     stays on genuinely technical readouts (panel labels, doc metadata). */
  .eyebrow {
    display: block;
    margin-bottom: var(--space-stack-md);
    font-family: var(--font-body);
    font-size: var(--text-label);
    font-weight: var(--weight-emphasis);
    letter-spacing: var(--tracking-lg);
    text-transform: uppercase;
    color: var(--color-accent);
  }
}

@layer modules {
  /* --- accent fragment: the serif italic inside a sans headline ----------
     The brand's signature type move. Reserved for the closing fragment
     of a headline and for large data numerals — never body copy. */
  .accent {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: var(--font-weight-medium);
    color: var(--color-accent);
  }
}

@layer modules {
  /* --- section head ------------------------------------------------------ */
  .section-head {
    max-width: 46rem;
    margin-bottom: var(--space-3xl);
  }
  .section-lede {
    max-width: var(--measure-text);
    margin-top: var(--space-stack-lg);
    font-size: var(--text-lede);
    color: var(--color-text-secondary);
  }
}

@layer modules {
  /* --- hero copy ----------------------------------------------------------
     Single column, left-aligned, holding roughly half the measure — the
     empty right half is carried by the ambient wash behind it, which is
     how the mockups compose this. */
  .hero-title {
    max-width: 14ch;
  }
  .hero-lede {
    max-width: 55ch;
    margin-block: var(--space-stack-lg) var(--space-stack-xl);
    font-size: var(--text-lede);
    color: var(--color-text-secondary);
  }
  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-inline-sm);
  }
}

@layer modules {
  /* --- intelligence panel (signature module) -----------------------------
     A dark analytics tile on the light page. It consumes the alt-surface
     tokens, so under .theme-dark it inverts along with everything else. */
  .panel {
    border-radius: var(--radius-panel);
    background-color: var(--color-surface-alt);
    background-image: var(--wash-alt);
    background-repeat: no-repeat;
    color: var(--color-text-on-alt);
    padding: var(--space-inset-panel);
    transition:
      background-color var(--motion-theme),
      color var(--motion-theme);
  }

  .panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-inline-sm);
    margin-bottom: var(--space-stack-xl);
  }

  .panel-badge {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-tile);
    background: var(--palette-ange-400-a16);
  }

  .panel-title {
    font-size: var(--text-body-sm);
    font-weight: var(--weight-emphasis);
  }
  .panel-meta {
    font-family: var(--font-utility);
    font-size: var(--text-caption);
    color: var(--color-text-on-alt-muted);
  }

  .panel-live {
    margin-left: auto;
    padding: var(--space-xs) var(--space-md);
    border: var(--border-width-hairline) solid var(--color-accent-on-alt);
    border-radius: var(--radius-pill);
    font-family: var(--font-utility);
    font-size: var(--text-caption);
    letter-spacing: var(--tracking-md);
    text-transform: uppercase;
    color: var(--color-accent-on-alt);
  }

  .panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  .panel-tile {
    border-radius: var(--radius-tile);
    background: var(--color-surface-alt-raised);
    padding: var(--space-xl);
  }

  .panel-label {
    display: flex;
    align-items: center;
    gap: var(--space-inline-xs);
    margin-bottom: var(--space-stack-lg);
    font-family: var(--font-utility);
    font-size: var(--text-caption);
    letter-spacing: var(--tracking-lg);
    text-transform: uppercase;
    color: var(--color-text-on-alt-muted);
  }
  .panel-delta {
    margin-left: auto;
    color: var(--color-accent-on-alt);
  }

  .panel-score {
    font-family: var(--font-accent);
    font-size: 3.5rem;
    line-height: var(--line-height-flat);
    font-variant-numeric: tabular-nums;
  }
  .panel-score-frac {
    font-size: 1.75rem;
  }
  .panel-score-note {
    margin-top: var(--space-stack-sm);
    font-size: var(--text-body-sm);
    color: var(--color-text-on-alt-muted);
  }

  .panel-bars {
    display: grid;
    gap: var(--space-stack-md);
    margin-top: var(--space-stack-xl);
  }
  .panel-bar {
    display: grid;
    grid-template-columns: 6.5rem 1fr 2.5rem;
    align-items: center;
    gap: var(--space-inline-sm);
    font-size: var(--text-data);
  }
  .panel-bar-track {
    display: block;
    height: 0.375rem;
    border-radius: var(--radius-pill);
    background: var(--color-border-alt);
    overflow: hidden;
  }
  /* --fill is authored per-bar in the markup as data (a measurement),
     the same category as a progress width — not a style decision. It is
     normalised so the largest category nearly fills the track, which is
     how the mockups draw it: the bars compare categories against each
     other, and the true percentage is always printed alongside. */
  .panel-bar-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--color-accent-on-alt);
    transition: width var(--motion-reveal);
  }
  .panel-bar-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-on-alt-muted);
  }

  .panel-insight {
    border: var(--border-width-hairline) solid var(--palette-ange-400-a16);
    border-radius: var(--radius-tile);
    background: var(--palette-ange-400-a10);
    padding: var(--space-lg);
    font-size: var(--text-body-sm);
  }
  .panel-insight-mark {
    color: var(--color-accent-on-alt);
  }
  .panel-insight-label {
    display: flex;
    align-items: center;
    gap: var(--space-inline-xs);
    margin-bottom: var(--space-stack-sm);
    font-size: var(--text-caption);
    font-weight: var(--weight-emphasis);
    letter-spacing: var(--tracking-lg);
    text-transform: uppercase;
    color: var(--color-accent-on-alt);
  }
  .panel-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-inline-sm);
    margin-top: var(--space-stack-lg);
    padding-top: var(--space-md);
    border-top: var(--border-alt);
    font-size: var(--text-body-sm);
  }
  .panel-roi {
    margin-left: auto;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-pill);
    background: var(--palette-ange-400-a16);
    font-family: var(--font-utility);
    font-size: var(--text-caption);
    color: var(--color-accent-on-alt);
  }

  .panel-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-inline-xs);
    margin-top: var(--space-stack-lg);
  }
  .panel-chip {
    padding: var(--space-xs) var(--space-md);
    border: var(--border-alt);
    border-radius: var(--radius-pill);
    font-size: var(--text-caption);
    color: var(--color-text-on-alt-muted);
  }

  @media (max-width: 900px) {
    .panel-body {
      grid-template-columns: 1fr;
    }
  }
}

@layer modules {
  /* --- metric tile (compact readout, used in the AI section) ------------- */
  .metric {
    border-radius: var(--radius-tile);
    background: var(--color-surface-alt-raised);
    padding: var(--space-lg);
  }
  .metric + .metric {
    margin-top: var(--space-stack-md);
  }
  .metric-note {
    margin-block: var(--space-stack-sm);
    font-size: var(--text-body-sm);
    color: var(--color-text-on-alt-muted);
  }
  .metric-value {
    font-family: var(--font-accent);
    font-size: 2rem;
    line-height: var(--line-height-flat);
    font-variant-numeric: tabular-nums;
  }
}

@layer modules {
  /* --- stat (serif numeral + label) -------------------------------------- */
  .stat-value {
    display: block;
    font-family: var(--font-accent);
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-flat);
    color: var(--color-accent);
  }
  .stat-name {
    margin-top: var(--space-stack-md);
    font-size: var(--text-body-sm);
  }
  .stat-note {
    font-size: var(--text-body-sm);
    color: var(--color-text-secondary);
  }
}

@layer modules {
  /* --- benefit card (numbered: these are a ranked list of outcomes) ------ */
  .benefit {
    border: var(--border-hairline);
    border-radius: var(--radius-panel);
    background: var(--color-surface-card);
    padding: var(--space-2xl);
    transition: border-color var(--motion-press);
  }
  .benefit:hover {
    border-color: var(--color-accent);
  }
  .benefit-no {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 2.25rem;
    line-height: var(--line-height-flat);
    color: var(--palette-ange-700);
    opacity: 0.5;
  }
  /* Card titles run one step heavier than the base h3, per the mockups —
     at card scale the guide's 600 reads too close to the body copy. */
  .benefit-title {
    margin-block: var(--space-stack-lg) var(--space-stack-sm);
    font-size: var(--text-body);
    font-weight: var(--weight-heading);
  }
  .benefit-body {
    font-size: var(--text-body-sm);
    color: var(--color-text-secondary);
  }
}

@layer modules {
  /* --- feature card (icon + copy, sits on an alt-surface section) -------- */
  .feature {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-inline-md);
    border: var(--border-alt);
    border-radius: var(--radius-panel);
    background: var(--color-surface-alt-raised);
    padding: var(--space-xl);
  }
  .feature-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-tile);
    background: var(--palette-ange-400-a16);
  }
  .feature-title {
    font-size: var(--text-body);
    font-weight: var(--weight-heading);
  }
  .feature-body {
    margin-top: var(--space-stack-sm);
    font-size: var(--text-body-sm);
    color: var(--color-text-on-alt-muted);
  }
}

@layer modules {
  /* --- capability list (numbered: a real sequence of what the AI does) --- */
  .caps {
    display: grid;
    gap: var(--space-stack-lg);
    margin-top: var(--space-stack-xl);
  }
  .cap {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-inline-md);
    align-items: start;
  }
  /* Serif numerals, matching the benefit-card markers — both are
     editorial sequence markers, so they share a face. */
  .cap-no {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-card);
    background: var(--color-accent-surface);
    font-family: var(--font-accent);
    font-style: italic;
    font-size: var(--text-body-sm);
    color: var(--color-accent);
  }
  .cap-title {
    font-size: var(--text-body-sm);
    font-weight: var(--weight-emphasis);
  }
  .cap-body {
    margin-top: var(--space-stack-xs);
    font-size: var(--text-body-sm);
    color: var(--color-text-secondary);
  }
}

@layer modules {
  /* --- pricing plan ------------------------------------------------------ */
  .plan {
    position: relative;
    display: flex;
    flex-direction: column;
    border: var(--border-hairline);
    border-radius: var(--radius-panel);
    background: var(--color-surface-card);
    padding: var(--space-2xl);
  }
  .plan-name {
    font-family: var(--font-accent);
    font-size: 1.75rem;
    line-height: var(--line-height-tight);
  }
  .plan-list {
    display: grid;
    gap: var(--space-stack-md);
    margin-block: var(--space-stack-xl);
    font-size: var(--text-body-sm);
  }
  .plan-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-inline-xs);
    align-items: start;
  }
  .plan-cta {
    margin-top: auto;
  }

  .plan-featured {
    background: var(--color-surface-alt);
    color: var(--color-text-on-alt);
    border-color: var(--palette-transparent);
  }
  .plan-featured .plan-name {
    color: var(--color-accent-on-alt);
  }

  /* Straddles the card's top edge, as in the mockups. */
  .plan-flag {
    position: absolute;
    top: 0;
    left: 50%;
    translate: -50% -50%;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-pill);
    background: var(--color-action-accent-bg);
    color: var(--color-action-accent-text);
    font-family: var(--font-utility);
    font-size: var(--text-caption);
    font-weight: var(--weight-label);
    letter-spacing: var(--tracking-md);
    text-transform: uppercase;
    white-space: nowrap;
  }
}

@layer modules {
  /* --- category tile ----------------------------------------------------- */
  .cat {
    display: grid;
    justify-items: center;
    gap: var(--space-stack-md);
    border: var(--border-hairline);
    border-radius: var(--radius-panel);
    background: var(--color-surface-card);
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    transition: border-color var(--motion-press);
  }
  .cat:hover {
    border-color: var(--color-accent);
  }
  .cat-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-tile);
    background: var(--color-accent-surface);
  }
  .cat-name {
    font-size: var(--text-body-sm);
    font-weight: var(--weight-label);
  }
  .cat-more {
    background: var(--color-surface-alt);
    color: var(--color-text-on-alt);
    border-color: var(--palette-transparent);
  }
  .cat-more .cat-icon {
    background: var(--palette-ange-400-a16);
  }
}

@layer modules {
  /* --- checklist --------------------------------------------------------- */
  .checklist {
    display: grid;
    margin-top: var(--space-stack-xl);
  }
  .checklist li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-inline-sm);
    align-items: center;
    padding-block: var(--space-md);
    border-bottom: var(--border-hairline);
    font-size: var(--text-body-sm);
  }
  .checklist li:last-child {
    border-bottom: 0;
  }

  /* Solid green badge with a knocked-out check, per the mockups —
     more emphatic than a bare outline tick in a confirmation list. */
  .checklist-tick {
    display: grid;
    place-items: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    background: var(--color-accent);
  }
  .checklist-tick {
    color: var(--color-surface-card);
  }
}

@layer modules {
  /* --- demo form --------------------------------------------------------- */
  .form {
    border: var(--border-hairline);
    border-radius: var(--radius-panel);
    background: var(--color-surface-card);
    padding: clamp(var(--space-xl), 4vw, var(--space-3xl));
  }
  .form-title {
    font-size: var(--text-subheading);
  }
  .form-note {
    margin-top: var(--space-stack-sm);
    font-size: var(--text-body-sm);
    color: var(--color-text-secondary);
  }
  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-stack-xl);
  }
  .form-field {
    display: grid;
    gap: var(--space-stack-xs);
  }
  .form-field-wide {
    grid-column: 1 / -1;
  }
  .form-label {
    font-size: var(--text-label);
    font-weight: var(--weight-label);
  }
  .form-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: var(--border-width-hairline) solid var(--color-border-hairline);
    border-radius: var(--radius-tile);
    background: var(--color-surface-page);
    color: inherit;
    font: inherit;
    font-size: var(--text-body-sm);
  }
  .form-input:hover {
    border-color: var(--color-text-secondary);
  }
  textarea.form-input {
    resize: vertical;
    min-height: 6rem;
  }
  .form-submit {
    margin-top: var(--space-stack-xl);
  }
  .form-legal {
    margin-top: var(--space-stack-md);
    font-size: var(--text-caption);
    text-align: center;
    color: var(--color-text-secondary);
  }

  /* Off-screen rather than display:none, because a field that is not displayed is
     also not submitted, and an empty value is what the server checks for. */
  .form-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .form-status {
    margin-top: var(--space-stack-md);
    font-size: var(--text-body-sm);
    text-align: center;
  }
  /* Every outcome is written in the markup and one is revealed by the form's state
     class, so the script never writes a message and none of this wording lives in JS. */
  .form-status-line {
    display: none;
  }
  .form-status-sending {
    color: var(--color-text-secondary);
  }
  .form-status-sent {
    color: var(--color-status-success);
  }
  .form-status-failed {
    color: var(--color-status-danger);
  }

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

@layer modules {
  /* --- footer bits ------------------------------------------------------- */
  .footer-about {
    max-width: 30ch;
    margin-top: var(--space-stack-lg);
    font-size: var(--text-body-sm);
    color: var(--color-text-on-alt-muted);
  }
  .footer-head {
    margin-bottom: var(--space-stack-lg);
    color: var(--color-text-on-alt-muted);
  }
  .footer-list {
    display: grid;
    gap: var(--space-stack-sm);
    font-size: var(--text-body-sm);
  }
  .footer-list a {
    text-decoration: none;
  }
  .footer-list a:hover {
    text-decoration: underline;
  }
  .footer-social {
    display: flex;
    gap: var(--space-inline-xs);
    margin-top: var(--space-stack-lg);
  }
  .footer-social-link {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: var(--border-alt);
    border-radius: 50%;
    color: var(--color-text-on-alt);
    transition: background-color var(--motion-press);
  }
  .footer-social-link:hover {
    background: var(--color-border-alt);
  }

  .footer-legal {
    margin-left: auto;
  }
  .footer-fine {
    font-family: var(--font-utility);
    font-size: var(--text-caption);
    letter-spacing: var(--tracking-md);
    text-transform: uppercase;
    color: var(--color-text-on-alt-muted);
  }
}

@layer modules {
  /* --- icon (motif: "next step" — stroke-based, no fill, sharp corners) ---
     Glyphs come from icons.svg (Lucide + Tabler brand marks), referenced
     via <use>. Both sets ship 24x24 / stroke-width 2 / fill none, so this
     class owns every stroke property — including the butt/miter joins the
     brand guide asks for, since both libraries default to round. The
     miterlimit keeps acute corners from spiking. */
  .icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    stroke: var(--color-accent);
    stroke-width: var(--icon-stroke-width);
    stroke-linecap: butt;
    stroke-linejoin: miter;
    stroke-miterlimit: 4;
    fill: none;
  }
  .icon-on-alt {
    stroke: var(--color-accent-on-alt);
  }

  /* Size and colour modifiers, applied to the <svg> itself rather than
     reached for with a descendant selector (see §4 of CLAUDE.md). */
  .icon-lg {
    width: 1.5rem;
    height: 1.5rem;
  }
  .icon-sm {
    width: 0.875rem;
    height: 0.875rem;
  }
  .icon-inherit {
    stroke: currentColor;
  }
  /* For glyphs whose internal detail crowds at the default weight —
     the sparkle's points close up against each other at 2px. */
  .icon-thin {
    stroke-width: var(--icon-stroke-width-thin);
  }
}

@layer modules {
  /* --- alternate/highlight surface ------------------------------------
     Independent of .theme-dark: wrap a <section> to alternate it against
     the page's current primary surface. Each theme defines what "alt"
     resolves to (see tokens.semantic) — this class just consumes it, so
     it works the same regardless of which global theme is active. */
  .surface-alt {
    background-color: var(--color-surface-alt);
    background-image: var(--wash-alt);
    background-repeat: no-repeat;
    color: var(--color-text-on-alt);
    transition:
      background-color var(--motion-theme),
      color var(--motion-theme);
  }
  .surface-alt .eyebrow {
    color: var(--color-accent-on-alt);
  }
  .surface-alt .accent {
    color: var(--color-accent-on-alt);
  }
  .surface-alt .section-lede {
    color: var(--color-text-on-alt-muted);
  }
}

@layer states {
  /* =========================================================================
     4. STATE
     ========================================================================= */

  .is-open {
    display: block;
  }

  .is-hidden {
    display: none;
  }

  /* the panel's orchestrated reveal: bars grow to their authored --fill
     only once the panel has scrolled into view */
  .is-revealed .panel-bar-fill {
    width: var(--fill);
  }

  /* the demo form reports one outcome at a time */
  .is-sending .form-status-sending,
  .is-sent .form-status-sent,
  .is-failed .form-status-failed {
    display: block;
  }

  /* theme toggle shows the icon for the mode a click switches to */
  .theme-dark .lights-icon-moon {
    display: none;
  }
  .theme-dark .lights-icon-sun {
    display: block;
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
    * {
      transition-duration: 0.01ms !important;
    }
  }
}

@layer themes {
  /* =========================================================================
     5. THEME — "house lights down"
     Only semantic tokens are re-pointed. No module selector is touched.
     ========================================================================= */

  .theme-dark {
    --color-surface-page: var(--palette-ink-950);
    --color-surface-card: var(--palette-ink-900);
    --color-surface-hover: var(--palette-ange-400-a10);

    --color-text-primary: var(--palette-ink-050);
    --color-text-secondary: var(--palette-ink-400);

    --color-border-hairline: var(--palette-ink-050-a10);

    --color-action-primary-bg: var(--palette-ink-050);
    --color-action-primary-text: var(--palette-ink-950);
    --color-action-primary-bg-hover: var(--palette-ink-000);
    --color-action-secondary-bg: var(--palette-transparent);
    --color-action-secondary-text: var(--palette-ink-050);
    --color-action-secondary-bg-hover: var(--palette-ange-400-a10);

    --color-accent: var(--palette-ange-400);
    --color-accent-surface: var(--palette-ange-400-a10);
    --color-focus-ring: var(--palette-ange-400);
    --color-status-success: var(--palette-ange-400);
    --color-status-danger: var(--palette-rose-400);

    --color-link-underline: var(--palette-ink-700);
    --color-link-underline-hover: var(--palette-ange-400);
  }
}
