/* NineLives. Night and amber, taken from the logo: the dark counter, the eyes and
   the newest record. The faint record is the muted tone. Not shared with getfelix.dev. */

@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-400-800.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken-grotesk-400-700.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-deep: #e8edf3;
  --surface: #fbfcfd;
  --surface-hi: #ffffff;
  --line: rgba(14, 30, 56, 0.11);
  --line-hi: rgba(14, 30, 56, 0.22);
  --text: #0d1728;
  --muted: #46536a;
  --faint: #5d6a80;
  --amber: #f0a020;
  --amber-hi: #f7b84a;
  --amber-text: #8f4c00;
  --amber-soft: rgba(240, 160, 32, 0.16);
  --on-amber: #1a1204;
  --glow: rgba(240, 160, 32, 0.30);
  --record: #4f93c4;
  --record-faint: rgba(79, 147, 196, 0.32);
  --code-bg: #0b1524;
  --code-text: #e4ecf6;
  --code-line: rgba(200, 225, 255, 0.10);
  --shadow: 0 1px 2px rgba(14, 30, 56, 0.06), 0 18px 40px -22px rgba(14, 30, 56, 0.30);
  --grain: 0.04;
  --light-display: block;
  --dark-display: none;

  --peek-head: #0d1117;
  --peek-line: hsl(192, 90%, 42%);
  --peek-ledge: var(--line-hi);
  --peek-eye: hsl(192, 90%, 52%);
  --peek-focus: var(--amber-text);
  --peek-tip-bg: var(--surface-hi);
  --peek-tip-text: var(--text);
  --peek-tip-line: var(--line-hi);
  --peek-tip-font: var(--sans);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 68ch;
  --wrap: 1160px;
  --gutter: 32px;
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #070e1a;
    --bg-deep: #050a13;
    --surface: #0c1626;
    --surface-hi: #111d30;
    --line: rgba(200, 225, 255, 0.09);
    --line-hi: rgba(200, 225, 255, 0.18);
    --text: #eef3f9;
    --muted: #a9b6c8;
    --faint: #8592a6;
    --amber-text: #f7b13a;
    --amber-soft: rgba(245, 166, 35, 0.12);
    --glow: rgba(245, 166, 35, 0.26);
    --record: #8fc9ec;
    --record-faint: rgba(143, 201, 236, 0.30);
    --code-bg: #040912;
    --shadow: 0 1px 0 rgba(200, 225, 255, 0.04) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
    --grain: 0.07;
    --light-display: none;
    --dark-display: block;
    --peek-line: hsl(192, 85%, 55%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070e1a;
  --bg-deep: #050a13;
  --surface: #0c1626;
  --surface-hi: #111d30;
  --line: rgba(200, 225, 255, 0.09);
  --line-hi: rgba(200, 225, 255, 0.18);
  --text: #eef3f9;
  --muted: #a9b6c8;
  --faint: #8592a6;
  --amber-text: #f7b13a;
  --amber-soft: rgba(245, 166, 35, 0.12);
  --glow: rgba(245, 166, 35, 0.26);
  --record: #8fc9ec;
  --record-faint: rgba(143, 201, 236, 0.30);
  --code-bg: #040912;
  --shadow: 0 1px 0 rgba(200, 225, 255, 0.04) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --grain: 0.07;
  --light-display: none;
  --dark-display: block;
  --peek-line: hsl(192, 85%, 55%);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 17.5px/1.68 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  position: relative;
}
/* Film grain over everything, very faint. */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("/img/grain.png");
  background-size: 128px;
}
img, svg { max-width: 100%; }
a { color: var(--amber-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber-text); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--amber); color: var(--on-amber); }
.on-light { display: var(--light-display); }
.on-dark { display: var(--dark-display); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 300; padding: 10px 14px; background: var(--amber); color: var(--on-amber); font-weight: 600; border-radius: 8px; }
.skip:focus { top: 8px; }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.6rem); line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font: 500 14px/1.4 var(--mono); letter-spacing: 0.01em; color: var(--amber-text); margin: 0 0 22px; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.eyebrow::before { content: ""; width: 18px; height: 7px; border-radius: 2px; background: var(--amber); transform: skewX(-24deg); box-shadow: 0 0 12px var(--glow); }
.lede { font-size: clamp(1.12rem, 1.6vw, 1.3rem); line-height: 1.6; color: var(--muted); max-width: 56ch; }
.lede strong { color: var(--text); font-weight: 600; }
code, kbd { font-family: var(--mono); font-size: 0.86em; background: var(--amber-soft); color: var(--text); padding: 0.12em 0.42em; border-radius: 6px; }
main { display: block; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  min-height: 72px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.brand { display: inline-flex; align-items: center; flex: none; text-decoration: none; border-radius: 8px; }
.brand img { display: var(--light-display); width: auto; height: 40px; }
.brand img.on-dark { display: var(--dark-display); }
.brand { margin-left: 4px; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a, .nav button {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font: 500 15px/1 var(--sans);
  padding: 11px 13px;
  border-radius: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav a:hover, .nav button:hover { color: var(--text); background: var(--amber-soft); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 10px var(--glow); }
.nav .gh { display: inline-flex; align-items: center; gap: 6px; }
.nav .gh svg { width: 16px; height: 16px; }
.tools { display: flex; align-self: stretch; align-items: center; gap: 6px; }
.icon { display: inline-flex; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; transition: color 0.2s ease, background-color 0.2s ease; }
.icon:hover { color: var(--text); background: var(--amber-soft); }
.icon svg { width: 18px; height: 18px; }
.menu { display: none; }
.menu .shut, .open .menu .open { display: none; }
.open .menu .shut { display: block; }
.theme .moon { display: none; }

/* The peeking cat's art: Felix's black cat with cyan eyes. The rest is peek.css. */
.peek-cat .h { fill: var(--peek-head); stroke: var(--peek-line); stroke-width: 1.6; stroke-linejoin: round; }
.peek-cat .in { fill: var(--peek-line); opacity: 0.55; }
.peek-cat .mz { fill: #f3f6f9; }
.peek-cat .br { fill: none; stroke: #f3f6f9; stroke-width: 1.4; stroke-linecap: round; }
.peek-cat .e { fill: var(--peek-eye); }
.peek-cat .p { fill: #05080c; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}


/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 12px;
  font: 600 16px/1 var(--sans);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-hi);
  transition: transform 0.2s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--amber-text); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); box-shadow: 0 8px 28px -10px var(--amber), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.primary:hover { background: var(--amber-hi); border-color: var(--amber-hi); }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Hero */
.hero { position: relative; padding: clamp(56px, 9vw, 120px) 0 40px; overflow: hidden; isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 70%;
  height: 120%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  opacity: 0.55;
}
.hero .wrap:first-child {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: 1fr auto auto auto auto 1fr;
  grid-template-areas: ". mark" "tag mark" "h1 mark" "lede mark" "actions mark" ". mark";
  column-gap: 56px;
}
.hero-tag { grid-area: tag; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 26px; }
.hero-tag .eyebrow { margin: 0; }
.stage { display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 6px 12px 6px 10px; border-radius: 99px; border: 1px solid var(--line-hi); background: var(--surface); font: 500 12.5px/1.2 var(--mono); color: var(--muted); }
.stage .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: breathe 3.2s ease-in-out infinite; }
.hero h1 { grid-area: h1; margin-bottom: 28px; max-width: 14ch; }
.hero .lede { grid-area: lede; margin: 0; }
.hero .actions { grid-area: actions; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--amber-text); padding-right: 0.06em; }
.hero .lede { font-size: clamp(1.15rem, 1.7vw, 1.38rem); }
.hero-mark { grid-area: mark; position: relative; display: grid; place-items: center; aspect-ratio: 1; align-self: center; }
.hero-mark::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 42%, var(--amber-soft), transparent 62%);
}
.hero-mark::after {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  border: 1px dashed var(--line);
}
.hero-mark img { position: relative; z-index: 1; width: 76%; height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.28)); }

