  /* ============================================================
     Shared base + component rules (home + service pages)
     Tokens live in tokens.css. Page-specific rules stay in the
     per-page sheet. 2026 base first, then the theme-transition
     keyframes, then 1998 chrome.
     ============================================================ */
/* === Cross-document View Transitions opt-in (motion-gated) === */
  @media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
  }

  /* ============================================================
     Base
     ============================================================ */
  *, *::before, *::after { box-sizing: border-box; }

  html {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-feature-settings: "ss01", "ss02", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    /* Anchor landings clear the fixed nav (which grows with the notch inset) */
    scroll-padding-top: 90px;
    scroll-padding-top: calc(90px + env(safe-area-inset-top));
  }

  body {
    margin: 0;
    min-height: 100dvh;
    overflow-x: clip;
    line-height: 1.55;
    font-size: 1rem;
  }

  /* Ambient glow on a real fixed layer; iOS ignores background-attachment:
     fixed. body must stay backgroundless (html paints the base color): this
     sits at z-index -1, and any body background would paint over it. */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(1200px 700px at 80% -10%, rgba(231, 211, 168, 0.04), transparent 60%),
      radial-gradient(900px 600px at -10% 30%, rgba(150, 180, 255, 0.025), transparent 60%);
  }

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

  a { color: inherit; text-decoration: none; }
  a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

  /* skip link */
  .skip {
    position: absolute; top: -100px; left: 1rem;
    background: var(--accent); color: var(--on-accent);
    padding: 0.5rem 0.9rem; border-radius: 6px;
    font-family: var(--mono); font-size: 0.8rem; z-index: 100;
    transition: top 0.2s var(--ease-out);
  }
  .skip:focus { top: 1rem; }

  /* Typography */
  h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.02em; }

  .eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 500;
  }

  .eyebrow::before {
    content: "";
    display: inline-block;
    width: 24px; height: 1px;
    background: currentColor;
    vertical-align: middle;
    margin-right: 0.7em;
    transform: translateY(-1px);
  }

  /* Layout */
  .wrap {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding-inline: var(--gutter);
    padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  }

  /* ============================================================
     Nav
     ============================================================ */
  .nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s, border-color 0.3s;
  }

  .nav__inner {
    padding-block: 1.1rem;
    padding-top: max(1.1rem, calc(0.5rem + env(safe-area-inset-top)));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .nav__brand {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    display: flex; align-items: center; gap: 0.6em;
    transition: color 0.3s;
  }
  .nav__brand:hover { color: var(--text); }
  .nav__brand::before {
    content: "";
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 14px var(--accent-glow);
  }

  .nav__right {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.4vw, 1.75rem);
  }

  .nav__links {
    display: flex; gap: clamp(0.85rem, 1.45vw, 1.8rem);
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-dim);
  }
  .nav__links a {
    position: relative;
    padding: 0.4em 0;
    transition: color 0.2s;
  }
  .nav__links a::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 1px; background: var(--accent);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.4s var(--ease-out);
  }
  .nav__links a:hover { color: var(--text); }
  .nav__links a:hover::after { transform: scaleX(1); }
  .nav__links a[aria-current="page"] { color: var(--text); }
  .nav__links a[aria-current="page"]::after { transform: scaleX(1); }

  .nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    cursor: pointer;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.3s, color 0.3s;
  }
  .nav__toggle:hover { border-color: var(--border-2); color: var(--text); }
  .nav__toggle svg {
    width: 16px; height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .nav__toggle__close { display: none; }
  .nav--open .nav__toggle__open { display: none; }
  .nav--open .nav__toggle__close { display: inline-block; }

  @media (max-width: 760px) {
    .nav__links {
      display: none;
      position: fixed;
      inset: 0;
      background: var(--bg);
      flex-direction: column;
      align-items: center;
      justify-content: center;
      justify-content: safe center;
      gap: 2.5rem;
      font-size: 1rem;
      z-index: 49;
      /* Sits under the fixed bar (z-index 49 < 50); top padding clears it so the
         layout survives nav-height changes, and overflow keeps landscape scrollable. */
      padding: calc(110px + env(safe-area-inset-top)) 1.5rem calc(2.5rem + env(safe-area-inset-bottom));
      overflow-y: auto;
      overscroll-behavior: contain;
    }
    .nav--open .nav__links {
      display: flex;
    }
    .nav--open .nav__brand,
    .nav--open .era-toggle,
    .nav--open .nav__toggle,
    .nav--open .theme-toggle {
      position: relative;
      z-index: 60;
    }
    .nav__toggle { display: inline-flex; }
  }

  .noscript-nav {
    display: none;
  }
  @media (max-width: 760px) {
    .noscript-nav {
      display: flex;
      flex-wrap: wrap;
      gap: 0.7rem 1rem;
      padding: calc(5.25rem + env(safe-area-inset-top)) var(--gutter) 1rem;
      border-bottom: 1px solid var(--border);
      background: var(--bg);
      font-family: var(--mono);
      font-size: 0.78rem;
      color: var(--text-dim);
    }
    .noscript-nav__label {
      flex-basis: 100%;
      color: var(--text-faint);
      text-transform: uppercase;
      letter-spacing: 0.12em;
    }
    .noscript-nav a {
      color: var(--text);
      text-decoration: underline;
      text-underline-offset: 0.22em;
    }
  }

  @media (max-width: 760px) and (max-height: 540px) {
    .nav__links { justify-content: flex-start; }
  }

  /* ============================================================
     Theme toggle + era toggle
     ============================================================ */
  .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    cursor: pointer;
    font: inherit;
    transition: border-color 0.3s var(--ease-out), color 0.3s, background 0.3s, transform 0.3s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
  }
  .theme-toggle:hover {
    border-color: var(--border-2);
    color: var(--text);
    background: var(--surface);
  }
  .theme-toggle:active { transform: scale(0.94); }
  .theme-toggle svg {
    width: 16px; height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .theme-toggle__moon { display: none; }
  [data-theme="light"] .theme-toggle__sun  { display: none; }
  [data-theme="light"] .theme-toggle__moon { display: inline-block; }

  .era-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.3s var(--ease-out), background 0.3s, border-color 0.3s, color 0.3s;
    -webkit-tap-highlight-color: transparent;
  }
  .era-toggle:hover {
    transform: translateY(-1px);
    background: var(--accent-2);
    border-color: var(--accent-2);
  }
  .era-toggle:active { transform: scale(0.96); }
  .era-toggle__label--2026 { display: none; }
  [data-era="1998"] .era-toggle__label--1998 { display: none; }
  [data-era="1998"] .era-toggle__label--2026 { display: inline; }
  .era-toggle__short { display: none; }
  .era-marquee,
  .era-stats { display: none; }

  .no-js .era-toggle,
  .no-js .theme-toggle,
  .no-js .nav__toggle {
    display: none;
  }

  /* ============================================================
     Footer
     ============================================================ */
  .footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-faint);
    letter-spacing: 0.06em;
  }

  .footer__line { color: var(--text-dim); }

  .retro-badges { display: none; }
  .retro-badge { color: inherit; }

  /* ============================================================
     Reduced motion
     ============================================================ */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* Circle-wipe theme transition from the toggle position */
  @keyframes themeCircleIn {
    from { clip-path: circle(0px at var(--theme-x, 50%) var(--theme-y, 50%)); }
    to   { clip-path: circle(var(--theme-r, 150vmax) at var(--theme-x, 50%) var(--theme-y, 50%)); }
  }
  html.theme-transitioning::view-transition-old(root) {
    animation: none;
    z-index: 0;
  }
  html.theme-transitioning::view-transition-new(root) {
    animation: themeCircleIn 0.6s var(--ease-out) both;
    z-index: 1;
  }

  /* ============================================================
     1998 mode chrome (shared)
     ============================================================ */
  html[data-era="1998"] {
    background: #000080;
    color-scheme: dark;
    font-feature-settings: normal;
    scroll-behavior: auto;
  }

  [data-era="1998"] body {
    background: transparent;
    color: #ffff00;
    font-size: 16px;
  }

  [data-era="1998"] body::before {
    background:
      repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.08) 1px, transparent 1px, transparent 4px),
      radial-gradient(900px 520px at 50% 0%, rgba(0,255,255,0.14), transparent 65%);
    opacity: 0.34;
  }

  [data-era="1998"] a {
    color: #00ffff;
    text-decoration: underline;
  }

  [data-era="1998"] .reveal,
  [data-era="1998"] .reveal-stagger > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  [data-era="1998"] .nav {
    position: sticky;
    background: #c0c0c0;
    border-bottom: 3px ridge #ffffff;
    color: #000000;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  [data-era="1998"] .nav__inner {
    padding-block: 0.35rem;
    gap: 0.6rem;
  }

  [data-era="1998"] .nav__brand {
    color: #000080;
    font-weight: 700;
    letter-spacing: 0;
  }
  [data-era="1998"] .nav__brand::before {
    width: 10px;
    height: 10px;
    border-radius: 0;
    background: #ff0000;
    box-shadow: none;
  }

  [data-era="1998"] .nav__links {
    gap: 0.8rem;
    color: #000000;
    letter-spacing: 0;
  }
  [data-era="1998"] .nav__links a {
    color: #000080;
    padding: 0.25rem 0;
  }
  [data-era="1998"] .nav__links a::after {
    display: none;
  }

  [data-era="1998"] h1,
  [data-era="1998"] h2,
  [data-era="1998"] h3 {
    letter-spacing: 0;
  }

  [data-era="1998"] .theme-toggle {
    display: none;
  }

  [data-era="1998"] .nav__toggle,
  [data-era="1998"] .era-toggle {
    min-height: 34px;
    border: 2px outset #ffffff;
    border-radius: 0;
    background: #c0c0c0;
    color: #000000;
    box-shadow: none;
    font-weight: 700;
    letter-spacing: 0;
  }

  [data-era="1998"] .era-marquee {
    display: block;
    width: min(760px, calc(100% - 2rem));
    margin: 0 auto 0.75rem;
    padding: 0.2rem 0;
    border: 2px inset #ffffff;
    background: #ffff00;
    color: #000080;
    font-family: var(--mono);
    font-size: 0.86rem;
    font-weight: 700;
    overflow: hidden;
    text-align: left; /* left so the scrolling span starts fully off the right edge */
    white-space: nowrap;
  }

  /* Real scrolling marquee: the text slides right-to-left so it never clips,
     regardless of viewport width (the old static bar truncated on mobile). */
  [data-era="1998"] .era-marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: era-marquee-scroll 16s linear infinite;
  }
  @keyframes era-marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
  }
  @media (prefers-reduced-motion: reduce) {
    /* No motion: show the full text statically, wrapping so nothing truncates. */
    [data-era="1998"] .era-marquee { white-space: normal; text-align: center; }
    [data-era="1998"] .era-marquee span { display: inline; padding-left: 0; animation: none; }
  }

  [data-era="1998"] .era-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    font-family: var(--mono);
    font-size: 0.85rem;
  }

  [data-era="1998"] .era-stat {
    border: 2px inset #c0c0c0;
    background: #000000;
    color: #00ff00;
    padding: 0.3rem 0.55rem;
  }

  [data-era="1998"] .footer__inner {
    color: #ffffff;
  }

  [data-era="1998"] .retro-badges {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    padding-top: 0.75rem;
  }

  [data-era="1998"] .retro-badge {
    border: 2px outset #ffffff;
    background: #c0c0c0;
    color: #000000;
    padding: 0.3rem 0.55rem;
    text-decoration: none;
  }

  [data-era="1998"] a.retro-badge {
    color: #000080;
    text-decoration: underline;
  }

  @media (max-width: 760px) {
    .era-toggle__full { display: none; }
    .era-toggle__short { display: inline; }
    [data-era="1998"] .nav__links {
      background: #c0c0c0;
      border: 4px ridge #ffffff;
      color: #000000;
      gap: 1.4rem;
    }
    [data-era="1998"] .nav__links a {
      color: #000080;
      font-size: 1rem;
    }
  }
