/* ============================================================
   go2048 — Editorial design system.
   Bold editorial storytelling: Georgia serif, burnt-orange (#C44900)
   brand accent, clean white canvas, full-bleed diagonally-clipped
   timeline images stacked above contained text. Light / Dark via
   [data-theme] (set by the inline boot script + theme switcher).
   ============================================================ */

:root {
  /* --- Neutral surfaces (white canvas) --- */
  --neutral-primary-soft: #FFFFFF;   /* sections + surfaces */
  --neutral-primary: #FFFFFF;        /* page */
  --neutral-secondary-medium: #F9FAFB;
  --neutral-tertiary-soft: #F5F5F5;
  --neutral-tertiary-medium: #EBEBEB;

  /* --- Text --- */
  --heading: #1A1A1A;
  --body: #4A4A4A;
  --body-subtle: #6E6E6E;
  --white: #FFFFFF;

  /* --- Brand (monochrome ink — no accent color) --- */
  --brand: #1A1A1A;
  --brand-strong: #000000;
  --brand-medium: #D4D4D4;
  --brand-soft: #ECECEC;
  --brand-softer: #F5F5F5;
  --fg-brand: #1A1A1A;
  --fg-brand-strong: #000000;

  /* --- Borders --- */
  --border-default: #E5E7EB;
  --border-default-medium: #E5E7EB;
  --border-default-strong: #D6D6D6;

  /* --- Utility --- */
  --dark: #1F2937;
  --dark-strong: #111827;

  /* --- Button glint custom props --- */
  --color-1-400: rgba(255, 255, 255, 0.25);
  --color-1-700: rgba(0, 0, 0, 0.12);

  /* --- Shadows --- */
  --shadow-2xs: 0 1px rgb(0 0 0 / 0.03);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.06), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.06), 0 8px 10px -6px rgb(0 0 0 / 0.04);

  /* --- Radius (sharp, editorial) --- */
  --r: 4px;
  --r-sm: 2px;
  --r-full: 9999px;

  /* --- Type + layout --- */
  --font: Georgia, Cambria, "Times New Roman", "Noto Serif", "Noto Serif KR",
    "Noto Serif SC", "Noto Naskh Arabic", "Times", serif;
  --maxw: 1440px;
  --reading: 768px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* Page bg the html/body use (also overridden by the app, kept here for parity) */
  --bg: var(--neutral-primary-soft);
}

[data-theme="dark"] {
  --neutral-primary-soft: #0E0E10;
  --neutral-primary: #0E0E10;
  --neutral-secondary-medium: #1D1D20;
  --neutral-tertiary-soft: #161618;
  --neutral-tertiary-medium: #28282C;

  --heading: #FFFFFF;
  --body: #A1A1AA;
  --body-subtle: #A1A1AA;

  --brand: #F5F5F5;
  --brand-strong: #FFFFFF;
  --brand-medium: #34343A;
  --brand-soft: #1D1D20;
  --brand-softer: #1D1D20;
  --fg-brand: #E5E7EB;
  --fg-brand-strong: #FFFFFF;

  --border-default: #28282C;
  --border-default-medium: #34343A;
  --border-default-strong: #34343A;

  --color-1-400: rgba(255, 255, 255, 0.12);
  --color-1-700: rgba(0, 0, 0, 0.25);

  --bg: var(--neutral-primary-soft);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--neutral-primary-soft);
  color: var(--body);
  line-height: 1.8;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  color: var(--heading);
  font-weight: 700;
  margin: 0;
}
/* Mobile-first heading scale */
h1 { font-size: 36px; line-height: 1.05; letter-spacing: -.9px; }
h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.5px; }
h3 { font-size: 26px; line-height: 1.2; letter-spacing: -.3px; }
h4 { font-size: 22px; line-height: 1.25; letter-spacing: -.2px; }
h5 { font-size: 20px; line-height: 1.3; }
h6 { font-size: 18px; line-height: 1.35; }
@media (min-width: 768px) {
  h1 { font-size: 44px; } h2 { font-size: 36px; } h3 { font-size: 30px; }
  h4 { font-size: 26px; } h5 { font-size: 22px; }
}
@media (min-width: 1024px) {
  h1 { font-size: 60px; line-height: 1.05; }
  h2 { font-size: 44px; } h3 { font-size: 36px; } h4 { font-size: 30px; }
  h5 { font-size: 24px; } h6 { font-size: 20px; }
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 700; color: var(--heading); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.container-reading { width: 100%; max-width: var(--reading); margin: 0 auto; padding: 0 32px; }

/* Eyebrow / overline */
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--fg-brand);
}

