/* The blog, in the landing's world (apps/web/DESIGN.md): graphite dark by default, cream light,
   Newsreader for headings, Geist for text, Geist Mono for figures. Flat: no gradients, glows or
   tinted boxes. Neon is the one CTA (Start the challenge); phthalo marks money only. */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/geist-400-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/geist-400-700-latin.woff2') format('woff2'); 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; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/geist-mono-400-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/geist-mono-400-600-latin.woff2') format('woff2'); 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; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('/fonts/newsreader-400-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('/fonts/newsreader-400-500-latin.woff2') format('woff2'); 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; }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/newsreader-italic-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/newsreader-italic-400-latin.woff2') format('woff2'); 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; }

/* ---------- tokens: the landing's graphite (dark) and cream (light) ladders ---------- */
:root {
  --background: 200 12% 4.5%;
  --muted: 200 12% 3%;
  --card: 200 7% 8.5%;
  --card-hover: 200 6% 11.5%;
  --secondary: 200 6% 12.5%;
  --popover: 200 6% 14%;
  --border: 200 6% 17%;
  --foreground: 60 10% 96%;
  --muted-foreground: 200 6% 68%;
  --foreground-3: 200 5% 52%;
  --structure: 228 3.4% 28.8%;
  --primary: 144 100% 50%;
  --primary-foreground: 200 30% 4%;
  --ring: 144 100% 50%;
  --long: 168 62% 46%;
  --short: 350 88% 63%;
  --warning: 48 87.2% 63.1%;
  --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --font-serif: 'Newsreader', Georgia, serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --nav-h: 64px;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --background: 48 18.5% 94.7%;
  --muted: 50 13.6% 91.4%;
  --card: 45 33.3% 97.6%;
  --card-hover: 50 15.8% 92.5%;
  --secondary: 51 12.7% 89.2%;
  --popover: 0 0% 100%;
  --border: 51 9.3% 85.3%;
  --foreground: 225 8.3% 9.4%;
  --muted-foreground: 225 5.1% 30.6%;
  --foreground-3: 222 5.1% 38.4%;
  --structure: 228 2.8% 64.9%;
  --primary: 144 88% 46%;
  --primary-foreground: 200 30% 6%;
  --ring: 225 8.3% 9.4%;
  --long: 171 72% 25%;
  --short: 350 75% 42%;
  --warning: 43 100% 27.1%;
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 24px); scrollbar-color: hsl(var(--structure)) hsl(var(--background)); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: hsl(var(--foreground));
}
::selection { background: hsl(var(--foreground)); color: hsl(var(--background)); }
a { color: inherit; text-decoration: none; }
:where(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
:is(button, a, summary) { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img, svg { display: block; }
h1, h2, h3, h4, p, ol, ul, figure, blockquote { margin: 0; }
.serif { font-family: var(--font-serif); font-optical-sizing: auto; font-weight: 400; letter-spacing: -0.02em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.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; }
.fill-primary { fill: hsl(var(--primary)); }
.fill-foreground { fill: hsl(var(--foreground)); }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 60; padding: 10px 16px; background: hsl(var(--foreground)); color: hsl(var(--background)); font-size: 14px; font-weight: 600; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1320px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
@media (min-width: 1024px) { .wrap { padding: 0 40px; } }

/* ---------- buttons: square, semibold ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border: 0; border-radius: 0;
  font: 600 14px/1 var(--font-sans); white-space: nowrap; cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), filter 150ms var(--ease);
}
.btn-neon { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-neon:hover { filter: brightness(1.1); }
.btn-neon:active { filter: brightness(0.95); }
:root[data-theme='light'] .btn-neon { box-shadow: 0 1px 2px hsl(var(--foreground) / 0.12), 0 4px 12px hsl(var(--foreground) / 0.1); }
.btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--foreground)); font-weight: 500; }
.btn-secondary:hover { background: hsl(var(--card-hover)); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--secondary)); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  background: transparent; border: 0; color: hsl(var(--muted-foreground)); cursor: pointer; list-style: none;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary)); }
@media (min-width: 1024px) { .icon-btn { width: 40px; height: 40px; } }

/* ---------- header ---------- */
.nav { position: sticky; top: 0; z-index: 40; height: var(--nav-h); background: hsl(var(--background)); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; height: 44px; font-size: 16px; font-weight: 600; line-height: 1; }
.brand-mark { width: 24px; height: 24px; }
.nav-links { display: none; gap: 32px; margin-left: 24px; font-size: 14px; font-weight: 500; }
.nav-links a { color: hsl(var(--muted-foreground)); transition: color 150ms var(--ease); }
.nav-links a:hover, .nav-links a[aria-current], .nav-links a.is-section { color: hsl(var(--foreground)); }
.nav-act { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-desk { display: none; }
@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .nav-desk { display: inline-flex; }
  .menu { display: none; }
}

/* Theme glyph (ThemeGlyph): the sun sets while the crescent rises; the button offers the other theme. */
.icon-btn svg { overflow: hidden; }
.tg-sun, .tg-moon, .tg-disc, .tg-rays { transform-box: fill-box; transform-origin: center; transition: transform 340ms cubic-bezier(0.65, 0, 0.35, 1), opacity 340ms cubic-bezier(0.65, 0, 0.35, 1); }
.tg-rays { transform-origin: 12px 12px; transform-box: view-box; }
.tg-moon { opacity: 0; transform: translateY(10px) rotate(-35deg); }
:root[data-theme='light'] .tg-sun { opacity: 0; transform: translateY(9px); }
:root[data-theme='light'] .tg-disc { transform: scale(0.6); }
:root[data-theme='light'] .tg-rays { transform: scale(0) rotate(60deg); }
:root[data-theme='light'] .tg-moon { opacity: 1; transform: none; transition-delay: 120ms; }
:root:not([data-theme='light']) .tg-sun { transition-delay: 120ms; }

/* Phone menu: a native disclosure, full width under the bar. */
.menu > summary .menu-close, .menu[open] > summary .menu-open { display: none; }
.menu[open] > summary .menu-close { display: inline; }
.menu-panel {
  position: fixed; left: 0; right: 0; top: var(--nav-h); bottom: 0; z-index: 39;
  display: flex; flex-direction: column; gap: 32px; padding: 24px 16px calc(32px + env(safe-area-inset-bottom, 0px));
  background: hsl(var(--background)); overflow-y: auto;
}
.menu-panel nav { display: flex; flex-direction: column; }
.menu-panel nav a { display: flex; align-items: center; min-height: 56px; font: 400 32px/1.1 var(--font-serif); letter-spacing: -0.02em; color: hsl(var(--muted-foreground)); }
.menu-panel nav a[aria-current], .menu-panel nav a.is-section { color: hsl(var(--foreground)); }
.menu-act { display: grid; gap: 8px; margin-top: auto; }
.menu-act .btn { height: 52px; font-size: 16px; }

/* Reading progress (articles): a hairline under the bar, driven by the scroll itself. */
.progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress {
      display: block; position: fixed; z-index: 41; left: 0; right: 0; top: calc(var(--nav-h) - 2px); height: 2px;
      background: hsl(var(--foreground)); transform-origin: 0 50%; transform: scaleX(0);
      animation: progress linear both; animation-timeline: scroll(root);
    }
  }
}
@keyframes progress { to { transform: scaleX(1); } }

