/* Food Marshal website, WEB-1 (15 Oct 2026). Shared by every page: fonts, the two app palettes, type, header,
   footer, legal pages and the 404. The home page adds home.css. Colours are the app's (src/theme/tokens.ts) plus an
   extension (marked +) chosen for WCAG AA on each ground: see WEB1_STATUS.md for every measured pair. */

/* ---------- fonts: self-hosted, SIL OFL 1.1 (see /licences). Converted to WOFF2 with the font data unchanged: re-wrapped
   by tools/woff2.js from the TTFs in fonts-src/ (byte-identical tables after decoding, checked with --verify) ---------- */
@font-face { font-family: "Anek Latin"; src: url("../fonts/AnekLatin_400Regular.woff2") format("woff2"); font-weight: 300 499; font-style: normal; font-display: swap; }
@font-face { font-family: "Anek Latin"; src: url("../fonts/AnekLatin_600SemiBold.woff2") format("woff2"); font-weight: 500 900; font-style: normal; font-display: swap; }
/* one Devanagari file for every weight; it downloads only when Devanagari text is on the page (unicode-range) */
@font-face { font-family: "Anek Devanagari"; src: url("../fonts/AnekDevanagari_500Medium.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }

/* the italic serif for the heading accents (Instrument Serif Italic): it loads only after the first paint (boot.js
   lifts serif-pending), and the device’s own serif stands in until then, or if it never arrives */
@font-face { font-family: "Instrument Serif"; src: url("../fonts/InstrumentSerif-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
/* stand-ins until it arrives: the device's own italic serif, scaled (size-adjust, nothing downloaded) to the width of
   Instrument Serif Italic as measured on the site's accent words, so the swap moves no line. Measured in Chrome on
   Windows: Palatino Linotype / Book Antiqua 90.7 %, Times New Roman 90.4 %, Georgia 79.9 %. Noto Serif (Android) could
   not be measured here: 80 % is an estimate, to be checked on a phone */
@font-face { font-family: "Accent Fallback P"; src: local("Palatino Linotype Italic"), local("PalatinoLinotype-Italic"), local("Book Antiqua Italic"), local("BookAntiqua-Italic"), local("Palatino Italic"), local("Palatino-Italic"); font-weight: 400; font-style: italic; size-adjust: 90.7%; }
@font-face { font-family: "Accent Fallback G"; src: local("Georgia Italic"), local("Georgia-Italic"); font-weight: 400; font-style: italic; size-adjust: 79.9%; }
@font-face { font-family: "Accent Fallback N"; src: local("Noto Serif Italic"), local("NotoSerif-Italic"); font-weight: 400; font-style: italic; size-adjust: 80%; }
@font-face { font-family: "Accent Fallback T"; src: local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT"); font-weight: 400; font-style: italic; size-adjust: 90.4%; }

/* ---------- tokens ---------- */
:root {
  --font: "Anek Latin", "Anek Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-hi: "Anek Devanagari", "Anek Latin", "Nirmala UI", "Noto Sans Devanagari", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Roboto Mono", "SF Mono", Menlo, monospace;

  /* score colours: one set in both themes (app verdictColours) */
  --red: #FF5C23; --red-ink: #10131A;
  --yellow: #FFCE6B; --yellow-ink: #10131A;
  --green: #075E46; --green-ink: #E8FFF2;

  --radius: 18px; --radius-s: 10px; --radius-l: 28px;
  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1320px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --header-h: 68px;
}

/* DARK, "Blueberry Night" (the default: the app falls back to dark) */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #10131A; --raised: #151A34; --floating: #151A36;
  --ink: #F4F5FA; --ink2: #B9C2DA; --accent: #C8F3FF; --line: #586A73;
  --button: #4B3FCF; --on-button: #FFFFFF; --button-edge: #C8F3FF;
  --aurora-1: rgba(28, 36, 89, .75); --aurora-2: rgba(75, 63, 207, .75); --aurora-3: rgba(75, 63, 207, .45);
  --divider: rgba(200, 243, 255, .12);
  --glass: rgba(28, 36, 89, .42); --glass-edge: rgba(200, 243, 255, .16);
  /* + score tones as ink/strokes on this ground (AA): */
  --red-tone: #FF5C23; --yellow-tone: #FFCE6B; --green-tone: #2FBF71;
  /* + violet glow, the button hue lifted for text on the ground */
  --violet: #A99CFF;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
  --focus: #C8F3FF;
}
/* LIGHT, "Berry & Vanilla" by the system setting, unless the visitor chose dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --ground: #FFF8DF; --raised: #FFFCF1; --floating: #FFFCF1;
    --ink: #10131A; --ink2: #5A5468; --accent: #591E5E; --line: #A7849B;
    --button: #591E5E; --on-button: #FFFFFF; --button-edge: #591E5E;
    --aurora-1: rgba(243, 217, 230, .9); --aurora-2: rgba(200, 243, 255, .9); --aurora-3: rgba(255, 230, 176, .9);
    --divider: rgba(16, 19, 26, .09);
    --glass: rgba(255, 252, 241, .7); --glass-edge: rgba(89, 30, 94, .16);
    --red-tone: #B8400F; --yellow-tone: #8A5A00; --green-tone: #075E46;
    --violet: #4B3FCF;
    --shadow: 0 30px 70px -24px rgba(89, 30, 94, .28);
    --focus: #591E5E;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #FFF8DF; --raised: #FFFCF1; --floating: #FFFCF1;
  --ink: #10131A; --ink2: #5A5468; --accent: #591E5E; --line: #A7849B;
  --button: #591E5E; --on-button: #FFFFFF; --button-edge: #591E5E;
  --aurora-1: rgba(243, 217, 230, .9); --aurora-2: rgba(200, 243, 255, .9); --aurora-3: rgba(255, 230, 176, .9);
  --divider: rgba(16, 19, 26, .09);
  --glass: rgba(255, 252, 241, .7); --glass-edge: rgba(89, 30, 94, .16);
  --red-tone: #B8400F; --yellow-tone: #8A5A00; --green-tone: #075E46;
  --violet: #4B3FCF;
  --shadow: 0 30px 70px -24px rgba(89, 30, 94, .28);
  --focus: #591E5E;
}

/* ---------- font hold (boot.js): hidden until the fonts are in, at most 3 s; no layout shift from the swap ---------- */
html.fonts-pending .site-header, html.fonts-pending main, html.fonts-pending .site-footer, html.fonts-pending .skip-link { visibility: hidden; }
/* the still posters (calm version) wait for the fonts, so the words arrive first on a slow connection */
html.fonts-pending .poster { display: none !important; }
html.deva-pending body, html.deva-pending [lang="hi"], html.deva-pending :lang(hi) { font-family: "Anek Latin", system-ui, sans-serif; }

/* ---------- reset & type ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { font-synthesis: none; margin: 0; min-height: 100vh; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: clamp(1.0625rem, .98rem + .3vw, 1.1875rem); line-height: 1.55; font-weight: 400; overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:lang(hi), [lang="hi"] { font-family: var(--font-hi); }
::selection { background: var(--accent); color: var(--ground); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 3px var(--ground); border-radius: 6px; }
.skip-link { position: fixed; left: 12px; top: 12px; z-index: 100; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--ground); font-weight: 600; text-decoration: none; transform: translateY(-160%); transition: transform .2s var(--ease-out); }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
main:focus { outline: none; }

.mark { width: 1em; height: 1em; overflow: visible; }
.icon { width: 22px; height: 22px; flex: none; }

/* ---------- buttons & links ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 52px; padding: 0 1.4em; border: 0; border-radius: 999px; background: var(--button); color: var(--on-button); font-weight: 600; font-size: 1.05rem; text-decoration: none; cursor: pointer; box-shadow: 0 0 0 1.5px var(--button-edge) ; transition: transform .25s var(--ease-out), box-shadow .25s; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(.98); }
.button-ghost { background: transparent; color: var(--ink); box-shadow: 0 0 0 1.5px var(--line) inset; }
.text-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .22em; }
.text-link:hover { text-decoration-thickness: 3px; }

.play-slot { min-height: 56px; display: flex; align-items: center; }
.store-state { display: inline-flex; align-items: center; gap: .6em; min-height: 48px; padding: 0; color: var(--ink); font-weight: 600; }
.store-state::before { content: ""; width: 1.15em; height: 1.15em; flex: none; border: 2px solid currentColor; border-radius: 50%; background: radial-gradient(circle, currentColor 0 22%, transparent 24%); }
.play-badge-link { display: inline-block; border-radius: 10px; }
.play-badge-link img { width: 200px; height: auto; }

/* ---------- header ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h); display: flex; align-items: center; padding: 0 var(--gutter); transition: background-color .3s, box-shadow .3s, transform .4s var(--ease-out); }
.site-header[data-scrolled] { background: color-mix(in srgb, var(--ground) 82%, transparent); box-shadow: 0 1px 0 var(--divider); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
@supports not (backdrop-filter: blur(1px)) { .site-header[data-scrolled] { background: var(--ground); } }
.header-inner { width: 100%; max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: .5em; min-height: 44px; text-decoration: none; font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; }
.primary-nav { display: flex; gap: 4px; margin-left: auto; }
.primary-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-weight: 500; color: var(--ink2); transition: color .2s, background-color .2s; }
.primary-nav a:hover, .primary-nav a[aria-current="true"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.header-tools { display: flex; gap: 6px; }
.primary-nav + .header-tools { margin-left: 8px; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent); cursor: pointer; transition: background-color .2s, transform .2s var(--ease-out); }
.icon-button:hover { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.icon-button:active { transform: scale(.94); }
.icon-button .icon { width: 20px; height: 20px; }
[data-theme-toggle] .icon-moon, [data-motion] .icon-play { display: none; }
.is-light [data-theme-toggle] .icon-sun { display: none; }
.is-light [data-theme-toggle] .icon-moon { display: block; }
[data-motion][aria-pressed="true"] .icon-pause { display: none; }
[data-motion][aria-pressed="true"] .icon-play { display: block; }
.nav-toggle { display: none; }
/* the header tools are in place from the first paint (no jump): hidden only where they would do nothing */
html:not(.js) [data-theme-toggle], html:not(.js) [data-motion] { display: none; }
html:not([data-page="home"]):not([data-page="404"]) [data-motion] { display: none; }
@media (prefers-reduced-motion: reduce) { [data-motion] { display: none; } }
@media (max-width: 920px) {
  .js .primary-nav { position: fixed; inset: var(--header-h) 12px auto; flex-direction: column; gap: 2px; padding: 10px; border-radius: 22px; background: var(--floating); box-shadow: var(--shadow), 0 0 0 1px var(--divider); visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .25s var(--ease-out), visibility 0s .25s; }
  .js .primary-nav[data-open] { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .25s var(--ease-out); }
  .js .primary-nav a { min-height: 52px; font-size: 1.15rem; color: var(--ink); }
  .js .nav-toggle { display: inline-grid; }
  .js .header-tools { margin-left: auto; }
}
@media (max-width: 380px) { .brand-name { font-size: 1rem; } .header-inner { gap: 10px; } .header-tools { gap: 4px; } }

/* without JavaScript: the header sits in the page flow on a solid ground and the nav is a plain wrapping row */
html:not(.js) .site-header { position: relative; height: auto; min-height: var(--header-h); padding-block: 8px; background: var(--ground); box-shadow: 0 1px 0 var(--divider); }
html:not(.js) .header-inner { flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 920px) { html:not(.js) .primary-nav { order: 3; width: 100%; margin-left: -12px; flex-wrap: wrap; } }
html:not(.js) .legal-main, html:not(.js) .not-found { padding-top: clamp(28px, 6vw, 80px); }
html:not(.js) .hero { padding-top: 24px; min-height: calc(100svh - var(--header-h)); }

/* the header's scroll progress (a thin aurora line) and the pill that appears once the visitor is past the top */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--violet), var(--accent), var(--green-tone)); }
.cta-pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: var(--ground); font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; opacity: 0; transform: translateY(-6px) scale(.96); pointer-events: none; transition: opacity .35s var(--ease-out), transform .45s var(--ease-out); }
html:not(.js) .cta-pill { display: none; }
.cta-pill:not(.is-on) { visibility: hidden; transition-property: opacity, transform, visibility; transition-delay: 0s, 0s, .35s; }
.cta-pill.is-on { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.cta-pill:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
@media (max-width: 520px) { .cta-pill { min-height: 36px; padding: 0 12px; font-size: .88rem; } .brand-name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.button.magnetic { transform: translate(var(--mx, 0px), var(--my, 0px)); transition: transform .5s var(--ease-out), box-shadow .25s; }
.button.magnetic:hover { transform: translate(var(--mx, 0px), var(--my, 0px)); }

/* ---------- the field: thousands of points, behind the words ---------- */
.field { position: fixed; inset: 0; width: 100%; height: 100vh; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
html.gl-on .field { opacity: 1; }
html.arriving .field, html.iris-opening .field { z-index: 96; }

/* ---------- the iris: the app's shutter (iris.js) ---------- */
html, body { overflow-x: clip; }
.iris { display: none; position: fixed; inset: 0; z-index: 95; pointer-events: none; }
html.arriving .iris, html.iris-in .iris, .iris.is-on { display: block; }
html.arriving .iris:not(.is-drawn), html.iris-in .iris:not(.is-drawn) { background: var(--ground); }
.iris-blades { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.iris-blade { fill: var(--raised); stroke: color-mix(in srgb, var(--accent) 40%, transparent); stroke-width: 1.4; }
.iris-core { stroke: none; }
html.arriving .site-header, html.iris-in .site-header { visibility: hidden; opacity: 0; }
@media (prefers-reduced-motion: no-preference) { html.iris-opening .site-header { animation: header-in .45s var(--ease-out) both; } }
@keyframes header-in { from { opacity: 0; } to { opacity: 1; } }

/* the 404's mark: drawn by the field when it runs, the plain mark otherwise */
.nf-mark .mark { transition: opacity .5s ease; }
html.gl-on .nf-mark .mark { opacity: 0; }
html:not(.gl-on) .nf-mark .mark { opacity: 1; }
html[data-motion-paused] .field, html[data-motion-paused] .iris { display: none !important; }
@media (prefers-reduced-motion: reduce) { .field, .iris { display: none !important; } }

/* ---------- footer ---------- */
.site-footer { position: relative; z-index: 2; padding: clamp(56px, 8vw, 110px) var(--gutter) 40px; background: var(--ground); border-top: 1px solid var(--divider); }
.footer-inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 26px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-top .brand { font-size: 1.4rem; }
.footer-top .brand-mark { width: 38px; height: 38px; }
.footer-age { color: var(--ink2); font-weight: 600; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; }
.footer-nav a:hover { text-decoration-color: currentColor; }
.disclaimer { max-width: 70ch; color: var(--ink2); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--ink2); font-size: .95rem; }
.trademark { color: var(--ink2); font-size: .9rem; }
.placeholder-inline, .legal-placeholder { font-family: var(--mono); font-size: .86em; color: var(--ink2); background: color-mix(in srgb, var(--yellow) 18%, transparent); padding: .05em .35em; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- legal pages ---------- */
.legal-main { position: relative; padding: calc(var(--header-h) + clamp(28px, 6vw, 80px)) var(--gutter) clamp(64px, 10vw, 140px); }
.legal-main::before { content: ""; position: absolute; inset: 0 0 auto; height: 520px; z-index: -1; background: radial-gradient(60% 70% at 15% 0%, var(--aurora-2), transparent 70%), radial-gradient(50% 60% at 90% 10%, var(--aurora-1), transparent 70%); opacity: .55; pointer-events: none; }
.legal-wrap { position: relative; max-width: 76ch; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: .5em; min-height: 44px; font-weight: 600; text-decoration: none; color: var(--accent); }
.back-link .icon-back { transform: scaleX(-1); width: 20px; height: 20px; }
.back-link:hover span { text-decoration: underline; text-underline-offset: .22em; }
.legal-stamp { position: absolute; top: 0; right: 0; width: clamp(64px, 12vw, 120px); height: clamp(64px, 12vw, 120px); color: var(--ink); opacity: .14; }
.legal-stamp .mark { width: 100%; height: 100%; }
.legal-copy h1, .legal-main > .legal-wrap > h1 { margin: 22px 0 28px; font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.2rem); letter-spacing: -.035em; line-height: .95; max-width: 14ch; }
.legal-copy h2, .legal-section h2 { margin: 2.4em 0 .7em; font-size: clamp(1.35rem, 1.1rem + .9vw, 1.8rem); letter-spacing: -.015em; display: flex; gap: .55em; align-items: baseline; padding-top: 1.1em; border-top: 1px solid var(--divider); }
.legal-copy p, .legal-copy li, .legal-section p { color: var(--ink); }
.legal-copy p + p { margin-top: 1em; }
.legal-copy ul, .legal-copy ol { padding-left: 1.3em; margin: .8em 0; }
.legal-copy li { margin: .45em 0; padding-left: .2em; }
.legal-copy li::marker { color: var(--accent); }
.legal-copy strong { font-weight: 600; }
.legal-hold { padding: 14px 16px; border-radius: 14px; border: 1.5px dashed var(--line); }
.legal-copy > p:first-of-type { color: var(--ink2); }
.licence-copyright { margin-top: 14px; font-family: var(--mono); font-size: .92rem; color: var(--ink2); overflow-wrap: anywhere; }
.licence-text { margin: 18px 0 0; padding: 20px; max-height: 60vh; overflow: auto; border-radius: 16px; background: var(--raised); box-shadow: 0 0 0 1px var(--divider) inset; font-family: var(--mono); font-size: .84rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.licence-text:focus-visible { outline-offset: 2px; }

/* ---------- 404 ---------- */
.not-found { min-height: 100vh; display: grid; place-items: center; padding: calc(var(--header-h) + 40px) var(--gutter) 80px; text-align: center; }
.nf-wrap { display: grid; justify-items: center; gap: 18px; max-width: 34rem; }
.nf-mark { width: clamp(110px, 24vw, 180px); height: clamp(110px, 24vw, 180px); color: var(--ink); }
.nf-mark .mark { width: 100%; height: 100%; }
.not-found h1 { font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem); letter-spacing: -.035em; }
.not-found p:not(.eyebrow) { color: var(--ink2); }
.eyebrow { font-family: var(--mono); font-size: .86rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion-paused]) .nf-mark .mark-d { animation: nf-scan 2.4s var(--ease-in-out) infinite; }
}
@keyframes nf-scan { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(5px); } }

/* ---------- print ---------- */
@media print { .site-header, .skip-link, .header-tools { display: none !important; } body { background: #fff; color: #000; } }
