:root {
  /* Declares that this page handles BOTH schemes itself. Without it, Chrome's
     "force dark" (on by default for many Android users) applies its own
     auto-inversion on top of the dark block below, which double-darkens the
     text and wrecks fixed-colour brand assets like the lime sticker and the
     Play Store badge. It also makes scrollbars and form controls match. */
  color-scheme: light dark;

  --page:   #FCFCFD;
  --raised: #FFFFFF;
  --sunken: #F6F7F9;
  --line-1: #EEF0F4;
  --line-2: #E2E5EB;
  --line-3: #CBD0D9;
  --t1: #0F1320;
  --t2: #4B5263;
  --t3: #6B7280;
  --t4: #9CA3B0;
  --indigo-50:  #EEF0FF;
  --indigo-100: #E0E4FF;
  --indigo:     #4F46E5;
  --indigo-700: #4338CA;
  --violet: #7C3AED;
  --lime:   #C7F284;
  --green-on: #047857;
  --grad-text: linear-gradient(135deg,#4F46E5 0%,#7C3AED 55%,#A78BFA 100%);
  --grad-soft: linear-gradient(135deg,#EEF0FF 0%,#F5F0FF 100%);
  --font-d: 'Outfit', system-ui, sans-serif;
  --font-b: 'Inter', system-ui, sans-serif;
  --font-m: 'JetBrains Mono', ui-monospace, monospace;
  --spring: cubic-bezier(0.34,1.56,0.64,1);
  --snap:   cubic-bezier(0.4,0,0.2,1);
  --out:    cubic-bezier(0.16,1,0.3,1);
  --shadow-xs: 0 1px 2px rgba(15,19,32,0.04);
  --shadow-sm: 0 1px 3px rgba(15,19,32,0.06),0 1px 2px rgba(15,19,32,0.04);
  --shadow-md: 0 4px 12px rgba(15,19,32,0.06),0 2px 4px rgba(15,19,32,0.04);
  --shadow-lg: 0 10px 24px rgba(15,19,32,0.08),0 4px 8px rgba(15,19,32,0.04);
  --shadow-brand-md: 0 10px 24px rgba(79,70,229,0.22),0 4px 8px rgba(79,70,229,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--page);
  color: var(--t1);
  font-family: var(--font-b);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Stops iOS Safari inflating body copy in landscape, which otherwise breaks
     the measure the type scale below is tuned for. */
  -webkit-text-size-adjust: 100%;
}

::selection { background: var(--indigo-100); color: var(--indigo-700); }

h1, h2, h3, h4 {
  font-family: var(--font-d); line-height: 1.2; letter-spacing: -0.02em;
  /* Headings are the thing most likely to leave one orphaned word on a phone. */
  text-wrap: balance;
}
a { color: var(--indigo); text-decoration: none; }

/* Long merchant names, card names and URLs are the usual cause of a stray
   horizontal scrollbar on a 360px screen. */
p, li, td, th, .prose { overflow-wrap: break-word; }

.label-short { display: none; }

.wrap { max-width: 760px; margin: 0 auto; padding: 44px 24px 72px; }
/* 1200px / 40px gutter — identical to .landing-page-root .wrap, so the header
   and footer line up with the homepage's edges at every width. */
.wrap-wide { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

/* ---------- nav (mirrors .landing-page-root .nav) ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(252,252,253,0.78);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--line-1);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  transition: transform 300ms var(--spring); transform-origin: left center;
}
.logo:hover { transform: scale(1.04); }
.logo:active { transform: scale(0.96); }
.logo-img { height: 28px; width: auto; display: block; border-radius: 7px; }
.logo-text {
  font-family: var(--font-d); font-weight: 800; font-size: 1.1875rem;
  letter-spacing: -0.03em; color: var(--t1); line-height: 1;
}
.logo-text-accent { color: var(--indigo); }

/* shrink:0 + nowrap on the actions: without both, a 360px viewport squeezes the
   CTA until "Open app" wraps onto two lines and bursts out of its pill. */
.nav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-link, .btn-primary { white-space: nowrap; }
.logo-text { white-space: nowrap; }
.nav-link {
  height: 40px; padding: 0 16px; border-radius: 9999px;
  display: inline-flex; align-items: center;
  font-weight: 600; font-size: 0.875rem; color: var(--t2);
  transition: color 200ms var(--snap), background 200ms var(--snap);
}
.nav-link:hover { color: var(--t1); background: var(--sunken); }
.btn-primary {
  height: 40px; padding: 0 22px; border-radius: 9999px;
  display: inline-flex; align-items: center;
  background: var(--indigo); color: #fff;
  font-weight: 600; font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--snap), box-shadow 200ms var(--snap), background 200ms var(--snap);
}
.btn-primary:hover {
  background: var(--indigo-700);
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-brand-md);
}

/* ---------- index hero ---------- */
.blog-hero { margin-bottom: 40px; }
.eyebrow {
  display: inline-block; margin-bottom: 14px;
  padding: 5px 13px; border-radius: 9999px;
  background: var(--indigo-50); color: var(--indigo);
  font-weight: 700; font-size: 0.6875rem;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.blog-hero h1 {
  font-size: clamp(34px, 6vw, 50px); font-weight: 800;
  letter-spacing: -0.035em; margin-bottom: 14px;
}
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.blog-hero p { color: var(--t2); font-size: 1.0625rem; max-width: 620px; }

/* ---------- article cards ---------- */
.card-list { list-style: none; display: grid; gap: 18px; }
.card {
  background: var(--raised);
  border: 1px solid var(--line-1);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
  transition: transform 250ms var(--out), box-shadow 250ms var(--out), border-color 250ms var(--snap);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-2);
}
.card > a { display: block; padding: 26px; color: inherit; }
.card h2 { margin: 10px 0 9px; font-size: 1.375rem; font-weight: 700; color: var(--t1); }
.card .excerpt { margin-bottom: 16px; color: var(--t2); font-size: 0.9375rem; line-height: 1.65; }
.card .read-more { color: var(--indigo); font-weight: 600; font-size: 0.875rem; }
.card .arrow { display: inline-block; transition: transform 250ms var(--out); }
.card:hover .arrow { transform: translateX(4px); }
.card.empty { padding: 26px; color: var(--t3); }

.meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px;
  font-size: 0.8125rem; color: var(--t3); font-weight: 500;
}
.tag {
  background: var(--indigo-50); color: var(--indigo);
  padding: 4px 11px; border-radius: 9999px;
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.dot { color: var(--t4); }

/* ---------- article ---------- */
.crumbs { font-size: 0.875rem; font-weight: 600; margin-bottom: 24px; }
.crumbs a { color: var(--t3); transition: color 200ms; }
.crumbs a:hover { color: var(--indigo); }
.post h1 {
  font-size: clamp(30px, 5.4vw, 44px); font-weight: 800;
  letter-spacing: -0.035em; margin: 14px 0 16px;
}
.standfirst {
  font-size: 1.1875rem; line-height: 1.65; color: var(--t2);
  padding-bottom: 30px; margin-bottom: 34px;
  border-bottom: 1px solid var(--line-1);
}

/* ---------- table of contents ---------- */
.toc {
  margin-bottom: 36px; padding: 18px 22px;
  background: var(--sunken); border: 1px solid var(--line-1);
  border-radius: 14px;
}
.toc > summary {
  cursor: pointer; list-style: none;
  font-family: var(--font-d); font-weight: 700; font-size: 0.9375rem;
  color: var(--t1);
}
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::after {
  content: '▾'; float: right; color: var(--t3);
  transition: transform 200ms var(--snap);
}
.toc[open] > summary::after { transform: rotate(180deg); }
.toc ol {
  margin: 14px 0 0; padding: 0; list-style: none;
  counter-reset: toc;
}
.toc li { counter-increment: toc; margin: 0; }
.toc li + li { margin-top: 2px; }
.toc a {
  display: block; padding: 7px 0 7px 26px; position: relative;
  color: var(--t2); font-size: 0.9375rem; font-weight: 500;
  border-bottom: 0;
}
.toc a::before {
  content: counter(toc) '.'; position: absolute; left: 0;
  color: var(--t4); font-weight: 600; font-size: 0.8125rem;
}
.toc a:hover { color: var(--indigo); }

/* Anchor targets sit under the sticky header without this. */
.prose h2, .prose h3, #top { scroll-margin-top: 84px; }

.prose { color: var(--t1); }
/* Caps the measure at a comfortable ~70 characters even though the column is
   wider, which keeps long paragraphs readable on a big screen. */
.prose p, .prose ul, .prose ol, .prose blockquote { max-width: 68ch; }
.prose h2 { font-size: 1.625rem; font-weight: 700; margin: 44px 0 14px; }
.prose h3 { font-size: 1.25rem; font-weight: 700; margin: 32px 0 10px; }
.prose p { margin-bottom: 20px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 24px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--t4); }

