/* dispatches.info — shared look ("Paper and Ink", Oct 2026).
   Every page links fonts.css + this file. Page-specific styles stay in the page.
   Colour rule: yellow (--y) is a highlighter behind ink, a button fill in dark mode,
   or an accent on dark bands. Never yellow text on the cream paper. */

:root {
  --paper: #faf8f3;
  --paper-2: #f2eee5;
  --ink: #15171c;
  --body: #2a2d33;
  --soft: #5d6068;
  --line: #ddd7c9;
  --line-strong: #15171c;
  --y: #ffd60a;
  --on-y: #15171c;
  --btn: #15171c;
  --on-btn: #faf8f3;
  --btn-hover: #ffd60a;
  --on-btn-hover: #15171c;
  --tick: #15171c;
  --uline: #15171c;
  --band: #0d0f13;
  --band-ink: #ece9e1;
  --band-soft: #a3a7b0;
  --band-line: #272b33;
  --plate: #f7f8f2;
  --code-bg: #f2eee5;

  --f-text: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --f-mono: "Spline Sans Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --wrap: 1280px;
  --measure: 720px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --nav-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161b;
    --paper-2: #1a1d23;
    --ink: #e9e6df;
    --body: #d6d3cc;
    --soft: #9aa0ab;
    --line: #2b2f38;
    --line-strong: #e9e6df;
    --btn: #ffd60a;
    --on-btn: #15171c;
    --btn-hover: #e9e6df;
    --on-btn-hover: #15171c;
    --tick: #ffd60a;
    --uline: #ffd60a;
    --band: #0a0c10;
    --band-line: #22262e;
    --plate: #0f110e;
    --code-bg: #1a1d23;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--f-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
h1, h2, h3 { text-wrap: balance; }
[id] { scroll-margin-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 16px); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--y); color: var(--on-y); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.visually-hidden, .sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; top: -60px; left: 16px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 16px; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- type helpers ---------- */
.mono, .eyebrow {
  font: 500 .74rem/1.35 var(--f-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--soft);
}
em.s, .serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; }
.mk {
  background: linear-gradient(transparent 60%, var(--y) 60%, var(--y) 90%, transparent 90%);
  color: var(--on-y);
  padding: 0 .06em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* On dark paper the marker can't sit under light text, so the word itself turns yellow. */
@media (prefers-color-scheme: dark) { .mk { background: none; color: var(--y); } }
.band .mk { background: none; color: var(--y); }

.kicker { display: flex; align-items: baseline; gap: 1rem; }
.kicker .no { font: 500 .8rem var(--f-mono); color: var(--ink); }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--btn); color: var(--on-btn);
  padding: .9rem 1.6rem; border: 0; border-radius: 2px;
  font: 600 1rem/1.2 var(--f-text); text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--btn-hover); color: var(--on-btn-hover); }
.btn.sm { padding: .55rem 1rem; font-size: .92rem; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.link {
  font-weight: 600; text-decoration: underline;
  text-decoration-color: var(--uline); text-decoration-thickness: 2px; text-underline-offset: .25em;
}
.link:hover { background: var(--y); color: var(--on-y); text-decoration: none; }

/* ---------- header ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 30;
  height: env(safe-area-inset-top, 0px); background: var(--paper);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--y); color: #15171c; display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 16px; height: 16px; }
.nav-links { display: flex; gap: 1.6rem; font-size: .92rem; }
.nav-links a { text-decoration: none; color: var(--soft); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--uline); text-decoration-thickness: 2px; text-underline-offset: .45em; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.menu { display: none; position: relative; }
.menu summary {
  list-style: none; cursor: pointer; padding: .55rem .2rem;
  font: 500 .78rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .menu-list {
  display: grid; gap: .7rem; position: absolute; right: 0; top: 2.7rem; min-width: 14rem;
  background: var(--paper); border: 1px solid var(--line); padding: 1rem 1.2rem;
}
.menu-list { display: none; }
.menu-list a { text-decoration: none; }
@media (max-width: 1060px) { .site-header .nav-links { display: none; } .menu { display: block; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 3rem 2.5rem; margin-top: 2rem; }
.thirty { font: 500 1rem var(--f-mono); letter-spacing: .3em; text-align: center; color: var(--soft); margin: 0 0 2.5rem; }
.foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 2rem; align-items: start; }
.foot p { margin: .45rem 0 0; color: var(--soft); font-size: .95rem; }
.foot-links { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; font-size: .95rem; }
.foot-links li { padding: .15rem 0; break-inside: avoid; }
.foot-links a { text-decoration: none; color: var(--soft); }
.foot-links a:hover { color: var(--ink); }
@media (max-width: 900px) { .foot { grid-template-columns: minmax(0, 1fr); } }

/* ---------- long-form prose (guide, tutorials, legal, field notes) ---------- */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.6rem); line-height: .98; letter-spacing: -.045em;
  font-weight: 500; margin: 1rem 0 0; max-width: 18ch;
}
.page-head .lede, .lede { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.45; color: var(--soft); max-width: 52ch; margin: 1.2rem 0 0; }
.prose { max-width: var(--measure); color: var(--body); }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.03em; line-height: 1.1; font-weight: 500; color: var(--ink); margin: 3rem 0 .8rem; }
.prose h3 { font-size: 1.25rem; letter-spacing: -.015em; line-height: 1.25; font-weight: 600; color: var(--ink); margin: 2rem 0 .5rem; }
.prose p, .prose li { font-size: 1.0625rem; line-height: 1.7; }
.prose a { color: var(--ink); text-decoration-color: var(--uline); text-decoration-thickness: 2px; }
.prose a:hover { background: var(--y); color: var(--on-y); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .3rem 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote { margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 2px solid var(--ink); font-family: var(--f-serif); font-style: italic; font-size: 1.25rem; color: var(--ink); }
.prose code { font: .9em var(--f-mono); background: var(--code-bg); padding: .1em .35em; border-radius: 3px; }
.prose pre { background: var(--code-bg); padding: 1rem 1.2rem; overflow-x: auto; border-radius: 4px; font: .9rem/1.55 var(--f-mono); }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .7rem .8rem .7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 500 .74rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); border-bottom-color: var(--line-strong); }
.table-scroll { overflow-x: auto; }
.prose figure { margin: 2rem 0; }
.prose figcaption { font-size: .9rem; color: var(--soft); margin-top: .6rem; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
.note-box { border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); padding: 1.1rem 0; margin: 2rem 0; }

/* ---------- FAQ ---------- */
details.qa { border-top: 1px solid var(--line); padding: 1.3rem 0; }
details.qa:last-of-type { border-bottom: 1px solid var(--line); }
details.qa summary { font-size: 1.2rem; letter-spacing: -.01em; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; font-family: var(--f-mono); color: var(--soft); }
details.qa[open] summary::after { content: "\2013"; }
details.qa p { color: var(--body); max-width: 62ch; margin: .8rem 0 0; }

/* ---------- click-to-play YouTube (assets/js/video-embed.js) ---------- */
.video-frame { position: relative; display: block; border-radius: 6px; overflow: hidden; background: #0f110e; box-shadow: 0 0 0 1px var(--line); aspect-ratio: 16 / 9; }
.video-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.video-frame:hover img { transform: scale(1.02); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame .play {
  position: absolute; left: 1.2rem; bottom: 1.2rem; display: flex; align-items: center; gap: .7rem;
  background: var(--y); color: #15171c; padding: .65rem 1.1rem .65rem .8rem; font-weight: 600; border-radius: 999px;
}
.video-frame .play svg { width: 22px; height: 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
