/* LOSTFALL, what every page shares: palette, type, the top bar, the footer.
   Palette unchanged from the site of July (warm dark, grain, one red), imposed
   by the book on 30/09/2026. Sizes are in rem on purpose: a reader who sets a
   larger default text size in the browser must get larger text, and px would
   quietly refuse. */

:root {
  --bg: #141210;
  --panel: #1B1815;
  --cream: #EFEADE;
  --cream-soft: #DAD3C5;
  --silver: #948B7C;
  --hairline: rgba(239, 234, 222, .15);
  --hairline-strong: rgba(239, 234, 222, .34);
  --accent: #8E2C1E;
  --accent-hover: #A3331F;
  --accent-ink: #EFEADE;
  /* 3.9:1 on --bg: numerals and rules only, never running text */
  --accent-line: #C0473A;

  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  --mark: 'Anton', 'Arial Narrow', Impact, sans-serif;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
/* a single long word ("Confidentialité" at 200 % text) must break rather than
   push the page sideways; break-word only acts when nothing else fits */
h1, h2, p, li, a { overflow-wrap: break-word; }

/* Literata has no kana, no kanji and no Devanagari, so the Japanese and Hindi
   pages are set in the reader's own face. Named ones first: left to "serif"
   alone, Windows hands Japanese a hairline Mincho meant for print. Only the
   root matches :lang() here, so the EN / FR of the menu and the Latin mark
   keep inheriting the same stack, and Literata still draws their letters. */
:lang(ja) { --serif: 'Literata', 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', 'Noto Serif CJK JP', serif; }
:lang(hi) { --serif: 'Literata', 'Kohinoor Devanagari', 'Noto Serif Devanagari', 'Nirmala UI', 'Noto Sans Devanagari', serif; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

/* The grain hangs off the body, not the viewport: a fixed layer only covers
   the first screen of a full-page capture and the review sees a band the site
   does not have. */
.grainy::after {
  content: ""; position: absolute; inset: 0; z-index: 50; pointer-events: none;
  opacity: .05; background-image: var(--grain);
}

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem 1rem;
  padding: .375rem var(--gutter);
}
.topbar--bare { justify-content: flex-end; }
.home-mark {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  font-family: var(--mark); font-size: 1.375rem; letter-spacing: .08em; text-decoration: none;
}
.home-mark:hover { color: var(--cream-soft); }

/* 44 x 44 both ways, measured: EN alone is 30px wide at this size, so the
   width is a floor, not a result of the padding */
.langs { display: flex; flex-wrap: wrap; gap: .25rem; }
.langs a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 .5rem;
  font-size: 1rem; letter-spacing: .08em; text-decoration: none; color: var(--silver);
}
.langs a:hover { color: var(--cream); }
.langs a[aria-current] {
  color: var(--cream); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--accent-line);
  text-decoration-thickness: 2px; text-underline-offset: .45em;
}
/* Nine languages since October 2026. At the 44px floor they filled a phone's
   row and left JA and HI hanging alone under it. 2rem still clears the 24px a
   target must have, the height keeps its 44, and the row only breaks again for
   a reader who has enlarged the text, which is what wrapping is for. */
@media (max-width: 30em) {
  .langs { gap: 0; }
  .langs a { min-width: 2rem; padding: 0 .0625rem; font-size: .9375rem; letter-spacing: .04em; }
}

/* ---- the worn LOSTFALL ------------------------------------------------ */
/* Two noises: a fine one says where a chip could fall, a coarse one says where
   the ink is worn at all, and only their overlap is bitten out. Most of every
   letter stays solid. The zone threshold is the one knob: 3.9 here, 3.3 made
   the exploration's poster version, and past that an L starts reading as an I.
   The tile is sized in em, so a phone gets the same wear as a desktop. */
.worn {
  font-family: var(--mark); font-weight: 400; text-transform: uppercase; letter-spacing: .015em;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='300'%3E%3Cfilter id='w' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' seed='23' result='f'/%3E%3CfeColorMatrix in='f' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14 0 0 0 -9.2' result='holes'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='2' seed='5' result='c'/%3E%3CfeColorMatrix in='c' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0 0 0 -3.9' result='zone'/%3E%3CfeComposite in='holes' in2='zone' operator='in' result='bite'/%3E%3CfeFlood flood-color='white'/%3E%3CfeComposite in2='bite' operator='out'/%3E%3C/filter%3E%3Crect width='600' height='300' filter='url(%23w)'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='300'%3E%3Cfilter id='w' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' seed='23' result='f'/%3E%3CfeColorMatrix in='f' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14 0 0 0 -9.2' result='holes'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='2' seed='5' result='c'/%3E%3CfeColorMatrix in='c' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0 0 0 -3.9' result='zone'/%3E%3CfeComposite in='holes' in2='zone' operator='in' result='bite'/%3E%3CfeFlood flood-color='white'/%3E%3CfeComposite in2='bite' operator='out'/%3E%3C/filter%3E%3Crect width='600' height='300' filter='url(%23w)'/%3E%3C/svg%3E");
  -webkit-mask-size: 5em 2.5em; mask-size: 5em 2.5em;
}

/* ---- footer ------------------------------------------------------------ */
.endpaper {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 2rem;
  margin-top: 5rem; padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--hairline);
  color: var(--silver); font-size: 1rem;
}
.endpaper .foot-mark { margin: 0; font-family: var(--mark); font-size: 1.5rem; letter-spacing: .06em; color: var(--cream); }
.endpaper .byline { margin: 0; font-style: italic; }
.fine-links { display: flex; flex-wrap: wrap; gap: 0 .5rem; margin: 0 0 0 auto; padding: 0; list-style: none; }
.fine-links a {
  display: inline-flex; align-items: center; min-height: 2.75rem; min-width: 2.75rem; padding: 0 .5rem;
  text-underline-offset: .3em; text-decoration-color: var(--hairline-strong);
}
.fine-links a:hover { color: var(--cream); text-decoration-color: currentColor; }

/* The neutral cover slot: empty on purpose. The book asked for a slot, not a
   cover, and any letter inside it would already be a cover proposal. */
.cover-slot { aspect-ratio: 2 / 3; background: var(--panel); border: 1px solid var(--hairline); }

/* a display:flex rule once beat [hidden] on the radio (RADIO-01): never again */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 40em) {
  .fine-links { margin-left: 0; }
}
