/* THIS IS THE NEW NORMAL — design system. See SPEC.md for the rules behind these values. */

@layer reset, tokens, base, layout, components, sections, utilities;

/* Fonts (self-hosted, OFL licensed, see /assets/fonts/) */
@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  src: url(/assets/fonts/mona-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  src: url(/assets/fonts/mona-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/fonts/fraunces-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/fonts/fraunces-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Metric-matched fallback so the swap to Mona Sans doesn't shift the layout */
@font-face {
  font-family: "Mona Sans Fallback";
  src: local("Helvetica Neue"), local("Arial");
  size-adjust: 104%;
  ascent-override: 92%;
  descent-override: 24%;
}

@view-transition { navigation: auto; }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
  img, svg, canvas, video { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
}

@layer tokens {
  :root {
    color-scheme: light;

    /* Palette: cream 60%, indigo 30%, peach 10%. Charcoal for text, never pure black. */
    --cream: #fdfbf7;
    --sand: #f4efe6;
    --sand-2: #eae3d6;
    --indigo: #3b3b98;
    --indigo-2: #45459f;
    --indigo-3: #5252ab;
    --peach: #ff7e5f;
    --peach-hi: #ff9a80;
    --peach-lo: #e8664a;
    --terracotta: #b4472a;
    --peach-soft: #ffb39f;
    --charcoal: #2f3542;
    --sign-red: #db121f;

    /* Semantic tokens (redefined inside .theme-indigo) */
    --bg: var(--cream);
    --surface: var(--sand);
    --surface-2: var(--sand-2);
    --text: var(--charcoal);
    --muted: #5d6370;
    --line: rgba(47, 53, 66, 0.12);
    --line-strong: rgba(47, 53, 66, 0.24);
    --accent: var(--peach);
    --accent-text: var(--terracotta);
    --accent-glow: rgba(255, 126, 95, 0.16);
    --highlight: rgba(255, 255, 255, 0.7);

    --sans: "Mona Sans", "Mona Sans Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

    --fs-hero: clamp(56px, 15vw, 220px);
    --fs-h2: clamp(34px, 5vw, 64px);
    --fs-h3: clamp(20px, 2vw, 26px);
    --fs-lead: clamp(18px, 1.6vw, 22px);
    --fs-body: 17px;
    --fs-label: 12px;

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
    --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px; --s-11: 160px;

    --container: 1200px;
    --reading: 760px;
    --gutter: clamp(16px, 4vw, 40px);
    --section-pad: clamp(80px, 12vw, 160px);

    --r-card: 20px;
    --r-pill: 999px;
    --r-tag: 4px;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --t-press: 120ms;
    --t-hover: 200ms;
    --t-reveal: 400ms;

    --shadow-card: inset 0 1px 0 var(--highlight), 0 1px 2px rgba(47, 53, 66, 0.06), 0 24px 48px -28px rgba(47, 53, 66, 0.28);
    --header-h: 64px;
  }

  .theme-indigo {
    --bg: var(--indigo);
    --surface: var(--indigo-2);
    --surface-2: var(--indigo-3);
    --text: var(--cream);
    --muted: #c9c9e8;
    --line: rgba(253, 251, 247, 0.16);
    --line-strong: rgba(253, 251, 247, 0.32);
    --accent-text: var(--peach-soft);
    --accent-glow: rgba(255, 126, 95, 0.22);
    --highlight: rgba(255, 255, 255, 0.08);
    --shadow-card: inset 0 1px 0 var(--highlight), 0 24px 48px -24px rgba(20, 20, 60, 0.5);
    background-color: var(--bg);
    color: var(--text);
  }

  @media (prefers-contrast: more) {
    :root {
      --muted: #474c58;
      --line: rgba(47, 53, 66, 0.3);
      --line-strong: rgba(47, 53, 66, 0.5);
    }
  }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

  body {
    background: var(--bg);
    color: var(--text);
    font: 400 var(--fs-body)/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
  }

  ::selection { background: var(--peach); color: var(--charcoal); }

  a { color: var(--text); text-decoration-color: var(--accent-text); text-underline-offset: 4px; text-decoration-thickness: 1px; }
  a:hover { color: var(--accent-text); }

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

  h1, h2, h3 { font-weight: 500; text-wrap: balance; }
  h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1.05; font-stretch: 85%; font-weight: 600; letter-spacing: -0.01em; margin: var(--s-8) 0 var(--s-3); }
  h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.02em; margin: var(--s-8) 0 var(--s-3); }
  h3 { font-size: 18px; font-weight: 600; margin: var(--s-6) 0 var(--s-2); }
  p { text-wrap: pretty; }

  .lead { font-size: var(--fs-lead); color: var(--muted); margin: 0 0 var(--s-6); max-width: 40em; }
  .muted { color: var(--muted); }
  .small { font-size: 14px; }
  em.accent, .accent { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent-text); }
}

