/* Kurvball changelog: kurvball.ca's paper, ink and greens (dist/home.css), as a timetable of production releases. A
   ruler across the page names every entry (Start of Beta, then numbered changelogs) and marks the one being read; that entry's
   number is the page's one serif statement; its notes fill the width beside it. */
@font-face { font-family: Geist; src: url('/fonts/Geist-normal-400-600.woff2') format('woff2'); font-style: normal; font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url('/fonts/SourceSerif4-normal-400-600.woff2') format('woff2'); font-style: normal; font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url('/fonts/SourceSerif4-italic-400-600.woff2') format('woff2'); font-style: italic; font-weight: 400 600; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f7f6f2; --white: #fcfcfa; --ink: #1a1d1b; --body: #3f4742; --muted: #5f6d65; --line: #dcdfd9; --rim: #9fb0a8;
  --green: #006f62; --deep: #00231f; --mint: #a3d2c9;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: Geist, ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --read: clamp(1.0625rem, .42vw + 1rem, 1.3125rem);
  --small: .9375rem;
  --gutter: clamp(20px, 4.4vw, 64px);
  --max: 1472px;
  --edge: max(var(--gutter), calc((100vw - var(--max)) / 2));
  --top-h: clamp(76px, 3vw + 56px, 104px);
  --ruler-h: 64px;
  --section: clamp(72px, 8vw, 120px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--ruler-h) + 24px); scrollbar-color: var(--rim) var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--read)/1.52 var(--sans); caret-color: var(--green); -webkit-font-smoothing: antialiased; font-kerning: normal; }
::selection { background: var(--mint); color: var(--deep); }
h1, h2, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 70; top: -70px; left: 16px; padding: 10px 14px; border-radius: 8px; background: var(--white); color: var(--ink); }
.skip-link:focus { top: 12px; }
.arrow { display: inline-flex; vertical-align: -.14em; transition: transform .3s var(--ease-out); }

/* The top row, as on kurvball.ca. */
.top { height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: clamp(6px, 1.4vw, 18px) var(--edge) 0; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--ink); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; text-decoration: none; }
.wordmark .mark { width: 28px; height: 28px; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: clamp(14px, 2.2vw, 28px); font-size: var(--small); }
.top-nav > a { padding-block: 10px; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .2s ease; }
.top-nav > a:hover { color: var(--ink); }
.top-nav > a.here { color: var(--ink); text-decoration: underline 1px var(--green); text-underline-offset: 6px; }
.lang-switch { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; }
.lang-switch a { padding-block: 10px; text-decoration: none; transition: color .2s ease; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current] { color: var(--ink); text-decoration: underline 1px var(--green); text-underline-offset: 4px; }

/* The ruler: every entry on one hairline, Start of Beta at the left end, the newest at the right. It stays in view. */
.ruler {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 120px 1fr; align-items: end;
  height: var(--ruler-h); padding-inline: var(--edge);
  background: var(--paper);
}
.ruler::after { content: ""; position: absolute; left: var(--edge); right: var(--edge); bottom: 0; border-bottom: 1px solid var(--line); }
.ruler-label { padding-bottom: 16px; color: var(--muted); font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
/* The entries spread evenly between the two ends, so the ruler always spans the page. The graduations divide each gap
   between entries into --subs parts, counted from the newest tick, so every entry stands on one of them. */
.ticks {
  --pad: 40px;
  --subs: var(--subs-wide);
  --step: calc((100% - 2 * var(--pad)) / var(--gaps));
  --minor: calc(var(--step) / var(--subs));
  position: relative; height: 100%;
  font-family: var(--mono); font-size: .8125rem;
  background: repeating-linear-gradient(270deg, var(--line) calc(var(--pad) - 1px) var(--pad), transparent var(--pad) calc(var(--pad) - 1px + var(--minor))) left bottom / 100% 6px no-repeat;
}
/* Each tick owns a slot no wider than the space to its neighbours, so a tap lands on the entry under it. */
.ticks li { position: absolute; bottom: 0; left: calc(100% - var(--pad) - var(--i) * var(--step)); width: min(var(--step), 9ch); transform: translateX(-50%); }
.ticks a { position: relative; display: flex; justify-content: center; padding: 18px 0 24px; color: var(--muted); letter-spacing: .04em; font-variant-numeric: tabular-nums; line-height: 1; text-decoration: none; white-space: nowrap; }
.ticks a::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 11px; background: var(--muted); }
/* A label wider than its slot spills over its neighbours; only a shown label takes the pointer there. */
.tick-label { opacity: 0; pointer-events: none; transition: opacity .2s ease, color .2s ease; }
.ticks li.labelled { z-index: 1; }
.ticks li.labelled .tick-label { pointer-events: auto; }
.ticks li.labelled .tick-label, .ticks a:hover .tick-label, .ticks a:focus-visible .tick-label { opacity: 1; }
.ticks a:hover { color: var(--ink); }
.ticks li.open a { color: var(--ink); }
.ticks li.open a::after { width: 3px; height: 16px; margin-left: -1px; background: var(--green); }
.ticks li.open a::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 3px solid var(--green); }
/* The hover marker: an ink hairline that slides from the open entry to the tick under the pointer or focus. */
.ticks .ghost { position: absolute; left: 0; bottom: 0; width: 40px; margin-left: -20px; border-bottom: 2px solid var(--ink); opacity: 0; pointer-events: none; transform: translateX(var(--ghost-x, 0)); transition: transform .5s var(--ease-out), opacity .25s ease; }
.ticks.ghosting .ghost { opacity: 1; }

