/* ============================================================================
   Puzzmint Blog — Design System CSS
   Brand tokens (color / radius / elevation / motion, dark + light) are GENERATED
   from packages/design-tokens/src/tokens.json into the delimited blocks below by
   `npm run tokens` (build-tokens.mjs). Do NOT edit inside the markers — edit the
   token source and regenerate. Hand-authored extras (fluid type scale, section
   rhythm, prose ink, scroll reveal) live in their own :root block AFTER the
   generated one.
   Dark-first, 60/30/10. Lens: Color (AA), Type (Fraunces+Inter, tnum), Cognition
   (Gestalt proximity/common-region), Accessibility (focus, contrast, reduced-motion).
   ============================================================================ */

/* === GENERATED-TOKENS-START — do not edit; source: packages/design-tokens/src/tokens.json
     Regenerate: node packages/design-tokens/scripts/build-tokens.mjs (or npm run tokens from packages/design-tokens)
     Parity guard: npm run tokens:check — deterministic output, no timestamps === */
:root {
  /* --- Color tokens (dark theme = default) --- */
  --surface-dominant:  #0F1419;   /* 60% base ink */
  --surface-secondary: #1A222B;  /* 30% raised cards/boards */
  --surface-line:      #2A3540;       /* grid lines, dividers, hairlines */
  --text-primary:      #ECF1F2;       /* AA+ 16.25:1 on dominant */
  --text-muted:        #8A97A0;         /* AA  6.18:1 on dominant */
  --accent-primary:    #4C6FFF;    /* 10% — focus/selection/action (UI/large only) */
  --accent-mint:       #3FD6B0;       /* brand bridge — gradients/highlights, sparing */
  --accent-mint-text:  #3FD6B0;    /* mint AS TEXT — theme-responsive; dark = raw mint (8.8:1 on secondary).
                                   Light override deepens to #0C7A60 for AA. Use this
                                   (not --accent-mint) whenever mint is TEXT. */
  --semantic-success:  #37C871;
  --semantic-caution:  #F2B33D;
  --semantic-error:    #E5544B;
  --brand-gradient:    linear-gradient(135deg, #4C6FFF 0%, #3FD6B0 100%);

  /* --- Puzzle-category hues (always pair with a glyph + label, never color alone) --- */
  --cat-sudoku:   #5B8DEF;
  --cat-queens:   #9B6BE8;
  --cat-nonogram: #33B7C9;

  /* --- Ink on brand-gradient fills (theme-invariant: gradient never changes) --- */
  --ink-on-brand: #0F1419;

  /* --- Type --- */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* --- Spacing scale (4px base) --- */
  --space-1: 0.25rem;  /* 4px — xs */
  --space-2: 0.5rem;  /* 8px — sm */
  --space-3: 0.75rem;  /* 12px — sm3 */
  --space-4: 1rem;  /* 16px — md */
  --space-5: 1.5rem;  /* 24px — lg */
  --space-6: 2rem;  /* 32px — xl */
  --space-7: 3rem;  /* 48px — xxl */
  --space-8: 4rem;  /* 64px — xl2 */
  --space-9: 6rem;  /* 96px — xl3 */
  /* semantic aliases (also usable in new CSS): */
  --space-xs:  var(--space-1);   /* 4px */
  --space-sm:  var(--space-2);   /* 8px */
  --space-sm3: var(--space-3);   /* 12px */
  --space-md:  var(--space-4);   /* 16px */
  --space-lg:  var(--space-5);   /* 24px */
  --space-xl:  var(--space-6);   /* 32px */
  --space-xxl: var(--space-7);   /* 48px */
  --space-xl2: var(--space-8);   /* 64px */
  --space-xl3: var(--space-9);   /* 96px */

  /* --- Radii / elevation --- */
  --radius-sm:   8px;  --radius-md: 12px;  --radius-lg: 18px;  --radius-pill: 999px;
  --elev-1: 0px 1px 2px 0px rgba(0,0,0,0.12);
  --elev-2: 0px 4px 12px 0px rgba(0,0,0,0.18);
  --elev-3: 0px 8px 24px 0px rgba(0,0,0,0.24);
  --elev-card:       0px 1px 2px 0px rgba(0,0,0,0.12), 0px 8px 24px 0px rgba(0,0,0,0.24);
  --elev-card-hover: 0 2px 4px rgba(0,0,0,0.5), 0 16px 40px rgba(0,0,0,0.35);

  /* --- Measure / motion --- */
  --measure:      68ch;          /* article reading measure */
  --max-content:  1040px;        /* listing grid width */
  --dur-instant:   50ms;
  --dur-fast:      180ms;
  --dur-base:      240ms;
  --dur-slow:      300ms;
  --dur-celebrate: 320ms;
  --ease-standard: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-entrance: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-settle:   cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-exit:     cubic-bezier(0.32, 0, 0.67, 0);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  180ms;   /* < Doherty 400ms */
}
/* === GENERATED-TOKENS-END === */

/* ============================================================================
   Hand-authored design-system extras (NOT generated — safe to edit).
   ============================================================================ */
:root {
  /* --- Fluid type scale (one rhythm shared by homepage + blog).
         Every heading/body size pulls a --step-* instead of an ad-hoc clamp(),
         so the two surfaces read as one system. --step-0 is body. --- */
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);    /* captions, notes    */
  --step-0:  clamp(1rem, 0.97rem + 0.18vw, 1.0625rem);    /* body               */
  --step-1:  clamp(1.08rem, 1.03rem + 0.28vw, 1.2rem);    /* lede, card title s */
  --step-2:  clamp(1.2rem, 1.1rem + 0.55vw, 1.45rem);     /* card title         */
  --step-3:  clamp(1.5rem, 1.28rem + 1.1vw, 2.2rem);      /* h3 / section h2 s  */
  --step-4:  clamp(1.8rem, 1.42rem + 1.9vw, 2.7rem);      /* section h2         */
  --step-5:  clamp(2.1rem, 1.42rem + 3.2vw, 3.6rem);      /* hero h1            */

  /* --- Vertical rhythm: one section padding for every band on both surfaces --- */
  --section-y: clamp(2.5rem, 6vw, 4rem);

  /* --- Article prose ink: softened text.primary, derived from tokens so ONE
         value works in both themes (was #C8D2D8 dark + #2C3A40 light). --- */
  --text-body: color-mix(in srgb, var(--text-primary) 72%, var(--text-muted));
}