/* The log strip: nine records with offsets; the fifth was lost, the last is the newest. */
.strip { padding-top: 64px; padding-bottom: 8px; }
.strip ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 12px; }
.strip li { display: grid; gap: 10px; }
.strip i { display: block; height: 11px; border-radius: 3px; background: var(--record); transform: skewX(-24deg); }
.strip li:nth-child(5) i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--record-faint); }
.strip li:last-child i { background: linear-gradient(90deg, var(--amber), var(--amber-hi)); box-shadow: 0 0 22px var(--glow); }
.strip span { font: 500 11.5px/1 var(--mono); color: var(--faint); letter-spacing: 0.06em; }
.strip li:last-child span { color: var(--amber-text); }
.strip p { margin: 18px 0 0; font: 400 13.5px/1.5 var(--mono); color: var(--faint); max-width: none; }
@keyframes tick { 0%, 20%, 100% { filter: none; } 8% { filter: brightness(1.3); } }
@keyframes lost { 0%, 55%, 100% { background: transparent; } 70%, 88% { background: var(--record-faint); } }
@keyframes newest { 0%, 20%, 100% { box-shadow: 0 0 22px var(--glow); } 8% { box-shadow: 0 0 36px var(--amber); } }

/* Sections */
.section { position: relative; padding: clamp(64px, 8vw, 104px) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 24px 64px; align-items: start; margin-bottom: 56px; }
.section-head h2 { margin: 0; }
.section-head .num { display: block; font: 500 12.5px/1 var(--mono); letter-spacing: 0.04em; color: var(--amber-text); margin-bottom: 18px; }
.section-head .body { font-size: 1.12rem; color: var(--muted); }
.section-head .body p:last-child { margin-bottom: 0; }
.section-head .body a { font-weight: 500; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-hi) 20%, var(--line-hi) 80%, transparent); }

