/* ==========================================================================
   Nmonic — shared broadsheet system
   One source for tokens, masthead, mobile menu, buttons, margin notes and the
   colophon footer. Utility pages (download, sign-in, trust, privacy) link this
   file so the site can't drift back into three different brands.
   The homepage keeps its own inline copy for first-paint speed — if you change
   a token here, change it in index.html too (site/qa/site-qa.mjs checks).
   ========================================================================== */
:root {
  --paper:      #f4eee3;
  --paper-2:    #efe7d6;
  --paper-3:    #e9dfca;
  --ink:        #211c17;
  --ink-soft:   #534a3e;
  --ink-faint:  #7d7264;   /* darkened from #8d8273 to clear 4.5:1 on paper */
  --rule:       #d8ceba;
  --rule-strong:#c1b49a;
  --spot:       #b23a22;
  --spot-deep:  #8c2b16;
  --spot-soft:  #c66a52;
  --ok:         #3f6b3a;

  --display: 'Fraunces', 'Charter', Georgia, serif;
  --text:    'Newsreader', 'Iowan Old Style', Georgia, serif;
  --label:   'Hanken Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --measure: min(1220px, calc(100vw - 3rem));
  --column:  40rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--text); font-optical-sizing: auto;
  font-size: 19px; line-height: 1.55; min-width: 320px; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--spot); color: var(--paper); }
:focus-visible { outline: 2px solid var(--spot); outline-offset: 3px; }

body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.65 0 0 0 0 0.58 0 0 0 0 0.47 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.sheet { position: relative; z-index: 1; max-width: var(--measure); margin: 0 auto; }

/* ---------- Masthead ---------- */
.masthead { border-top: 2px solid var(--ink); position: relative; z-index: 20; }
.folio { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; font-size: 0.66rem; color: var(--ink-faint); border-bottom: 1px solid var(--rule); }
.folio span { font-family: var(--label); text-transform: uppercase; letter-spacing: 0.16em; }
@media (max-width: 620px) { .folio span:last-child { display: none; } }
.topnav { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 0; gap: 1rem; }
.nameplate { font-family: var(--display); font-weight: 500; font-size: 1.7rem; font-variation-settings: 'opsz' 60, 'WONK' 1; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.5rem; }
.nameplate .mark, .foot-name .mark { color: var(--spot); }
.topnav nav { display: flex; align-items: center; gap: 1.6rem; }
.topnav nav a { font-family: var(--label); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.13em; font-weight: 600; color: var(--ink-soft); transition: color .2s; }
.topnav nav a:hover, .topnav nav a[aria-current="page"] { color: var(--spot); }
.topnav nav a.signin { color: var(--paper); background: var(--ink); padding: 0.5rem 0.95rem; letter-spacing: 0.1em; transition: background .2s; }
.topnav nav a.signin:hover { background: var(--spot); color: var(--paper); }

/* Mobile menu: a <details> so it works with JS off. Desktop never shows it. */
.menu { display: none; position: static; }
.topnav { position: relative; }
.menu summary { list-style: none; cursor: pointer; font-family: var(--label); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.13em; font-weight: 600; color: var(--ink); padding: 0.5rem 0.2rem; display: flex; align-items: center; gap: 0.5rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary .bars { width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
.menu summary .bars::after { content: ''; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; }
.menu[open] summary .bars { border-color: transparent; }
.menu[open] summary .bars::after { top: 2px; transform: rotate(45deg); box-shadow: none; }
.menu[open] summary .bars::before { content: ''; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; transform: rotate(-45deg); }
.menu-panel { position: absolute; right: 0; top: calc(100% - 0.3rem); width: min(20rem, 100%); background: var(--paper); border: 1px solid var(--ink); box-shadow: 6px 7px 0 rgba(33,28,23,0.08); padding: 0.4rem 1.2rem 1rem; }
.topnav .menu-panel a { display: block; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 400; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); font-family: var(--display); font-size: 1.2rem; font-variation-settings: 'opsz' 40; }
.topnav .menu-panel a:last-child { border-bottom: none; }
.topnav .menu-panel a.cta { margin-top: 0.6rem; border: none; background: var(--ink); color: var(--paper); text-align: center; font-family: var(--label); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; padding: 0.9rem; }
@media (max-width: 820px) {
  .topnav nav > a:not(.signin) { display: none; }
  .menu { display: block; }
  .topnav nav { gap: 0.9rem; }
}

/* ---------- Buttons ---------- */
.btn-ink { background: var(--ink); color: var(--paper); font-family: var(--label); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; font-size: 0.8rem; padding: 0.95rem 1.5rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; border: none; cursor: pointer; transition: background .2s, transform .2s; }
.btn-ink:hover { background: var(--spot); transform: translateY(-2px); }
.btn-ink:disabled { opacity: 0.55; cursor: progress; transform: none; }
.btn-ink svg { width: 15px; height: 15px; }
.link-u { color: var(--ink); border-bottom: 1px solid var(--spot); transition: color .2s; }
.link-u:hover { color: var(--spot); }

/* ---------- Single-column utility page ---------- */
.page { padding: 3.4rem 0 4.6rem; border-bottom: 2px solid var(--ink); }
.page-col { max-width: var(--column); }
.kicker { font-family: var(--label); text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; font-size: 0.72rem; color: var(--spot); display: inline-block; margin-bottom: 1rem; }
.page h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 3.9rem); line-height: 1.02; letter-spacing: -0.02em; font-variation-settings: 'opsz' 144, 'WONK' 1; margin-bottom: 1.1rem; }
.page .standfirst { font-style: italic; font-weight: 300; font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.4; color: var(--ink-soft); max-width: 38ch; margin-bottom: 2.2rem; }
.fine { font-size: 0.92rem; line-height: 1.5; color: var(--ink-faint); font-style: italic; }

/* Margin note: how Nmonic talks — used for every status/feedback message. */
.note { padding: 0.35rem 0 0.35rem 1.1rem; border-left: 2px solid var(--spot); margin: 1.4rem 0; }
.note .who { font-family: var(--label); font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--spot); display: block; margin-bottom: 0.3rem; }
.note p { font-size: 1.02rem; line-height: 1.45; }
.note.ok { border-left-color: var(--ok); }
.note.ok .who { color: var(--ok); }
.note[hidden] { display: none; }

/* ---------- Footer / colophon ---------- */
footer.colofon { padding: 2.6rem 0 3.4rem; }
.foot-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.foot-name { font-family: var(--display); font-size: 1.3rem; font-variation-settings: 'opsz' 40, 'WONK' 1; display: flex; align-items: center; gap: 0.45rem; }
.foot-links { display: flex; gap: 1.4rem; flex-wrap: wrap; row-gap: 0.7rem; }
.foot-links a { font-family: var(--label); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; color: var(--ink-soft); transition: color .2s; }
.foot-links a:hover { color: var(--spot); }
.colophon { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); font-style: italic; font-size: 0.84rem; color: var(--ink-faint); }

@media (max-width: 520px) { body { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