/* ============================================================================
   Scroll reveal — sections fade/rise once as they enter the viewport. The
   .reveal class is inert until JS adds .reveal-on (so no-JS shows everything),
   and it collapses to a plain fade under prefers-reduced-motion.
   ============================================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--dur-slow, 300ms) var(--ease-entrance, var(--ease)),
                transform var(--dur-slow, 300ms) var(--ease-entrance, var(--ease));
  }
  .reveal-on .reveal.is-in { opacity: 1; transform: none; }
}




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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--surface-dominant);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-feature-settings: 'tnum' 1, 'ss01' 1;  /* tabular numerals, slashed zero */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(76,111,255,0.35); color: #fff; }

/* --- Accessibility: visible focus ring (accent, UI/large per a11y constraint) --- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 3px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent-primary); color: #fff;
  padding: var(--space-2) var(--space-4); border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100; text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ============================================================================
   Header / Footer (shared chrome — Common Region via hairline)
   ============================================================================ */
.site-header {
  border-bottom: 1px solid var(--surface-line);
  /* Derived from the surface token so the frosted bar is correct in BOTH themes
     (was a hardcoded rgba + a light-theme override). */
  background: color-mix(in srgb, var(--surface-dominant) 76%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex; align-items: center; gap: var(--space-5);
}
.site-header__lockup { display: flex; align-items: center; text-decoration: none; }
/* ONE combined lockup — founder-approved canonical mark+wordmark in a
   single file. Logo:wordmark ratio is baked into the asset, so it
   scales as one unit and can NEVER drift. Theme-mapped: dark-panel lockup on dark,
   white-panel lockup on light. width/height attrs hint the ~3.31:1 ratio (avoid CLS). */
/* 48px (was 40): at 40px the wordmark strokes rendered muddy on 1x displays
   and the founder flagged it (2026-07-09). */
.site-header__lockup .site-header__mark { height: 48px; width: auto; display: block; flex: 0 0 auto; }
.site-header__lockup .mark-light { display: none; }
.site-header__lockup .mark-dark { display: block; }
/* Explicit light choice (data-theme wins over OS) swaps to the light-surface lockup. */
:root[data-theme='light'] .site-header__lockup .mark-dark { display: none; }
:root[data-theme='light'] .site-header__lockup .mark-light { display: block; }
/* OS light — only when the user has NOT made an explicit choice (no-JS fallback;
   the inline theme-init script always sets data-theme when JS runs). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .site-header__lockup .mark-dark { display: none; }
  :root:not([data-theme]) .site-header__lockup .mark-light { display: block; }
}
.site-header__nav { margin-left: auto; display: flex; gap: var(--space-5); align-items: center; }
.site-header__nav a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  transition: color var(--dur) var(--ease);
}
.site-header__nav a:hover { color: var(--text-primary); }
.site-header__cta {
  background: var(--brand-gradient); color: var(--ink-on-brand) !important;
  /* Buttons standardize on --radius-md (founder 2026-07-09): matches the
     waitlist submit + form inputs; labels/chips stay pill. */
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.85rem;
  white-space: nowrap;  /* never wrap "Join waitlist" to 2 lines on narrow */
}
.site-header__cta:hover { filter: brightness(1.06); }
/* Touch devices: pad the header CTA up to the 44px hit-area guideline
   (design critique — it measured ~32px). Theme-toggle twin lives next to its
   base rule further down (must follow it in source order to win). */
