/* Hallmark · genre: editorial · macrostructure: Long Document / Workbench · design-system: design.md · designed-as-app
   talesof.app — the brand system: the wall calendar (black grid, heavy rules, red for what matters)
   with the calendar tear-off button. Read design.md at the repo root before changing anything here.
   Zero external resources, no build step. Every rule uses logical properties, so RTL needs only
   <html dir="rtl">. The deployed CSP is style-src 'self' and font-src 'self', which forbids <style>
   blocks and style="" attributes, so page-scoped rules (see .policy) live here too.

   LOOKS: the site has more than one look. The build sets <html data-look="..."> on every page from
   scripts/site/look.json, so switching the look is one word in that file plus a rebuild.
   :root below is the calendar look (the default); each other look redefines the tokens under
   :root[data-look="<name>"] and adds its signature rules in a "Look: <name>" section at the end
   of brand.css, museums.css and home.css. */

@font-face {
  font-family: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk-italic-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}

/* Metric-matched fallback for Latin text while the web font loads (Familjen Grotesk vs Arial,
   measured with fontTools): the swap does not move the layout. Latin only, so Hebrew, Cyrillic
   and CJK keep their system fonts at full size. */
@font-face {
  font-family: "Familjen Fallback";
  src: local("Arial"), local("Helvetica"), local("Roboto");
  size-adjust: 94.5%;
  ascent-override: 108.4%;
  descent-override: 23.8%;
  line-gap-override: 0%;
  unicode-range: U+0000-02FF, U+2000-206F, U+20AC, U+2122;
}

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  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: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-500-latin-ext.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  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: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  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: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-600-latin-ext.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  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: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  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: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-700-latin-ext.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  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 for the heritage look (Barlow Semi Condensed 500 vs Arial, fontTools). */
@font-face {
  font-family: "Barlow Fallback";
  src: local("Arial"), local("Helvetica"), local("Roboto");
  size-adjust: 84.7%;
  ascent-override: 118.1%;
  descent-override: 23.6%;
  line-gap-override: 0%;
  unicode-range: U+0000-02FF, U+2000-206F, U+20AC, U+2122;
}

:root {
  /* Colour — light only: the owner does not want a dark mode (23 Oct 2026). */
  --paper:     oklch(99.6% 0.002 25);
  --ink:       oklch(20% 0.004 25);
  --muted:     oklch(50% 0.006 25);
  --rule:      oklch(90% 0.003 25);
  --red:       oklch(54% 0.21 27);
  --red-text:  oklch(50% 0.2 27);   /* red for small text: AA on paper */
  --on-red:    oklch(99.6% 0.002 25);
  --qr-ground: oklch(100% 0 0);     /* a QR code needs a true white quiet zone */
  --highlight: oklch(91% 0.045 15);
  /* Old names, kept so anything still reading them follows the new palette. */
  --brass: var(--red);
  --brass-text: var(--red-text);

  /* Type */
  --font-display: "Familjen Grotesk", "Familjen Fallback", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-body:    "Familjen Grotesk", "Familjen Fallback", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-serif: var(--font-display); /* old name */
  --font-sans:  var(--font-body);    /* old name */
  --track-display: -0.02em;

  /* Space (4-point) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 20px;
  --s5: 32px;
  --s6: 56px;

  /* Geometry */
  --container-max: 40rem;
  --measure: 66ch;
  --radius: 0;
  --btn-min-h: 52px;
  --rule-w: 1px;
  --rule-heavy: 2px solid var(--ink);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 200ms;

  color-scheme: light;
}

/* Scripts without Latin letters: no negative tracking. */
:root:is(:lang(he), :lang(zh), :lang(ja), :lang(ko)) { --track-display: 0; }

*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: clip; }
body { margin: 0; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Layout ---- */

.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  text-align: start;
}

.container {
  inline-size: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--s4);
  padding-block: var(--s5) var(--s6);
}

/* ---- Type ---- */

.wordmark {
  margin: 0 0 var(--s5) 0;
  padding-block-end: var(--s3);
  border-block-end: var(--rule-heavy);
  font: 700 22px/1.1 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--ink);
}

.h1, .policy h1 { margin: 0 0 var(--s4) 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 6vw, 42px); line-height: 1.04; letter-spacing: var(--track-display); text-wrap: balance; }
.h2, .policy h2 { margin: var(--s5) 0 var(--s3) 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(21px, 4.2vw, 26px); line-height: 1.15; letter-spacing: var(--track-display); text-wrap: balance; }
.h3 { margin: var(--s4) 0 var(--s2) 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 3.4vw, 20px); line-height: 1.25; text-wrap: balance; }

.body {
  margin: 0 0 var(--s4) 0;
  max-width: var(--measure);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
}