/* Numbered lists get counter badges instead of bare digits — the steps in a
   how-to are the most scannable thing in an article and should look it. */
.prose ol {
  list-style: none; padding-left: 0; counter-reset: step;
}
.prose ol > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 16px;
}
.prose ol > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--indigo-50); color: var(--indigo-700);
  font-family: var(--font-d); font-weight: 700; font-size: 0.8125rem;
}
.prose strong { font-weight: 700; color: var(--t1); }
.prose a { font-weight: 500; border-bottom: 1px solid var(--indigo-100); transition: border-color 200ms; }
.prose a:hover { border-bottom-color: var(--indigo); }
.prose img { max-width: 100%; height: auto; border-radius: 14px; }
.prose hr { border: 0; border-top: 1px solid var(--line-1); margin: 40px 0; }

.prose code {
  font-family: var(--font-m); font-size: 0.86em;
  background: var(--sunken); border: 1px solid var(--line-1);
  padding: 2px 7px; border-radius: 6px; color: var(--indigo-700);
}
.prose pre {
  background: var(--sunken); border: 1px solid var(--line-1);
  padding: 18px 20px; border-radius: 14px; overflow-x: auto;
  margin-bottom: 22px;
}
.prose pre code {
  background: none; border: 0; padding: 0; color: var(--t1);
  font-size: 0.875rem; line-height: 1.6;
}
.prose blockquote {
  margin: 28px 0; padding: 18px 24px;
  background: var(--grad-soft);
  border-left: 3px solid var(--indigo);
  border-radius: 0 14px 14px 0;
  color: var(--t2); font-size: 1.0625rem;
}
.prose blockquote p { margin: 0; }

