/* brand/tokens.css */
/* sfuma web design tokens. Source of truth: docs/brand.md (mirrors plan/03-design-system.md).
   Dark-first: :root carries the dark palette; a light system preference or
   [data-theme="light"] swaps it; [data-theme="dark"] pins dark. Contrast of every text
   pair is verified >= 4.5:1 (table in docs/brand.md). No external references. */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101014;            /* bg/base, warm near-black, never #000 */
  --bg-raised: #1A1A20;     /* cards, sheets, code chips */
  --bg-canvas: #0B0B0E;     /* behind photos / UI mockups */
  --ink: #F2F0EC;           /* primary text, never #FFF */
  --ink-2: #A39E97;         /* secondary text: captions, labels, meta */
  --accent: #D8A47F;        /* the one accent: CTA fill, focus ring, active state */
  --accent-ink: #D8A47F;    /* accent used AS text (links, .proof marks) */
  --on-accent: #101014;     /* text on an --accent fill */
  --positive: #8FB996;      /* success only */
  --danger: #C97B6D;        /* destructive / error only */
  --line: rgb(242 240 236 / 0.12);  /* hairline dividers (non-text; never a hard border) */
  --veil: rgb(16 16 20 / 0.92);     /* sticky header backdrop */
  --sphere-hi: #E2B28A;     /* mark gradient ends, for marketing art only */
  --sphere-lo: #946042;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #FAF9F7;
    --bg-raised: #FFFFFF;
    --bg-canvas: #EFEDE9;
    --ink: #1C1B19;
    --ink-2: #69655F;
    --accent: #B9773F;
    --accent-ink: #965729;
    --on-accent: #1C1B19;
    --positive: #3E7148;
    --danger: #A4473A;
    --line: rgb(28 27 25 / 0.12);
    --veil: rgb(250 249 247 / 0.92);
    --sphere-hi: #CBA07C;
    --sphere-lo: #7F5339;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAF9F7;
  --bg-raised: #FFFFFF;
  --bg-canvas: #EFEDE9;
  --ink: #1C1B19;
  --ink-2: #69655F;
  --accent: #B9773F;
  --accent-ink: #965729;
  --on-accent: #1C1B19;
  --positive: #3E7148;
  --danger: #A4473A;
  --line: rgb(28 27 25 / 0.12);
  --veil: rgb(250 249 247 / 0.92);
  --sphere-hi: #CBA07C;
  --sphere-lo: #7F5339;
}

:root {
  /* type: serif for the wordmark + display/h1/h2 only; everything else system sans */
  --font-serif: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  /* fluid scale: min at 390px viewport, max at 1280px */
  --fs-display: clamp(2.5rem, 1.6236rem + 3.5955vw, 4.5rem);    /* 40 -> 72 */
  --fs-h1: clamp(2.125rem, 1.632rem + 2.0225vw, 3.25rem);        /* 34 -> 52 */
  --fs-h2: clamp(1.625rem, 1.3511rem + 1.1236vw, 2.25rem);       /* 26 -> 36 */
  --fs-h3: clamp(1.25rem, 1.1952rem + 0.2247vw, 1.375rem);       /* 20 -> 22 */
  --fs-lede: clamp(1.1875rem, 1.1327rem + 0.2247vw, 1.3125rem);  /* 19 -> 21 */
  --fs-body: 1.0625rem;  /* 17 */
  --fs-small: 0.9375rem; /* 15 */
  --fs-label: 0.8125rem; /* 13 */
  --fs-mono: 0.9375rem;  /* 15 */

  --lh-display: 1.04;
  --lh-heading: 1.12;
  --lh-body: 1.55;

  --fw-serif: 450;       /* display, h1, h2 (the wordmark is drawn at 450 too) */
  --tracking-display: -0.012em;
  --tracking-label: 0.02em;
  --tracking-code: 0.04em;

  /* space (4-pt base) and layout */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;
  --gutter: 1rem;        /* 16px phone gutter */
  --measure: 38rem;      /* max text column (~68ch body) */
  --page-max: 72rem;

  /* shape: soft, never sharp */
  --radius-btn: 12px;
  --radius-card: 16px;
  --radius-chip: 8px;

  /* motion: settle, never bounce */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-micro: 120ms;
  --dur-std: 220ms;
  --dur-sheet: 320ms;

  /* the only permitted shadow: a wide, low-alpha ambient lift (no hard drop shadows) */
  --shadow-soft: 0 12px 40px -12px rgb(0 0 0 / 0.35);
}