/* ---------- covers: the generated plates (covers.py), one per post, both themes ---------- */
.cover { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: hsl(var(--muted)); }
.cover > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.cover .cv-light { display: none; }
:root[data-theme='light'] .cover .cv-dark { display: none; }
:root[data-theme='light'] .cover .cv-light { display: block; }

/* Reading-length cells beside the minutes. */
.card-len { display: inline-flex; align-items: center; gap: 8px; }
.len { display: inline-flex; gap: 2px; }
.len i { display: block; width: 4px; height: 10px; background: hsl(var(--structure)); }
.len i.on { background: hsl(var(--foreground) / 0.8); }

/* ---------- index ---------- */
.ix-head { padding-top: clamp(48px, 7vw, 104px); padding-bottom: clamp(32px, 4vw, 56px); display: grid; gap: 20px; }
.ix-head h1 { max-width: 17ch; font-size: clamp(44px, 6.4vw, 96px); line-height: 0.98; text-wrap: balance; }
.b-sub { max-width: 56ch; font-size: 18px; line-height: 1.5; color: hsl(var(--muted-foreground)); text-wrap: pretty; }

/* Featured guide + Latest (21st.dev Filterable Blog Index hero, Split Image Blog List). */
.hero { display: grid; gap: 40px; }
@media (min-width: 1024px) { .hero { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; align-items: stretch; } }
.feature { display: grid; background: hsl(var(--card)); transition: background-color 200ms var(--ease); }
.feature:hover { background: hsl(var(--card-hover)); }
.feature-body { display: grid; gap: 16px; align-content: start; padding: clamp(20px, 3vw, 40px); }
.feature-title { max-width: 22ch; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.02; text-wrap: balance; }
.feature-desc { max-width: 58ch; font-size: 17px; line-height: 1.55; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
.feature-go { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.feature-go svg, .latest-go svg, .more-all svg { transition: transform 200ms var(--ease); }
.feature:hover .feature-go svg { transform: translateX(4px); }
.latest-head { padding-bottom: 12px; font-size: 13px; font-weight: 400; color: hsl(var(--foreground-3)); border-bottom: 1px solid hsl(var(--border)); }
.latest ol { list-style: none; padding: 0; }
.latest li { border-bottom: 1px solid hsl(var(--border)); }
.latest a { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 20px 0; }
.latest-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 12px; color: hsl(var(--foreground-3)); }
.latest-title { grid-column: 1; font: 400 22px/1.3 var(--font-serif); letter-spacing: -0.015em; text-wrap: balance; }
.latest-go { grid-column: 2; grid-row: 1 / 3; align-self: center; color: hsl(var(--foreground-3)); transition: color 150ms var(--ease); }
.latest a:hover .latest-go { color: hsl(var(--foreground)); }
.latest a:hover .latest-go svg { transform: translateX(4px); }
.latest a:hover .latest-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: hsl(var(--foreground-3)); }

