/* ==========================================================================
   Bragi landing page
   1. Fonts   2. Tokens   3. Base   4. Components   5. Sections
   6. Responsive   7. Motion
   ========================================================================== */

/* 1. Fonts --------------------------------------------------------------- */
@font-face {
  font-family: "Clash Display";
  src: url("../assets/fonts/clash-display.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../assets/fonts/satoshi.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  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;
}

/* 2. Tokens -------------------------------------------------------------- */
:root {
  --bg-canvas: #0a0a0c;
  --bg-card: #111114;
  --bg-raised: #18181b;
  --ink-primary: #fafafa;
  --ink-secondary: #a1a1aa;
  --ink-muted: #8b8b94;
  --hairline: rgba(255, 255, 255, 0.07);
  --accent: #f43f5e;
  --accent-fill: #e11d48;
  --accent-fill-hover: #be123c;
  --accent-tint: rgba(244, 63, 94, 0.14);

  --font-display: "Clash Display", "Satoshi", system-ui, "Segoe UI", sans-serif;
  --font-sans: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* ≈ expo.out */
  --content-max: 1280px;
  color-scheme: dark;
}

/* 3. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; }
img { max-width: 100%; height: auto; }
a { color: var(--ink-secondary); text-decoration: none; }
a:hover { color: var(--ink-primary); }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
h1, h2, h3, p, dl, dd, figure { margin: 0; }
section[id] { scroll-margin-top: 24px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent-fill);
  color: #fff;
  font-weight: 600;
}
.skip-link:focus { top: 16px; color: #fff; }

.wrap { width: 100%; max-width: var(--content-max); margin: 0 auto; }
.section { padding-left: 32px; padding-right: 32px; }

.display { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.005em; }
.eyebrow {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.h2 { font-size: clamp(36px, 4.4vw, 56px); line-height: 1.04; }
.mono { font-family: var(--font-mono); }

/* 4. Components ---------------------------------------------------------- */
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink-primary); }
.logo-word { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; }

.btn {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  font-size: 16px;
  transition: background-color 160ms ease, color 160ms ease;
}
.btn-primary { gap: 10px; background: var(--accent-fill); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-fill-hover); color: #fff; }
.btn-ghost {
  gap: 8px;
  color: var(--ink-secondary);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.btn-ghost:hover { background: var(--bg-raised); color: var(--ink-primary); }
.btn-lg { height: 52px; padding: 0 22px; }
.btn-ghost.btn-lg { padding: 0 20px; }

/* Download split button (OS-aware) -------------------------------------- */
/* <html data-os> is set by the inline script in <head> before first paint.
   Windows / mobile / unknown / no-JS: normal download. macOS & Linux: disabled
   "Coming soon" main button; the chevron menu still offers the Windows build. */
.dl { position: relative; display: inline-flex; }
.dl-main { gap: 10px; font-weight: 600; border-radius: 12px 0 0 12px; }
.dl-hero .dl-main { height: 52px; padding: 0 22px; }
.dl-lg .dl-main { height: 56px; padding: 0 26px; font-size: 17px; }
.dl-toggle {
  justify-content: center;
  width: 48px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 0 12px 12px 0;
  background: var(--accent-fill);
  color: #fff;
  cursor: pointer;
  font: inherit;
}
.dl-lg .dl-toggle { width: 52px; }
.dl-toggle:hover, .dl-toggle[aria-expanded="true"] { background: var(--accent-fill-hover); }
.dl-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dl-toggle svg { transition: transform 200ms var(--ease-out); }
.dl-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.dl-soon, .os-mac, .os-linux { display: none; }
.dl-soon {
  border: 0;
  font-family: inherit;
  background: var(--bg-raised);
  color: var(--ink-muted);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}
[data-os="mac"] .dl-win, [data-os="linux"] .dl-win { display: none; }
[data-os="mac"] .dl-soon, [data-os="linux"] .dl-soon { display: inline-flex; }
[data-os="mac"] .os-mac, [data-os="linux"] .os-linux { display: inline; }
.dl-soon .os-mac svg, .dl-soon .os-linux svg { display: inline-block; vertical-align: -3px; }

.dl-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 100%;
  width: max-content;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  text-align: left;
}
.dl-menu[hidden] { display: none; }
.dl.is-up .dl-menu { top: auto; bottom: calc(100% + 8px); }
.dl-menu [role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}
.dl-menu [role="menuitem"] > span { display: flex; flex-direction: column; flex: 1; }
.dl-menu small { font-size: 12px; font-weight: 400; line-height: 16px; color: var(--ink-muted); }
.dl-menu a[role="menuitem"]:hover, .dl-menu a[role="menuitem"]:focus-visible { background: var(--bg-raised); color: var(--ink-primary); outline: none; }
.dl-menu [aria-disabled="true"] { color: var(--ink-secondary); cursor: not-allowed; }
.dl-menu em {
  margin-left: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--ink-secondary);
  font: 500 11px/16px var(--font-mono);
  font-style: normal;
}
.dl-menu .dl-sep { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--hairline); }
.dl-menu svg { flex: none; }