/* The release: its number, date, lead and neighbours at the left; its notes across the rest of the width. */
.release { display: grid; grid-template-columns: auto 1fr; column-gap: clamp(48px, 5.5vw, 104px); align-items: start; padding: clamp(40px, 4.4vw, 64px) var(--edge) 0; }
.release-head { position: sticky; top: calc(var(--ruler-h) + 40px); width: clamp(300px, 30vw, 460px); min-width: min-content; }
/* The entry's name, set like a chapter opening: its first word(s) (Start of, Changelog) at the site's display size in
   Sage, and under it the figure at monumental size (Beta, or the changelog's number as a counter, 01 with its leading
   zero in Rim), the page's one statement. */
.title-word { display: block; margin-bottom: 10px; color: var(--muted); font: 400 clamp(1.75rem, 2.35vw, 2.5rem)/1.16 var(--serif); letter-spacing: -.022em; }
.title-figure { display: block; font: 400 clamp(7rem, 10vw, 10rem)/.86 var(--serif); letter-spacing: -.04em; font-variant-numeric: lining-nums; white-space: nowrap; margin-left: -.045em; }
.title-figure .pad { color: var(--rim); }
.meta { margin-top: 28px; color: var(--muted); font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.lead { margin-top: 18px; max-width: 30em; color: var(--body); text-wrap: pretty; }
.lead a, .follow-up a, .notes a { text-decoration: underline 1px var(--green); text-underline-offset: 4px; }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 28px; font-size: var(--small); }
.steps a { display: inline-flex; align-items: center; gap: 8px; padding-block: 6px; color: var(--ink); text-decoration: underline 1px var(--green); text-underline-offset: 5px; }
.steps a[rel="prev"]:hover .arrow { transform: translateX(-3px); }
.steps a[rel="next"]:hover .arrow { transform: translateX(3px); }
.latest { color: var(--muted); }

.notes { columns: 2; column-gap: clamp(40px, 4vw, 72px); padding-top: 6px; }
.kind { break-inside: avoid; padding-bottom: 44px; }
.kind h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--read); font-weight: 400; line-height: 1.3; }
.count { font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.kind ul { display: grid; gap: 16px; }
.kind li, .kind p { position: relative; color: var(--body); font-size: 1.0625rem; line-height: 1.55; text-wrap: pretty; }
.kind li { padding-left: 22px; }
.kind li::before { content: ""; position: absolute; left: 0; top: .66em; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.kind p + p, .kind ul + p, .kind p + ul { margin-top: 14px; }
.kind strong { color: var(--ink); font-weight: 500; }
.kind code { font-family: var(--mono); font-size: .875em; }
.follow-up { column-span: all; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--small); }

/* Every entry as a row, to scan. */
.ledger { margin-top: var(--section); padding-inline: var(--edge); }
.ledger h2 { margin-bottom: 18px; color: var(--muted); font-size: var(--read); font-weight: 400; }
.ledger li { border-top: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 1px solid var(--line); }
.ledger a { display: grid; grid-template-columns: 9rem 13rem 1fr; gap: 6px 24px; align-items: baseline; padding: 18px 0; text-decoration: none; }
.row-title { font-family: var(--mono); font-size: var(--small); font-variant-numeric: tabular-nums; text-decoration: underline 1px transparent; text-underline-offset: 5px; transition: text-decoration-color .2s ease; }
.row-date { color: var(--muted); font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.row-summary { color: var(--body); font-size: 1.0625rem; line-height: 1.5; transition: color .2s ease; }
.ledger a:hover .row-title { text-decoration-color: var(--green); }
.ledger a:hover .row-summary { color: var(--ink); }
.ledger a[aria-current] .row-title { color: var(--green); }

.footer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; margin: var(--section) var(--edge) 0; padding-block: 22px clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: .8125rem; }
.footer > a { padding-block: 8px; text-decoration: none; transition: color .2s ease; }
.footer > a:hover { color: var(--ink); }
.footer .lang-switch { margin-left: auto; font-size: inherit; }

/* No release yet, and the 404: the statement at display size, not monumental. */
.empty { grid-template-columns: 1fr; }
.empty .release-head { position: static; width: auto; max-width: 720px; }
.empty .title { font: 400 clamp(1.75rem, 2.35vw, 2.5rem)/1.16 var(--serif); letter-spacing: -.022em; }
.empty .lead + .lead { margin-top: 12px; }
.empty .notes { columns: 1; margin-top: 32px; }

@media (max-width: 1179px) {
  .release { grid-template-columns: 1fr; }
  .release-head { position: static; width: auto; margin-bottom: 48px; }
  .lead { max-width: 36em; }
}
@media (max-width: 759px) {
  :root { --ruler-h: 56px; }
  .ruler { grid-template-columns: 1fr; }
  .ruler-label { display: none; }
  .ticks { --pad: 36px; --subs: var(--subs-narrow); }
  .ticks li.labelled { z-index: auto; }
  .ticks li.labelled .tick-label { pointer-events: none; }
  .ticks li:not(.labelled-narrow) .tick-label { opacity: 0; }
  .ticks li.labelled-narrow { z-index: 1; }
  .ticks li.labelled-narrow .tick-label { pointer-events: auto; opacity: 1; }
  .ticks li a:focus-visible .tick-label { opacity: 1; }
  .title-figure { font-size: clamp(4.5rem, 21vw, 7rem); }
  .notes { columns: 1; }
  .ledger a { grid-template-columns: 8.5rem 1fr; }
  .row-summary { grid-column: 1 / -1; }
}
@media (max-width: 519px) {
  .top-nav > a:not(.here) { display: none; }
  .name-rest { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
@media (max-width: 349px) {
  .wordmark span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ticks .ghost { transition: opacity .25s ease; }
  .arrow { transition: none; }
}