@layer layout {
  .wrap { max-width: calc(var(--reading) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
  .wrap.wide { max-width: calc(var(--container) + 2 * var(--gutter)); }

  .skip-link {
    position: absolute; left: var(--s-4); top: -100px; z-index: 100;
    background: var(--accent); color: var(--bg); padding: var(--s-2) var(--s-4); border-radius: var(--r-pill); font-weight: 600; text-decoration: none;
  }
  .skip-link:focus { top: var(--s-3); }

  /* Header: glass, darkens once the page scrolls (scroll-driven, CSS only) */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    isolation: isolate;
  }
  .site-header::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: rgba(253, 251, 247, 0.8);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--line);
  }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-header::before { background: var(--cream); }
  }
  @media (prefers-reduced-transparency: reduce) {
    .site-header::before { background: var(--cream); -webkit-backdrop-filter: none; backdrop-filter: none; }
  }

  .site-header .wrap { height: 100%; display: flex; align-items: center; gap: var(--s-6); }

  .logo {
    display: inline-flex; align-items: center; gap: var(--s-3);
    font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-decoration: none; white-space: nowrap;
    view-transition-name: logo;
  }
  .logo:hover { color: var(--text); }
  .logo-mark { width: 14px; height: 14px; border: 1.5px solid currentColor; background: linear-gradient(135deg, var(--peach) 50%, transparent 50%); transform: rotate(45deg); flex: none; transition: transform var(--t-reveal) var(--ease); }
  .logo:hover .logo-mark { transform: rotate(225deg); }

  .nav { display: flex; gap: var(--s-5); margin-left: auto; font-size: 14px; }
  .nav a { color: var(--muted); text-decoration: none; transition: color var(--t-hover); }
  .nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
  .nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent-text); text-decoration-thickness: 2px; }

  .menu-button {
    display: none; margin-left: auto;
    width: 44px; height: 44px; border-radius: var(--r-pill);
    background: transparent; border: 1px solid var(--line-strong);
    align-items: center; justify-content: center;
  }
  .menu-button span, .menu-button span::before, .menu-button span::after {
    display: block; width: 16px; height: 1.5px; background: var(--text); position: relative;
  }
  .menu-button span::before, .menu-button span::after { content: ""; position: absolute; left: 0; }
  .menu-button span::before { top: -5px; }
  .menu-button span::after { top: 5px; }

  .mobile-menu {
    inset: var(--s-3) var(--s-3) auto auto; margin: 0;
    width: min(320px, calc(100vw - 24px));
    padding: var(--s-5);
    border: 1px solid var(--line-strong); border-radius: var(--r-card);
    background: rgba(253, 251, 247, 0.92);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    color: var(--text);
    box-shadow: 0 30px 60px -20px rgba(47, 53, 66, 0.35);
    opacity: 0; transform: translateY(-8px) scale(0.98);
    transition: opacity var(--t-hover) var(--ease), transform var(--t-hover) var(--ease), display var(--t-hover) allow-discrete, overlay var(--t-hover) allow-discrete;
  }
  .mobile-menu:popover-open { opacity: 1; transform: none; }
  @starting-style { .mobile-menu:popover-open { opacity: 0; transform: translateY(-8px) scale(0.98); } }
  .mobile-menu::backdrop { background: rgba(47, 53, 66, 0.3); }
  .mobile-menu nav { display: grid; gap: var(--s-1); margin-bottom: var(--s-4); }
  .mobile-menu nav a { padding: var(--s-3) var(--s-2); font-size: 18px; text-decoration: none; border-bottom: 1px solid var(--line); }
  .mobile-menu .button { width: 100%; text-align: center; }
  .menu-close { position: absolute; top: var(--s-3); right: var(--s-3); width: 36px; height: 36px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; font-size: 18px; line-height: 1; }
  .mobile-menu nav { margin-top: var(--s-6); }


  /* Footer */
  .site-footer { margin-top: var(--section-pad); padding: var(--s-8) 0 var(--s-7); color: var(--muted); font-size: 14px; }
  .footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: var(--s-6); }
  .footer-grid h2 { font-size: var(--fs-label); font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.2em; color: var(--accent-text); margin: 0 0 var(--s-4); }
  .footer-grid ul { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
  .footer-grid a { color: var(--muted); text-decoration: none; }
  .footer-grid a:hover { color: var(--text); }
  .footer-grid address { font-style: normal; display: grid; gap: var(--s-2); }
  .footer-brand p { max-width: 28em; margin-top: var(--s-4); }
  .footer-bottom { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: 13px; }
  .footer-bottom a { color: var(--muted); }
  @media (max-width: 899px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
  @media (max-width: 479px) { .footer-grid { grid-template-columns: 1fr; } }
}

@layer components {
  .eyebrow {
    display: inline-flex; align-items: center; gap: var(--s-3);
    font: 500 var(--fs-label)/1.4 var(--mono); letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--accent-text); margin: 0 0 var(--s-5);
  }
  .eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }

  /* Buttons: light skeuomorphism, physical press */
  .button {
    --b-bg: linear-gradient(180deg, var(--peach-hi), var(--peach) 55%, var(--peach-lo));
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    min-height: 48px; padding: 0 var(--s-5);
    border-radius: var(--r-pill);
    background: var(--b-bg); color: var(--charcoal);
    border: 1px solid var(--peach-lo); border-bottom-color: #c9502f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 24px -10px rgba(232, 102, 74, 0.55);
    font-size: 15px; font-weight: 600; letter-spacing: 0.01em; text-decoration: none;
    transition: transform var(--t-press) var(--ease), box-shadow var(--t-hover) var(--ease), filter var(--t-hover);
    cursor: pointer;
  }
  .button:hover { color: var(--charcoal); filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 12px 30px -10px rgba(232, 102, 74, 0.7); }
  .button:active { transform: translateY(1px); box-shadow: inset 0 2px 6px rgba(140, 50, 30, 0.3); }
  .button.secondary {
    --b-bg: transparent;
    color: var(--text); border: 1px solid var(--line-strong);
    box-shadow: inset 0 1px 0 var(--highlight);
  }
  .button.secondary:hover { color: var(--text); border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-glow); filter: none; }
  .button.small { min-height: 40px; padding: 0 var(--s-4); font-size: 14px; }
  span.button { cursor: default; }
  .buttons { display: flex; gap: var(--s-3); flex-wrap: wrap; margin: var(--s-5) 0; }

  .tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .tags li { font: 500 12px/1 var(--mono); letter-spacing: 0.04em; color: var(--muted); padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-tag); }

  /* Cards with cursor spotlight (see assets/js/main.js) */
  .card {
    --x: 20%; --y: 0%;
    position: relative; isolation: isolate;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    transition: transform var(--t-hover) var(--ease), border-color var(--t-hover);
  }
  .card::before, .card::after { content: ""; position: absolute; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--t-hover) var(--ease); }
  .card::before {
    inset: -1px; padding: 1px; z-index: 1;
    background: radial-gradient(260px circle at var(--x) var(--y), var(--accent), transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  .card::after { inset: 0; z-index: -1; background: radial-gradient(420px circle at var(--x) var(--y), var(--accent-glow), transparent 65%); }
  .card:hover, .card:focus-visible, .card:focus-within { transform: translateY(-2px); }
  .card:hover::before, .card:hover::after, .card:focus-visible::before, .card:focus-visible::after, .card:focus-within::before { opacity: 1; }
  a.card { text-decoration: none; color: var(--text); display: block; }
  a.card:focus-visible { outline-offset: 4px; border-radius: var(--r-card); }

  .arrow { color: var(--accent-text); transition: transform var(--t-hover) var(--ease); display: inline-block; }
  a:hover .arrow, a:focus-visible .arrow { transform: translateX(4px); }
  .button .arrow { color: inherit; }

  /* Speed limit sign, as in the app */
  .sign {
    flex: none; width: 72px; height: 72px; border-radius: 50%;
    background: #fff; border: 7px solid var(--sign-red);
    display: grid; place-items: center;
    color: #000; font-weight: 800; font-stretch: 90%; font-size: 24px;
  }
  .sign.big { width: 140px; height: 140px; border-width: 13px; font-size: 48px; margin: var(--s-8) 0 var(--s-2); }

  /* App page */
  .features { list-style: none; padding: 0; margin: var(--s-5) 0; display: grid; gap: var(--s-3); }
  .features li { padding: var(--s-4) var(--s-5); border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
  .features strong { display: block; font-weight: 600; }
  .features span { color: var(--muted); font-size: 15px; }

  .prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3); margin: var(--s-5) 0; }
  .price { padding: var(--s-5); border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
  .price b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 34px; display: block; color: var(--text); }
  .price.best { border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-glow); }

  .note { border-left: 2px solid var(--accent-text); padding: var(--s-1) 0 var(--s-1) var(--s-4); color: var(--muted); margin: var(--s-5) 0; }

  /* FAQ / disclosure */
  details { border-bottom: 1px solid var(--line); }
  summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding: var(--s-4) 0; font-weight: 600; }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: "+"; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--accent-text); font-weight: 300; transition: transform var(--t-hover) var(--ease), background var(--t-hover); }
  details[open] summary::after { transform: rotate(45deg); background: var(--accent-glow); }
  summary h3 { font-size: inherit; font-weight: inherit; margin: 0; }
  details > p, details > ul { color: var(--muted); margin: 0 0 var(--s-4); max-width: 60ch; }

  /* Legal text */
  .legal p, .legal li { color: var(--text); }
  .legal p + p { margin-top: var(--s-3); }
  .legal ul { margin: var(--s-3) 0; }
  .legal table { width: 100%; border-collapse: collapse; font-size: 15px; margin: var(--s-3) 0; }
  .legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  .legal th { color: var(--muted); font-weight: 600; }
  .table-scroll { overflow-x: auto; }

  /* App sub-pages keep their reading layout */
  main.wrap > p, main.wrap > .buttons { margin-top: var(--s-3); }
  .breadcrumb { margin-top: var(--s-6); font-size: 13px; color: var(--muted); }
  .breadcrumb ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .breadcrumb li + li::before { content: "/"; margin-right: var(--s-2); color: var(--line-strong); }
  .breadcrumb a { color: var(--muted); text-decoration: none; }
  .breadcrumb a:hover { color: var(--text); }
}