/* 5. Sections ------------------------------------------------------------ */

/* Nav */
.site-header {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 6px 6px 6px 16px;
  border-radius: 14px;
  background: rgba(17, 17, 20, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.nav .logo { margin-right: 12px; }
.nav .logo-word { font-size: 17px; }
.nav-link { font-size: 14px; font-weight: 500; padding: 10px 12px; border-radius: 10px; }
.nav-cta {
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  margin-left: 4px;
  border-radius: 10px;
  font-size: 14px;
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 960px;
  /* no overflow clip: .hero-ascii clips its own art, and the download menu must hang below */
}
.hero-ascii {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 560px;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 20%, transparent 72%);
}
.hero-glow {
  position: absolute;
  left: 50%;
  top: -180px;
  width: 1300px;
  height: 720px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(244, 63, 94, 0.55), rgba(225, 29, 72, 0.22) 45%, rgba(225, 29, 72, 0) 100%);
  filter: blur(20px);
}
.ascii {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  margin: 0;
  font: 500 20px/24px var(--font-mono);
  white-space: pre;
}
.ascii-base { font-weight: 400; color: rgba(250, 250, 250, 0.16); }
.ascii-dense { color: rgba(255, 228, 232, 0.72); }
.ascii-accent { color: var(--accent); }

.hero-inner {
  position: relative;
  z-index: 2; /* keeps the download menu above the next section */
  padding: 0 32px 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
}
.hero-copy { flex: 1 1 560px; min-width: 0; max-width: 760px; }
.hero-kicker {
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-secondary);
}
.hero-title { font-size: clamp(52px, 8vw, 112px); line-height: 1; }
.hero-title .line-mask { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .line { display: block; }
.hero-lede { margin-top: 24px; max-width: 540px; font-size: 18px; line-height: 28px; color: var(--ink-secondary); }
.hero-ctas { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 16px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }

.stats { display: flex; gap: 40px; }
.stat-v { font-family: var(--font-display); font-weight: 500; font-size: 44px; line-height: 1; letter-spacing: 0.01em; }
.stat dd { margin-top: 8px; font-size: 14px; color: var(--ink-muted); }

/* App shots */
.app { position: relative; padding-top: 64px; padding-bottom: 120px; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.section-head > div { max-width: 620px; }
.section-head > p { max-width: 420px; font-size: 16px; line-height: 24px; color: var(--ink-secondary); }
.shot {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 40px 120px -40px rgba(225, 29, 72, 0.35), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.shot img { width: 100%; }
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  margin-top: 32px;
}
.shot-card { display: flex; flex-direction: column; gap: 14px; }
.shot-frame {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}
.shot-frame img { width: 100%; }
.shot-card figcaption strong { display: block; font-size: 16px; font-weight: 700; color: var(--ink-primary); }
.shot-card figcaption span { display: block; margin-top: 4px; font-size: 14px; line-height: 21px; color: var(--ink-secondary); }

/* Features */
.features { padding-top: 40px; padding-bottom: 120px; }
.features .h2 { margin-bottom: 40px; max-width: 760px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}
.feature {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--hairline);
}
.feature h3 { margin-bottom: 6px; font-size: 18px; font-weight: 700; }
.feature p { font-size: 15px; line-height: 22px; color: var(--ink-secondary); }
.feature .footnote { margin-top: 10px; font: 400 11px/16px var(--font-mono); color: var(--ink-muted); }
.visual { box-sizing: content-box; height: 120px; border-radius: 12px; background: var(--bg-canvas); }

.v-eq { display: flex; align-items: flex-end; gap: 8px; padding: 16px; }
.v-eq span {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transform-origin: 50% 100%;
}

.v-lyrics {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  overflow: hidden;
  font-family: var(--font-display);
  white-space: nowrap;
}
.v-lyrics .l1 { font-weight: 500; font-size: 15px; color: var(--ink-muted); opacity: 0.6; }
.v-lyrics .l2 { font-weight: 600; font-size: 19px; color: var(--ink-primary); }
.v-lyrics .l3 { font-weight: 500; font-size: 15px; color: var(--ink-secondary); }

.v-center { display: flex; align-items: center; justify-content: center; }
.v-col { flex-direction: column; gap: 10px; }
.chip-private {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--bg-raised);
  color: var(--ink-primary);
  font-size: 15px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.chip-codec {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--accent-tint);
  color: var(--accent);
  font: 500 14px/1 var(--font-mono);
}
.codec-meta { font: 400 13px/1 var(--font-mono); color: var(--ink-muted); }