@media (prefers-reduced-motion: reduce) {
  /* movement off; the site may still crossfade opacity with its own short duration */
  :root { --dur-micro: 0ms; --dur-std: 0ms; --dur-sheet: 0ms; }
}

/* brand/fonts.css */
/* sfuma brand serif: Newsreader (Production Type), SIL OFL 1.1, see fonts/LICENSE-OFL.txt.
   Self-hosted. Variable axes trimmed to wght 400-600 and opsz 20-72 (display use only;
   body text is the system sans). Browsers pick opsz from font-size automatically.
   Split latin / latin-ext like Google Fonts: Turkish ı ö ü ç are in latin, ş ğ İ in
   latin-ext (loaded only when the page contains them). */
/* latin */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/brand/fonts/newsreader-roman-latin.woff2?v=4d7b65fa41") 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;
}
/* latin-ext */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/brand/fonts/newsreader-roman-latin-ext.woff2?v=b45175d144") 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;
}
/* latin */
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/brand/fonts/newsreader-italic-latin.woff2?v=645238b98f") 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;
}
/* latin-ext */
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/brand/fonts/newsreader-italic-latin-ext.woff2?v=b5e09b5b3a") 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;
}
/* Metric-matched fallback while the woff2 loads (Georgia, tuned to Newsreader's width
   and line metrics) so the swap does not shift layout. */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 96%;
  ascent-override: 76.6%;
  descent-override: 27.6%;
  line-gap-override: 0%;
}

/* style.css */
/* sfuma.cam site styles. Served as /static/site.css = brand/tokens.css +
   brand/fonts.css + this file (web/assets.go). Dark-first, phone-first
   (390px, 16px gutters), one accent, no hard shadows, no framework.
   Rules: docs/brand.md. Serif (Newsreader) only for h1/h2/display. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
::selection { background: var(--accent); color: var(--on-accent); }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: color var(--dur-micro) var(--ease); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 20;
  background: var(--bg-raised); color: var(--ink); padding: var(--s-2) var(--s-4);
  border-radius: var(--radius-chip); text-decoration: none;
}
.skip:focus { top: var(--s-2); }

.wrap { width: 100%; max-width: 68.75rem; margin-inline: auto; padding-inline: var(--gutter); }

/* --- type ------------------------------------------------------------- */
h1, h2 {
  font-family: var(--font-serif); font-weight: var(--fw-serif); font-synthesis: none;
  line-height: var(--lh-heading); margin: 0 0 var(--s-4); text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.005em; }
h1 em, h2 em { font-style: italic; }
h1, h2, blockquote { hanging-punctuation: first; }
h3 { font: 600 var(--fs-h3)/1.25 var(--font-sans); margin: 0 0 var(--s-2); }
p, ul, ol { margin: 0 0 var(--s-4); }
p, li { max-width: var(--measure); }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: var(--s-2); }
li::marker { color: var(--ink-2); }
strong { font-weight: 600; }
.lede { font-size: var(--fs-lede); line-height: 1.5; max-width: 36rem; }
.muted, .byline, .store-note { color: var(--ink-2); font-size: var(--fs-small); }
.page-home .hero h1 { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--tracking-display); }