@layer sections {
  .section { padding-top: var(--section-pad); }
  .section.band { margin-top: var(--section-pad); padding-bottom: var(--section-pad); }
  .section-head { display: grid; gap: var(--s-4); align-content: start; align-self: start; margin-bottom: var(--s-7); max-width: 760px; }
  .section-head .eyebrow { margin: 0; }
  .section-head h2 { font-size: var(--fs-h2); font-weight: 500; font-stretch: 90%; letter-spacing: -0.03em; line-height: 1.02; margin: 0; }
  .section-head p:not(.eyebrow) { color: var(--muted); font-size: var(--fs-lead); }

  /* Scroll-driven reveal. Content is visible by default; only animates where supported. */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
      @keyframes reveal { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
    }
  }

  /* ---------- Hero ---------- */
  .hero {
    position: relative; overflow: hidden;
    min-height: min(calc(100svh - var(--header-h)), 920px);
    padding-top: clamp(48px, 10vh, 120px);
    display: flex; flex-direction: column;
    background:
      radial-gradient(ellipse 50% 60% at 80% 30%, rgba(255, 126, 95, 0.20), transparent 70%),
      radial-gradient(ellipse 60% 50% at 0% 100%, rgba(253, 251, 247, 0.08), transparent 70%),
      var(--bg);
  }
  /* 2% grain so the black isn't flat */
  .hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.08; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  .hero-art {
    position: absolute; z-index: 0;
    width: min(64vw, 860px); aspect-ratio: 1;
    right: -8%; top: 50%; translate: 0 -50%;
    pointer-events: none;
    -webkit-mask: radial-gradient(closest-side, #000 55%, transparent);
    mask: radial-gradient(closest-side, #000 55%, transparent);
  }
  .hero-poster, .hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .hero-poster { background: url(/assets/lattice.svg) center / contain no-repeat; opacity: 1; transition: opacity 800ms var(--ease); }
  .hero-canvas { opacity: 0; transition: opacity 800ms var(--ease); }
  .hero-art.is-live .hero-canvas { opacity: 1; }
  .hero-art.is-live .hero-poster { opacity: 0; }


  .hero-inner { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: var(--s-8); }

  .hero-title {
    font-size: var(--fs-hero);
    line-height: 0.86;
    letter-spacing: -0.035em;
    font-weight: 600; font-stretch: 78%;
    text-transform: uppercase;
    margin: 0 0 var(--s-6);
  }
  .hero-title > span { display: block; }
  .hero-title .accent { font-weight: 300; font-size: 0.92em; letter-spacing: -0.02em; text-transform: none; padding-right: 0.05em; }

  @media (prefers-reduced-motion: no-preference) {
    .hero-title > span { animation: kinetic 1200ms var(--ease) both; }
    .hero-title > span:nth-child(2) { animation-delay: 90ms; }
    .hero-title > span:nth-child(3) { animation-delay: 180ms; }
    @keyframes kinetic {
      from { font-stretch: 125%; font-weight: 250; opacity: 0; letter-spacing: 0.02em; }
      40% { opacity: 1; }
      to { font-stretch: 78%; font-weight: 600; opacity: 1; letter-spacing: -0.035em; }
    }
    .hero-title > span.accent { animation-name: kinetic-accent; }
    @keyframes kinetic-accent {
      from { font-weight: 100; opacity: 0; transform: translateX(-0.1em); }
      to { font-weight: 300; opacity: 1; transform: none; }
    }

    @supports (animation-timeline: scroll()) {
      .hero-inner { animation: hero-out linear both; animation-timeline: scroll(root); animation-range: 0 80vh; }
      @keyframes hero-out { to { opacity: 0.15; transform: translateY(-60px) scale(0.97); } }
    }
  }

  .hero-sub { font-size: var(--fs-lead); color: var(--muted); max-width: 34em; }
  .hero-sub strong { color: var(--text); font-weight: 500; }

  .marquee {
    position: relative; z-index: 1;
    border-top: 1px solid var(--line);
    padding: var(--s-6) 0;
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  }
  .marquee-track { display: flex; width: max-content; }
  .marquee ul { list-style: none; padding: 0 var(--s-7) 0 0; display: flex; gap: var(--s-7); font-size: clamp(22px, 2.6vw, 34px); font-weight: 400; font-stretch: 90%; letter-spacing: -0.02em; line-height: 1.15; color: var(--text); }
  .marquee li { white-space: nowrap; display: flex; align-items: center; gap: var(--s-7); }
  .marquee li:nth-child(even) { font-family: var(--serif); font-style: italic; font-weight: 300; color: var(--accent-text); }
  .marquee li::after { content: ""; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); }
  @media (prefers-reduced-motion: no-preference) {
    .marquee-track { animation: marquee 70s linear infinite; }
    .marquee:hover .marquee-track { animation-play-state: paused; }
    @keyframes marquee { to { transform: translateX(-50%); } }
  }
  @media (prefers-reduced-motion: reduce) {
    .marquee ul[aria-hidden] { display: none; }
    .marquee ul { flex-wrap: wrap; row-gap: var(--s-3); padding-inline: var(--gutter); }
    .marquee { -webkit-mask: none; mask: none; }
  }

  @media (max-width: 699px) {
    .hero-art { width: 130vw; right: -55vw; top: 38%; opacity: 0.55; }
  }

  /* ---------- Services bento ---------- */
  .bento { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
  .bento .card { padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: var(--s-3); container-type: inline-size; min-height: 220px; overflow: hidden; }
  .bento h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
  .bento p { color: var(--muted); max-width: 34em; }
  .bento .tags { margin-top: auto; padding-top: var(--s-3); }
  .card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); }
  .card-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-text); box-shadow: inset 0 1px 0 var(--highlight); }
  .card-icon svg { width: 20px; height: 20px; }
  .card-top .arrow { font-size: 20px; }

  @media (min-width: 700px) {
    .bento { grid-template-columns: repeat(6, 1fr); }
    .bento > * { grid-column: span 3; }
    .bento .b-arch, .bento .b-ops, .bento .b-mon { grid-column: span 6; }
  }
  @media (min-width: 1024px) {
    .bento { grid-template-columns: repeat(12, 1fr); }
    .bento .b-arch, .bento .b-ops { grid-column: span 6; grid-row: span 2; min-height: 460px; }
    .bento .b-k8s, .bento .b-iac, .bento .b-mon { grid-column: span 4; }
    .bento .b-migrate, .bento .b-sec { grid-column: span 6; }
  }

  /* Big cards: text keeps clear of the visual when the card is wide enough */
  .feature-visual { margin-top: auto; }

  /* Architecture diagram (card A) */
  .arch { margin: var(--s-2) 0 0; padding: var(--s-3) var(--s-4) var(--s-4); border-radius: 14px; background: var(--cream); border: 1px solid var(--line); }
  .arch figcaption { font: 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: right; margin-bottom: var(--s-3); }
  .arch svg { width: 100%; height: auto; font: 500 14px var(--sans); }
  .arch text { fill: var(--charcoal); }
  .arch-link { stroke: var(--peach); stroke-width: 2; stroke-dasharray: 4 6; }
  .arch-band { fill: var(--sand-2); }
  .arch-hub { fill: var(--indigo); }
  .arch .arch-hub-text { fill: var(--cream); }
  .arch-node { fill: #fff; stroke: var(--line-strong); }
  @media (prefers-reduced-motion: no-preference) {
    .arch-link { animation: arch-flow 1.6s linear infinite; }
    @keyframes arch-flow { to { stroke-dashoffset: -20; } }
  }

  /* Terminal (card B) */
  .terminal {
    border-radius: 14px; background: var(--charcoal); border: 1px solid rgba(47, 53, 66, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 40px -24px rgba(47, 53, 66, 0.5);
    font: 13px/1.9 var(--mono); color: #c9ccd3;
    overflow: hidden;
  }
  .terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-size: 11px; }
  .terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
  .terminal-bar i:first-child { background: var(--peach); }
  .terminal-bar span { margin-left: auto; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }
  .terminal ol { list-style: none; padding: 12px 14px; }
  .terminal li { display: flex; gap: 10px; white-space: nowrap; }
  .terminal li b { color: #ffa58f; font-weight: 500; }
  .terminal li em { margin-left: auto; font-style: normal; opacity: 0.6; }
  .terminal li:first-child { color: var(--cream); }
  @media (prefers-reduced-motion: no-preference) {
    .terminal li { animation: term-line 10s steps(1, end) infinite both; }
    .terminal li:nth-child(1) { animation-delay: 0s; }
    .terminal li:nth-child(2) { animation-name: term-2; }
    .terminal li:nth-child(3) { animation-name: term-3; }
    .terminal li:nth-child(4) { animation-name: term-4; }
    .terminal li:nth-child(5) { animation-name: term-5; }
    .terminal li:nth-child(6) { animation-name: term-6; }
    @keyframes term-line { 0%, 100% { opacity: 1; } }
    @keyframes term-2 { 0% { opacity: 0; } 12% { opacity: 1; } 95% { opacity: 0; } }
    @keyframes term-3 { 0% { opacity: 0; } 24% { opacity: 1; } 95% { opacity: 0; } }
    @keyframes term-4 { 0% { opacity: 0; } 36% { opacity: 1; } 95% { opacity: 0; } }
    @keyframes term-5 { 0% { opacity: 0; } 48% { opacity: 1; } 95% { opacity: 0; } }
    @keyframes term-6 { 0% { opacity: 0; } 60% { opacity: 1; } 95% { opacity: 0; } }
  }


  /* ---------- Engagement models ---------- */
  .models { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
  .model { padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: var(--s-4); }
  .model .num { font: italic 300 48px/1 var(--serif); color: var(--accent-text); }
  .model h3 { font-size: var(--fs-h3); margin: 0; }
  .model > p { color: var(--muted); }
  .model dl { display: grid; gap: var(--s-3); margin-top: auto; padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: 15px; }
  .model dt { font: 500 var(--fs-label)/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
  .model dd { margin-top: 2px; }

  /* ---------- Process timeline ---------- */
  .process-grid { display: grid; gap: var(--s-7); }
  @media (min-width: 1024px) {
    .process-grid { grid-template-columns: 5fr 7fr; }
    .process-grid .section-head { position: sticky; top: calc(var(--header-h) + 48px); align-self: start; }
  }
  .timeline { position: relative; view-timeline-name: --timeline; }
  .timeline ol { list-style: none; padding: 0; display: grid; gap: var(--s-3); }
  .timeline::before, .timeline-progress { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 2px; border-radius: 2px; }
  .timeline::before { background: var(--line); }
  .timeline-progress { background: linear-gradient(var(--peach-soft), var(--peach)); transform-origin: top; }
  .timeline li { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: var(--s-5); padding: var(--s-4) 0 var(--s-5); }
  .step-num {
    width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
    font: italic 400 20px/1 var(--serif);
    background: var(--peach); color: var(--charcoal); border: 1px solid var(--peach);
    box-shadow: 0 0 0 6px var(--bg);
  }
  .timeline h3 { font-size: var(--fs-h3); margin: 8px 0 var(--s-2); }
  .timeline p { color: var(--muted); max-width: 36em; }
  @supports (animation-timeline: view()) {
    .timeline-progress { animation: progress-fill linear both; animation-timeline: --timeline; animation-range: entry 40% exit 60%; }
    @keyframes progress-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
    .step-num { animation: step-on linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
    @keyframes step-on {
      0%, 99% { background: var(--surface); color: var(--muted); border-color: var(--line-strong); }
      100% { background: var(--peach); color: var(--charcoal); border-color: var(--peach); }
    }
  }

  /* ---------- Estimator ---------- */
  .estimator { display: grid; gap: var(--s-3); }
  @media (min-width: 1024px) { .estimator { grid-template-columns: 7fr 5fr; align-items: start; } }
  .estimator-form { padding: clamp(22px, 3vw, 36px); display: grid; gap: var(--s-6); }
  .estimator-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
  .estimator-form legend { font-weight: 600; margin-bottom: var(--s-3); padding: 0; }
  .estimator-form legend small { color: var(--muted); font-weight: 400; margin-left: var(--s-2); }
  .chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .chip { position: relative; }
  .chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
  .chip span {
    display: inline-flex; align-items: center; gap: var(--s-2);
    min-height: 44px; padding: 0 var(--s-4);
    border-radius: var(--r-pill); border: 1px solid var(--line-strong);
    background: var(--bg); color: var(--muted); font-size: 15px;
    box-shadow: inset 0 1px 0 var(--highlight);
    transition: color var(--t-hover), border-color var(--t-hover), background var(--t-hover), transform var(--t-press);
  }
  .chip span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-strong); transition: background var(--t-hover), border-color var(--t-hover); }
  .chip input[type="checkbox"] + span::before { border-radius: 2px; }
  .chip:hover span { color: var(--text); border-color: var(--muted); }
  .chip input:checked + span { color: var(--text); border-color: var(--accent-text); background: var(--accent-glow); }
  .chip input:checked + span::before { background: var(--accent-text); border-color: var(--accent-text); }
  .chip input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }
  .chip input:active + span { transform: translateY(1px); }

  .estimate {
    position: sticky; top: calc(var(--header-h) + 24px);
    padding: clamp(22px, 3vw, 32px);
    border-radius: var(--r-card);
    border: 1px solid var(--line-strong);
    background: radial-gradient(120% 80% at 100% 0%, rgba(255, 126, 95, 0.22), transparent 60%), var(--bg);
    box-shadow: var(--shadow-card);
  }
  .estimate h3 { font: 500 var(--fs-label)/1.4 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 var(--s-5); }
  .estimate dl { display: grid; gap: var(--s-4); }
  .estimate dt { font-size: 13px; color: var(--muted); }
  .estimate dd { font-size: 17px; margin-top: 2px; }
  .estimate dd.big { font: italic 400 clamp(30px, 3.4vw, 40px)/1.1 var(--serif); color: var(--text); }
  .estimate ol { padding-left: 1.2em; display: grid; gap: 2px; }
  .estimate .fine { font-size: 13px; color: var(--muted); margin: var(--s-5) 0 var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
  .estimate .button { width: 100%; }
  .estimate [data-out] { transition: opacity var(--t-hover); }
  .estimate.is-updating [data-out] { opacity: 0.4; }

  /* ---------- Experience ---------- */
  .stats { list-style: none; padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-bottom: var(--s-3); }
  .stats li { padding: clamp(22px, 3vw, 32px); border-radius: var(--r-card); background: var(--indigo); color: var(--cream); display: grid; gap: var(--s-3); align-content: start; }
  .stats b { font: italic 300 clamp(38px, 4.4vw, 54px)/1.05 var(--serif); color: var(--peach-soft); }
  .stats span { color: #c9c9e8; font-size: 15px; }

  .projects { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
  .project { padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: var(--s-3); }
  .project h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; margin: 0; }
  .project > p:not(.project-tag) { color: var(--muted); font-size: 15px; }
  .project-tag { font: 500 var(--fs-label)/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
  .project-cert ul { padding-left: 1.1em; display: grid; gap: var(--s-2); }

  .stack { margin-top: var(--s-8); }
  .stack h3 { font-size: var(--fs-h3); margin: 0 0 var(--s-4); }
  .stack dl { display: grid; border-top: 1px solid var(--line); }
  .stack dl > div { display: grid; gap: var(--s-1) var(--s-5); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
  @media (min-width: 700px) { .stack dl > div { grid-template-columns: 160px 1fr; } }
  .stack dt { font-weight: 600; }
  .stack dd { color: var(--muted); }

  .case-label { margin: var(--s-8) 0 var(--s-4); }

  /* ---------- Work / case ---------- */
  .case { display: grid; gap: var(--s-6); padding: clamp(24px, 4vw, 56px); overflow: hidden; }
  @media (min-width: 900px) { .case { grid-template-columns: 7fr 5fr; align-items: center; } }
  .case-head { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); }
  .case-head h3 { font-size: clamp(24px, 3vw, 34px); letter-spacing: 0.08em; font-weight: 700; margin: 0; }
  .case-head p { color: var(--muted); font-size: 15px; }
  .case dl { display: grid; gap: var(--s-5); }
  @media (min-width: 600px) { .case dl { grid-template-columns: 1fr 1fr; } }
  .case dt { font: 500 var(--fs-label)/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-text); margin-bottom: var(--s-2); }
  .case dd { color: var(--muted); font-size: 15px; }
  .case .buttons { margin-bottom: 0; }

  .case-phone {
    justify-self: center;
    width: 250px; height: 500px; border-radius: 44px; padding: 12px;
    background: linear-gradient(160deg, #4a5061, var(--charcoal));
    border: 1px solid rgba(47, 53, 66, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 50px 80px -30px rgba(47, 53, 66, 0.55), 0 0 120px -30px rgba(255, 126, 95, 0.45);
    transform: perspective(1200px) rotateY(-14deg) rotateX(4deg);
    transition: transform 600ms var(--ease);
  }
  .case:hover .case-phone { transform: perspective(1200px) rotateY(-6deg) rotateX(2deg); }
  .case-screen { height: 100%; border-radius: 34px; background: #000; padding: 48px 18px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; position: relative; }
  .case-screen::before { content: ""; position: absolute; top: 12px; width: 84px; height: 24px; border-radius: 14px; background: #111; }
  .case-screen .sign { width: 96px; height: 96px; border-width: 10px; font-size: 32px; }
  .case-speed { color: #f5f5f5; font-size: 72px; font-weight: 700; font-stretch: 80%; line-height: 1; letter-spacing: -0.03em; margin-top: 8px; }
  .case-speed small { display: block; font-size: 12px; font-weight: 500; font-stretch: 100%; letter-spacing: 0.12em; color: #a9adb6; text-transform: uppercase; margin-top: 6px; }
  .case-bar { width: 100%; height: 6px; border-radius: 3px; background: #222; overflow: hidden; margin-top: auto; }
  .case-bar i { display: block; height: 100%; width: 62%; background: #30d158; border-radius: inherit; }
  .case-meta { width: 100%; display: flex; justify-content: space-between; font-size: 11px; color: #a9adb6; }

  .placeholder-note { margin-top: var(--s-4); font-size: 14px; color: var(--muted); }

  /* ---------- FAQ ---------- */
  .faq-grid { display: grid; gap: var(--s-6); }
  @media (min-width: 1024px) {
    .faq-grid { grid-template-columns: 5fr 7fr; }
    .faq-grid .section-head { position: sticky; top: calc(var(--header-h) + 48px); }
  }
  .faq-list { border-top: 1px solid var(--line); }
  .faq-list summary { font-size: 18px; padding: var(--s-5) 0; }

  /* ---------- Contact ---------- */
  .contact { display: grid; gap: var(--s-3); }
  @media (min-width: 1024px) { .contact { grid-template-columns: 5fr 7fr; } }
  .contact-info { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: var(--s-5); background: radial-gradient(120% 80% at 0% 0%, rgba(255, 126, 95, 0.2), transparent 60%), var(--bg); }
  .contact-info h2 { font-size: var(--fs-h2); font-weight: 500; font-stretch: 90%; letter-spacing: -0.03em; line-height: 1.02; margin: 0; }
  .contact-info > p:not(.eyebrow) { color: var(--muted); }
  .copy-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-3); border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
  .copy-row a { font-size: 15px; text-decoration: none; overflow-wrap: anywhere; flex: 1; min-width: 0; padding-left: var(--s-2); }
  .copy-button { min-height: 36px; padding: 0 var(--s-3); border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 13px; transition: border-color var(--t-hover), color var(--t-hover); }
  .copy-button:hover { border-color: var(--accent-text); }
  .copy-button[data-copied] { color: var(--accent-text); border-color: var(--accent-text); }
  .contact-info address { font-style: normal; color: var(--muted); font-size: 15px; margin-top: auto; }

  .contact-form { padding: clamp(24px, 3vw, 40px); display: grid; gap: var(--s-4); grid-template-columns: 1fr 1fr; }
  .field { display: grid; gap: 6px; grid-column: span 2; }
  @media (min-width: 600px) { .field.half { grid-column: span 1; } }
  .field label { font-size: 14px; color: var(--muted); }
  .field input, .field select, .field textarea {
    width: 100%; min-height: 48px; padding: 12px 14px;
    border-radius: 12px; border: 1px solid var(--line-strong);
    background: #fff; color: var(--text);
    box-shadow: inset 0 1px 3px rgba(47, 53, 66, 0.08);
    transition: border-color var(--t-hover), box-shadow var(--t-hover);
  }
  .field textarea { min-height: 140px; resize: vertical; }
  .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--accent-text); box-shadow: inset 0 1px 3px rgba(47, 53, 66, 0.08), 0 0 0 4px var(--accent-glow); }
  .form-foot { grid-column: span 2; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
  .form-foot p { font-size: 13px; color: var(--muted); max-width: 30em; }
}

@layer utilities {
  /* Header collapses to the menu button; lives here so it wins over .button in components */
  @media (max-width: 899px) {
    .site-header .nav, .site-header .header-cta { display: none; }
    .menu-button { display: inline-flex; }
  }

  .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  }
}