.v-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  padding: 16px 12px;
  text-align: center;
}
.v-stats > div:nth-child(2) { border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline); }
.v-stats b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1; color: var(--ink-primary); }
.v-stats b.accent { color: var(--accent); }
.v-stats small { display: block; margin-top: 6px; font: 400 11px/14px var(--font-mono); color: var(--ink-muted); }

.v-queue { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 12px 16px; }
.q-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 13px; color: var(--ink-secondary); }
.q-row.is-playing { border-radius: 8px; background: var(--accent-tint); color: var(--accent); font-weight: 500; }
.q-art { flex: none; width: 24px; height: 24px; border-radius: 5px; }
.q-art.a1 { background: linear-gradient(135deg, #1e3a8a, #312e81); }
.q-art.a2 { background: linear-gradient(135deg, #14532d, #052e16); }
.q-radio { display: flex; align-items: center; gap: 8px; padding: 0 8px; font-size: 12px; color: var(--ink-muted); }

/* Everything else list */
.more-title { margin: 48px 0 16px; font-size: 18px; font-weight: 700; }
.more-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.more-list li { padding: 16px 0; border-top: 1px solid var(--hairline); }
.more-list h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.more-list h3::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.more-list p { font-size: 14px; line-height: 20px; color: var(--ink-secondary); }

/* Why native comparison */
.compare { padding-top: 40px; padding-bottom: 80px; }
.compare-inner { max-width: 1080px; margin: 0 auto; }
.compare-lede { margin: 20px 0 32px; max-width: 620px; font-size: 17px; line-height: 27px; color: var(--ink-secondary); }
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--hairline);
  font-size: 15px;
  line-height: 22px;
  text-align: left;
}
.compare-table th, .compare-table td { padding: 16px 20px; vertical-align: top; border-top: 1px solid var(--hairline); }
.compare-table thead th, .compare-table thead td { border-top: 0; font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.compare-table thead th:nth-child(2) { color: var(--accent); }
.compare-table tbody th { width: 18%; font-weight: 700; color: var(--ink-primary); }
.compare-table tbody td:nth-child(2) { color: var(--ink-primary); }
.compare-table tbody td:nth-child(3) { color: var(--ink-muted); }
.compare-note { margin-top: 12px; font: 400 12px/18px var(--font-mono); color: var(--ink-muted); }

/* Story */
.story { padding-top: 80px; padding-bottom: 120px; }
.story-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.rune-tile {
  flex: 0 0 auto;
  width: 180px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--hairline), 0 30px 80px -30px rgba(225, 29, 72, 0.45);
}
.story-copy { flex: 1 1 420px; min-width: 0; }
.story .h2 { font-size: clamp(34px, 4vw, 52px); }
.story-text { margin-top: 20px; font-size: 17px; line-height: 27px; color: var(--ink-secondary); }
.story-cite { margin-top: 16px; font: 400 13px/18px var(--font-mono); color: var(--ink-muted); }

/* FAQ */
.faq { padding-top: 40px; padding-bottom: 40px; }
.faq-inner { max-width: 820px; margin: 0 auto; }
.faq .h2 { margin-bottom: 24px; font-size: clamp(32px, 3.6vw, 44px); }
.faq-list { border-bottom: 1px solid var(--hairline); }
.faq details { border-top: 1px solid var(--hairline); padding: 20px 0; }
.faq summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 17px;
  line-height: 24px;
  font-weight: 700;
  color: var(--ink-primary);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::marker { content: ""; }
.faq summary:hover span { color: #fff; }
.faq-ico { flex: none; transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1); }
.faq details[open] .faq-ico { transform: rotate(45deg); }
.faq details p { margin: 12px 36px 0 0; font-size: 16px; line-height: 25px; color: var(--ink-secondary); }

/* Download */
.download { position: relative; padding-top: 140px; padding-bottom: 40px; text-align: center; }
.download-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.download h2 { font-size: clamp(44px, 6vw, 84px); line-height: 1; }
.download-lede { margin-top: 24px; max-width: 460px; font-size: 18px; line-height: 28px; color: var(--ink-secondary); }
.download .dl { margin-top: 36px; }
.download-meta { margin-top: 16px; font: 400 13px/18px var(--font-mono); color: var(--ink-muted); }

/* Footer */
.site-footer {
  position: relative;
  min-height: 780px;
  padding-top: 72px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  overflow: hidden;
}
.plx-layers { position: absolute; inset: 0; pointer-events: none; }
.plx {
  position: absolute;
  left: 0;
  top: -40px;
  width: 100%;
  max-width: none;
  height: calc(100% + 40px);
  object-fit: cover;
  object-position: center bottom;
}
.footer-fade {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 360px;
  background: linear-gradient(to bottom, #0a0a0c 0%, rgba(10, 10, 12, 0.85) 40%, rgba(10, 10, 12, 0) 100%);
  pointer-events: none;
}
.footer-top { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 48px; }
.footer-brand { max-width: 360px; }
.footer-brand .logo { display: inline-flex; gap: 10px; }
.footer-brand .logo-word { font-size: 24px; }
.footer-brand p { margin-top: 16px; font-size: 16px; line-height: 24px; color: var(--ink-secondary); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 64px; }
.footer-nav nav { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.footer-nav .title { font-weight: 700; color: var(--ink-primary); }
.footer-bottom {
  position: relative;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-secondary);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

/* 6. Responsive ---------------------------------------------------------- */
@media (max-width: 760px) {
  .nav-link { display: none; }
  .hero { min-height: 0; padding-top: 300px; }
  .hero-ascii { height: 360px; }
  .hero-glow { top: -120px; width: 700px; height: 440px; }
  .hero-inner { padding: 0 20px 48px; gap: 36px; }
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; }
  .stat-v { font-size: 26px; }
  .hero-ctas > .btn, .hero-ctas > .dl { flex: 1 1 100%; justify-content: center; }
  .dl-main { flex: 1 1 auto; justify-content: center; }
  .dl-menu { min-width: 0; right: 0; }
  .section { padding-left: 20px; padding-right: 20px; }
  .compare-table thead { display: none; }
  .compare-table, .compare-table tbody, .compare-table tr { display: block; }
  .compare-table tr { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hairline); }
  .compare-table tr:first-child { border-top: 0; }
  .compare-table th, .compare-table td { border-top: 0; padding: 12px 16px; }
  .compare-table tbody th { grid-column: 1 / -1; width: auto; padding-bottom: 0; }
  .compare-table tbody td::before { display: block; margin-bottom: 2px; font: 500 11px/14px var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
  .compare-table tbody td:nth-child(2)::before { content: "Bragi"; color: var(--accent); }
  .compare-table tbody td:nth-child(3)::before { content: "Wrappers"; }
}

/* 7. Motion -------------------------------------------------------------- */
@keyframes eq { from { transform: scaleY(0.22); } to { transform: scaleY(1); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise, 24px)); } }
@keyframes line-up { from { transform: translateY(110%); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-24px); } }

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