code { font-family: var(--font-mono); font-size: 0.92em; }
.code {
  font-family: var(--font-mono); font-weight: 500; letter-spacing: var(--tracking-code);
  font-variant-numeric: tabular-nums slashed-zero; hyphens: manual; word-break: keep-all;
  background: var(--bg-raised); border-radius: var(--radius-chip); padding: 0.08em 0.4em;
  white-space: normal; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.code-short { white-space: nowrap; }

/* --- header ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--veil); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 3.75rem; position: relative; }
.brand { display: inline-flex; align-items: center; color: var(--ink); padding: var(--s-2) 0; border-radius: var(--radius-chip); }
.lockup { height: 1.75rem; width: auto; }
.lockup .tone-l { display: none; }
.lockup-foot { height: 1.5rem; }

.menu-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.menu-btn {
  display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; user-select: none;
  font: 500 var(--fs-label)/1 var(--font-sans); letter-spacing: var(--tracking-label);
  color: var(--ink); padding: var(--s-3) var(--s-3); margin-right: calc(var(--s-3) * -1);
  border-radius: var(--radius-btn);
}
.menu-toggle:focus-visible + .menu-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 1.1rem; height: 1.5px; background: currentColor; border-radius: 1px;
  transition: transform var(--dur-std) var(--ease), opacity var(--dur-std) var(--ease);
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu-btn .when-open, .menu-toggle:checked + .menu-btn .when-closed { display: none; }
.menu-toggle:checked + .menu-btn .when-open { display: inline; }
.menu-toggle:checked + .menu-btn .menu-icon { background: transparent; }
.menu-toggle:checked + .menu-btn .menu-icon::before { transform: translateY(5px) rotate(45deg); }
.menu-toggle:checked + .menu-btn .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }

.site-nav {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: var(--s-2) var(--gutter) var(--s-5);
}
.menu-toggle:checked ~ .site-nav { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; max-width: none; }
.site-nav ul a {
  display: block; padding: var(--s-3) 0; color: var(--ink); text-decoration: none;
  font-size: var(--fs-body); border-bottom: 1px solid var(--line);
}
.site-nav a[aria-current="page"] { color: var(--accent-ink); }
.nav-end { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-top: var(--s-4); }
.lang {
  color: var(--ink-2); text-decoration: none;
  font: 500 var(--fs-label)/1 var(--font-sans); letter-spacing: var(--tracking-label);
  padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: 999px;
}
.lang:hover { color: var(--ink); }
.nav-soon { margin: var(--s-4) 0 0; }

@media (min-width: 60rem) {
  .menu-btn { display: none; }
  .site-nav {
    display: flex; position: static; align-items: center; gap: var(--s-5);
    background: none; border: 0; padding: 0;
  }
  .site-nav ul { display: flex; gap: var(--s-1); }
  .site-nav ul a {
    border: 0; padding: var(--s-2) var(--s-3); border-radius: var(--radius-chip);
    color: var(--ink-2); font: 500 var(--fs-label)/1.3 var(--font-sans); letter-spacing: var(--tracking-label);
  }
  .site-nav ul a:hover { color: var(--ink); }
  .site-nav a[aria-current="page"] { color: var(--ink); }
  .nav-end { padding: 0; }
  .nav-soon { display: none; }
}

/* --- layout ----------------------------------------------------------- */
main { display: block; padding-block: var(--s-6) var(--s-8); }
main > section, main > article { padding-block: var(--s-7); }
main > section:first-child { padding-top: var(--s-5); }
main > section[id], main h2[id], main h3[id] { scroll-margin-top: 5rem; }
.main-legal, .main-article, .main-recipe { max-width: 48rem; }
/* Interior pages: one centred column (P1-4); home keeps the full wrap. */
.main-page, .main-learn, .main-notfound { max-width: 52rem; }
.main-page .media img, .main-learn .media img, .main-legal .media img, .main-article .media img {
  width: auto; max-width: 100%; max-height: min(34rem, 80vh); margin-inline: auto;
}
.main-page .media--phone img, .main-article .media--phone img { max-height: min(40rem, 85vh); }
main > section > .media:not(:first-child) { margin-block: var(--s-5); }
.main-legal > section, .main-article > section { padding-block: var(--s-5); }
.main-legal h2, .main-article h2 { font-size: clamp(1.5rem, 1.33rem + 0.7vw, 1.875rem); margin-top: var(--s-2); }

.hero { display: grid; gap: var(--s-6); align-items: center; }
.hero > * { margin-bottom: 0; }
.hero .lede { margin-top: var(--s-2); }
.hero .muted { margin-top: var(--s-3); }
.hero > .cta-row, .hero > figure, .hero > .img-slot { margin-top: var(--s-2); }
@media (min-width: 52rem) {
  .hero:has(> .media--phone) {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    grid-template-areas: ". m" "h m" "l m" "c m" ". m"; column-gap: var(--s-8); row-gap: var(--s-4);
  }
  .hero:has(> .media--phone) > h1 { grid-area: h; }
  .hero:has(> .media--phone) > .lede { margin-top: var(--s-3); }
  .hero:has(> .media--phone) > .lede { grid-area: l; }
  .hero:has(> .media--phone) > .cta-row { grid-area: c; align-self: start; }
  .hero:has(> .media--phone) > .media--phone { grid-area: m; margin: 0; }
}

/* Home hero claim chips: a quiet row of outlined pills under the lede. */
.hero ul.chips {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2);
  max-width: 36rem; margin-top: var(--s-1);
}
.hero ul.chips li {
  margin: 0; max-width: none; padding: 0.35em 0.85em; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); font: 500 var(--fs-label)/1.3 var(--font-sans); letter-spacing: var(--tracking-label);
}
@media (min-width: 52rem) {
  .hero:has(> .media--phone):has(> ul.chips) {
    grid-template-rows: 1fr auto auto auto auto 1fr;
    grid-template-areas: ". m" "h m" "l m" "k m" "c m" ". m";
  }
  .hero:has(> .media--phone) > ul.chips { grid-area: k; }
}

