/* ------------------------------------------------------------------
   Palette and structure follow how the University of Copenhagen uses
   its own identity on ku.dk: a KU-red band above the masthead, black
   serif display headings, sans-serif body text, red reserved for
   labels, figures and rules, a light grey panel for exhibits, and a
   solid KU-red footer block.

   KU-rød #901A1E and KU-grå #666666 are the two values KU publishes
   (designguide.ku.dk). The warm neutrals are derived around the red.

   Single theme, deliberately: lightening KU-rød for a dark ground
   turns it into a coral that belongs to no one.
   ------------------------------------------------------------------ */

:root {
  --ku:      #901a1e;
  --ku-deep: #6f1417;

  --paper: #fcfbf9;
  --panel: #f0efec;
  --ink:   #16130f;
  --muted: #55514b;
  --faint: #6b655c;
  --line:  #e5e0d8;
  --rule:  #c9c2b8;
  --underline: #8a8175;

  --serif: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --sans:  "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 34rem;
  --gap:     clamp(2.75rem, 6vw, 4.5rem);
  --pad:     1.5rem;
  --width:   56rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* KU-red band across the top, as on ku.dk */
.band { height: 7px; background: var(--ku); }

main {
  max-width: var(--width);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 4.5rem) var(--pad) 5rem;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

a { color: inherit; }

a:focus-visible { outline: 2px solid var(--ku); outline-offset: 3px; }

code { font-family: var(--mono); font-size: 0.88em; }

/* ── Masthead ───────────────────────────────────────────────── */

.masthead { display: grid; grid-template-columns: 1fr; gap: 0.85rem; }

.masthead h1 {
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.06;
}

.role {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ku);
}

.masthead::after {
  content: "";
  height: 2px;
  background: var(--ku);
  margin-top: 0.35rem;
}

@media (min-width: 54rem) {
  .masthead { grid-template-columns: 8rem minmax(0, 1fr); column-gap: 3.25rem; }
  .masthead > *,
  .masthead::after { grid-column: 2; }
}

.lede {
  font-family: var(--serif);
  font-size: 1.24rem;
  line-height: 1.5;
  max-width: var(--measure);
  text-wrap: pretty;
}

.links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; font-size: 0.88rem; }

.links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--underline);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.links a:hover { color: var(--ku); border-color: var(--ku); }

/* ── Blocks ─────────────────────────────────────────────────── */

.block { display: grid; grid-template-columns: 1fr; gap: 1rem; }

.block h2 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ku);
}

@media (min-width: 54rem) {
  .block { grid-template-columns: 8rem minmax(0, 1fr); gap: 0 3.25rem; }
  .block h2 { position: sticky; top: 2.5rem; align-self: start; }
}

.entries { display: flex; flex-direction: column; }

.entry {
  border-top: 1px solid var(--line);
  padding: 1.45rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.entry:last-child { border-bottom: 1px solid var(--line); }

.entry h3 {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.entry h3 a { text-decoration: none; border-bottom: 1.5px solid var(--underline); padding-bottom: 1px; transition: color 0.15s, border-color 0.15s; }
.entry h3 a:hover { color: var(--ku); border-color: var(--ku); }

.entry-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }

.entry p { max-width: var(--measure); font-size: 0.99rem; }

.entry .lead-para { font-size: 1.06rem; line-height: 1.58; }

/* Sentences: normal case. Uppercase is for the short label below only. */
.entry-intro { color: var(--muted); }

.entry-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.entry-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.entry-links a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--underline);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.entry-links a:hover { color: var(--ku); border-color: var(--ku); }

.entry-links span { color: var(--rule); }

/* ── Figure, on a grey panel as ku.dk frames its exhibits ───── */

.plot-figure {
  background: var(--panel);
  padding: 1.5rem 1.35rem 1.1rem;
  margin: 0.75rem 0 0.25rem;
  border-bottom: 2px solid var(--ku);
}

.plot { width: 100%; height: auto; display: block; }

.plot .baseline { stroke: var(--ink); stroke-width: 1; }
.plot .grid line { stroke: #d8d5cf; stroke-width: 1; }

.plot text { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.plot .tick text { font-size: 11px; fill: var(--faint); }
.plot .axis-title { font-size: 10px; letter-spacing: 0.09em; fill: var(--faint); }

.plot polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }

.line-stream { stroke: var(--ink); stroke-width: 2.25; }
.line-load   { stroke: var(--ku);  stroke-width: 2.25; }

.dot-load circle   { fill: var(--ku); }
.dot-stream circle { fill: var(--ink); }

.oom line { stroke: var(--ku); stroke-width: 2.75; stroke-linecap: round; }

.value      { font-size: 11px; fill: var(--muted); }
.annot-load { font-size: 12px; font-weight: 700; fill: var(--ku); }
.annot-sub  { font-size: 11px; fill: var(--faint); }
.annot-strm { font-size: 11px; fill: var(--ink); }

.annot-narrow { display: none; }

body.animate .line-load,
body.animate .line-stream {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 1s ease-out forwards;
}

body.animate .line-stream { animation-delay: 0.1s; }
body.animate .line-load   { animation-delay: 0.35s; }

@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Publications ───────────────────────────────────────────── */

.pubs { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; }

.pubs li { display: grid; gap: 0.1rem 1.5rem; }

@media (min-width: 40rem) {
  .pubs li { grid-template-columns: 12rem minmax(0, 1fr); }
}

.pubs .venue {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ku);
  align-self: start;
  font-variant-numeric: tabular-nums;
}

.pub-main { display: flex; flex-direction: column; gap: 0.18rem; }

/* A real text underline, not a border. A border on a wrapping anchor spans the
   whole grid cell, so it reads as a rule between the title and the author line
   rather than as a link. text-decoration follows each line and hugs the text. */
.pubs .pub-title {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.45;
  text-wrap: pretty;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.pubs .pub-title:hover { color: var(--ku); border-color: var(--ku); }

.pubs .authors { font-size: 0.82rem; color: var(--faint); }
.pubs .authors b { color: var(--muted); font-weight: 700; }

/* ── Upstream ───────────────────────────────────────────────── */

.upstream { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }

.upstream li { display: grid; gap: 0.1rem 1.5rem; max-width: var(--measure); }

@media (min-width: 40rem) {
  .upstream li { grid-template-columns: 10.5rem minmax(0, 1fr); max-width: none; }
}

.upstream a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--underline);
  justify-self: start;
  align-self: start;
  padding-bottom: 1px;
}

.upstream a:hover { color: var(--ku); border-color: var(--ku); }

.upstream span { font-size: 0.97rem; color: var(--muted); max-width: var(--measure); }

/* ── Footer, a solid KU-red block as on ku.dk ───────────────── */

.site-footer { background: var(--ku); color: #f7f2f0; }

.site-footer .inner {
  max-width: var(--width);
  margin: 0 auto;
  padding: 2.25rem var(--pad) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.5rem;
  font-size: 0.86rem;
}

.site-footer a { color: #ffffff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.45); padding-bottom: 1px; }
.site-footer a:hover { border-color: #ffffff; }

.site-footer a:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }

@media (max-width: 46rem) {
  .plot .tick text { font-size: 22px; }
  .plot .axis-title { font-size: 19px; }
  .value { font-size: 21px; }
  .annot-load { font-size: 26px; }
  .annot-sub  { font-size: 21px; }
  .annot-strm { font-size: 21px; }
  .annot-wide { display: none; }
  .annot-narrow { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