@media (prefers-reduced-motion: no-preference) {
  /* Equalizer bars (composited: transform only) */
  .dl-menu:not([hidden]) { animation: menu-in 160ms var(--ease-out); }
  .v-eq span { animation: eq var(--d) cubic-bezier(0.77, 0, 0.175, 1) infinite alternate; }
  .v-eq span:nth-child(1) { --d: 700ms; }
  .v-eq span:nth-child(2) { --d: 790ms; }
  .v-eq span:nth-child(3) { --d: 880ms; }
  .v-eq span:nth-child(4) { --d: 970ms; }
  .v-eq span:nth-child(5) { --d: 1060ms; }
  .v-eq span:nth-child(6) { --d: 1150ms; }
  .v-eq span:nth-child(7) { --d: 1240ms; }
  .v-eq span:nth-child(8) { --d: 1330ms; }
  .v-eq span:nth-child(9) { --d: 1420ms; }
  .v-eq span:nth-child(10) { --d: 1510ms; }

  /* Hero entrance: pure CSS so it never waits for JavaScript */
  .hero-ascii { animation: fade-in 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
  .nav { animation: drop-in 0.9s var(--ease-out) 0.1s both; }
  .hero-title .line { animation: line-up 1.1s var(--ease-out) both; }
  .hero-title .line-mask:nth-child(1) .line { animation-delay: 0.25s; }
  .hero-title .line-mask:nth-child(2) .line { animation-delay: 0.37s; }
  .hero-fade { animation: rise 0.9s var(--ease-out) both; }
  .hero-lede { animation-delay: 0.6s; }
  .hero-ctas { animation-delay: 0.7s; }
  .hero-note { animation-delay: 0.8s; }
  .stat { --rise: 20px; animation: rise 0.8s var(--ease-out) both; }
  .stat:nth-child(1) { animation-delay: 0.8s; }
  .stat:nth-child(2) { animation-delay: 0.88s; }
  .stat:nth-child(3) { animation-delay: 0.96s; }

  /* Reveal on scroll: hidden state only when JS is running (main.js adds .is-in) */
  .js [data-reveal] { opacity: 0; transform: translateY(var(--rise, 40px)); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--delay, 0s); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js [data-reveal="card"] { --rise: 48px; transition-duration: 0.9s; }
  .js .shot-card[data-reveal]:nth-child(3n + 2),
  .js .feature[data-reveal]:nth-child(3n + 2) { --delay: 0.08s; }
  .js .shot-card[data-reveal]:nth-child(3n + 3),
  .js .feature[data-reveal]:nth-child(3n + 3) { --delay: 0.16s; }
  .js [data-reveal="stagger"] { opacity: 1; transform: none; }
  .js [data-reveal="stagger"] > * { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
  .js [data-reveal="stagger"] > :nth-child(2) { transition-delay: 0.1s; }
  .js [data-reveal="stagger"] > :nth-child(3) { transition-delay: 0.2s; }
  .js [data-reveal="stagger"] > :nth-child(4) { transition-delay: 0.3s; }
  .js [data-reveal="stagger"].is-in > * { opacity: 1; transform: none; }

  /* Rune stroke draw */
  .js [data-reveal="rune"] { opacity: 1; transform: none; }
  .js [data-reveal="rune"] path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s cubic-bezier(0.45, 0, 0.55, 1); }
  .js [data-reveal="rune"].is-in path { stroke-dashoffset: 0; }

  /* Scroll-linked effects, where the browser supports them natively */
  @supports (animation-timeline: view()) {
    .shot {
      animation: shot-in linear both;
      animation-timeline: view();
      animation-range: cover 5vh cover 55vh;
    }
    .site-footer { view-timeline: --footer block; }
    .plx { animation: plx linear both; animation-timeline: --footer; animation-range: entry 0% entry 100%; }
    .plx-fjord { --from: -20px; }
  }
}

@keyframes shot-in {
  from { opacity: 0.4; transform: translateY(80px) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes plx {
  from { transform: translateY(var(--from, 0)); }
  to { transform: none; }
}

/* 404 page ---------------------------------------------------------------- */
.nf {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  text-align: center;
}
.nf .hero-ascii { height: 620px; }
.ascii-404 {
  position: absolute;
  left: 50%;
  top: 170px;
  margin: 0;
  transform: translateX(-50%);
  font: 600 clamp(14px, 2.4vw, 26px) / 1.05 var(--font-mono);
  color: var(--accent);
  text-shadow: 0 0 24px rgba(244, 63, 94, 0.55);
  white-space: pre;
  text-align: left;
  pointer-events: none;
}
.ascii-404 span { color: rgba(255, 228, 232, 0.28); text-shadow: none; }
/* Soft dark plate so the 404 reads clearly over the busy aurora. */
.ascii-404::before {
  content: "";
  position: absolute;
  inset: -45% -18%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(10, 10, 12, 0.92) 55%, rgba(10, 10, 12, 0));
}
.nf-copy { position: relative; display: flex; flex-direction: column; align-items: center; max-width: 760px; padding-top: 440px; padding-bottom: 96px; }
.nf h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1; }
.nf-lede { margin-top: 20px; max-width: 520px; font-size: 18px; line-height: 28px; color: var(--ink-secondary); }
.nf .hero-ctas { justify-content: center; }
@media (prefers-reduced-motion: no-preference) {
  .ascii-404 { animation: fade-in 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both; }
  .nf .eyebrow { animation-delay: 0.35s; }
  .nf h1 { animation-delay: 0.45s; }
  .nf-lede { animation-delay: 0.55s; }
  .nf .hero-ctas { animation-delay: 0.65s; }
}
@media (max-width: 760px) {
  .nf .hero-ascii { height: 420px; }
  .ascii-404 { top: 130px; }
  .nf-copy { padding-top: 330px; padding-bottom: 64px; }
}