/* Learn articles: key takeaways boxed at the top of the article. */
ul.takeaways {
  list-style: none; margin: 0; padding: var(--s-4) var(--s-5);
  background: var(--bg-raised); border-radius: var(--radius-card); border-left: 2px solid var(--accent);
  max-width: var(--measure);
}
ul.takeaways li { position: relative; padding-left: 1.1em; }
ul.takeaways li::before {
  content: ""; position: absolute; left: 0; top: 0.68em; width: 0.32em; height: 0.32em;
  border-radius: 50%; background: var(--ink-2);
}

/* Sources: a small numbered reference list. */
section.sources { color: var(--ink-2); font-size: var(--fs-small); }
section.sources h2 { font-size: var(--fs-h3); font-family: var(--font-sans); font-weight: 600; color: var(--ink); }
.main-legal section.sources h2, .main-article section.sources h2 { font-size: var(--fs-h3); margin-top: 0; }
section.sources ul, section.sources ol { list-style: decimal; padding-left: 1.5em; }
section.sources li::marker { color: var(--ink-2); font-variant-numeric: tabular-nums; }
section.sources a { overflow-wrap: anywhere; }

.grid-2, .grid-3, .claims { display: grid; gap: var(--s-5); align-items: start; }
.grid-2 > h2, .grid-3 > h2, .claims > h2 { grid-column: 1 / -1; margin-bottom: 0; }
@media (min-width: 46rem) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-7); }
  section.grid-2:has(> figure, > .img-slot) { align-items: center; }
  .grid-3, .claims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Balanced card grids (P2-1): never a lone orphan card. Two columns: an odd
   last card spans the row. Three columns (home only; interior columns are
   52rem): a 6-track grid where a 3n+2 tail splits 3+3 and a 3n+1 tail spans. */