/* Leading + body paragraphs */
.lead { font-size: 20px; line-height: 1.8; color: var(--body); max-width: 65ch; }
p.body, .section p { max-width: 65ch; }

/* Inline + CTA links */
.cta-link {
  display: inline-block; color: var(--fg-brand); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
.cta-link:hover { text-decoration: none; }

/* ---------- Sections ---------- */
.section { padding: 48px 0; background: var(--neutral-primary-soft); }
.section + .section { border-top: 1px solid var(--border-default); }
.section-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head h2 { margin-bottom: 24px; }
.section-head p { color: var(--body); margin: 0 auto; }
@media (min-width: 768px) { .section { padding: 80px 0; } .section-head { margin-bottom: 64px; } }
@media (min-width: 1024px) { .section { padding: 120px 0; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 16px; font-weight: 600;
  padding: 12px 24px; border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; box-sizing: border-box; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn:focus-visible { outline: none; }

.btn-primary,
.btn-brand {
  background: var(--brand); color: var(--white); border-color: transparent;
  box-shadow: var(--shadow-xs), inset var(--color-1-400) 0 6px 0px -5px, var(--color-1-700) 0 4px 10px -5px;
}
.btn-primary:hover, .btn-brand:hover { background: var(--brand-strong); color: var(--white); }
.btn-primary:focus-visible, .btn-brand:focus-visible {
  box-shadow: var(--shadow-xs), inset var(--color-1-400) 0 6px 0px -5px, var(--color-1-700) 0 4px 10px -5px, 0 0 0 4px var(--brand-medium);
}

/* Tertiary (used for the secondary/ghost-style CTAs) */
.btn-ghost,
.btn-tertiary {
  background: var(--neutral-primary-soft); color: var(--body);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs), inset var(--color-1-400) 0 6px 0px -5px, var(--color-1-700) 0 4px 10px -5px;
}
.btn-ghost:hover, .btn-tertiary:hover { background: var(--neutral-secondary-medium); color: var(--heading); }
.btn-ghost:focus-visible, .btn-tertiary:focus-visible {
  box-shadow: var(--shadow-xs), inset var(--color-1-400) 0 6px 0px -5px, var(--color-1-700) 0 4px 10px -5px, 0 0 0 4px var(--neutral-tertiary-soft);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Dark mode: monochrome primary button is light, so its label must be ink. */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-brand { color: #0E0E10; }
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-brand:hover { background: #FFFFFF; color: #0E0E10; }
[data-theme="dark"] .card-tile .card-play { color: #0E0E10; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--neutral-primary-soft) 90%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s;
}
@supports (backdrop-filter: blur(1px)) {
  body:not(.nav-open) .header {
    background: color-mix(in srgb, var(--neutral-primary-soft) 80%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
}
.header.scrolled { border-bottom-color: var(--border-default); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--heading); }
.brand .logo { width: 30px; height: 30px; border-radius: var(--r); flex: none; object-fit: cover; display: block; box-shadow: var(--shadow-xs); }

.nav { display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  color: var(--body); font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: var(--r);
  white-space: nowrap; transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--heading); background: var(--neutral-secondary-medium); }

.controls { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r); border: 1px solid var(--border-default); background: var(--neutral-primary-soft);
  color: var(--body); cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.icon-btn:hover { background: var(--neutral-secondary-medium); color: var(--heading); border-color: var(--border-default-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.select-wrap { position: relative; display: inline-flex; }
.select-wrap svg.chev { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; pointer-events: none; color: var(--body); }
select.lang, select.theme {
  appearance: none; -webkit-appearance: none;
  font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--body);
  background: var(--neutral-primary-soft); border: 1px solid var(--border-default); border-radius: var(--r);
  padding: 9px 30px 9px 12px; cursor: pointer; box-shadow: var(--shadow-xs); transition: background-color .2s, border-color .2s, color .2s;
}
select.lang:hover, select.theme:hover { border-color: var(--border-default-strong); color: var(--heading); background: var(--neutral-secondary-medium); }

.menu-toggle { display: none; }
.menu-toggle .i-close { display: none; }

.nav-stores { display: none; }
.nav-stores .store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: var(--r);
  background: var(--dark); color: #fff; text-decoration: none; border: 1px solid var(--dark);
  min-width: 210px; box-shadow: var(--shadow-xs); transition: background-color .15s ease;
}
.nav-stores .store-btn:hover { background: var(--dark-strong); color: #fff; }
.nav-stores .store-btn svg { width: 26px; height: 26px; flex: none; }
.nav-stores .store-btn .sb-small { font-size: 11px; opacity: .85; display: block; line-height: 1.1; }
.nav-stores .store-btn .sb-big { font-size: 17px; font-weight: 700; line-height: 1.2; }

/* ---------- Full-bleed diagonal media (the timeline's decorative device) ---------- */
.full-bleed-media {
  position: relative; margin: 0;
  width: 100vw; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
  overflow: hidden;
  background: var(--neutral-tertiary-soft);
  clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
}
.full-bleed-media img {
  display: block; width: 100%;
  height: clamp(380px, 56vh, 660px);
  object-fit: cover; object-position: center 24%;
}
/* alternating diagonal direction down the timeline */
.full-bleed-media.mirror { clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 0; }
.hero .container { text-align: left; }
.hero .eyebrow { margin-bottom: 20px; }
.hero h1 { margin-bottom: 24px; max-width: 16ch; }
.hero h1 .grad { color: var(--fg-brand); }
.hero .lead { margin-bottom: 0; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; padding: 0; list-style: none;
  color: var(--body-subtle); font-size: 14px; font-weight: 600;
}
.hero-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 16px; height: 16px; color: var(--fg-brand); flex: none; }
.hero-figure { margin-top: 56px; }
/* Two-column hero: copy on the left, paired phone mockups on the right */
.hero-grid { display: grid; gap: 8px; align-items: center; }
.hero-copy { text-align: left; }
.phone-frame {
  width: 300px; max-width: 82vw; border-radius: 30px; overflow: hidden;
  background: var(--neutral-primary-soft); border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
}
.phone-frame img { display: block; width: 100%; height: auto; }
/* Paired, fanned-out phones */
.hero-shots { margin-top: 48px; display: flex; justify-content: center; align-items: center; }
.hero-shots .phone-frame { width: 210px; max-width: 42vw; }
.hero-shots .phone-back { transform: rotate(-5deg) translateY(-14px); z-index: 1; margin-right: -38px; }
.hero-shots .phone-front { transform: rotate(5deg) translateY(14px); z-index: 2; }
@media (min-width: 1024px) {
  .hero { padding: 96px 0 64px; }
  .hero-figure { margin-top: 80px; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 40px; }
  .hero-shots { margin-top: 0; justify-content: flex-end; }
  .hero-shots .phone-frame { width: 232px; max-width: none; }
  .hero-shots .phone-back { margin-right: -48px; }
}

/* ---------- Timeline (games showcase) ---------- */
.timeline .tl-entry { margin-top: 56px; }
.timeline .tl-entry:first-of-type { margin-top: 0; }
.tl-text { max-width: 760px; margin: 0 auto; padding-top: 40px; text-align: center; }
.tl-text .eyebrow { margin-bottom: 16px; }
.tl-text h2 { margin-bottom: 8px; }
.tl-text h3 { color: var(--body); font-weight: 400; margin-bottom: 24px; }
.tl-text p { margin: 0 auto 24px; }
@media (min-width: 1024px) { .timeline .tl-entry { margin-top: 96px; } .tl-text { padding-top: 56px; } }

/* ---------- Games card gallery (editorial poster cards) ---------- */
.card-gallery { display: grid; grid-template-columns: 1fr; gap: 32px; max-width: 520px; margin: 0 auto; }
@media (min-width: 768px) { .card-gallery { grid-template-columns: repeat(3, 1fr); max-width: 1200px; gap: 32px; } }
.card-tile {
  display: block; position: relative; border: 1px solid var(--border-default); border-radius: var(--r);
  overflow: hidden; background: var(--neutral-primary-soft); box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s;
}
.card-tile img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.card-tile .card-play {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 16px; font-weight: 600; color: var(--white);
  background: var(--brand); padding: 14px 16px;
  box-shadow: inset var(--color-1-400) 0 6px 0px -5px;
  transition: background-color .2s;
}
.card-tile:hover { transform: translateY(-4px); border-color: var(--border-default-strong); box-shadow: var(--shadow-lg); }
.card-tile:hover .card-play { background: var(--brand-strong); }
.card-tile:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-medium); }

/* ---------- Feature pillars (editorial, borderless) ---------- */
.methods-grid { display: grid; grid-template-columns: 1fr; gap: 48px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 768px) { .methods-grid { grid-template-columns: repeat(2, 1fr); gap: 48px 64px; } }
.method { position: relative; background: transparent; }
.method .num { font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--body-subtle); }
.method .ic {
  width: 48px; height: 48px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--brand-softer); color: var(--fg-brand-strong); margin: 16px 0 20px;
}
.method .ic svg { width: 24px; height: 24px; }
.method h3 { font-size: 22px; margin-bottom: 12px; }
.method p { color: var(--body); font-size: 18px; }
.method ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.method li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; color: var(--body); }
.method li svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--fg-brand); }

