/*
 * Design tokens. One place to change the look.
 *
 * DARK ONLY (A-80 item 1, superseding A-78 item 4 and A-79 item 2): "heritage meets future",
 * night ground, engraved gold, glass, crest red. There is no light theme and no theme toggle.
 * Paper is still used as a material for objects (the membership certificate, wine tiles, letters),
 * never as a page ground.
 *
 * Type (AUTH-016): the three families are bundled in prototype/fonts/ and loaded from disk.
 *   Bodoni Moda    headings, tier names, numerals (variable: opsz 6-96, wght 400-900)
 *   Jost           interface (variable: wght 100-900)
 *   Pinyon Script  wine names only
 * Each stack keeps system fallbacks, and font-display: swap shows text at once.
 *
 * Contrast, WCAG 2.1 AA. Relative luminance computed by hand with the WCAG formula, rounded
 * down to one decimal. Not machine-checked: verify with a contrast tool before stage 4.
 *   On --black #0b0a09
 *     --ink #f6efdf 17.2:1 · --ink-2 #c2b8a4 10.0:1 · --ink-3 #a89d8a 7.4:1 · --gold #c8a96a 8.7:1
 *     --err #ff7b72 7.8:1 · white on --red #d20000 5.6:1
 *     --field-line #7d7262 4.1:1 (non-text, needs 3:1)
 *   On glass panels (--glass 76% night over a photo dimmed to 72%; worst case, a white pixel)
 *     --ink 10.6:1 · --ink-3 4.5:1 · --gold 5.4:1 · --err 4.8:1
 *   Membership certificate (paper object): --cert-ink #34261a on --cert #f3ead8 12.2:1 ·
 *     --cert-ink-2 #5a4632 on #f3ead8 7.4:1 · --cert-red #7a1018 on #f3ead8 9.1:1
 *   Paper surfaces (wine tiles, letters, Scoperta in the upgrade view) keep their own materials.
 * Text on photographs always sits on a veil or a glass panel.
 */

/* ---------- Bundled fonts (no network: files are read from disk) ---------- */
@font-face {
  font-family: "MZ Bodoni Moda";
  src: url("../fonts/bodonimoda-BodoniModa.ttf") format("truetype");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "MZ Bodoni Moda";
  src: url("../fonts/bodonimoda-BodoniModa-Italic.ttf") format("truetype");
  font-weight: 400 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "MZ Jost";
  src: url("../fonts/jost-Jost.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "MZ Jost";
  src: url("../fonts/jost-Jost-Italic.ttf") format("truetype");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "MZ Pinyon Script";
  src: url("../fonts/pinyonscript-PinyonScript-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* surfaces ("--black" is the page ground) */
  --black: #0b0a09;
  --grey-900: #121110;
  --grey-850: #181614;
  --grey-800: #201e1b;
  --grey-700: #34312d;
  --white: #ffffff;
  --ivory: #fffcf0;
  --veil: rgba(11, 10, 9, 0.78);
  --nav-bg: rgba(14, 13, 12, 0.9);
  --hdr-bg: rgba(11, 10, 9, 0.82);

  /* text */
  --ink: #f6efdf;
  --ink-2: #c2b8a4;
  --ink-3: #a89d8a;
  --line: rgba(246, 239, 223, 0.14);
  --line-2: rgba(246, 239, 223, 0.26);
  --err: #ff7b72;

  /* brand */
  --red: #d20000;
  --red-hi: #fa4545;
  --red-deep: #8f0000;
  --on-red: #ffffff;
  --gold: #c8a96a;
  --gold-hi: #e8d3a0;
  --gold-deep: #8a6a2c;
  --gold-line: rgba(200, 169, 106, 0.42);
  --gold-faint: rgba(200, 169, 106, 0.14);
  --paper: #fffcf0;
  --paper-2: #f3eedf;
  --paper-ink: #1a1a1a;
  --paper-ink-2: #5c574d;
  --cert: #f3ead8;
  --cert-ink: #34261a;
  --cert-ink-2: #5a4632;
  --cert-red: #7a1018;

  /* estates */
  --abruzzo: #2f6fa8;
  --abruzzo-hi: #8dbbe6;
  --sanpietro: #6f7752;
  --sanpietro-hi: #b9c290;

  /* states */
  --ok: #7fbf9f;
  --ok-bg: rgba(78, 122, 110, 0.22);
  --warn: #f0b862;
  --flag-bg: rgba(250, 69, 69, 0.12);
  --open: #9ec3ff;
  --open-ink: #9ec3ff;

  /* glass */
  --glass: rgba(14, 12, 10, 0.76);
  --glass-line: rgba(227, 201, 143, 0.22);
  --blur: 18px;
  --field-bg: rgba(246, 239, 223, 0.04);
  --field-line: #7d7262;
  --shadow-panel: 0 40px 90px rgba(0, 0, 0, 0.5), 0 2px 0 rgba(255, 240, 210, 0.04) inset;

  /* photographs under text */
  --photo-filter: brightness(0.72) saturate(0.92);
  --scene-veil: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(11, 10, 9, 0.18), rgba(11, 10, 9, 0.82) 100%);
  --scene-floor: linear-gradient(180deg, rgba(11, 10, 9, 0) 55%, rgba(11, 10, 9, 0.85) 100%);

  /* chapter materials (escalation Scoperta -> Famiglia -> Eredità) */
  --oak: #140c07;
  --oak-ink: #fffcf0;
  --oak-ink-2: #d8cbb6;
  --gilt: #060504;
  --leaf: #e3c98f;

  /* type */
  --font-ui: "MZ Jost", "Jost", "Futura", "Century Gothic", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-display: "MZ Bodoni Moda", "Bodoni Moda", "Bodoni 72", "Bodoni MT", "Didot", "Libre Bodoni", Georgia, "Times New Roman", serif;
  --font-script: "MZ Pinyon Script", "Pinyon Script", "Snell Roundhand", "Edwardian Script ITC", "Palace Script MT", "Apple Chancery", cursive;
  --fs-xs: 0.75rem; --fs-sm: 0.875rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.5625rem; --fs-2xl: 1.953rem; --fs-3xl: 2.441rem; --fs-4xl: 3.052rem;
  /* display scale (classical: 21 / 28 / 36 / 48 / 72 / 144 px) */
  --fd-sm: 1.3125rem; --fd-md: 1.75rem; --fd-lg: 2.25rem; --fd-xl: 3rem; --fd-2xl: 4.5rem; --fd-hero: 9rem;

  /* space and shape */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px;
  --r-panel: 22px; --r-card: 14px; --r-tile: 10px; --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-film: cubic-bezier(0.65, 0, 0.35, 1);
  --nav-h: 66px;
  --hdr-h: 64px;
  color-scheme: dark;
}
