/*
  cosy v3 — design rationale (2026-07-02)

  This stylesheet is laid out by hand. Decisions, so the next person doesn't
  have to guess:

  - Body is a serif (Literata), headings are a light sans (IBM Plex Sans 300).
    The inversion is deliberate: this is a reading site, not a dashboard.
  - One accent color only: burnt terracotta #a84b2a. No gradients anywhere.
  - Text is warm near-black #26221c on warm near-white #fcfbf8 — not #000/#fff.
  - Type ladder is hand-picked, not a modular scale: 44-64 / 26 / 19 / 17 / 13.
  - No scroll-reveal, no keyframes. All content is visible without JavaScript.
    The only motion on the site is link hover.
  - Two radii exist: 999px for pill controls, 2px for surfaces. Nothing else.
  - Long-form text measures 640px fixed. The page grid is 62rem with a left
    marginalia gutter on wide screens — lab-notebook layout, not centered hero.
*/

@import url("fonts.css");

:root {
  --paper: #fcfbf8;
  --ink: #26221c;
  --ink-soft: #6d675e;
  --hairline: #e4e0d8;
  --accent: #a84b2a;
  --wash: #f5f2ec;

  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --page: 62rem;
  --measure: 640px;
  --gutter: 176px;
}

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

html { scroll-behavior: smooth; }

body {
  font: 400 17px/1.65 var(--serif);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- typography ladder ---- */

h1, h2, h3 { font-family: var(--sans); font-weight: 300; }

h1 {
  font-size: clamp(2.375rem, 1.6rem + 2.6vw, 3.75rem); /* 38 → 60px */
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

h2 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h3 { font-size: 19px; line-height: 1.4; font-weight: 500; }

p, ul, ol { max-width: var(--measure); }
p + p { margin-top: 1em; }

em { font-style: italic; }
strong { font-weight: 600; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 120ms ease, color 120ms ease;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* meta line: dates, statuses, file names */
.meta {
  font: 400 12.5px/1.6 var(--mono);
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* marginalia & captions — a real hierarchy level, not an afterthought */
aside, figcaption, .aside {
  font: 400 13px/1.7 var(--sans);
  color: var(--ink-soft);
  max-width: 34ch;
}

/* maturity tags for notebook entries */
.tag {
  display: inline-block;
  font: 400 11.5px/1 var(--mono);
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.tag--hypothesis { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }

/* ---- page scaffold ---- */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

header.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 0 26px;
  border-bottom: 1px solid var(--hairline);
}

.wordmark {
  font: 600 21px/1 var(--serif);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.wordmark:hover { color: var(--ink); }
.wordmark .dot { color: var(--accent); }

nav.site { display: flex; gap: 22px; flex-wrap: wrap; }
nav.site a {
  font: 400 13.5px/1 var(--sans);
  color: var(--ink-soft);
  text-decoration: none;
}
nav.site a:hover, nav.site a[aria-current] { color: var(--accent); }

/* section = mono kicker in left gutter, content in main column */
section.row {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  gap: 12px 40px;
  padding: 56px 0;
  border-bottom: 1px solid var(--hairline);
}
section.row:last-of-type { border-bottom: none; }

.kicker {
  font: 400 12.5px/1.9 var(--mono);
  color: var(--ink-soft);
  text-transform: lowercase;
}

section.row > .body > h2 { margin-bottom: 18px; }

@media (max-width: 860px) {
  section.row { grid-template-columns: 1fr; padding: 40px 0; }
  :root { --gutter: 0px; }
}

/* ---- hero (text-only, editorial) ---- */

.lede { padding: 72px 0 56px; border-bottom: 1px solid var(--hairline); }
.lede .meta { margin-bottom: 22px; }
.lede h1 { margin-bottom: 26px; }
.lede .standfirst {
  font-size: 19px;
  line-height: 1.6;
  max-width: 34em;
}

/* ---- directions: numbered editorial rows, not cards ---- */

ol.directions { list-style: none; counter-reset: dir; max-width: none; }
ol.directions > li {
  counter-increment: dir;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}
ol.directions > li::before {
  content: counter(dir, decimal-leading-zero);
  font: 400 13px/2 var(--mono);
  color: var(--accent);
}
ol.directions h3 { margin-bottom: 4px; }
ol.directions h3 a { text-decoration: none; }
ol.directions h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
ol.directions p { color: var(--ink-soft); font-size: 15.5px; }

/* ---- notebook: dated entry list ---- */

ul.entries { list-style: none; max-width: none; }
ul.entries > li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  padding: 13px 0;
  border-top: 1px solid var(--hairline);
}
ul.entries .meta { white-space: nowrap; }
ul.entries a { text-decoration: none; font-family: var(--sans); font-size: 15.5px; }
ul.entries a:hover { color: var(--accent); }
@media (max-width: 640px) {
  ul.entries > li { grid-template-columns: 1fr; gap: 4px; }
}

/* ---- open questions: plain numbered list ---- */

ol.questions { padding-left: 0; list-style: none; counter-reset: q; }
ol.questions > li {
  counter-increment: q;
  padding: 14px 0 14px 44px;
  position: relative;
  border-top: 1px solid var(--hairline);
}
ol.questions > li::before {
  content: counter(q);
  position: absolute; left: 0; top: 15px;
  font: 400 13px/1.6 var(--mono);
  color: var(--accent);
}
ol.questions .aside { margin-top: 4px; }

/* ---- figure / diagram ---- */

figure { margin: 32px 0; max-width: 100%; }
figure svg { display: block; max-width: 100%; height: auto; }
figcaption { margin-top: 10px; }

/* ---- spec table (facts as content) ---- */

table.spec {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--measure);
  font-size: 15px;
}
table.spec th, table.spec td {
  text-align: left;
  padding: 9px 18px 9px 0;
  border-top: 1px solid var(--hairline);
  vertical-align: top;
}
table.spec th { font: 500 13px/1.6 var(--sans); color: var(--ink-soft); white-space: nowrap; }

/* ---- prose page (long-form notes) ---- */

.prose { max-width: var(--measure); }
.prose h2 { margin: 44px 0 14px; }
.prose h3 { margin: 30px 0 10px; }
.prose ul, .prose ol { padding-left: 22px; margin: 12px 0; }
.prose li + li { margin-top: 6px; }
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 18px;
  color: var(--ink-soft);
  margin: 18px 0;
}
.prose code { font: 400 0.88em var(--mono); background: var(--wash); padding: 1px 5px; border-radius: 2px; }
.prose pre { background: var(--wash); padding: 16px; overflow-x: auto; border-radius: 2px; margin: 16px 0; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 32px 0; }
.prose img { max-width: 100%; }
.prose table { border-collapse: collapse; font-size: 14.5px; margin: 16px 0; display: block; overflow-x: auto; }
.prose table th, .prose table td { border: 1px solid var(--hairline); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose table th { font: 500 12.5px/1.5 var(--sans); color: var(--ink-soft); }

/* ---- footer ---- */

footer.colophon {
  padding: 44px 0 64px;
  border-top: 1px solid var(--hairline);
  margin-top: 56px;
}
footer.colophon .cols {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
footer.colophon .meta { max-width: 52ch; }

/* ---- print: the site should survive on paper ---- */
@media print {
  nav.site { display: none; }
  body { font-size: 11pt; }
}