@media (min-width: 46rem) {
  .claims > .claim:last-child:nth-child(odd of .claim),
  .grid-2 > .card:last-child:nth-child(odd of .card),
  .grid-3 > .card:last-child:nth-child(odd of .card) { grid-column: 1 / -1; }
  .grid-2:has(> .card) { align-items: stretch; }
}
@media (min-width: 64rem) {
  .main-home .grid-3, .main-home .claims { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .main-home .claims > .claim, .main-home .grid-3 > .card { grid-column: span 2; }
  .main-home .claims > .claim:nth-child(3n+1 of .claim):nth-last-child(2 of .claim),
  .main-home .claims > .claim:nth-child(3n+1 of .claim):nth-last-child(2 of .claim) + .claim,
  .main-home .grid-3 > .card:nth-child(3n+1 of .card):nth-last-child(2 of .card),
  .main-home .grid-3 > .card:nth-child(3n+1 of .card):nth-last-child(2 of .card) + .card { grid-column: span 3; }
  .main-home .claims > .claim:nth-child(3n+1 of .claim):last-child,
  .main-home .grid-3 > .card:nth-child(3n+1 of .card):last-child { grid-column: 1 / -1; }
}
/* Cards in a row share a height; art sits at the bottom (P2-2). */
.grid-3 { align-items: stretch; }
.grid-3 > .card { display: flex; flex-direction: column; }
.grid-3 > .card > .media, .grid-3 > .card > .img-slot { margin-top: auto; padding-top: var(--s-4); }
/* Home: alternate the middle text/art section so the page doesn't zipper (P3-10). */
@media (min-width: 46rem) {
  .main-home > section.grid-2:has(> .media):nth-of-type(odd) > .media { order: -1; }
}
section > .grid-2, section > .grid-3 { margin-block: var(--s-5); }

.card, .claim {
  background: var(--bg-raised); border-radius: var(--radius-card);
  padding: var(--s-5); min-width: 0;
}
.card > :last-child, .claim > :last-child { margin-bottom: 0; }
.card h2 { font-size: var(--fs-h2); }
.card .media, .card .img-slot { margin-top: var(--s-4); }
.claim h3 { font-size: 1.1875rem; }

.proof {
  position: relative; padding-left: 1.1em; color: var(--ink-2); font-size: var(--fs-small);
}
.proof::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 0.42em; height: 0.42em;
  border-radius: 50%; background: var(--ink-2);
}

/* --- CTAs ------------------------------------------------------------- */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem;
  padding: var(--s-3) var(--s-5); border-radius: var(--radius-btn);
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font: 600 1rem/1.2 var(--font-sans); border: 1px solid transparent;
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease), border-color var(--dur-micro) var(--ease);
}
/* Hover mixes toward the raised surface: lighter in light mode (5.9:1),
   still 6.6:1 in dark (P2-4). */
.cta:hover { color: var(--on-accent); background: color-mix(in srgb, var(--accent) 85%, var(--bg-raised)); }
.cta-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.cta-secondary:hover { background: var(--bg-raised); color: var(--ink); }
/* Nothing to download yet: plain muted text, not a control (P2-6). */
.cta-soon { margin: 0; color: var(--ink-2); font: 500 var(--fs-body)/1.4 var(--font-sans); }
.cta-row > .store-note { flex-basis: 100%; margin: 0; }
.cta-small { min-height: 2.25rem; padding: var(--s-2) var(--s-4); font-size: var(--fs-label); }

section.cta-row {
  display: block; text-align: center; background: var(--bg-raised);
  border-radius: var(--radius-card); padding: var(--s-7) var(--s-5); margin-block: var(--s-7) 0;
}
section.cta-row > * { margin-inline: auto; }
/* Mid-article "try it" box: a raised card with at most one action. */
section.cta-row#try-it { text-align: left; padding: var(--s-5); margin-block: var(--s-5); max-width: var(--measure); }
section.cta-row#try-it > p { margin-inline: 0; }
section.cta-row#try-it > p:last-child { margin-bottom: 0; }
.store-mid { align-items: flex-start; margin-top: var(--s-4); }
.store { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); margin-top: var(--s-5); }
.store .store-note { margin: 0; }