@media (pointer: coarse) {
  .site-header__cta { padding: var(--space-3) var(--space-5); }
}

.site-footer {
  border-top: 1px solid var(--surface-line);
  margin-top: var(--space-9);
  padding: var(--space-7) var(--space-5);
}
.site-footer__inner {
  max-width: var(--max-content); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  align-items: center; justify-content: space-between;
}
.site-footer__meta { color: var(--text-muted); font-size: 0.85rem; }
.site-footer__nav { display: flex; gap: var(--space-5); }
.site-footer__nav a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.site-footer__nav a:hover { color: var(--text-primary); }

/* ============================================================================
   Listing page — hero, sections, cards
   ============================================================================ */
.listing { max-width: var(--max-content); margin: 0 auto; padding: 0 var(--space-5); }

.hero {
  padding: var(--space-9) 0 var(--space-7);
  border-bottom: 1px solid var(--surface-line);
  margin-bottom: var(--space-7);
  display: flex; align-items: center; gap: var(--space-7);
}
.hero__copy { flex: 1 1 auto; }

/* Hero mini puzzle-board — 3x3, one tile "placed" top-right (logo story) */
.hero__board {
  flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px;
  width: 156px; height: 156px; padding: 10px;
  background: var(--surface-secondary);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-card);
}
.hero__cell { border-radius: 7px; background: rgba(138,151,160,0.12); }
.hero__cell.is-filled { background: rgba(138,151,160,0.28); }
.hero__cell.is-placed {
  background: var(--brand-gradient);
  box-shadow: 0 0 0 1px rgba(63,214,176,0.4), 0 6px 16px rgba(76,111,255,0.35);
  animation: tile-place 600ms var(--ease) both;
}
@keyframes tile-place {
  0% { transform: scale(0) rotate(-18deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(6deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Section mark — small placed-tile bullet before the heading */
.section__mark {
  width: 14px; height: 14px; border-radius: 4px;
  background: var(--brand-gradient); transform: rotate(12deg);
  flex: 0 0 auto; align-self: center;
}
.hero__eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-mint-text); margin-bottom: var(--space-3);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-5);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-bottom: var(--space-4);
}
.hero h1 .accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-muted); font-size: var(--step-1); max-width: 56ch; line-height: 1.6;
}