/* Goal cards */
.goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.card {
  position: relative;
  padding: 30px 28px 30px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-hi), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.goals .card::before { content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--amber), transparent); opacity: 0.6; }
.glyph { display: block; width: 100%; height: 64px; margin-bottom: 26px; color: var(--record); }
.glyph .a { fill: var(--amber); }
.glyph .f { fill: none; stroke: var(--record-faint); stroke-width: 1.5; }
.glyph .r { fill: currentColor; }
.glyph .l { stroke: var(--line-hi); stroke-width: 1; fill: none; }
.glyph .p { stroke: var(--amber); stroke-width: 2; }
.card .label { display: block; font: 500 11.5px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 1.5rem; }
.card p { margin: 0; color: var(--muted); }
.aside-note { margin: 40px 0 0; font-size: 1.05rem; color: var(--muted); }

/* Milestone track on the home page */
.status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 40px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: 400 13.5px/1.5 var(--mono); color: var(--muted); }
.status b { color: var(--text); font-weight: 500; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 3px var(--amber-soft); } 50% { box-shadow: 0 0 0 7px transparent; } }
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; position: relative; }
.track::before { content: ""; position: absolute; left: 6px; right: 6px; top: 7px; height: 2px; background: repeating-linear-gradient(90deg, var(--line-hi) 0 6px, transparent 6px 12px); }
.track li { position: relative; display: flex; flex-direction: column; gap: 10px; padding-top: 36px; }
.track .bar { position: absolute; top: 0; left: 0; width: 46px; height: 16px; border-radius: 4px; transform: skewX(-24deg); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--record-faint); }
.track .next .bar { background: var(--amber); box-shadow: 0 0 24px var(--glow); animation: newest 3.6s ease-in-out infinite; }
.track .active .bar { background: var(--amber); }
.track .done .bar { background: var(--record); box-shadow: none; }
.track .mid { font: 500 13px/1 var(--mono); color: var(--faint); letter-spacing: 0.06em; }
.track .next .mid { color: var(--amber-text); }
.track h3 { margin: 0; font-size: 1.16rem; line-height: 1.2; }
.track .planned h3 { color: var(--muted); }
.pill { align-self: flex-start; font: 500 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 9px; border-radius: 99px; border: 1px solid var(--line-hi); color: var(--faint); }
.next .pill, .active .pill { border-color: var(--amber-text); color: var(--amber-text); background: var(--amber-soft); }
.done .pill { color: var(--muted); }
.more { display: inline-flex; align-items: center; gap: 8px; margin-top: 44px; font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }

/* Open questions */
.questions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.questions li { grid-column: span 2; }
.questions li:nth-child(-n+2) { grid-column: span 3; }
.questions a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 26px 26px 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-hi);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s var(--ease), border-color 0.25s ease, background-color 0.25s ease;
}
.questions a:hover { transform: translateY(-3px); border-style: solid; border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: var(--surface); }
.q-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-text); font: 600 18px/1 var(--serif); }
.questions b { font: 600 1.18rem/1.25 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.q-prop { color: var(--muted); font-size: 0.96rem; flex: 1; }
.q-prop em { font-style: normal; font-weight: 600; color: var(--text); }
.q-link { font: 500 12.5px/1 var(--mono); color: var(--amber-text); }
.q-link::after { content: " \2197"; }
.track-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin: 44px 0 0; }
.track-foot .more { margin: 0; }
.track-foot .meta { margin: 0; }

/* Link cards */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.links a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 26px 26px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s var(--ease), border-color 0.25s ease, box-shadow 0.25s ease;
}
.links a:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--amber) 55%, transparent); box-shadow: 0 18px 40px -24px var(--amber); }
.doc-n { font: 500 12.5px/1 var(--mono); color: var(--amber-text); margin-bottom: 6px; }
.links b { font: 600 1.28rem/1.2 var(--serif); letter-spacing: -0.01em; padding-right: 24px; }
.links span { color: var(--muted); font-size: 0.97rem; }
.links a::after { content: "\2197"; position: absolute; top: 24px; right: 24px; font: 500 15px/1 var(--mono); color: var(--faint); transition: color 0.2s ease, transform 0.25s var(--ease); }
.links a[href^="/"]::after { content: "\2192"; }
.links a:hover::after { color: var(--amber-text); transform: translate(2px, -2px); }

/* Inner pages */
.page-head { position: relative; padding: clamp(56px, 8vw, 104px) 0 48px; overflow: hidden; isolation: isolate; }
.page-head::before { content: ""; position: absolute; top: -60%; right: -10%; width: 60%; height: 200%; z-index: -1; background: radial-gradient(closest-side, var(--glow), transparent 70%); opacity: 0.35; }
.page-head h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); max-width: 22ch; margin-bottom: 22px; }
.page-head .lede { margin: 0; }
.page-head .lede p { margin: 0 0 0.6em; }
.page-head .lede p:last-child { margin: 0; }
.page-after h2 { margin-bottom: 12px; }
.page-after > .lede { margin-bottom: 32px; }
.lost-strip { padding: 0 0 48px; max-width: 520px; }
.lost-strip li:last-child i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--amber); }
.page-head .meta { margin: 18px 0 0; }
.page-body { padding: 8px 0 clamp(72px, 9vw, 120px); }
.meta { font: 400 13px/1.5 var(--mono); color: var(--faint); }
.meta a { color: var(--muted); }

/* Prose */
.prose { max-width: var(--measure); overflow-wrap: break-word; font-size: 1.06rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 2.2em 0 0.6em; padding-top: 0.2em; }
.prose h3 { font-size: 1.3rem; margin: 1.8em 0 0.5em; }
.prose h2 .anchor, .prose h3 .anchor { display: none; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--amber-text); }
.prose strong { font-weight: 650; color: var(--text); }
.prose img { height: auto; }
.prose hr { border: 0; height: 1px; background: var(--line-hi); margin: 3em 0; }
.prose blockquote { margin: 1.6em 0; padding: 1em 1.3em; border-radius: 0 12px 12px 0; border-left: 3px solid var(--amber); background: var(--amber-soft); color: var(--text); }
.prose blockquote p:last-child { margin: 0; }
.prose table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 1.8em 0; font-size: 0.95rem; display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.table-wrap { margin: 1.8em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.table-wrap table { display: table; margin: 0; border: 0; border-radius: 0; background: none; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); background: var(--surface-hi); }
.prose td:first-child { font-weight: 600; color: var(--text); }
.prose pre {
  position: relative;
  margin: 1.8em 0;
  padding: 20px 22px;
  border-radius: 14px;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--code-line);
  box-shadow: inset 3px 0 0 var(--amber), var(--shadow);
  font: 400 14px/1.7 var(--mono);
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 10px; right: 14px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(228, 236, 246, 0.45); }
.prose pre.mermaid { display: grid; place-items: center; padding: 28px 18px; background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow); }
.prose pre.mermaid::before { content: "diagram"; color: var(--faint); }
.prose-wide { max-width: 860px; }
/* Articles: one centred column for the head and the body. */
.article .wrap { max-width: calc(var(--col, 720px) + 2 * var(--gutter)); }
.article .prose { max-width: none; font-size: 1.1rem; }
.article .prose > p:first-child { font-size: 1.2rem; color: var(--text); }
.article.doc { --col: 860px; }