/* ---------- Quick feature grid (supporting) ---------- */
.features-grid { display: grid; grid-template-columns: 1fr; gap: 32px 48px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
.feature { background: transparent; }
.feature .fic {
  width: 48px; height: 48px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--neutral-secondary-medium); color: var(--fg-brand); margin-bottom: 16px;
}
.feature .fic svg { width: 24px; height: 24px; }
.feature h3 { font-size: 20px; margin-bottom: 8px; }
.feature p { color: var(--body); font-size: 16px; }

/* ---------- Stats (white, hairline-separated) ---------- */
.stats { background: var(--neutral-primary-soft); border-top: 1px solid var(--border-default); border-bottom: 1px solid var(--border-default); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px 24px; padding: 64px 0; max-width: var(--maxw); margin: 0 auto; padding-left: 32px; padding-right: 32px; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { text-align: center; }
.stat .big { font-family: var(--font); font-weight: 700; font-size: 44px; color: var(--fg-brand-strong); line-height: 1.05; letter-spacing: -.5px; }
@media (min-width: 1024px) { .stat .big { font-size: 60px; } }
.stat .lbl { color: var(--body); font-size: 14px; margin-top: 12px; }

/* ---------- How to play (editorial steps) ---------- */
.steps { display: grid; grid-template-columns: 1fr; gap: 48px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 48px 64px; } }
.step { background: transparent; position: relative; }
.step .badge {
  width: 48px; height: 48px; border-radius: var(--r-full); display: grid; place-items: center;
  font-family: var(--font); font-weight: 700; font-size: 20px;
  background: var(--brand-softer); color: var(--fg-brand-strong); margin-bottom: 20px;
}
.step h3 { font-size: 22px; margin-bottom: 12px; }
.step p { color: var(--body); font-size: 18px; }

