/* Data Driven Decisions website: the design system (docs/REDESIGN-PLAN.md, PR 2), one look for the studio home and
   the three apps, in English and in French (site/fr/). "Newsprint meets highlighter": paper, ink, the app's accent.
   Every colour is a token on :root; each page's <body> class (studio, app-brickography, app-marblecodex,
   app-fakeorfact) sets the app's paper, ink and accent, and the dark "night edition" follows the phone's
   setting (prefers-color-scheme). Headings are Noto Serif (self-hosted, assets/fonts/, SIL Open Font License),
   text the system sans. Every animation sits inside prefers-reduced-motion: no-preference; tools/check_site.py
   enforces that, the 30 KB budget of this file and the 45 KB budget of a font. */

@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/noto-serif.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 ---- */
:root {
  --paper: #f7f4ee; --paper-2: #efeae0; --card: #ffffff; --line: #e2dccf;
  --ink: #1e2226; --ink-2: #4a4f55; --ink-3: #5c6269;
  --accent: #2a4c6b; --on-accent: #ffffff;
  --real: #177a42; --fake: #c62828; --gold: #855a00;
  --hl: oklch(0.92 0.17 100 / 0.9);
  --radius: 16px;
  --shadow: 0 1px 2px rgb(30 34 38 / .06), 0 14px 32px -16px rgb(30 34 38 / .28);
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.app-brickography { --paper: #fffbf2; --paper-2: #fbf1d8; --line: #efe2bf; --accent: #c0211a; }
.app-marblecodex  { --paper: #f6ecd2; --paper-2: #eedfbd; --card: #fdf6e4; --line: #e3d3ae; --ink: #2b1e12; --ink-2: #5a4a35; --ink-3: #6b5a44; --accent: #85561c; }
.app-fakeorfact   { --paper: #faf8f3; --paper-2: #f1ede4; --line: #e4dfd4; --ink: #1c1c1c; --ink-2: #4a4a48; --ink-3: #66635c; --accent: #9a4a00; }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1a17; --paper-2: #23211c; --card: #26241f; --line: #3b372f;
    --ink: #ece7dd; --ink-2: #c2bcb0; --ink-3: #aba497;
    --accent: #8fb6dc; --on-accent: #10161c;
    --real: #5ccb8a; --fake: #ff7a70; --gold: #f2c14e;
    --hl: oklch(0.7 0.18 52 / 0.5);
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 18px 40px -16px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
  .app-brickography { --paper: #221c12; --paper-2: #2a2318; --card: #2e2618; --line: #463b2a; --ink: #f3ead8; --ink-2: #cfc3ab; --ink-3: #b9ad95; --accent: #ff8f5e; --on-accent: #231208; }
  .app-marblecodex  { --paper: #241b10; --paper-2: #2c2216; --card: #31261a; --line: #4b3c29; --ink: #f1e4c8; --ink-2: #cdbb9b; --ink-3: #bba987; --accent: #dcae63; --on-accent: #231608; }
  .app-fakeorfact   { --paper: #16181c; --paper-2: #1e2125; --card: #23262b; --line: #30343a; --ink: #ece9e2; --ink-2: #c2bfb8; --ink-3: #a29f98; --accent: #ffb77a; --on-accent: #101214; }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-x: clip;
}
.wrap { max-width: 800px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main { display: block; padding-top: 1.25rem; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in oklab, var(--accent) 28%, transparent); }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-top: 0.3em; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0.8em 0; text-wrap: pretty; }
ul, ol { padding-left: 1.4em; }
li { margin: 0.35em 0; }
strong { font-weight: 700; }
.muted { color: var(--ink-3); }
.small { font-size: 0.9rem; }
code { font-size: 0.95em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
td, th { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { color: var(--ink-3); font-weight: 600; font-size: 0.92rem; }
img, video { max-width: 100%; height: auto; }
time { font-variant-numeric: tabular-nums; }

/* ---- The header: the studio, the three apps, the language switch ---- */
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--accent); color: var(--on-accent); padding: 0.5em 0.9em; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; }
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
  view-transition-name: site-header;
}
.sh { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font: 700 1rem/1.1 var(--serif); color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.brand:hover span { text-decoration: underline; text-underline-offset: 0.2em; }
.nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 1rem; font-size: 0.92rem; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.site-head .lang { order: 2; color: var(--accent); font-weight: 600; text-decoration: none; padding: 0.35rem 0; }
.site-head .lang:hover { text-decoration: underline; }
.brand[aria-current] span { box-shadow: inset 0 -2px var(--accent); }
@media (max-width: 640px) {
  .site-head .lang { order: 1; margin-left: auto; }
  .nav { order: 2; flex: 1 0 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 0.9rem; font-size: 0.86rem; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

/* breadcrumb on the pages below a landing page: studio home › app › page */
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; font-size: 0.9rem; color: var(--ink-3); margin: 1.1rem 0 0; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span { margin: 0 0.45em; }
.crumbs + main { padding-top: 0.5rem; }

/* ---- Pieces the pages use ---- */
/* icon + name + pitch */
.app-head { display: flex; align-items: center; gap: 20px; margin: 0.6rem 0 1.4rem; }
.app-head img { width: 96px; height: 96px; border-radius: 22%; flex: none; box-shadow: var(--shadow), 0 0 0 1px color-mix(in oklab, var(--line) 80%, transparent); }
.app-head h1 { margin: 0; }
.pitch { margin: 0.35em 0 0; font-size: 1.2rem; line-height: 1.4; color: var(--ink-2); text-wrap: pretty; }
body.app-brickography .app-head img, .app-card.brickography > img { view-transition-name: icon-brickography; }
body.app-marblecodex .app-head img, .app-card.marblecodex > img { view-transition-name: icon-marblecodex; }
body.app-fakeorfact .app-head img, .app-card.fakeorfact > img { view-transition-name: icon-fakeorfact; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5rem 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 48px; padding: 0.65em 1.3em; border-radius: 999px; border: 2px solid var(--accent); font: 700 1rem/1.15 var(--sans); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s; }
.btn-fill { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 22px -12px var(--accent); }
.btn-fill:hover { background: color-mix(in oklab, var(--accent) 86%, var(--ink)); border-color: color-mix(in oklab, var(--accent) 86%, var(--ink)); }
.btn-line { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.btn-line:hover { background: color-mix(in oklab, var(--accent) 10%, transparent); }
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px) scale(0.98); }

.note { background: color-mix(in oklab, var(--accent) 7%, var(--card)); border: 1px solid color-mix(in oklab, var(--accent) 25%, var(--line)); border-radius: var(--radius); padding: 14px 18px; margin: 1.3rem 0; }
.bullets li { margin: 0.6em 0; }

/* ---- Reading pages: privacy, support, standards, the press kit, the 404 page (docs/REDESIGN-PLAN.md, PR 6) ---- */
body.reading .wrap:not(.sh) { max-width: 712px; }
.page-head { padding: 0.4rem 0 1.1rem; margin: 0.4rem 0 1.5rem; border-bottom: 3px solid var(--accent); }
.page-head h1 { margin: 0; }
.page-head p { margin: 0.7em 0 0; color: var(--ink-2); text-wrap: pretty; }
.page-head .date { display: inline-block; font: 600 0.85rem/1.3 var(--sans); color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, transparent); border-radius: 999px; padding: 0.35em 0.85em; margin-top: 0.9rem; }
.toc { background: var(--paper-2); border-radius: 14px; padding: 1rem 1.25rem; margin: 1.5rem 0 2rem; }
.toc p { margin: 0 0 0.5rem; font: 700 0.78rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 2rem; }
.toc li { margin: 0.25em 0; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 560px) { .toc ol { columns: 1; } }
h2, h3 { scroll-margin-top: 84px; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.8rem; margin: 1.3rem 0 1.8rem; }
.cards3 a { display: grid; gap: 0.3rem; align-content: start; padding: 1rem 1.1rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.cards3 a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cards3 .n { font: 800 0.75rem/1.2 var(--sans); color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; }
.cards3 b { font: 700 1.05rem/1.25 var(--serif); }
.cards3 span:last-child { font-size: 0.9rem; color: var(--ink-2); }
/* the app's stamps: the verdicts on the standards page, the cards on the landing pages */
.stamp { display: inline-block; font: 800 0.78rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; padding: 0.38em 0.55em 0.32em; border: 3px solid currentColor; border-radius: 8px; rotate: -7deg; white-space: nowrap; }
.stamp.real { color: var(--real); } .stamp.fake { color: var(--fake); } .stamp.misleading, .stamp.exaggerated, .stamp.satire { color: var(--fake); }
.verdicts-table td:first-child { padding: 12px 14px 12px 10px; width: 9rem; }

/* press kit: key facts, file list, images */
.facts th { width: 30%; }
.facts td { overflow-wrap: anywhere; }
.files { padding-left: 1.2em; }
.framed { display: block; border: 1px solid var(--line); border-radius: 10px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 1rem 0; }
.shots li { margin: 0; }
.shots a { display: block; color: var(--ink-3); font-size: 0.9rem; text-decoration: none; text-align: center; }
.shots a:hover { color: var(--accent); text-decoration: underline; }
.shots img { display: block; width: 100%; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 10px; }

/* ---- Footer ---- */
footer { margin-top: 3.5rem; padding: 1.5rem 0 calc(2rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--ink-3); }
footer p { margin: 0.4em 0; }
footer a { color: var(--ink-2); }
footer a:hover { color: var(--accent); }

/* ---- Motion: only for visitors who allow it ---- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }
  ::view-transition-group(*) { animation-duration: 0.36s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---- Narrow phones ---- */
@media (max-width: 420px) {
  .app-head { gap: 14px; }
  .app-head img { width: 72px; height: 72px; }
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* hidden, but still the link's name */
}
