/* Redegjort design system — «Paragraf»
   Palette: Arkivpapir / Blekk / Fristrød / Sepia / Salvie.
   Type: Source Serif 4 (display + document text), Public Sans (UI),
   IBM Plex Mono (orgnr, dates, source codes). All self-hosted (no CDN, no tracking).
   Rules: red is reserved for the 30 June deadline and signature lines. */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/SourceSerif4-400.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/SourceSerif4-400i.woff2") format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/PublicSans-400.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --paper: #F9F7F2;      /* page ground */
  --card: #FFFDF8;       /* raised surfaces */
  --ink: #1C1A15;
  --sepia: #55503F;      /* muted text */
  --line: #E2DDD0;
  --rod: #A6251F;        /* Fristrød — deadline + signature lines ONLY */
  --salvie: #8A9B8E;     /* secondary accent, success-adjacent */
  --mono-bg: #F1EDE2;    /* chip background */

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: "Public Sans", "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140F; --card: #211E17; --ink: #E8E4D8; --sepia: #A89F8C;
    --line: #3A362C; --rod: #D65B54; --salvie: #8A9B8E; --mono-bg: #2A261D;
  }
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.7;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.4rem; }
a { color: var(--ink); text-decoration-color: var(--salvie); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--rod); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--sepia); outline-offset: 3px; }

/* Document header: the double rule of a tinglyst dokument */
.dochead {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1.5rem 0 0.9rem;
  border-bottom: 3px double var(--ink);
}
.mark { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.mark span { color: var(--rod); }
.dochead .ref { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--sepia); text-align: right; }

/* Type roles */
h1.display {
  font-size: clamp(2.1rem, 5.5vw, 3.2rem); line-height: 1.13; font-weight: 700;
  letter-spacing: -0.015em; text-wrap: balance;
}
h1.display em { font-style: italic; color: var(--rod); white-space: nowrap; }
h2 { font-size: 1.6rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.008em; text-wrap: balance; }
h3 { font-size: 1.15rem; font-weight: 700; }
.lede { font-size: 1.12rem; color: var(--sepia); }
.kicker {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--sepia);
}
.kicker b { color: var(--ink); font-weight: 400; }
.sans { font-family: var(--sans); }
.mono { font-family: var(--mono); }

/* Buttons */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  background: var(--ink); color: var(--paper); padding: 0.8rem 1.5rem;
  border-radius: 2px; text-decoration: none; border: none; cursor: pointer;
}
.btn:hover { background: var(--sepia); }

/* Source chips (kildespor) */
.kilde {
  font-family: var(--mono); font-size: 0.74rem; background: var(--mono-bg);
  padding: 0.1rem 0.45rem; border-radius: 2px; white-space: nowrap;
}

/* Tables: document setting */
.tablewrap { overflow-x: auto; }
table.doc {
  border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.9rem;
  background: var(--card); border: 1px solid var(--line);
}
table.doc th {
  text-align: left; font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--sepia); font-weight: 400;
  padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--ink);
}
table.doc td { padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.doc tr:last-child td { border-bottom: none; }
table.doc td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Stat block: red-rule citations */
.stat { border-left: 3px solid var(--rod); padding-left: 1rem; }
.stat .big { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.stat .what { font-family: var(--sans); font-size: 0.92rem; line-height: 1.5; margin-top: 0.3rem; }
.stat .src { font-family: var(--mono); font-size: 0.68rem; color: var(--sepia); margin-top: 0.6rem; line-height: 1.6; letter-spacing: 0.02em; }

/* Signature line motif */
.siglinje { border-bottom: 1px solid var(--rod); padding-bottom: 0.15rem; }

/* Closing CTA band */
.closer { border-top: 3px double var(--ink); margin-top: 3.5rem; padding: 3.2rem 0 1.5rem; }
.closer h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); max-width: 24ch; }
.closer h2 em { font-style: italic; color: var(--rod); white-space: nowrap; }
.closer .row { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; margin-top: 1.8rem; }
.closer .note { font-family: var(--mono); font-size: 0.68rem; color: var(--sepia); letter-spacing: 0.04em; line-height: 1.7; max-width: 40ch; }
.closer + footer.doc, .closer + footer { border-top: 1px solid var(--line); }

footer.doc {
  border-top: 3px double var(--ink); margin-top: 3.5rem; padding: 1.8rem 0 3rem;
  font-family: var(--sans); font-size: 0.8rem; color: var(--sepia);
}
footer.doc p { max-width: 68ch; }
footer.doc p + p { margin-top: 0.6rem; }
