/* mononews — tokens, type, shell, header, footer, forms. Self-hosted fonts only (no third-party requests). */

@font-face {
  font-family: 'Piazzolla';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/piazzolla-latin-opsz-normal.woff2') format('woff2-variations'), url('/fonts/piazzolla-latin-opsz-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Piazzolla';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/piazzolla-latin-opsz-italic.woff2') format('woff2-variations'), url('/fonts/piazzolla-latin-opsz-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Martian Mono';
  font-style: normal;
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  src: url('/fonts/martian-mono-latin-standard-normal.woff2') format('woff2-variations'), url('/fonts/martian-mono-latin-standard-normal.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --serif: 'Piazzolla', Georgia, 'Times New Roman', serif;
  --sans: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Martian Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.86rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.3vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
  --step-3: clamp(1.6rem, 1.3rem + 1.3vw, 2.3rem);
  --step-4: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  --step-5: clamp(2.6rem, 1.5rem + 4.6vw, 5.4rem);

  --gutter: clamp(16px, 4vw, 44px);
  --max: 1280px;
  --radius: 10px;
  --radius-sm: 6px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);

  --z-sticky: 10;
  --z-progress: 20;
  --z-toast: 40;
  --z-skip: 50;

  --bg: oklch(0.985 0.003 215);
  --bg-2: oklch(0.962 0.007 215);
  --surface: oklch(1 0 0);
  --ink: oklch(0.21 0.02 225);
  --ink-2: oklch(0.39 0.02 225);
  --muted: oklch(0.49 0.018 225);
  --rule: oklch(0.885 0.009 215);
  --rule-strong: oklch(0.21 0.02 225);
  --field: oklch(0.6 0.015 225);
  --brand: oklch(0.46 0.09 205);
  --brand-ink: oklch(0.42 0.088 205);
  --brand-wash: oklch(0.945 0.03 200);
  --brand-deep: oklch(0.29 0.055 212);
  --on-brand: oklch(0.99 0.005 200);
  --halo: var(--bg-2);

  --ok: oklch(0.44 0.11 155);
  --ok-bg: oklch(0.95 0.035 155);
  --ok-bar: oklch(0.6 0.13 155);
  --warn: oklch(0.47 0.1 68);
  --warn-bg: oklch(0.955 0.045 85);
  --warn-bar: oklch(0.77 0.14 76);
  --unk: oklch(0.43 0.025 250);
  --unk-bg: oklch(0.94 0.01 250);
  --unk-bar: oklch(0.72 0.022 250);
  --bad: oklch(0.49 0.16 27);
  --bad-bg: oklch(0.95 0.03 27);
  --bad-bar: oklch(0.6 0.18 27);

  --map-0: oklch(0.915 0.01 215);
  --map-1: oklch(0.86 0.045 200);
  --map-2: oklch(0.74 0.08 201);
  --map-3: oklch(0.58 0.098 204);
  --shadow: 0 1px 2px oklch(0.2 0.02 225 / 0.06), 0 8px 28px -12px oklch(0.2 0.02 225 / 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.175 0.012 225);
    --bg-2: oklch(0.205 0.013 225);
    --surface: oklch(0.225 0.014 225);
    --ink: oklch(0.94 0.008 215);
    --ink-2: oklch(0.83 0.012 215);
    --muted: oklch(0.72 0.015 215);
    --rule: oklch(0.315 0.015 225);
    --rule-strong: oklch(0.9 0.01 215);
    --field: oklch(0.52 0.015 220);
    --brand: oklch(0.8 0.1 200);
    --brand-ink: oklch(0.83 0.095 200);
    --brand-wash: oklch(0.275 0.04 205);
    --brand-deep: oklch(0.255 0.045 210);
    --on-brand: oklch(0.18 0.02 220);

    --ok: oklch(0.83 0.12 155);
    --ok-bg: oklch(0.28 0.05 155);
    --ok-bar: oklch(0.7 0.14 155);
    --warn: oklch(0.86 0.12 82);
    --warn-bg: oklch(0.3 0.05 75);
    --warn-bar: oklch(0.8 0.14 78);
    --unk: oklch(0.83 0.02 250);
    --unk-bg: oklch(0.29 0.015 250);
    --unk-bar: oklch(0.6 0.022 250);
    --bad: oklch(0.81 0.11 27);
    --bad-bg: oklch(0.3 0.06 27);
    --bad-bar: oklch(0.66 0.17 27);

    --map-0: oklch(0.285 0.014 225);
    --map-1: oklch(0.35 0.045 205);
    --map-2: oklch(0.47 0.075 203);
    --map-3: oklch(0.62 0.095 200);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 10px 30px -12px oklch(0 0 0 / 0.55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0) / 1.6 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; line-height: 1.12; letter-spacing: -0.006em; word-spacing: 0.03em; text-wrap: balance; margin: 0; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--brand-wash); color: var(--ink); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-2); padding: 0.1em 0.35em; border-radius: 4px; }