/* Roadmap */
.log { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 22px; }
.log::before { content: ""; position: absolute; left: 31px; top: 30px; bottom: 30px; width: 2px; background: repeating-linear-gradient(180deg, var(--line-hi) 0 6px, transparent 6px 12px); }
.log > li { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 28px; }
.log .marker { position: relative; z-index: 1; display: grid; align-content: start; justify-items: center; gap: 10px; padding-top: 34px; }
.log .marker i { display: block; width: 40px; height: 15px; border-radius: 4px; transform: skewX(-24deg); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--record-faint), 0 0 0 6px var(--bg); }
.log .next .marker i { background: var(--amber); box-shadow: 0 0 0 6px var(--bg), 0 0 26px var(--glow); }
.log .active .marker i { background: var(--amber); }
.log .done .marker i { background: var(--record); }
.log .marker span { font: 500 11px/1 var(--mono); color: var(--faint); background: var(--bg); padding: 2px 0; }
.log .card { padding: 30px 32px; }
.log .next .card { border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); }
.log .head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.log .mid { font: 500 13px/1 var(--mono); color: var(--amber-text); letter-spacing: 0.06em; }
.log h2 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.85rem); flex: 1 1 auto; }
.log .pill { align-self: center; }
.log .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 36px; margin: 0; }
.log dt { font: 500 11.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.log dd { margin: 0; color: var(--muted); }
.issues { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
.issues a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; font-size: 0.92rem; transition: border-color 0.2s ease; }
.issues a:hover { border-color: var(--amber-text); }
.issues a b { font: 500 12px/1 var(--mono); color: var(--amber-text); }
.issues .done a { color: var(--faint); text-decoration: line-through; }
.issues .gh a { border-style: dashed; color: var(--muted); }
.page-after { margin-top: 56px; }

/* Devlog */
.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.posts li { border-bottom: 1px solid var(--line); }
.posts a { display: grid; grid-template-columns: 180px minmax(0, 1fr) 24px; gap: 8px 32px; align-items: baseline; padding: 32px 4px; color: var(--text); text-decoration: none; }
.posts time { font: 400 13px/1.5 var(--mono); color: var(--faint); }
.posts h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 2.4vw, 1.9rem); transition: color 0.2s ease; }
.posts p { margin: 0; color: var(--muted); max-width: 60ch; }
.posts .go { font: 500 16px/1 var(--mono); color: var(--faint); transition: transform 0.25s var(--ease), color 0.2s ease; }
.posts a:hover h2 { color: var(--amber-text); }
.posts a:hover .go { color: var(--amber-text); transform: translateX(4px); }

/* Footer */
.site-footer { position: relative; margin-top: 24px; background: var(--bg-deep); border-top: 1px solid var(--line); }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--amber) 50%, transparent); opacity: 0.5; }
.foot { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px 64px; padding: 64px 0 40px; }
.foot-brand img { height: 40px; width: auto; display: var(--light-display); }
.foot-brand img.on-dark { display: var(--dark-display); }
.foot-brand p { margin: 20px 0 0; color: var(--muted); font-size: 0.95rem; max-width: 44ch; }
.foot-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-links h2 { margin: 0 0 14px; font: 500 11.5px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.foot-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-links a { color: var(--text); text-decoration: none; font-size: 0.97rem; }
.foot-links a:hover { color: var(--amber-text); text-decoration: underline; }
.foot-base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 36px; border-top: 1px solid var(--line); font: 400 12.5px/1.5 var(--mono); color: var(--faint); }
.rail { display: flex; gap: 5px; width: 150px; height: 7px; }
.rail i { flex: 1; border-radius: 2px; background: var(--record); transform: skewX(-24deg); }
.rail i:nth-child(5) { background: var(--record-faint); }
.rail i:last-child { background: var(--amber); box-shadow: 0 0 10px var(--glow); }