/* --- FAQ -------------------------------------------------------------- */
.faq details { border-bottom: 1px solid var(--line); max-width: 48rem; }
.faq h2 + details, .faq > details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--s-4);
  font: 600 1.0625rem/1.4 var(--font-sans); padding: var(--s-4) 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; color: var(--ink-2); font-weight: 400; font-size: 1.25rem; line-height: 1.1;
  transition: transform var(--dur-std) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > :not(summary) { margin-top: 0; padding-bottom: var(--s-4); color: var(--ink); }
.faq > p:last-child { margin-top: var(--s-5); }

/* --- tables, quotes, figures ----------------------------------------- */
table { width: 100%; border-collapse: collapse; margin: var(--s-5) 0; font-size: var(--fs-small); }
th, td { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-3) var(--s-3) 0; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--ink-2); font-size: var(--fs-label); letter-spacing: var(--tracking-label); }
td:first-child { font-weight: 500; }
@media (max-width: 40rem) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
blockquote {
  margin: var(--s-5) 0; padding: var(--s-1) 0 var(--s-1) var(--s-5);
  border-left: 2px solid var(--line); font-size: var(--fs-lede); line-height: 1.5;
}
blockquote p { max-width: 40rem; }
figure { margin: 0; }
figcaption { color: var(--ink-2); font-size: var(--fs-small); margin-top: var(--s-2); }

/* media slots: real art, or a placeholder at the art's final aspect */
.media { margin: 0; }
.media img, .media video { width: 100%; height: auto; border-radius: var(--radius-card); background: var(--bg-canvas); }
.media--phone { width: 100%; max-width: 20rem; margin-inline: auto; }
.frame-phone {
  padding: 0.6rem; border-radius: 2.6rem; background: var(--bg-canvas);
  border: 1px solid var(--line); box-shadow: var(--shadow-soft);
}
.frame-phone img, .frame-phone video, .frame-phone.img-slot::before { border-radius: 2.05rem; }
.motion-wrap { position: relative; }
.motion-wrap .poster { display: none; }

.img-slot { position: relative; width: 100%; border-radius: var(--radius-card); overflow: hidden; }
.img-slot.media--wide { aspect-ratio: 16 / 9; }
.img-slot.media--card { aspect-ratio: 4 / 3; }
.img-slot.media--phone { aspect-ratio: 720 / 1560; }
.img-slot::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--sphere-hi) 30%, transparent), transparent 42%),
    radial-gradient(circle at 62% 70%, color-mix(in srgb, var(--sphere-lo) 22%, transparent), transparent 50%),
    var(--bg-canvas);
}
.frame-phone.img-slot { overflow: visible; }
.frame-phone.img-slot::before { inset: 0.6rem; }

/* --- learn, crumbs, lists -------------------------------------------- */
.crumbs { font-size: var(--fs-small); color: var(--ink-2); margin-bottom: var(--s-2); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: var(--s-2); color: var(--line); color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
.crumbs [aria-current] {
  display: inline-block; max-width: 22ch; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; vertical-align: bottom;
}
.byline { margin: 0; }
.byline a { color: var(--ink-2); }
.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
.article-list li { margin: 0; max-width: none; }
.article-list h2, .article-list h3 { font-size: var(--fs-h3); font-family: var(--font-sans); font-weight: 600; line-height: 1.3; }
.article-list a { color: var(--ink); text-decoration: none; }
.article-list a:hover { color: var(--accent-ink); }
/* The whole card is the link (P2-11). */
.article-list > li { position: relative; transition: background-color var(--dur-micro) var(--ease); }
.article-list > li:hover { background: color-mix(in srgb, var(--bg-raised) 85%, var(--ink)); }
.article-list h2 a::after, .article-list h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.article-list a:focus-visible { outline: none; }
.article-list > li:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 46rem) {
  .article-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-list > li:first-child:nth-last-child(odd) { grid-column: 1 / -1; } /* lead story, then pairs */
}
.main-article .article-list { grid-template-columns: 1fr; }
.learn-more { border-top: 1px solid var(--line); margin-top: var(--s-6); }
.suggest { padding-left: 1.25em; }