/* ---------- CTA band (white, no gradient) ---------- */
.cta-band { padding: 80px 0; background: var(--neutral-primary-soft); border-top: 1px solid var(--border-default); }
@media (min-width: 1024px) { .cta-band { padding: 120px 0; } }
.cta-card { max-width: 760px; margin: 0 auto; text-align: center; }
.cta-card h2 { margin-bottom: 24px; }
.cta-card p { color: var(--body); margin: 0 auto 32px; max-width: 60ch; }
.cta-card .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border-default); padding: 64px 0 48px; background: var(--neutral-primary-soft); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 48px; }
.footer .brand { margin-bottom: 16px; }
.footer-about { max-width: 340px; color: var(--body); font-size: 16px; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--body-subtle); font-weight: 600; margin-bottom: 16px; }
.footer-col a { display: block; color: var(--body); font-size: 16px; padding: 6px 0; transition: color .2s; }
.footer-col a:hover { color: var(--fg-brand); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-default); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--body-subtle); font-size: 14px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Download page ---------- */
.dl-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 24px;
  margin: 8px auto 32px; max-width: 1100px;
}
.dl-card {
  flex: 1 1 240px; max-width: 360px; min-width: 0;
  background: var(--neutral-primary-soft); border: 1px solid var(--border-default); border-radius: var(--r);
  padding: 32px; text-align: center; box-shadow: var(--shadow-xs);
  transition: background-color .2s, border-color .2s;
}
.dl-card:hover { background: var(--neutral-secondary-medium); border-color: var(--border-default-strong); }
.dl-card .dl-ic { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--fg-brand); }
.dl-card .dl-ic svg { width: 48px; height: 48px; }
.dl-card h3 { font-size: 20px; margin-bottom: 8px; }
.dl-card p { color: var(--body); font-size: 16px; margin-bottom: 18px; min-height: 42px; }
.dl-badge { font-size: 12px; color: var(--body-subtle); display: block; margin-top: 12px; }