mark { background: var(--brand-wash); color: inherit; border-radius: 2px; padding: 0 0.1em; }
b, strong { font-weight: 650; }

.mono, code, .machine-label, .diff-kind, .chg-kind, .step-kind, .src-kind, .stance, .persp-avatar { font-stretch: 82%; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum' 1, 'zero' 1; letter-spacing: -0.02em; font-size-adjust: 0.5; }
.shell { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: var(--z-skip); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm); }
.skip:focus { top: 12px; }
.fine { font-size: var(--step--1); color: var(--muted); }
.quiet { color: var(--ink-2); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  view-transition-name: site-header;
}
.bar {
  width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto;
  display: flex; align-items: center; gap: 12px 28px; min-height: 62px;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 440 1.42rem/1 var(--serif); letter-spacing: -0.02em; }
.wordmark b { font-weight: 760; }
.wordmark .mark { width: 30px; height: 30px; flex: none; }
.mark-tile { fill: var(--brand); }
.mark-m { fill: none; stroke: var(--on-brand); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.mark-dot { fill: var(--ok-bar); stroke: var(--bg); stroke-width: 1.4; }
.nav { margin-right: auto; }
.nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 999px;
  color: var(--ink-2); font-weight: 520; font-size: 0.95rem; text-decoration: none;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.tag {
  display: inline-block; font: 650 0.7rem/1 var(--sans); letter-spacing: 0.02em; padding: 4px 7px 3px; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok); vertical-align: 0.1em;
}
.search-mini { display: flex; align-items: center; position: relative; }
.search-mini input {
  width: 13.5rem; height: 38px; padding: 0 38px 0 14px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--bg-2); color: var(--ink); font: inherit; font-size: 0.93rem;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.search-mini input::placeholder { color: var(--muted); }
.search-mini input:focus { background: var(--surface); border-color: var(--field); outline: none; box-shadow: 0 0 0 3px var(--brand-wash); }
.search-mini button { position: absolute; right: 4px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.search-mini svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

@media (max-width: 960px) {
  .bar { flex-wrap: wrap; padding-top: 10px; gap: 6px 12px; }
  .nav { order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--gutter)); overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - 40px), transparent); }
  .nav ul { padding: 0 var(--gutter) 6px; width: max-content; }
  .nav a { padding: 7px 10px; font-size: 0.92rem; }
  .search-mini { margin-left: auto; }
  .search-mini input { width: 10rem; }
}
@media (max-width: 420px) {
  .search-mini input { width: 8.5rem; padding-right: 34px; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(64px, 10vw, 120px); background: var(--bg-2); border-top: 1px solid var(--rule); padding: 48px 0 36px; font-size: 0.95rem; }
.site-footer .shell { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); gap: 32px 48px; }
.footer-brand p { color: var(--ink-2); margin-top: 12px; font-family: var(--serif); font-size: 1.1rem; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.machine-label { grid-column: 1 / -1; margin: 12px 0 0; padding-top: 20px; border-top: 1px solid var(--rule); font: 450 0.84rem/1.5 var(--mono); color: var(--ink-2); display: flex; align-items: baseline; gap: 10px; }
.bot-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--brand); transform: translateY(-1px); }
@media (max-width: 720px) {
  .site-footer .shell { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Forms & buttons ---------- */
.field { display: grid; gap: 6px; font-size: 0.93rem; font-weight: 600; color: var(--ink); }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); }
.field input, .field select, .field textarea, .search-big input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--field); background: var(--surface); font-weight: 400; font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s var(--ease-out);
}
.field textarea { min-height: 7.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-big input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 8px; font: 650 0.98rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s, transform 0.15s var(--ease-out), color 0.2s;
}
.btn { background: var(--brand); color: var(--on-brand); border: 1px solid transparent; }
.btn:hover { background: color-mix(in oklch, var(--brand), var(--ink) 18%); }
.btn:active, .btn-ghost:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); min-height: 40px; padding: 0 14px; font-weight: 580; font-size: 0.92rem; }
.btn-ghost:hover { border-color: var(--field); background: var(--bg-2); }
.btn-ghost svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 650; margin-bottom: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; background: var(--surface); }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: var(--z-toast); margin: 0;
  translate: -50% 16px; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
  transition: opacity 0.3s var(--ease-out), translate 0.4s var(--ease-out);
}
.toast.is-on { opacity: 1; translate: -50% 0; }