.section { margin-bottom: var(--space-8); }
.section__head {
  display: flex; align-items: baseline; gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.section__head h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-3); letter-spacing: -0.01em;
}
.section__head .count {
  color: var(--text-muted); font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* Pillar cards — large, featured (Gestalt: common region + proximity) */
.card-grid { display: grid; gap: var(--space-4); }
.card-grid--pillars { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card {
  display: flex; flex-direction: column;
  /* Mint Arcade: pillar cards are hue-blocked plates — the category hue washed
     into the surface + border (falls back to the neutral line hue when a card
     carries no category class). Hue is always redundant with glyph + label. */
  --card-hue: var(--surface-line);
  background: color-mix(in srgb, var(--card-hue) 9%, var(--surface-secondary));
  border: 1px solid color-mix(in srgb, var(--card-hue) 32%, var(--surface-line));
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-decoration: none; color: inherit;
  box-shadow: var(--elev-card);
  transition: transform var(--dur) var(--ease-settle),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  position: relative; overflow: hidden;
}
.card--sudoku     { --card-hue: var(--cat-sudoku); }
.card--nonogram   { --card-hue: var(--cat-nonogram); }
.card--logic-grid { --card-hue: var(--cat-queens); }
.card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--elev-card-hover);
  border-color: color-mix(in srgb, var(--card-hue) 55%, var(--surface-line));
}
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }
/* Level number — an oversized Fraunces numeral bleeding off the card corner
   (Mint Arcade, matches the homepage story steps). Decorative: real order is
   the grid order. */
.card__level {
  position: absolute; top: -0.24em; right: var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(3rem, 2.6rem + 1.6vw, 4rem); font-weight: 600; line-height: 1;
  color: color-mix(in srgb, var(--card-hue) 38%, transparent);
  font-variant-numeric: tabular-nums;
  transition: color var(--dur) var(--ease);
  pointer-events: none; user-select: none;
}
.card:hover .card__level { color: color-mix(in srgb, var(--card-hue) 60%, transparent); }
/* Placed-tile — a tile "snaps" into the corner on hover (the brand verb) */
.card__tile {
  position: absolute; right: -10px; bottom: -10px;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand-gradient);
  transform: rotate(12deg) scale(0.4); opacity: 0;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.card:hover .card__tile { transform: rotate(12deg) scale(1); opacity: 0.9; }
.cat-glyph { display: block; flex: 0 0 auto; }
/* Per-puzzle accent families — the puzzle hues generated from CANONICAL (was
   ad-hoc #6E8BFF/#C49BFF drift). Glyph carries color-independence. These color
   rules drive the cluster-row glyphs and the pill glyph via currentColor. */
.cat--sudoku    { color: var(--cat-sudoku);       --chip-hue: var(--cat-sudoku); }
.cat--nonogram  { color: var(--accent-mint-text); --chip-hue: var(--accent-mint); }
.cat--logic-grid{ color: var(--cat-queens);       --chip-hue: var(--cat-queens); }
.cat--general   { color: var(--text-muted);       --chip-hue: var(--text-muted); }
/* Category pill (AA fix, UI-WOW §5.4): the hue moves to a TINT + border + the
   glyph; the LABEL reads in --text-body so every pill clears 4.5:1 in both
   themes without inventing deepened per-hue text hexes (that canonical token
   pair remains the open DesignDirector follow-up). Declared after the .cat--*
   color rules so the label override wins at equal specificity. */
