@layer base {
  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--body-font);
    font-size: 1.125rem;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
  }

  body[data-edition="modern"] {
    background:
      radial-gradient(1200px 600px at 85% -10%, rgb(57 243 255 / 0.12), transparent 60%),
      radial-gradient(900px 600px at -10% 30%, rgb(255 61 242 / 0.08), transparent 60%),
      repeating-linear-gradient(118deg, transparent 0 140px, rgb(120 160 255 / 0.035) 140px 141px),
      linear-gradient(180deg, #060a18, var(--bg) 40%);
    background-color: var(--bg);
    background-attachment: fixed;
  }

  /* Rec-room wood paneling: grain, planks, and a warm vignette. */
  body[data-edition="vintage"] {
    background:
      radial-gradient(ellipse at 50% 0%, rgb(255 220 160 / 0.18), transparent 65%),
      var(--wood-grain),
      repeating-linear-gradient(90deg, rgb(0 0 0 / 0.28) 0 2px, transparent 2px 180px),
      linear-gradient(90deg, #6e4527, #7d5030 30%, #6a4224 60%, #7a4e2e);
    background-color: var(--bg);
    background-attachment: fixed;
  }

  a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: 3px solid var(--neon); outline-offset: 3px; border-radius: 4px; }

  h1, h2, h3 {
    font-family: var(--heading-font);
    font-style: var(--heading-style);
    font-weight: var(--heading-weight);
    line-height: 1.05;
  }

  abbr[title] { text-decoration: none; cursor: help; }
  small { font-size: 0.8em; color: var(--ink-muted); }
}

@layer layout {
  .page {
    flex: 1;
    width: min(1240px, 100% - 2rem);
    margin-inline: auto;
    padding-block: var(--space-6) var(--space-8);
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px) saturate(1.4);
  }

  [data-edition="modern"] .site-header {
    background: rgb(4 6 13 / 0.78);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgb(57 243 255 / 0.25), 0 10px 30px rgb(0 0 0 / 0.4);
  }

  /* Vintage header: cream stock with the red-and-blue pinstripes of a 70s wrapper. */
  [data-edition="vintage"] .site-header {
    background:
      linear-gradient(var(--neon) 0 0) bottom / 100% 4px no-repeat,
      linear-gradient(var(--neon-hot) 0 0) bottom 6px left 0 / 100% 2px no-repeat,
      var(--noise-light),
      var(--surface);
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.35);
  }

  .site-header__inner {
    width: min(1240px, 100% - 2rem);
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding-block: var(--space-3);
    flex-wrap: wrap;
  }

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

  .brand__mark {
    display: grid;
    place-items: center;
    width: 2.4rem;
    aspect-ratio: 1;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: linear-gradient(135deg, #d9dde8, #fff 30%, #8d93a8 55%, #f1f3fa 75%, #9aa0b5);
    color: #060a18;
    font: 900 0.95rem/1 var(--font-label);
  }

  [data-edition="vintage"] .brand__mark {
    clip-path: circle(50%);
    background: var(--neon);
    color: var(--surface);
    font-family: var(--font-collegiate);
  }

  .brand__name {
    font: italic 900 1.5rem/1 var(--font-display);
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  [data-edition="vintage"] .brand__name { font: 400 1.4rem/1 var(--font-slab); font-style: normal; }

  .brand__season {
    font: 600 0.75rem/1 var(--label-font);
    color: var(--ink-muted);
    letter-spacing: 0.08em;
  }

  .site-nav { display: flex; gap: var(--space-1); flex-wrap: wrap; flex: 1; }

  .site-nav__link {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: var(--ink-muted);
    text-decoration: none;
    font: 600 0.95rem/1.2 var(--body-font);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

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

  .site-nav__link.is-active {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--neon);
    border-radius: 0;
  }

  /* The vintage serif runs wider than the modern face: set tighter so the links fit one row. */
  [data-edition="vintage"] .site-nav__link { font-size: 0.88rem; letter-spacing: 0.03em; padding-inline: 0.55rem; }

  .site-search__input {
    width: 13rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
  }

  .site-footer {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.95rem;
    border-top: 1px solid var(--line);
  }

  [data-edition="vintage"] .site-footer { color: #f3e8cf; border-color: rgb(255 255 255 / 0.15); }
  .site-footer__fine { font-size: 0.85rem; opacity: 0.75; }
}

@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@layer layout {
  .site-nav__link { white-space: nowrap; }

  /* Just under full width: tighten so brand, links, and search still share one row. */
  @media (min-width: 1161px) and (max-width: 1279px) {
    .site-header__inner { gap: var(--space-4); }
    .brand__season { display: none; }
    .site-search__input { width: 10rem; }
    .site-nav__link { padding-inline: 0.5rem; letter-spacing: 0.03em; }
  }

  /* Narrower: brand and search on top, the links on their own row below, never wrapping. The
     links scroll sideways if they must; the fade at the edge says there's more. */
  @media (max-width: 1160px) {
    .site-header__inner { gap: var(--space-2) var(--space-4); }
    .site-nav {
      order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -0.5rem;
      padding-inline-end: 2.5rem;
      mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
    }
    .site-search { margin-left: auto; }
  }

  @media (max-width: 760px) {
    .site-header { position: static; }
    .site-search { flex: 1; }
    .site-search__input { width: 100%; }
    .brand__season { display: none; }
  }
}
