/* Ichnos: a tracker's survey plate.
   Plaster-cast grey, the colour a track is kept in, sepia ink, one surveyor's red for what has to run, one slate for what
   stayed still. Tracks are drawn, measured and annotated; nothing is decorated. */

:root {
  --ground: #d8d9d2;
  --sheet: #f2f2ec;
  --sheet-2: #e7e8e0;
  --ink: #1d1a16;
  --ink-2: #453e35;
  --ink-3: #62594c;
  --rule: #b9bbb0;
  --rule-2: #d0d2c8;
  --red: #b3391f;
  --red-ink: #8f2a14;
  --red-soft: #f0d9cf;
  --still: #2c5f63;
  --still-soft: #d5e3e0;
  --code-bg: #262019;
  --code-ink: #efe7d6;
  --code-dim: #a99c85;
  --code-key: #e8a48e;
  --code-str: #a9cfc9;
  --shadow: 0 1px 1px rgb(29 26 22 / .08), 0 14px 28px -18px rgb(29 26 22 / .45);
  --f-display: "Cardo", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1180px;
  --gutter: clamp(18px, 4.5vw, 56px);
  --sec: clamp(76px, 10vw, 148px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.62 var(--f-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
html { scrollbar-color: var(--ink-3) var(--ground); }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--red-ink); }
p { margin: 0 0 1.05em; max-width: 68ch; }
code, kbd, pre { font-family: var(--f-mono); font-size: .9em; }
:not(pre) > code { background: var(--sheet-2); padding: .08em .34em; border-radius: 3px; border: 1px solid var(--rule-2); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--sheet); padding: 10px 14px; z-index: 30; }
.skip:focus { top: 12px; }