.card__cat {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-3);
  color: var(--text-body);
  background: color-mix(in srgb, var(--chip-hue, var(--text-muted)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-hue, var(--text-muted)) 45%, transparent);
}
/* The pill's glyph keeps the category hue (currentColor cascades from .cat--*
   would be overridden by the label color above, so re-point it explicitly). */
.card__cat.cat--sudoku     .cat-glyph { color: var(--cat-sudoku); }
.card__cat.cat--nonogram   .cat-glyph { color: var(--accent-mint-text); }
.card__cat.cat--logic-grid .cat-glyph { color: var(--cat-queens); }
.card__cat.cat--general    .cat-glyph { color: var(--text-muted); }

.card__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-2); line-height: 1.25; margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}
.card__desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.55; }
.card__foot {
  margin-top: auto; padding-top: var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--text-muted); font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.card__arrow { margin-left: auto; color: var(--accent-primary); transition: transform var(--dur) var(--ease); }
.card:hover .card__arrow { transform: translateX(3px); }

/* Cluster list — compact rows (Similarity) */
.card-grid--clusters { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface-secondary);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-decoration: none; color: inherit;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
/* Hover tint derived from tokens: mixing text.primary into the card surface
   lightens on dark and darkens on light, so ONE rule works in both themes
   (was #1F2832 + a separate light-theme override). */
.row:hover {
  border-color: color-mix(in srgb, var(--row-hue, var(--accent-primary)) 45%, transparent);
  background: color-mix(in srgb, var(--text-primary) 6%, var(--surface-secondary));
  transform: translateY(-2px);
}
/* Cluster rows glow in their own category hue on hover (Mint Arcade). */
.row--sudoku     { --row-hue: var(--cat-sudoku); }
.row--nonogram   { --row-hue: var(--cat-nonogram); }
.row--logic-grid { --row-hue: var(--cat-queens); }
.row__glyph { display: flex; flex: 0 0 auto; transition: transform var(--dur) var(--ease); }
.row:hover .row__glyph { transform: rotate(8deg) scale(1.08); }
.row__title { font-weight: 500; font-size: 0.98rem; color: var(--text-primary); line-height: 1.3; }
.row__arrow { margin-left: auto; color: var(--text-muted); }

/* ============================================================================
   Article reading experience
   ============================================================================ */
.article-shell { max-width: var(--max-content); margin: 0 auto; padding: var(--space-6) var(--space-5) 0; }

.breadcrumb {
  display: flex; gap: var(--space-2); align-items: center;
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: var(--space-5);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb .sep { opacity: 0.5; }

.article-container { max-width: var(--measure); margin: 0 auto; padding-bottom: var(--space-8); }

.article-meta {
  display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center;
  margin-bottom: var(--space-6); color: var(--text-muted); font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }

.draft-banner {
  background: rgba(242,179,61,0.12);
  border: 1px solid rgba(242,179,61,0.35);
  color: var(--semantic-caution);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 0.85rem; margin-bottom: var(--space-6);
  display: flex; gap: var(--space-2); align-items: center;
}

article > :first-child { margin-top: 0; }

article h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-4);
  line-height: 1.12; letter-spacing: -0.02em;
  margin-bottom: var(--space-4); color: var(--text-primary);
}
article h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-3); letter-spacing: -0.01em;
  margin: var(--space-8) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--surface-line);
  scroll-margin-top: 80px;
}
article h3 {
  font-size: var(--step-2); font-weight: 600;
  margin: var(--space-6) 0 var(--space-2); color: var(--text-primary);
  scroll-margin-top: 80px;
}
article p { margin-bottom: var(--space-5); color: var(--text-body); }
article strong { color: var(--text-primary); font-weight: 600; }
article a {
  color: var(--accent-mint-text); text-decoration: none;
  border-bottom: 1px solid rgba(63,214,176,0.35);
  transition: border-color var(--dur) var(--ease);
}
article a:hover { border-bottom-color: var(--accent-mint); }