/* Every guide: topic pills over a cover grid (21st.dev Filterable Blog Index). */
.library { padding-top: clamp(72px, 9vw, 128px); }
.lib-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 32px; margin-bottom: 32px; }
.lib-head h2 { font-size: clamp(34px, 4vw, 56px); line-height: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 0;
  background: hsl(var(--card)); color: hsl(var(--muted-foreground)); font: 500 14px/1 var(--font-sans); cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.pill .mono { font-size: 12px; color: hsl(var(--foreground-3)); }
.pill:hover { color: hsl(var(--foreground)); background: hsl(var(--card-hover)); }
.pill[aria-pressed='true'] { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.pill[aria-pressed='true'] .mono { color: hsl(var(--background) / 0.7); }
.anchor { display: block; }

.grid { list-style: none; padding: 0; display: grid; gap: 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.card-li[hidden] { display: none; }
.card { display: flex; flex-direction: column; height: 100%; background: hsl(var(--card)); transition: background-color 200ms var(--ease); }
.card:hover { background: hsl(var(--card-hover)); }
.card:hover .cover img, .feature:hover .cover img { transform: scale(1.02); }
.card-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 20px 20px 22px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; font-size: 12px; color: hsl(var(--foreground-3)); }
.feature .card-meta { justify-content: flex-start; }
.card-title { font-size: clamp(22px, 1.9vw, 26px); line-height: 1.12; text-wrap: balance; }
.card-desc { font-size: 15px; line-height: 1.55; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
.card-date { margin-top: auto; padding-top: 8px; font-size: 12px; color: hsl(var(--foreground-3)); }
/* Rhythm (21st.dev bento): every seventh guide is a wide card on the post's 3:1 plate. */
.grid { grid-auto-flow: dense; }
@media (min-width: 640px) { .card-li.wide { grid-column: span 2; } }
.card-li.wide .cover { aspect-ratio: 3 / 1; }
.card-li.wide .card-title { font-size: clamp(24px, 2.4vw, 34px); max-width: 26ch; }
.card-li.wide .card-desc { max-width: 62ch; }
/* Phones: two plates a row, title and length only, so 18 guides stay a short scroll. */
@media (max-width: 639px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid .card-body { gap: 8px; padding: 12px 12px 14px; }
  .grid .card-title { font-size: 17px; line-height: 1.2; }
  .grid .card-li.wide { grid-column: span 2; }
  .grid .card-li.wide .card-title { font-size: 22px; }
  .grid .card-meta > span:first-child, .grid .card-desc, .grid .card-date { display: none; }
  .pill { min-height: 40px; padding: 0 12px; font-size: 13px; }
}

/* ---------- article ---------- */
.post-head { display: grid; gap: 24px; padding-top: clamp(40px, 6vw, 96px); }
.post-kicker { display: flex; gap: 10px; font-size: 13px; color: hsl(var(--foreground-3)); }
.post-kicker a { color: hsl(var(--muted-foreground)); transition: color 150ms var(--ease); }
.post-kicker a:hover { color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 4px; }
.post-head h1 { max-width: 20ch; font-size: clamp(40px, 5.6vw, 80px); line-height: 0.98; text-wrap: balance; }
.post-dek { max-width: 46ch; font: 400 clamp(20px, 1.9vw, 26px)/1.4 var(--font-serif); letter-spacing: -0.01em; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: hsl(var(--foreground-3)); }
.post-meta > span:first-child { color: hsl(var(--foreground)); }
.post-cover { margin-top: clamp(32px, 4vw, 56px); }
.cover-wide { aspect-ratio: 3 / 1; }
@media (max-width: 639px) { .cover-wide { aspect-ratio: 16 / 9; } }

.post-grid { display: grid; gap: 56px; padding-top: clamp(40px, 5vw, 72px); }
@media (min-width: 1100px) {
  .post-grid { grid-template-columns: minmax(0, 68ch) minmax(0, 300px); justify-content: space-between; column-gap: 64px; }
  .post-side { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; }
}
@media (min-width: 1280px) { .post-grid { padding-left: 96px; } }
.post-main { min-width: 0; max-width: 68ch; }

/* The inline contents, long guides only: one closed line until opened. */
.toc { margin-bottom: 40px; border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.toc > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 500; }
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary .mono { font-size: 12px; font-weight: 400; color: hsl(var(--foreground-3)); }
.toc > summary .mono::after { content: '+'; margin-left: 12px; font-size: 16px; }
.toc[open] > summary .mono::after { content: '\2212'; }
.toc ol { list-style: none; padding: 0 0 16px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 32px 1fr; padding: 6px 0; font-size: 15px; line-height: 1.4; color: hsl(var(--muted-foreground)); }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 400 12px/1.9 var(--font-mono); color: hsl(var(--foreground-3)); }
.toc a:hover { color: hsl(var(--foreground)); }

/* The sidebar (21st.dev Article With Author Sidebar): who publishes this, then more on the topic. */
.post-side { display: grid; gap: 40px; }
.side-card { display: grid; gap: 16px; padding: 24px; background: hsl(var(--card)); }
.side-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.side-mark { width: 24px; height: 24px; }
.side-line { font-size: 15px; line-height: 1.55; color: hsl(var(--muted-foreground)); }
.side-card .btn { justify-self: start; }
.side-head { padding-bottom: 12px; font-size: 12px; color: hsl(var(--foreground-3)); border-bottom: 1px solid hsl(var(--border)); }
.side-rel ul { list-style: none; padding: 0; }
.side-rel li { border-bottom: 1px solid hsl(var(--border)); }
.side-rel a { display: grid; gap: 6px; padding: 16px 0; }
.side-title { font: 400 19px/1.3 var(--font-serif); letter-spacing: -0.01em; text-wrap: balance; }
.side-min { font-size: 12px; color: hsl(var(--foreground-3)); }
.side-rel a:hover .side-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: hsl(var(--foreground-3)); }

/* The reading column: ~68 characters, a standfirst, numbered sections, a type scale with clear steps. */
.prose { font-size: 17px; line-height: 1.72; color: hsl(var(--foreground) / 0.88); counter-reset: sec; }
@media (min-width: 768px) { .prose { font-size: 18px; } }
.prose > * + * { margin-top: 1.15em; }
.prose > p:first-child { font-size: 1.2em; line-height: 1.55; color: hsl(var(--foreground)); text-wrap: pretty; }
.prose > p:first-child strong { font-weight: 500; }
.prose strong { font-weight: 600; color: hsl(var(--foreground)); }
.prose h2 { counter-increment: sec; margin-top: 2.2em; padding-top: 24px; border-top: 1px solid hsl(var(--border)); font: 400 clamp(28px, 3vw, 38px)/1.1 var(--font-serif); letter-spacing: -0.02em; color: hsl(var(--foreground)); text-wrap: balance; }
.prose h2::before { content: counter(sec, decimal-leading-zero); display: block; margin-bottom: 12px; font: 400 13px/1 var(--font-mono); letter-spacing: 0; color: hsl(var(--foreground-3)); }
.prose h3 { margin-top: 2em; font-size: 1.12em; font-weight: 600; line-height: 1.35; color: hsl(var(--foreground)); }
.prose h2 + *, .prose h3 + * { margin-top: 0.8em; }
.prose a { color: hsl(var(--foreground)); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: hsl(var(--foreground-3)); transition: text-decoration-color 150ms var(--ease); }
.prose a:hover { text-decoration-color: hsl(var(--foreground)); }
.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 28px; }
.prose li + li { margin-top: 0.6em; }
.prose ul > li::before { content: ''; position: absolute; left: 6px; top: 0.78em; width: 6px; height: 6px; background: hsl(var(--foreground-3)); }
.prose ol { counter-reset: li; }
.prose ol > li { counter-increment: li; }
.prose ol > li::before { content: counter(li); position: absolute; left: 0; font: 400 0.85em/1.95 var(--font-mono); color: hsl(var(--foreground-3)); }
/* Pull quote: set large, ruled above and below, no tinted box. */
.prose blockquote { margin: 1.6em 0; padding: 28px 0; border-top: 1px solid hsl(var(--foreground) / 0.4); border-bottom: 1px solid hsl(var(--border)); font: italic 400 clamp(26px, 3vw, 36px)/1.25 var(--font-serif); letter-spacing: -0.015em; color: hsl(var(--foreground)); text-wrap: balance; }
@media (min-width: 1280px) { .prose blockquote { margin-left: -96px; } }
.prose blockquote p + p { margin-top: 0.6em; }
.prose hr { margin: 3em 0 0; border: 0; border-top: 1px solid hsl(var(--border)); }
.prose hr + p { margin-top: 1.5em; font-size: 14px; line-height: 1.6; color: hsl(var(--foreground-3)); }
.prose hr + p em { font-style: normal; }
.prose hr + p a { color: hsl(var(--muted-foreground)); }
.prose code { font: 0.88em var(--font-mono); padding: 0.1em 0.35em; background: hsl(var(--secondary)); }
.prose pre { overflow-x: auto; padding: 16px 20px; background: hsl(var(--card)); font: 14px/1.6 var(--font-mono); }
.prose pre code { padding: 0; background: none; }
.prose img, .prose video { max-width: 100%; height: auto; }
.prose figure img { width: 100%; }
.prose figcaption { margin-top: 10px; font-size: 14px; color: hsl(var(--foreground-3)); }
.table-wrap { overflow-x: auto; margin: 2em 0; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.prose th { padding: 10px 16px 10px 0; text-align: left; font-size: 13px; font-weight: 500; color: hsl(var(--foreground-3)); border-bottom: 1px solid hsl(var(--structure)); }
.prose td { padding: 12px 16px 12px 0; vertical-align: top; border-bottom: 1px solid hsl(var(--border)); }
.prose td:first-child { color: hsl(var(--foreground)); font-weight: 500; }

/* The interactive widget (its inline colours are mapped to these tokens at render time). */
.prose .ib-embed { margin: 2.4em 0; overflow-x: auto; font-size: 15px; line-height: 1.5; }
.prose .ib-embed > div { max-width: 100% !important; padding: clamp(16px, 3vw, 28px) !important; }
.prose .ib-embed :is(p, label, select, option, button, input, textarea, div, span, table) { max-width: 100%; }
.prose .ib-embed :is(input, select, textarea) { background: hsl(var(--muted)); color: hsl(var(--foreground)); border-radius: 0; font: inherit; font-variant-numeric: tabular-nums; }
.prose .ib-embed :is(input[type='range'], input[type='checkbox'], input[type='radio']) { accent-color: hsl(var(--foreground)); background: transparent; }
.prose .ib-embed select option { background: hsl(var(--popover)); color: hsl(var(--foreground)); }
.prose .ib-embed :is(input, select, textarea):focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; }
.prose .ib-embed button:not(.ibTab) {
  background: hsl(var(--foreground)) !important; color: hsl(var(--background)) !important; border: 0 !important;
  padding: 10px 18px !important; border-radius: 0 !important; font-weight: 600 !important; cursor: pointer;
}
.prose .ib-embed button:not(.ibTab):hover { opacity: 0.9; }
.prose .ib-embed button.ibTab { cursor: pointer; font: inherit; }
.prose .ib-embed strong { font-variant-numeric: tabular-nums; }