/* --- footer ----------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-7) var(--s-6); color: var(--ink-2); font-size: var(--fs-small); }
.foot-top { display: grid; gap: var(--s-6); }
.foot-brand .brand { margin-bottom: var(--s-2); }
.foot-brand p { color: var(--ink); max-width: 18rem; }
.foot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-4); }
.foot-h { color: var(--ink); font: 600 var(--fs-label)/1.3 var(--font-sans); letter-spacing: var(--tracking-label); margin-bottom: var(--s-3); }
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li + li { margin-top: var(--s-2); }
.foot-cols a { color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
.foot-cols a:hover { color: var(--ink); text-decoration: underline; }
.foot-cols a[href^="mailto"] { overflow-wrap: normal; white-space: nowrap; }
.foot-legal { margin: var(--s-6) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--line); max-width: none; }
@media (min-width: 46rem) {
  .foot-top { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); }
  .foot-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- recipe page (/r/) ------------------------------------------------ */
.recipe { padding-block: var(--s-5); }
.recipe-card { background: var(--bg-raised); border-radius: var(--radius-card); padding: var(--s-6) var(--s-5); margin: var(--s-5) 0; }
.recipe-card .code { display: inline-block; font-size: clamp(1.25rem, 5.4vw, 2.25rem); background: none; padding: 0; margin: 0 0 var(--s-4); }
.label { color: var(--ink-2); font: 500 var(--fs-label)/1.3 var(--font-sans); letter-spacing: var(--tracking-label); margin-bottom: var(--s-2); }
.summary { color: var(--ink-2); font-size: var(--fs-small); }
.error { color: var(--danger); }
.get { color: var(--ink-2); font-size: var(--fs-small); }

/* --- light scheme specifics (tokens swap the colours) ----------------- */
/* Dark mockup art inside white card plates read as black slabs (P2-5): a
   card grid holding art drops its plates and lets the art sit on paper. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .lockup .tone-d { display: none; }
  :root:not([data-theme="dark"]) .lockup .tone-l { display: inline; }
  :root:not([data-theme="dark"]) .grid-3:has(> .card > .media) > .card { background: transparent; padding-inline: 0; }
  :root:not([data-theme="dark"]) .card > .media img { box-shadow: var(--shadow-soft); }
}
:root[data-theme="light"] .grid-3:has(> .card > .media) > .card { background: transparent; padding-inline: 0; }
:root[data-theme="light"] .lockup .tone-d { display: none; }
:root[data-theme="light"] .lockup .tone-l { display: inline; }

/* --- motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
  .motion-wrap video { display: none; }
  .motion-wrap .poster { display: block; }
}

/* --- print ------------------------------------------------------------ */
/* The token override must out-rank the light scheme's :root:not(…) (0,2,0)
   and [data-theme] pins (P2-10a). */
@media print {
  :root, :root:not([data-theme="dark"]), :root[data-theme] {
    --bg: #fff; --bg-raised: #fff; --bg-canvas: #fff; --ink: #000; --ink-2: #333; --accent-ink: #000; --line: #bbb;
  }
  .site-header, .skip, .store, .menu-btn, .img-slot, .media, .foot-cols, .foot-brand, section.cta-row .store { display: none !important; }
  .hero .cta-row, section.cta-row { display: none !important; }
  body { font-size: 11pt; }
  main { padding: 0; max-width: none; }
  main > section { padding-block: 0.6rem; break-inside: auto; }
  h2, h3, .card, .claim, tr { break-inside: avoid; }
  h2, h3 { break-after: avoid-page; }
  .main-legal::before, .main-article::before { content: "sfuma.cam"; display: block; font: 600 9pt var(--font-sans); margin-bottom: 8pt; }
  .card, .claim, section.cta-row { background: none; border: 1px solid var(--line); }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: var(--ink-2); }
  .faq details > :not(summary) { display: block; }
}

