/* icelander.net: trains of thought.
   One reading column. Ice paper by day, deep ocean by night. Each train has one muted hue (--train),
   used only for its name, marker and timeline. Colours carry over from the original landing card. */

@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/source-serif-4-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/source-serif-4-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/source-serif-4-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/source-serif-4-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: italic; font-display: swap; src: url(/fonts/source-serif-4-latin-600-italic.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }

:root {
  --paper: #f4f8fa;
  --sheet: #ffffff;
  --ink: #0b1d2b;
  --muted: #4f6473;
  --line: #d5e1e8;
  --accent: #0d78af;
  --code-bg: #e8f0f4;
  --deep: #061a2f;
  --train: var(--accent);
  --train-dark: #6cc0ea;
  --t: var(--train);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 40rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #071726; --sheet: #0c2236; --ink: #e6f1f7; --muted: #93abbb; --line: #1d3a52;
    --accent: #6cc0ea; --code-bg: #0f2a40;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.6vw + 0.95rem, 1.1875rem);
  line-height: 1.6;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  --t: var(--train);
}
a { color: var(--accent); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--sheet); padding: .5rem .8rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* chrome */
.site-head, main, .site-foot, .draft-banner { max-width: 46rem; margin-inline: auto; }
.site-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; padding-block: 1.75rem 1rem; border-bottom: 1px solid var(--line); }
.site-name { color: var(--ink); text-decoration: none; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.site-name .what { color: var(--muted); font-weight: 400; }
.site-nav { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-family: var(--sans); font-size: .8rem; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.draft-banner { font-family: var(--sans); font-size: .78rem; color: var(--muted); border: 1px dashed var(--line); padding: .4rem .7rem; margin-top: 1rem; border-radius: 6px; }
main { padding-block: 2.5rem 3rem; }
.site-foot { border-top: 1px solid var(--line); padding-block: 1.5rem 3rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); display: grid; gap: .3rem; }
.site-foot p { margin: 0; }
.site-foot a { color: var(--muted); }

/* shared bits */
.intro { font-size: 1.15em; line-height: 1.5; max-width: 36rem; margin: 0 0 2.25rem; }
.page-title { font-weight: 500; font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -.03em; line-height: 1.05; margin: 0 0 1rem; }
.section-label { font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 2.5rem 0 .75rem; }
.tname { font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--t); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.tname::before { content: ""; width: .55em; height: .55em; border-radius: 2px; background: currentColor; flex: none; }
.tmeta { font-family: var(--sans); font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tmeta a { color: var(--muted); }
.tag { font-family: var(--sans); font-size: .66rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: .05rem .35rem; white-space: nowrap; vertical-align: .15em; }
.empty { color: var(--muted); }

/* home: trains grid */
.trains { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .75rem; }
.train { background: var(--sheet); border: 1px solid var(--line); border-top: 3px solid var(--t); border-radius: 4px; padding: 1rem 1.2rem 1.1rem; display: flex; flex-direction: column; gap: .4rem; min-width: 0; position: relative; }
.train .tname::after { content: ""; position: absolute; inset: 0; }
.train:hover { background: color-mix(in srgb, var(--sheet) 92%, var(--t)); }
.train p { margin: 0; font-size: .95em; line-height: 1.45; }
.train .tmeta { margin-top: auto; padding-top: .3rem; }

.entries { list-style: none; margin: 0; padding: 0; }
.tl-entry { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tl-entry .t { font-weight: 600; font-size: 1.08em; line-height: 1.3; color: var(--ink); text-decoration: none; text-wrap: balance; }
.tl-entry .t:hover { color: var(--accent); }
.line .tag { margin-left: .35rem; }
.s { font-size: .93em; color: var(--muted); line-height: 1.4; }
.meta { font-family: var(--sans); font-size: .72rem; color: var(--muted); margin-top: .2rem; }

/* train page */
.train-page .big { font-size: .85rem; }
.train-page .intro { margin-top: .9rem; }
.train-tools { margin-bottom: 1.25rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--t); }
.year-group { padding-bottom: .4rem; }
.year { display: block; position: relative; font-family: var(--sans); font-size: .8rem; font-weight: 700; color: var(--t); font-variant-numeric: tabular-nums; margin: 1.1rem 0 .35rem; }
.year::before { content: ""; position: absolute; left: calc(-1.4rem - 7px); top: .3em; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--t); }
.year-group:first-child .year { margin-top: 0; }
.tl-entry { padding-block: .35rem .6rem; }
.gap { font-family: var(--sans); font-size: .74rem; font-style: italic; color: var(--muted); margin: .4rem 0 0; }

/* entry page */
.entry-head { margin-bottom: 2rem; }
.kicker { margin: 0; font-family: var(--sans); font-size: .74rem; color: var(--muted); }
.kicker .series { letter-spacing: .02em; }
.entry h1 { font-weight: 500; font-size: clamp(2.1rem, 6vw, 3.1rem); line-height: 1.04; letter-spacing: -.03em; margin: .7rem 0 .55rem; text-wrap: balance; }
.subtitle { font-style: italic; font-size: 1.25em; line-height: 1.35; color: var(--muted); margin: 0 0 1.3rem; text-wrap: balance; }
.dates { display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; align-items: center; margin: 0; padding-block: .7rem; border-block: 1px solid var(--line); font-family: var(--sans); font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dates b { color: var(--ink); font-weight: 600; }

.prose { max-width: var(--measure); }
.prose > * { margin-block: 0 1.1em; }
/* Justified body text, hyphenated so the justification doesn't open gaps between words */
.prose > p, .prose > ul > li, .prose > ol > li, .prose > blockquote p {
  text-align: justify; -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 7 3 3; }
.prose h2, .prose h3, .prose h4 { line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; margin-block: 2em .6em; }
.prose h2 { font-weight: 600; font-size: 1.4em; }
.prose h3 { font-weight: 600; font-size: 1.15em; }
.prose h4 { font-family: var(--sans); font-size: .85em; }
.prose blockquote { margin-inline: 0; padding-left: 1.1em; border-left: 3px solid var(--line); color: var(--muted); }
.prose code { font-family: var(--mono); font-size: .84em; background: var(--code-bg); padding: .08em .32em; border-radius: 4px; }
.prose pre { font-family: var(--mono); font-size: .8rem; line-height: 1.55; background: var(--code-bg); padding: 1rem 1.15rem; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .9em; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .45rem .8rem .45rem 0; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--sans); font-size: .8em; color: var(--muted); font-weight: 600; }
.prose hr { border: 0; text-align: center; margin-block: 2.2em; }
.prose hr::after { content: "· · ·"; color: var(--muted); letter-spacing: .5em; }
.prose img { max-width: 100%; height: auto; }

/* Inline SVG charts in an article: <figure class="chart"><svg>…</svg><figcaption>…</figcaption></figure>.
   Marks take their colours from the tokens, so they follow light and dark mode. On narrow screens the chart
   keeps a readable size and scrolls sideways inside its figure. */
.prose figure.chart { margin-inline: 0; overflow-x: auto; }
.prose figure.chart svg { display: block; width: 100%; min-width: 34rem; height: auto; font-family: var(--sans); }
.prose figure.chart figcaption { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-top: .6rem; line-height: 1.45; }
.chart .lbl { fill: var(--ink); font-size: 13px; font-weight: 600; }
.chart .sub { fill: var(--muted); font-size: 11.5px; font-weight: 500; }
.chart .axis { fill: var(--muted); font-size: 11px; font-weight: 500; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .track { fill: var(--code-bg); }
.chart .bar { fill: var(--accent); }
.chart .bar-claimed { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .val { fill: var(--accent); font-size: 13px; font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .3em; }
.author-line { max-width: var(--measure); font-style: italic; color: var(--muted); margin: 2.5rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.neighbours { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.neighbours a { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.3; }
.neighbours a span { font-family: var(--sans); font-size: .74rem; font-weight: 500; color: var(--muted); }
.neighbours a:hover { color: var(--accent); }
.neighbours .next { text-align: right; grid-column: 2; }

@media (max-width: 560px) {
  .neighbours { grid-template-columns: 1fr; }
  .neighbours .next { text-align: left; grid-column: 1; }
}
@media print {
  .site-head nav, .site-foot, .neighbours, .skip { display: none; }
  body { background: #fff; color: #000; }
}

/* Each train hue resolves where its --train is set: on body for train and entry pages, per row in lists. */
.train { --t: var(--train); }
@media (prefers-color-scheme: dark) {
  body, .train { --t: var(--train-dark); }
}

/* Series: one visible block on the train page, and a contents list under each part. */
.series-block { margin-block: .4rem .9rem; padding: .9rem 1.1rem 1rem; background: var(--sheet); border: 1px solid var(--line); border-left: 3px solid var(--t); border-radius: 4px; }
.series-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; margin: 0 0 .6rem; }
.series-label { font-family: var(--sans); font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--t); }
.series-title { font-weight: 600; font-size: 1.15em; line-height: 1.25; }
.series-desc { margin: -.2rem 0 .7rem; color: var(--muted); font-size: .95em; }
.series-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; counter-reset: none; }
.series-parts li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .6rem; align-items: baseline; }
.series-parts .num { font-family: var(--sans); font-size: .75rem; font-weight: 700; color: var(--t); font-variant-numeric: tabular-nums; text-align: right; }
.series-parts .tl-entry { padding: 0; }
.series-parts .t { font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.3; }
.series-parts a.t:hover { color: var(--accent); }
.series-parts .here { color: var(--muted); }
.series-toc { max-width: var(--measure); margin-top: 2rem; padding: .9rem 1.1rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--t); border-radius: 4px; background: var(--sheet); }

/* figures inside an entry: tile board, certificate, medals, report card. Raw HTML in the Markdown. */
.prose .figure-note { font-family: var(--sans); font-size: .76rem; color: var(--muted); text-align: center; margin: .5rem 0 2rem; }
.tiles { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; margin: 1.6em 0 0; }
/* full marks are solid; a tile under 100% is orange, darker the lower its mark (--s, 0 to 1, given inline),
   and hatched so it differs by pattern as well as by colour */
.tiles { --short-lo: #f3c6a4; --short-hi: #b4532a; }
.tiles i { aspect-ratio: 1; border-radius: 2px; background: var(--accent); }
.tiles i.tile-short {
  background-color: var(--short-hi);
  background-color: color-mix(in oklab, var(--short-hi) calc(var(--s, 1) * 100%), var(--short-lo));
  background-image: repeating-linear-gradient(135deg, rgb(255 255 255 / .32) 0 1.5px, transparent 1.5px 5px); }
@media (prefers-color-scheme: dark) { .tiles { --short-lo: #f6cfb2; --short-hi: #d4602f; } }
.cert { position: relative; margin: 2em 0 0; padding: 1.6rem 1.4rem 1.3rem; text-align: center; background: var(--sheet);
  border: 1px solid var(--line); outline: 3px double var(--accent); outline-offset: -10px; }
.cert p { margin: 0; }
.cert .cert-issuer { font-family: var(--sans); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1em; }
.cert .cert-line { font-style: italic; color: var(--muted); }
.cert .cert-name { font-size: 1.75em; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin: .15em 0 .3em; }
.cert .cert-award { font-size: 1.2em; font-weight: 600; line-height: 1.25; margin: .2em 0; }
.cert .cert-rules { font-size: .88em; color: var(--muted); margin: .2em 0 .9em; }
.cert .cert-class { display: inline-block; font-family: var(--sans); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); border: 1.5px solid var(--accent); border-radius: 999px; padding: .3em 1em; margin-bottom: 1em; }
.cert-seal { position: absolute; right: 1.1rem; bottom: 3.6rem; width: 4.2rem; height: 4.2rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--sans); font-size: .55rem; font-weight: 700; letter-spacing: .08em; line-height: 1.15; text-transform: uppercase; color: var(--accent);
  border: 2px dashed var(--accent); transform: rotate(-14deg); opacity: .85; }
.cert-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; font-family: var(--sans); font-size: .7rem; color: var(--muted); margin-top: .4em; }
.cert-sigs b { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.05rem; color: var(--ink);
  border-bottom: 1px solid var(--line); padding-bottom: .15em; margin-bottom: .3em; }
.prose .medals { list-style: none; padding: 0; margin: 1.8em 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1.1rem .8rem; }
.prose .medals li { margin: 0; text-align: center; font-family: var(--sans); font-size: .72rem; color: var(--muted); line-height: 1.35; }
.medal { width: 5.2rem; height: 5.2rem; margin: 0 auto .5rem; border-radius: 50%; display: grid; place-items: center; padding: .4rem; background: var(--sheet);
  border: 3px double var(--accent); color: var(--ink); font-weight: 700; font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1.15; }
.medal.medal-dim { border: 2px dashed var(--muted); color: var(--muted); }
.report-card { margin: 2em 0; padding: 1.3rem 1.4rem; background: var(--sheet); border: 1px solid var(--line); border-top: 4px solid var(--accent); font-family: var(--sans); font-size: .85rem; }
.report-card p { margin: 0; }
.report-card .report-head { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.report-card dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin: 0 0 1rem; }
.report-card dd { margin: 0; font-weight: 700; text-align: right; }
.report-card dd.report-low { color: #b4532a; }
.report-card .report-comment { padding-top: .8rem; border-top: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--ink); }
.report-card .report-sig { margin-top: .6rem; color: var(--muted); font-size: .75rem; text-align: right; }
@media (prefers-color-scheme: dark) { .report-card dd.report-low { color: #f0a07c; } }
@media (max-width: 30rem) { .cert-seal { position: static; margin: 0 auto .9rem; } .tiles { grid-template-columns: repeat(10, 1fr); } }