/* ---------- keep reading ---------- */
.more { padding-top: clamp(80px, 9vw, 136px); }
.more-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.more-head h2 { font-size: clamp(34px, 4vw, 56px); line-height: 1; }
.more-all { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 600; }
.more-all:hover svg { transform: translateX(4px); }

/* ---------- footer (landing SitemapFooter + the locked candle wordmark) ---------- */
.foot { margin-top: clamp(80px, 9vw, 136px); background: hsl(var(--muted)); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.foot-in { display: flex; flex-direction: column; gap: 48px; padding-top: clamp(64px, 8vw, 112px); }
.foot-top { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
@media (min-width: 1024px) { .foot-top { flex-direction: row; } }
.foot-logo { display: flex; align-items: center; gap: 10px; align-self: flex-start; height: 44px; font-size: 18px; font-weight: 600; }
.foot-mark { width: 28px; height: 28px; }
.foot-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; }
.foot-col { display: flex; flex-direction: column; }
.foot-head { margin-bottom: 8px; font-size: 12px; font-weight: 500; line-height: 16px; color: hsl(var(--foreground-3)); }
.foot-nav a { display: flex; align-items: center; min-height: 44px; font-size: 14px; color: hsl(var(--muted-foreground)); transition: color 150ms var(--ease); }
@media (hover: hover) { .foot-nav a:hover { color: hsl(var(--foreground)); } }
.foot-mail-wide { display: none; }
.foot-mail-phone { grid-column: 1 / -1; margin-top: -24px; }
.foot-legal { grid-column: 1 / -1; }
.foot-legal-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; }
.foot-legal-row .dot { font-size: 14px; color: hsl(var(--foreground-3)); }
@media (min-width: 640px) {
  .foot-nav { grid-template-columns: repeat(3, auto); column-gap: 48px; row-gap: 40px; }
  .foot-col { gap: 4px; }
  .foot-mail-wide { display: contents; }
  .foot-mail-phone { display: none; }
  .foot-legal { grid-column: auto; }
  .foot-legal-row { display: contents; }
  .foot-legal-row .dot { display: none; }
}
@media (min-width: 1024px) {
  .foot-nav { column-gap: 80px; }
  .foot-nav a { min-height: 32px; }
}
.foot-disclaimer { display: flex; flex-direction: column; gap: 12px; font-size: 12px; line-height: 1.65; color: hsl(var(--foreground-3)); }
.foot-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12px; color: hsl(var(--foreground-3)); }
.foot-copy { margin-right: auto; }
.to-top { height: 44px; gap: 6px; color: hsl(var(--muted-foreground)); font-size: 14px; }
.theme-switch { display: inline-flex; padding: 2px; background: hsl(var(--card)); }
.theme-switch button {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 0; background: transparent; color: hsl(var(--foreground-3)); cursor: pointer;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.theme-switch button:hover { color: hsl(var(--foreground)); }
.theme-switch button[aria-checked='true'] { background: hsl(var(--card-hover)); color: hsl(var(--foreground)); }
.theme-switch button:focus-visible { outline-offset: -2px; }
@media (min-width: 1024px) { .theme-switch button { width: 36px; height: 36px; } }

.candle-wrap { margin-top: 48px; }
@media (max-width: 639px) { .candle-wrap { padding: 0 16px; } }
.candle-box { position: relative; width: 100%; overflow: clip; height: 0.97em; font-size: 22vw; }
.candle-row { position: absolute; left: 0; top: 0; white-space: nowrap; line-height: 1; color: hsl(var(--foreground) / 0.9); }
.candle-i { display: inline-block; width: 0.39em; height: 1.25em; overflow: visible; vertical-align: -0.255em; margin-right: 0.02em; }
.cb rect { transition: fill 300ms var(--ease); }
.cb.fill-long { fill: hsl(var(--long)); }
.cb.fill-short { fill: hsl(var(--short)); }

/* A theme flip is instant: no colour fades from the old theme to the new. */
.theme-flip, .theme-flip * { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
}