/* Entrance: staggered on load, and sections fade up as they scroll in. Scroll reveal only with JS, so nothing stays hidden without it. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { opacity: 0; transform: skewX(-24deg) scaleX(0.2); } to { opacity: 1; transform: skewX(-24deg); } }
.rise { animation: rise 0.8s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }
.strip i { animation: grow 0.6s var(--ease) both, tick 6s ease-in-out infinite; animation-delay: calc(var(--n) * 70ms + 500ms), calc(var(--n) * 160ms + 2s); }
.strip li:nth-child(5) i { animation-name: grow, lost; }
.strip li:last-child i { animation-name: grow, newest; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--d, 0) * 80ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* Tablet */
@media (max-width: 1020px) {
  .hero .wrap:first-child { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 24px; }
  .goals { grid-template-columns: 1fr; }
  .goals .card { display: grid; grid-template-columns: 180px minmax(0, 1fr); column-gap: 28px; align-items: center; }
  .goals .glyph { grid-row: 1 / span 3; margin: 0; }
  .track { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; }
  .track::before { display: none; }
  .questions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .questions li, .questions li:nth-child(-n+2) { grid-column: auto; }
  .questions li:first-child { grid-column: 1 / -1; }
  .foot { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; margin-bottom: 40px; }
  .nav .gh span { display: none; }
}
/* Phone */
@media (max-width: 680px) {
  :root { --gutter: 20px; }
  body { font-size: 16.5px; }
  .site-header .wrap { min-height: 60px; gap: 8px; }
  .brand img { height: 34px; }
  .hero-tag .eyebrow::before { display: none; }
  .js .menu { display: inline-flex; }
  .js .nav { display: none; }
  .js .open .nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.5);
  }
  .js .open .nav a { padding: 14px 4px; font-size: 17px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .js .open .nav a:last-child { border-bottom: 0; }
  .js .open .nav a[aria-current="page"]::after { left: 4px; right: auto; width: 24px; bottom: 6px; }
  .nav .gh span { display: inline; }
  .tools { margin-left: auto; }
  /* Without JS the nav wraps onto its own scrollable row. */
  html:not(.js) .site-header .wrap { flex-wrap: wrap; }
  html:not(.js) .nav { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .hero { padding-top: 28px; }
  .hero .wrap:first-child {
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "mark tag" "h1 h1" "lede lede" "actions actions";
    column-gap: 16px;
  }
  .hero-mark { width: 104px; margin: 0 0 18px -6px; }
  .hero-mark::after { display: none; }
  .hero-tag { flex-direction: column; align-items: flex-start; gap: 10px; margin: 0 0 18px; }
  .hero-tag .eyebrow { font-size: 13px; }
  .hero h1 { font-size: clamp(2.3rem, 10.5vw, 3rem); margin-bottom: 18px; }
  .strip { padding-top: 44px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .actions .primary { grid-column: 1 / -1; }
  .actions .btn { padding: 14px 12px; }
  .btn { justify-content: center; }
  .strip ol { gap: 6px; }
  .strip i { height: 9px; }
  .strip span { font-size: 10px; }
  .goals .card { display: block; }
  .goals .glyph { margin-bottom: 20px; height: 52px; }
  .track { grid-template-columns: 1fr; row-gap: 0; }
  .track li { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 16px 0 16px 64px; border-bottom: 1px solid var(--line); }
  .track .bar { top: 21px; width: 40px; height: 14px; left: 2px; }
  .track h3 { flex: 1 1 60%; }
  .track .mid { order: -1; width: 100%; }
  .track .pill { align-self: center; }
  .log::before { left: 19px; }
  .log > li { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .log .marker i { width: 28px; height: 12px; }
  .log .card { padding: 22px 20px; }
  .log .facts { grid-template-columns: 1fr; }
  .posts a { grid-template-columns: minmax(0, 1fr); padding: 26px 0; gap: 6px; }
  .posts .go { display: none; }
  .foot-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .questions { grid-template-columns: 1fr; }
  .prose pre { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-radius: 0; border-left: 0; border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