article ul, article ol { margin: 0 0 var(--space-5) var(--space-5); color: var(--text-body); }
article li { margin-bottom: var(--space-2); padding-left: var(--space-1); }
article li::marker { color: var(--accent-primary); }

article blockquote {
  border-left: 3px solid var(--accent-primary);
  background: rgba(76,111,255,0.06);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted); font-style: italic;
}
article blockquote p:last-child { margin-bottom: 0; }

/* Callout / example blocks */
article .callout, article :global(.callout) {
  background: rgba(76,111,255,0.07);
  border: 1px solid rgba(76,111,255,0.22);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
}

/* Code — monospace example grids (tabular, github-dark shiki) */
article code {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
  font-size: 0.9em;
  background: rgba(255,255,255,0.06);
  padding: 0.15em 0.4em; border-radius: 5px;
}
article pre {
  background: #0B0F14 !important;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  overflow-x: auto; margin: var(--space-6) 0;
  font-size: 0.9rem; line-height: 1.6;
}
article pre code { background: none; padding: 0; }

/* Inline diagrams/images must never overflow the measure on small screens.
   SVGs carry a viewBox, so capping width + auto height preserves aspect ratio. */
article svg, article img {
  max-width: 100%;
  height: auto;
}

/* ── Guide-content color utilities (UI-WOW §5.5) ──
   Replace the raw-hex inline styles that were scattered through the guide MDX
   (invisible to the brand guard, frozen to dark-theme values). All token-driven,
   so guide figures/captions/series-navs now adapt to light theme AND the
   colorblind-safe palette. Use these in MDX; never inline a hex. */
.tx-ink     { color: var(--text-primary); }
.tx-muted   { color: var(--text-muted); }
.tx-blue    { color: var(--accent-primary); }
.tx-mint    { color: var(--accent-mint-text); }
.tx-caution { color: var(--semantic-caution); }
.tx-error   { color: var(--semantic-error); }
.tx-success { color: var(--semantic-success); }
.tx-queens  { color: var(--cat-queens); }
.tx-sudoku  { color: var(--cat-sudoku); }
/* Figure caption under inline SVG diagrams. */
article figcaption, .figcap {
  font-size: 0.8125rem; color: var(--text-muted);
  margin-top: var(--space-2); font-family: var(--font-body);
}
/* Series navigation strip (the Sudoku Hub/Beginner/… breadcrumb band). */
.series-nav {
  margin: var(--space-5) 0; padding: 0.875rem 1.1rem;
  background: color-mix(in srgb, var(--series-hue, var(--accent-primary)) 8%, transparent);
  border-left: 3px solid var(--series-hue, var(--accent-primary));
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.875rem; line-height: 1.6;
}
.series-nav--queens { --series-hue: var(--cat-queens); }
.series-nav--sudoku { --series-hue: var(--cat-sudoku); }
.series-nav--mint   { --series-hue: var(--accent-mint); }
/* Level cards on the Sudoku hub (was an inline dark #1A222B block that stayed
   dark in light theme). */
.level-card {
  padding: 1.25rem 1.5rem; margin: var(--space-4) 0;
  background: var(--surface-secondary);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--level-hue, var(--accent-mint));
}
.level-card--mint   { --level-hue: var(--accent-mint); }
.level-card--blue   { --level-hue: var(--accent-primary); }
.level-card--queens { --level-hue: var(--cat-queens); }
.level-card__eyebrow {
  font-size: 0.75rem; font-family: var(--font-body);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem;
}
.level-card__title {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
  color: var(--text-primary); text-decoration: none; display: block;
  margin-bottom: 0.4rem; border-bottom: none;
}
.level-card p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