/* ---------- Download hero (text left, QR right) ---------- */
.dl-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 32px 48px; flex-wrap: wrap;
  max-width: 1100px; margin: 8px auto 40px;
}
.dl-hero-text { flex: 1 1 340px; min-width: 0; }
.dl-hero-text .eyebrow { display: block; margin-bottom: 8px; }
.dl-hero-text h1 { margin-bottom: 12px; }
.dl-hero-text .legal-lead { margin: 0; }
.qr-code {
  flex: 0 0 auto; width: 188px; padding: 14px 14px 10px;
  background: #fff; border: 1px solid var(--border-default-strong); border-radius: 16px;
  box-shadow: var(--shadow-md); text-align: center;
}
.qr-code svg { display: block; width: 160px; height: 160px; margin: 0 auto; }
.qr-cap { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; letter-spacing: .2px; color: #333; }
/* Phones: stack & center, keep the QR comfortably scannable */
@media (max-width: 640px) {
  .dl-hero { flex-direction: column; text-align: center; gap: 24px; margin-bottom: 28px; }
  .dl-hero-text { flex: 0 1 auto; }
}
@media (max-width: 360px) {
  .qr-code { width: 168px; }
  .qr-code svg { width: 144px; height: 144px; }
}

/* ---------- Store auto-redirect notice ---------- */
.dl-redirect {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  width: max-content; max-width: calc(100% - 24px); padding: 12px 18px;
  background: var(--neutral-primary-soft); border: 1px solid var(--border-default);
  border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px;
}
.dl-redirect-msg { color: var(--body); font-weight: 600; }
.dl-redirect-go { color: var(--fg-brand); font-weight: 600; }
.dl-redirect-stay {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--body-subtle); font-size: 14px; text-decoration: underline;
}

/* ---------- Responsive nav ---------- */
@media (max-width: 720px) {
  .menu-toggle { display: inline-grid; }
  .nav-links { display: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-links {
    position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
    justify-content: center; align-items: stretch; gap: 4px; padding: 24px; background: var(--neutral-primary-soft);
  }
  body.nav-open .nav-links > a {
    font-size: 22px; font-weight: 700; color: var(--heading); text-align: center; padding: 14px; border-radius: var(--r);
  }
  body.nav-open .nav-links > a:hover, body.nav-open .nav-links > a:active { background: var(--neutral-secondary-medium); }
  body.nav-open .nav-stores { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 16px; }
  body.nav-open .menu-toggle .i-open { display: none; }
  body.nav-open .menu-toggle .i-close { display: block; }
  .controls:has(.menu-toggle) .select-wrap { display: none; }
  body.nav-open .controls { position: fixed; left: 0; right: 0; bottom: 32px; z-index: 61; display: flex; justify-content: center; gap: 12px; }
  body.nav-open .controls .select-wrap { display: inline-flex; }
  body.nav-open .menu-toggle { position: fixed; top: 14px; right: 24px; z-index: 62; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* Fallback dark mode when JS hasn't set [data-theme] */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --neutral-primary-soft: #101828; --neutral-primary: #030712;
    --neutral-secondary-medium: #1E2939; --neutral-tertiary-soft: #101828;
    --heading: #FFFFFF; --body: #9CA3AF; --body-subtle: #9CA3AF;
    --brand: #D96B20; --brand-strong: #C44900; --fg-brand: #E8985A; --fg-brand-strong: #FADCCA;
    --brand-softer: #3D1A00; --brand-soft: #6B2E00;
    --border-default: #1F2937; --border-default-strong: #4B5563;
    --color-1-400: rgba(255,255,255,0.12); --color-1-700: rgba(0,0,0,0.25);
  }
}

/* ============================================================
   Install banner — native-style smart app-banner (mobile only).
   Injected by js/app-banner.js as the first child of <body>; pinned to
   the top on phones, hidden on desktop. The sticky header is nudged
   down by --appbar-h so the two never overlap. Monochrome per the
   Go Brain design system (ink-on-white / white-on-ink).
   ============================================================ */
:root { --appbar-h: 60px; }
.app-banner { display: none; }

@media (max-width: 767px) {
  .app-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 45;
    display: flex; align-items: center; gap: 12px;
    height: var(--appbar-h); padding: 0 14px;
    background: var(--neutral-primary-soft);
    border-bottom: 1px solid var(--border-default);
    font-family: var(--font);
  }
  .app-banner .ab-icon { width: 40px; height: 40px; border-radius: var(--r); flex: none; box-shadow: var(--shadow-xs); }
  .app-banner .ab-text { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
  .app-banner .ab-text b { display: block; font-weight: 700; font-size: 15px; color: var(--heading); }
  .app-banner .ab-text span {
    display: block; font-size: 12px; color: var(--body-subtle);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .app-banner .ab-cta {
    flex: none; background: var(--brand); color: var(--neutral-primary-soft);
    font-family: var(--font); font-weight: 700; font-size: 14px;
    border-radius: var(--r); padding: 9px 18px; text-decoration: none;
    box-shadow: var(--shadow-xs), inset var(--color-1-400) 0 6px 0 -5px;
  }
  .app-banner .ab-cta:active { opacity: .9; }

  /* make room for the fixed banner + push the sticky header below it */
  body.has-appbar { padding-top: var(--appbar-h); }
  body.has-appbar .header { top: var(--appbar-h); }
  body.has-appbar.nav-open .header { top: 0; }
}