.muted {
  margin: 0 0 var(--s4) 0;
  max-width: var(--measure);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---- Structure ---- */

.rule {
  border: 0;
  border-block-start: var(--rule-w) solid var(--rule);
  margin-block: var(--s5);
}

.panel {
  border: var(--rule-heavy);
  padding: var(--s4);
}

/* ---- Buttons: the calendar tear-off (design.md § Buttons) ----
   A 2px ink frame; on the start side a red tab like a torn calendar date; the label on paper.
   The tab is a pseudo-element with an arrow, so every existing .btn gets it without new markup.
   The App Store button (museums.css .m-store) uses a real tab element instead. */

.btn,
.btn-secondary {
  display: inline-flex;
  align-items: stretch;
  column-gap: var(--s4);
  min-height: var(--btn-min-h);
  padding: 0;
  padding-inline-end: var(--s4);
  border: var(--rule-heavy);
  background: var(--paper);
  color: var(--ink);
  font: 700 17px/1.2 var(--font-body);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  align-items: center;
}
.btn::before,
.btn-secondary::before {
  content: "→";
  align-self: stretch;
  display: grid;
  place-items: center;
  min-inline-size: 48px;
  background: var(--red);
  color: var(--on-red);
  font-weight: 700;
}
:root[dir="rtl"] .btn::before,
:root[dir="rtl"] .btn-secondary::before { content: "←"; }
.btn-secondary::before { background: var(--ink); color: var(--paper); }
.btn:hover, .btn-secondary:hover { background: var(--highlight); }
.btn:active, .btn-secondary:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: default; }

@media (max-width: 30rem) {
  .btn, .btn-secondary { display: flex; inline-size: 100%; }
}

.btn-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

/* State. Set by confirmed.html's script only; the no-JS page never dims. */
.is-dim { opacity: .55; }

/* ---- Scoped policy typography ----
   privacy.html and terms.html drop an authored fragment inside .policy. */

.policy p,
.policy li { max-width: var(--measure); font-size: 17px; line-height: 1.55; color: var(--ink); }
.policy p { margin: 0 0 var(--s3) 0; }
.policy ul { margin: 0 0 var(--s3) 0; padding-inline-start: var(--s4); }
.policy li { margin-block-end: var(--s2); }
.policy li::marker { color: var(--red); }
/* Links follow the theme (browser defaults are blue/purple in both modes). */
.policy a, .page a:not([class]) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ================================================================
   Look: heritage road sign (data-look="heritage")
   Italy's brown signs for museums: brown plates with a white inset border, condensed sign
   lettering, the arrow as the only ornament. Warm grey ground, rounded plates.
   ================================================================ */
:root[data-look="heritage"] {
  --paper:     #e8e5df;
  --ink:       #2a2420;
  --muted:     #645a50;
  --rule:      #cdc5ba;
  --red:       #5b3a24;   /* the sign brown takes the accent role */
  --red-text:  #5b3a24;
  --on-red:    #ffffff;
  --plate:     #5b3a24;
  --plate-hover: #472c1a;
  --plate-fg:  #ffffff;
  --plate-muted: #e3cdb9;
  --highlight: #f2d16b;
  --font-display: "Barlow Semi Condensed", "Barlow Fallback", "Arial Narrow", Arial, system-ui, sans-serif;
  --font-body:    "Barlow Semi Condensed", "Barlow Fallback", "Arial Narrow", Arial, system-ui, sans-serif;
  --track-display: 0;
  --radius-plate: 6px;
  --radius-box: 10px;
  --inset: 2px solid var(--plate-fg);
}
:root[data-look="heritage"] body { background: var(--paper); }
:root[data-look="heritage"] .page { font-weight: 500; }
:root[data-look="heritage"] .wordmark { font-size: 24px; letter-spacing: 0; }
/* Buttons are sign plates: brown, white lettering, a white line inset from the edge. */
:root[data-look="heritage"] .btn,
:root[data-look="heritage"] .btn-secondary {
  column-gap: var(--s2);
  padding-inline: var(--s4) var(--s5);
  border: 0;
  border-radius: var(--radius-plate);
  background: var(--plate);
  color: var(--plate-fg);
  outline: var(--inset);
  outline-offset: -6px;
  font-weight: 700;
  font-size: 18px;
}
:root[data-look="heritage"] .btn::before,
:root[data-look="heritage"] .btn-secondary::before { min-inline-size: 0; background: none; color: var(--plate-fg); }
:root[data-look="heritage"] .btn-secondary { background: var(--paper); color: var(--plate); outline-color: var(--plate); }
:root[data-look="heritage"] .btn-secondary::before { color: var(--plate); }
:root[data-look="heritage"] .btn:hover { background: var(--plate-hover); }
:root[data-look="heritage"] .btn-secondary:hover { background: var(--highlight); }
:root[data-look="heritage"] .panel { border-radius: var(--radius-box); border-color: var(--plate); }
/* The inset line is an outline, so plates show focus as a ring outside the plate. */
:root[data-look="heritage"] .btn:focus-visible,
:root[data-look="heritage"] .btn-secondary:focus-visible { outline: var(--inset); outline-offset: -6px; box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