/* --- top bar ------------------------------------------------------------ */
.top { position: sticky; top: 0; z-index: 20; background: rgb(216 217 210 / .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.5rem/1 var(--f-display); letter-spacing: .01em; }
.brand img { width: 30px; height: 30px; }
.top nav { margin-left: auto; display: flex; gap: clamp(14px, 2.4vw, 30px); align-items: center; font-size: .96rem; }
.top nav a { text-decoration: none; padding: 8px 0; }
.top nav a:hover { text-decoration: underline; }
.top nav .gh { border: 1px solid var(--ink); padding: 7px 14px; border-radius: 2px; }
.top nav .gh:hover { background: var(--ink); color: var(--sheet); text-decoration: none; }

/* --- type --------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.06; margin: 0; text-wrap: balance; letter-spacing: -.012em; }
h1 { font-size: clamp(2.55rem, 6.1vw, 5.2rem); }
h2 { font-size: clamp(2rem, 3.9vw, 3.25rem); margin-bottom: .5em; }
h3 { font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.15; margin-bottom: .4em; }
.lede { font-size: clamp(1.14rem, 1.55vw, 1.32rem); line-height: 1.5; color: var(--ink-2); max-width: 54ch; }
.greek { font-family: var(--f-display); font-style: italic; }

/* --- buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 600 1rem/1 var(--f-body); padding: 15px 22px; border-radius: 2px; text-decoration: none; border: 1px solid var(--ink); transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn.ghost:hover { background: var(--ink); color: var(--sheet); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* --- hero --------------------------------------------------------------- */
.hero { padding: clamp(48px, 7vw, 104px) 0 var(--sec); position: relative; overflow: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(32px, 5vw, 76px); align-items: end; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--red-ink); }
.hero .lede { margin-top: 1.5rem; }
.hero .acts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2.2rem; }
.trail { position: absolute; inset: auto 0 clamp(14px, 2.4vw, 34px) 0; margin-inline: auto; width: min(100% - 2 * var(--gutter), var(--wrap)); height: auto; pointer-events: none; opacity: .75; }
.trail .print { fill: none; stroke: var(--ink-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.trail .stride { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 5; fill: none; }
.js .trail .print { opacity: 0; animation: step .7s var(--ease) forwards; animation-delay: calc(var(--i) * 170ms + 250ms); }
@keyframes step { from { opacity: 0; transform: translateY(10px) scale(.92); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.trail .print { transform-box: fill-box; transform-origin: center; }

/* The measured plate: runs on main, drawn to scale. */
.plate { margin: 0; position: relative; background: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--shadow); padding: clamp(20px, 2.6vw, 34px); }
.plate h2 { font-size: 1.32rem; letter-spacing: 0; margin-bottom: 4px; }
.plate .cond { font-size: .9rem; color: var(--ink-3); margin-bottom: 20px; max-width: none; }
.runs { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.runs li { display: grid; gap: 6px; }
.runs .repo { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font: 500 .93rem/1.3 var(--f-mono); }
.runs .repo span:last-child { color: var(--ink-3); font-family: var(--f-body); font-size: .86rem; text-align: right; }
.bar { height: 13px; background: var(--rule-2); position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 1%); background: var(--ink-3); display: block; }
.bar.after i { background: var(--red); min-width: 3px; }
.bar.range i::after { content: ""; position: absolute; left: 100%; top: 0; bottom: 0; width: calc(var(--to) * 1%); background: repeating-linear-gradient(90deg, var(--ink-3) 0 2px, transparent 2px 5px); }
.runs .vals { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.runs .vals b { color: var(--red-ink); font-weight: 600; }
.plate .scale { display: flex; justify-content: space-between; font: 400 .74rem/1 var(--f-mono); color: var(--ink-3); border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 8px; }
.plate .note { font-size: .86rem; color: var(--ink-3); margin: 14px 0 0; max-width: none; }

/* --- sections ----------------------------------------------------------- */
section { padding: var(--sec) 0; }
.sheet { background: var(--sheet); border-block: 1px solid var(--rule); }
.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }

.rule-quote { font: 400 clamp(1.7rem, 3.5vw, 3rem)/1.16 var(--f-display); margin: 0 0 1.4rem; max-width: 22ch; text-wrap: balance; }
.rule-quote b { font-weight: 700; color: var(--red-ink); }

/* Footprint plate: four kinds of track. */
.tracks { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--ink); }
.tracks > div { display: grid; grid-template-columns: 58px minmax(0, 11rem) minmax(0, 1fr); gap: 4px 18px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.tracks svg { width: 46px; height: 46px; stroke: var(--ink); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tracks dt { font: 500 .98rem/1.4 var(--f-mono); padding-top: 9px; }
.tracks dd { margin: 0; padding-top: 7px; color: var(--ink-2); }
.tracks dd small { display: block; color: var(--ink-3); font-size: .9rem; margin-top: 2px; }

/* Three ways, safest first: the order is the information. */
.ways { list-style: none; margin: clamp(28px, 4vw, 56px) 0 0; padding: 0; counter-reset: way; display: grid; gap: clamp(36px, 5vw, 72px); }
.ways > li { counter-increment: way; display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(22px, 4vw, 64px); align-items: start; padding-top: clamp(22px, 3vw, 36px); border-top: 1px solid var(--ink); }
.ways h3::before { content: counter(way) ". "; color: var(--red-ink); font-style: italic; font-weight: 400; }
.ways .status { display: inline-block; font: 500 .8rem/1.4 var(--f-mono); padding: 4px 9px; border: 1px solid currentColor; margin: 2px 0 14px; }
.ways .status.live { color: var(--still); }
.ways .status.trial { color: var(--red-ink); }
.ways ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); }
.ways ul li { margin-bottom: .35em; }

pre { margin: 0; background: var(--code-bg); color: var(--code-ink); padding: 22px 24px; overflow-x: auto; font-size: .86rem; line-height: 1.62; border-radius: 2px; box-shadow: var(--shadow); tab-size: 2; scrollbar-color: var(--code-dim) var(--code-bg); }
pre .k { color: var(--code-key); }
pre .s { color: var(--code-str); }
pre .c { color: var(--code-dim); }
pre ::selection { background: var(--code-key); color: var(--code-bg); }
.code { position: relative; }
.copy { position: absolute; top: 10px; right: 10px; font: 500 .76rem/1 var(--f-mono); color: var(--code-dim); background: transparent; border: 1px solid #5a4f41; padding: 7px 9px; border-radius: 2px; cursor: pointer; }
.copy:hover { color: var(--code-ink); border-color: var(--code-ink); }
.copy[data-done] { color: var(--code-str); border-color: var(--code-str); }

/* Video */
.film { background: var(--code-bg); color: var(--code-ink); }
.film h2 { color: var(--code-ink); }
.film p { color: #cfc4ae; }
.film a { color: var(--code-ink); }
.film a:hover { color: var(--code-key); }
.film .stage { margin-top: clamp(24px, 3vw, 40px); container-type: inline-size; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .7); border: 1px solid #4a4034; }
.film iframe { display: block; width: 100%; height: calc(56.25cqw + 40px); border: 0; background: #14110d; }

/* Measured / not measured */
.ledger { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 80px); margin-top: clamp(24px, 3vw, 44px); }
.ledger h3 { padding-bottom: 14px; border-bottom: 1px solid var(--ink); margin-bottom: 0; }
.ledger ul { list-style: none; margin: 0; padding: 0; }
.ledger li { padding: 16px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 3px; }
.ledger li b { font: 700 1.5rem/1.15 var(--f-display); font-variant-numeric: lining-nums tabular-nums; }
.ledger li span { color: var(--ink-2); }
.ledger .open b { font: 600 1.02rem/1.4 var(--f-body); }
.ledger .open li { grid-template-columns: 22px 1fr; gap: 3px 10px; }
.ledger .open li svg { width: 18px; height: 18px; stroke: var(--red-ink); fill: none; stroke-width: 2; stroke-linecap: round; margin-top: 4px; grid-row: span 2; }

/* Start */
.start .split { align-items: center; }
.steps { margin: 0 0 1.6rem; padding-left: 1.2em; color: var(--ink-2); }
.steps li { margin-bottom: .55em; padding-left: .2em; }
.steps li::marker { color: var(--red-ink); font-family: var(--f-display); font-style: italic; }

footer { padding: 44px 0 56px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: .93rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: space-between; align-items: baseline; }
footer p { margin: 0; max-width: 60ch; }
footer nav { display: flex; gap: 22px; }

@media (max-width: 900px) {
  .hero-grid, .split, .ways > li, .ledger { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { align-items: start; }
  .trail { display: none; }
  .top nav a:not(.gh):not(.keep) { display: none; }
  .tracks > div { grid-template-columns: 46px minmax(0, 1fr); }
  .tracks dd { grid-column: 2; padding-top: 0; }
  .tracks svg { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .trail .print { animation: none; opacity: 1; }
  .btn { transition: none; }
}