article table {
  width: 100%; border-collapse: collapse; margin: var(--space-6) 0;
  font-size: 0.92rem; font-variant-numeric: tabular-nums;
}
article th, article td {
  text-align: left; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--surface-line);
}
article th { background: var(--surface-secondary); color: var(--text-primary); font-weight: 600; }

article hr { border: none; border-top: 1px solid var(--surface-line); margin: var(--space-7) 0; }

/* FAQ section (paired with FAQPage schema) */
article .faq h2, article :global(.faq) h2 { border-bottom: none; }
article details {
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  background: var(--surface-secondary);
}
article details summary {
  cursor: pointer; font-weight: 600; color: var(--text-primary);
  list-style: none; display: flex; align-items: center; justify-content: space-between;
}
article details summary::-webkit-details-marker { display: none; }
article details summary::after { content: '+'; color: var(--accent-primary); font-size: 1.2rem; }
article details[open] summary::after { content: '−'; }
article details[open] summary { margin-bottom: var(--space-3); }

/* End-of-article CTA back to the app — the page's conversion moment, so it gets
   a soft mint glow behind the card to lift it off the page. */
.article-cta {
  position: relative; isolation: isolate; overflow: hidden;
  margin: var(--space-8) 0 var(--space-7);
  background: var(--surface-secondary);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
}
.article-cta::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -60%; left: 50%; transform: translateX(-50%);
  width: min(520px, 120%); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--accent-mint) 16%, transparent) 0%, transparent 62%);
}
.article-cta h3 { font-family: var(--font-display); font-size: var(--step-2); margin-bottom: var(--space-2); }
.article-cta p { color: var(--text-muted); margin-bottom: var(--space-4); }
.article-cta a {
  display: inline-block; background: var(--brand-gradient); color: var(--ink-on-brand);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
  font-weight: 600; text-decoration: none; border: none;
  transition: filter var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.article-cta a:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  /* Tighten header chrome so the nav (Guides + theme toggle + CTA)
     fits a single row down to 360px with no horizontal overflow (RULE 6). */
  .site-header__inner { padding: var(--space-3); gap: var(--space-2); }
  .site-header__nav { gap: var(--space-2); }
  .theme-toggle { width: 32px; height: 32px; }
  .theme-toggle svg { width: 16px; height: 16px; }
  .site-header__cta { padding: var(--space-2) var(--space-3); }
  .site-header__lockup .site-header__mark { height: 34px; }
  .listing, .article-shell { padding-left: var(--space-4); padding-right: var(--space-4); }
  .hero {
    padding: var(--space-7) 0 var(--space-6);
    flex-direction: column; align-items: flex-start;
  }
  /* Standalone board reads awkward stacked on narrow screens — drop it here;
     the puzzle motif still carries via glyph badges, level numbers, tile bullets. */
  .hero__board { display: none; }
  .card-grid--pillars { grid-template-columns: 1fr; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
}

/* ============================================================================
   Reduced motion — honor user preference (Motion lens)
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover, .row:hover { transform: none; }
  /* Reveal must never leave content invisible when motion is reduced. */
  .reveal-on .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================================
   Light theme — the token color VALUES live in the GENERATED
   light block below (build-tokens.mjs) so both theme paths stay in
   lockstep from a single source.

   Most former light-theme overrides are GONE because their values are now
   derived from tokens and therefore correct in both themes automatically:
     · .site-header background  → color-mix on --surface-dominant
     · .site-header__cta / .article-cta ink → --ink-on-brand (theme-invariant)
     · article prose            → --text-body
     · .row:hover               → color-mix on --text-primary
   Only genuinely light-specific, non-token tweaks remain.
   ============================================================================ */
/* === GENERATED-TOKENS-LIGHT-START — do not edit === */
/* Light-theme token overrides. Same mechanism as above — replace everything
   between the START/END markers to regenerate. */
:root[data-theme='light'] {
  --surface-dominant:  #F7FAF9;
  --surface-secondary: #FFFFFF;
  --surface-line:      #DBE3E2;
  --text-primary:      #101820;    /* AA+ 17.04:1 on dominant */
  --text-muted:        #5C6B72;      /* AA  5.26:1 on dominant */
  --accent-mint-text:  #0C7A60;  /* deepened mint TEXT — 5.04:1 on #F7FAF9 / 5.29:1 on #FFFFFF
                                  (DD-locked; raw #3FD6B0 is only ~1.8:1 on white). */
}
/* === GENERATED-TOKENS-LIGHT-END === */

:root[data-theme='light'] body { -webkit-font-smoothing: auto; }
/* Keep code blocks dark in light theme (shiki github-dark highlights). */
:root[data-theme='light'] article pre { background: #0B0F14 !important; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) body { -webkit-font-smoothing: auto; }
  :root:not([data-theme]) article pre { background: #0B0F14 !important; }
}

/* ============================================================================
   Theme toggle control — token-driven UI chip in the header nav.
   Sun icon shown in dark mode (click → light), moon in light mode (click → dark).
   Icons are currentColor UI glyphs (not brand assets). No ad-hoc color.
   ============================================================================ */
/* Bare icon button — no circular border/chip (founder found the ring
   around the sun/moon glyph odd). Just the currentColor glyph with a hover tint
   and a keyboard focus ring. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: transparent; color: var(--text-muted);
  border: none; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.theme-toggle:hover { color: var(--text-primary); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
/* Touch devices: grow to the 44px hit-area guideline (design critique). */
@media (pointer: coarse) {
  .theme-toggle { width: 44px; height: 44px; }
}
/* Default both glyphs hidden, then show exactly one per resolved theme. This
   avoids the specificity fight where `.theme-toggle svg { display:block }`
   (0,1,1) beat `.theme-toggle__moon { display:none }` (0,1,0), leaving BOTH
   glyphs visible in dark mode. */
.theme-toggle svg { display: none; width: 18px; height: 18px; }
:root[data-theme='dark'] .theme-toggle__sun { display: block; }
:root[data-theme='light'] .theme-toggle__moon { display: block; }
/* No explicit data-theme yet (JS not run): mirror the dark-first default,
   respecting an OS light preference. ThemeScript normally sets data-theme
   before paint, so this only guards the no-JS / pre-hydration edge. */
:root:not([data-theme]) .theme-toggle__sun { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle__sun { display: none; }
  :root:not([data-theme]) .theme-toggle__moon { display: block; }
}

/* ============================================================================
   Social follow — footer row + standalone CTA (token-driven, currentColor glyphs)
   ============================================================================ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.social-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
}
.social-links a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--text-muted); text-decoration: none;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.social-links a:hover { color: var(--text-primary); }
.social-links svg { display: block; }

/* Compact footer row — icon-only chips */
.social-links--row a {
  width: 36px; height: 36px; justify-content: center;
  border: 1px solid var(--surface-line); border-radius: var(--radius-pill);
}
.social-links--row a:hover { border-color: var(--text-muted); }

/* Standalone CTA block */
.social-cta {
  max-width: var(--max-content); margin: var(--space-7) auto 0;
  padding: var(--space-6); border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg); background: var(--surface-secondary);
  text-align: center;
}
.social-cta__heading {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.25rem; color: var(--text-primary); margin: 0;
}
.social-cta__sub { color: var(--text-muted); font-size: 0.9rem; margin: var(--space-2) 0 var(--space-5); }
.social-links--cta { justify-content: center; gap: var(--space-3); }
.social-links--cta a {
  padding: var(--space-2) var(--space-4); font-size: 0.85rem; font-weight: 500;
  border: 1px solid var(--surface-line); border-radius: var(--radius-pill);
}
.social-links--cta a:hover { border-color: var(--text-muted); }

/* Per-post footer follow CTA (BlogPost) */
.post-follow {
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: 1px solid var(--surface-line);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4);
}
.post-follow__label { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