/* ---------- callouts ----------
   Written as "> [!TIP] ..." in markdown. Colour carries the meaning, but the
   label spells it out too, so it still reads correctly in greyscale or to a
   screen reader rather than relying on hue alone. */
.prose .callout {
  border-left-width: 4px;
  border-radius: 14px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--t4);
  padding: 18px 22px;
  color: var(--t1);
  font-size: 1rem;
  box-shadow: var(--shadow-xs);
}
.callout__label {
  font-family: var(--font-d); font-weight: 700;
  font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 6px !important; color: var(--t3);
}
.prose .callout p + p { margin-top: 0; }

.prose .callout--tip { border-left-color: var(--indigo); background: var(--indigo-50); }
.callout--tip .callout__label { color: var(--indigo-700); }

.prose .callout--key { border-left-color: #7C3AED; background: #F5F0FF; }
.callout--key .callout__label { color: #6D28D9; }

.prose .callout--warning { border-left-color: #F59E0B; background: #FFFBEB; }
.callout--warning .callout__label { color: #B45309; }

.prose .callout--note { border-left-color: #10B981; background: #ECFDF5; }
.callout--note .callout__label { color: var(--green-on); }

.table-wrap {
  overflow-x: auto; margin-bottom: 24px;
  border: 1px solid var(--line-1); border-radius: 14px;
  -webkit-overflow-scrolling: touch;
  /* Tables are the one block that legitimately exceeds a phone's width; give it
     its own scroll container so the PAGE never scrolls sideways. */
  overscroll-behavior-x: contain;
}
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
.prose th, .prose td { padding: 12px 16px; text-align: left; }
.prose th {
  background: var(--sunken); font-weight: 700; color: var(--t1);
  font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.prose tbody tr { border-top: 1px solid var(--line-1); }
.prose tbody tr:nth-child(even) { background: rgba(246,247,249,0.6); }
.prose td { color: var(--t2); }
/* First column is the identifier (an MCC, a card name) — anchor the row on it. */
.prose td:first-child {
  font-family: var(--font-m); font-weight: 600; color: var(--t1);
  white-space: nowrap;
}

.to-top {
  margin: 34px 0 0; padding-top: 20px;
  border-top: 1px solid var(--line-1);
  font-size: 0.875rem; font-weight: 600;
}
.to-top a { color: var(--t3); }
.to-top a:hover { color: var(--indigo); }

/* ---------- cta ---------- */
.cta-box {
  margin-top: 52px; padding: 30px;
  background: var(--grad-soft);
  border: 1px solid var(--indigo-100);
  border-radius: 20px;
}
.cta-box h2 { font-size: 1.375rem; font-weight: 700; margin-bottom: 10px; }
.cta-box p { color: var(--t2); font-size: 0.9375rem; margin-bottom: 18px; }
.cta-cards { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cta-cards-label { color: var(--t3); font-weight: 600; font-size: 0.8125rem; }
.pill {
  background: var(--raised); border: 1px solid var(--line-2);
  padding: 4px 12px; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600; color: var(--t1);
}
.cta-button {
  display: inline-flex; align-items: center; height: 46px; padding: 0 26px;
  background: var(--indigo); color: #fff; border-radius: 9999px;
  font-weight: 700; font-size: 0.9375rem;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--snap), box-shadow 200ms var(--snap), background 200ms var(--snap);
}
.cta-button:hover {
  background: var(--indigo-700); transform: translateY(-2px);
  box-shadow: var(--shadow-brand-md);
}

/* ---------- related ---------- */
.related { max-width: 760px; margin: 56px auto 0; padding-top: 30px; border-top: 1px solid var(--line-1); }
.related h2 { font-size: 1.125rem; font-weight: 700; margin-bottom: 16px; }
.related ul { list-style: none; display: grid; gap: 10px; }
.related a {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 14px;
  background: var(--raised); border: 1px solid var(--line-1);
  color: var(--t1); font-weight: 600; font-size: 0.9375rem;
  transition: border-color 200ms, box-shadow 200ms, transform 200ms var(--out);
}
.related a:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.related-title { flex: 1; }

/* ---------- footer (mirrors .landing-page-root .footer) ---------- */
.footer { padding: 56px 0 48px; }
.footer-inner {
  display: grid; grid-template-columns: 1fr auto;
  gap: 32px; align-items: center;
  padding-top: 36px; border-top: 1px solid var(--line-1);
}
.footer-left { display: flex; flex-direction: column; gap: 16px; }
.footer-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-d); font-size: 1.125rem;
  letter-spacing: -0.02em; color: var(--t2); font-weight: 600;
}
.tagline-sticker {
  display: inline-block; padding: 3px 10px;
  background: var(--lime); color: #0F1320;
  font-weight: 800; border-radius: 7px;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.4);
  animation: sticker-wiggle 900ms var(--spring) 700ms both;
  transition: transform 250ms var(--spring), box-shadow 250ms var(--snap);
}
.tagline-sticker:hover {
  animation: none;
  transform: rotate(0deg) scale(1.07);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.5);
}
@keyframes sticker-wiggle {
  0%,100% { transform: rotate(-2deg); }
  35%     { transform: rotate(-4.5deg) scale(1.06); }
  70%     { transform: rotate(-1deg) scale(1.02); }
}
.footer-copy { font-weight: 500; font-size: 0.8125rem; color: var(--t3); }
.footer-right { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.play-badge img { height: 40px; width: auto; display: block; }
.flink {
  font-weight: 500; font-size: 0.875rem;
  color: var(--t2); transition: color 200ms;
}
.flink:hover { color: var(--t1); }
.footer-contact {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 9999px;
  background: rgba(79,70,229,0.04); border: 1px solid rgba(79,70,229,0.08);
  font-weight: 600; font-size: 0.8125rem; color: var(--indigo);
  transition: all 250ms var(--snap);
}
.footer-contact:hover {
  background: var(--indigo); color: #fff; border-color: var(--indigo);
  transform: translateY(-1.5px); box-shadow: 0 4px 12px rgba(79,70,229,0.12);
}
.contact-icon { display: inline-flex; align-items: center; justify-content: center; }
.fbadge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 9999px;
  background: #ECFDF5; border: 1px solid #BBF7D0;
  font-weight: 600; font-size: 0.75rem; color: var(--green-on);
}
.footer-disclaimer {
  margin-top: 26px; max-width: 640px;
  font-size: 0.75rem; line-height: 1.65; color: var(--t4);
}

/* ---------- responsive ---------- */

/* Footer, mobile. Values copied verbatim from the 640px block in
   LandingPage.tsx — same breakpoint, same centring, same gaps — so the two
   footers are indistinguishable on a phone. Deliberately NOT merged into the
   600px block below: matching the homepage means matching where it breaks, and
   these must not be overridden by a later rule. */
@media (max-width: 640px) {
  .footer { padding: 48px 0 40px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .footer-left { align-items: center; gap: 12px; }
  .footer-tag { justify-content: center; }
  .footer-copy { line-height: 1.6; font-size: 0.78rem; max-width: 420px; margin: 0 auto; }
  .footer-right { justify-content: center; flex-wrap: wrap; gap: 14px 20px; }
  /* Blog-only row (the homepage carries no disclaimer); centred to sit with the
     rest of the stacked column rather than hanging left. */
  .footer-disclaimer { margin: 20px auto 0; text-align: center; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 26px 18px 48px; }
  .wrap-wide { padding: 0 18px; }
  .nav-inner { padding: 10px 18px; }

  /* The blurred nav is the most expensive thing on the page for a mid-range
     Android GPU, and it buys the least on a small screen. Solid instead. */
  .nav {
    background: var(--raised);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-actions { gap: 2px; }
  .nav-link { height: 38px; padding: 0 10px; font-size: 0.8125rem; }
  .btn-primary { height: 38px; padding: 0 15px; font-size: 0.8125rem; }
  .label-full { display: none; }
  .label-short { display: inline; }

  .blog-hero { margin-bottom: 30px; }
  .blog-hero p { font-size: 0.9875rem; }
  .card-list { gap: 14px; }
  .card { border-radius: 16px; }
  .card > a { padding: 20px; }
  .card h2 { font-size: 1.1875rem; }
  .card .excerpt { font-size: 0.9062rem; }

  .standfirst { font-size: 1.0625rem; padding-bottom: 24px; margin-bottom: 28px; }
  .prose h2 { font-size: 1.375rem; margin: 34px 0 12px; }
  .prose h3 { font-size: 1.125rem; margin: 26px 0 8px; }
  .prose p, .prose ul, .prose ol { margin-bottom: 18px; }
  .prose ul, .prose ol { padding-left: 20px; }
  .prose pre { padding: 14px 16px; border-radius: 12px; }
  .prose pre code { font-size: 0.8125rem; }
  .prose blockquote { padding: 14px 18px; font-size: 1rem; }
  .prose th, .prose td { padding: 10px 13px; }
  /* Source lists are long URLs behind long titles; give them room to breathe
     and a tap target that isn't a one-line sliver. */
  .prose li { margin-bottom: 12px; }

  .toc { padding: 14px 18px; margin-bottom: 28px; }
  .toc a { padding: 9px 0 9px 24px; }
  .prose h2, .prose h3, #top { scroll-margin-top: 70px; }

  /* A touch more leading on a phone, where the column is narrow and the eye
     has to find the next line more often. */
  .prose p, .prose li { line-height: 1.75; }
  .prose .callout { padding: 15px 17px; border-radius: 12px; }
  .prose ol > li { padding-left: 38px; margin-bottom: 14px; }
  .prose ol > li::before { width: 26px; height: 26px; font-size: 0.75rem; }

  .cta-box { padding: 22px; border-radius: 18px; }
  .cta-box h2 { font-size: 1.1875rem; }
  /* Full-width tap target — the primary conversion action on the page. */
  .cta-button { width: 100%; justify-content: center; height: 48px; }

  .related { margin-top: 40px; }
  /* No .footer rules here on purpose — the 640px block above owns the footer so
     it stays a copy of the homepage's. */
}

/* Narrow phones (≈360px). Four items plus a wordmark do not fit, so the "Blog"
   link goes: on the blog it points at the page you are already on, and article
   pages carry an "All articles" link of their own. */
@media (max-width: 430px) {
  .nav-inner { padding: 10px 14px; gap: 8px; }
  .nav-actions .nav-link:first-child { display: none; }
  .nav-link { padding: 0 8px; font-size: 0.8125rem; }
  .btn-primary { padding: 0 14px; font-size: 0.8125rem; }
  .logo-text { font-size: 1.0625rem; }
  .logo { gap: 8px; }
}

/* ---------- dark mode ----------
   Follows the OS setting only. There is no toggle, because a toggle needs
   JavaScript and storage to persist across pages, and these pages ship none.

   Most of this is token reassignment. The exceptions are the places where a
   light value is baked into a rule rather than a variable: the indigo scale
   inverts (on dark, --indigo becomes the LIGHT tint, so anything sitting on it
   needs dark text), the nav's translucent white, and the callout tints, which
   have to be re-mixed rather than dimmed or they turn muddy. */
@media (prefers-color-scheme: dark) {
  :root {
    --page:   #0B1120;
    --raised: #121A2B;
    --sunken: #172033;
    --line-1: #1F2A3E;
    --line-2: #2B3850;
    --line-3: #3C4A64;
    --t1: #E7ECF5;
    --t2: #AEB8CB;
    --t3: #8B96AC;
    --t4: #6B7689;
    --indigo-50:  #1E2150;
    --indigo-100: #2B3070;
    --indigo:     #A5B4FC;
    --indigo-700: #C7D2FE;
    --green-on: #6EE7B7;
    --grad-text: linear-gradient(135deg,#A5B4FC 0%,#C4B5FD 55%,#DDD6FE 100%);
    --grad-soft: linear-gradient(135deg,#161B3D 0%,#1D1839 100%);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.35),0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4),0 2px 4px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 24px rgba(0,0,0,0.45),0 4px 8px rgba(0,0,0,0.3);
    --shadow-brand-md: 0 10px 24px rgba(99,102,241,0.3),0 4px 8px rgba(99,102,241,0.2);
  }

  .nav { background: rgba(11,17,32,0.8); border-bottom-color: var(--line-1); }

  /* --indigo is now a pale tint, so buttons need dark text on it. */
  .btn-primary, .cta-button { background: var(--indigo); color: #0B1120; }
  .btn-primary:hover, .cta-button:hover { background: var(--indigo-700); color: #0B1120; }

  .prose code { color: var(--indigo-700); }
  .prose tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
  .prose a { border-bottom-color: var(--line-3); }

  .prose .callout--tip { background: #171E42; border-left-color: #818CF8; }
  .callout--tip .callout__label { color: #A5B4FC; }
  .prose .callout--key { background: #1D1740; border-left-color: #A78BFA; }
  .callout--key .callout__label { color: #C4B5FD; }
  .prose .callout--warning { background: #2A1F0C; border-left-color: #F59E0B; }
  .callout--warning .callout__label { color: #FCD34D; }
  .prose .callout--note { background: #0E2A22; border-left-color: #10B981; }
  .callout--note .callout__label { color: #6EE7B7; }

  .fbadge { background: #0E2A22; border-color: #1C4B3A; color: #6EE7B7; }
  .footer-contact { background: rgba(165,180,252,0.07); border-color: rgba(165,180,252,0.16); }
  .footer-contact:hover { background: var(--indigo); color: #0B1120; }
  .footer-contact:hover .contact-icon { color: #0B1120; }

  /* The lime sticker and the Play badge are fixed brand assets. Both already
     carry their own contrast, so they stay exactly as they are. */
}

@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;
  }
}
