/* Tallowmere: a field journal on provenance.
   The whole palette lives on :root. Six colors, nothing else. */
:root {
  --paper: #f9f2f1;
  --blush: #eddcd9;
  --ink: #281815;
  --clay: #634945;
  --rust: #953628;
  --rule: #866965;
  --font: "Gill Sans", "Gill Sans MT", Optima, "Segoe UI", sans-serif;
  --gutter: 16px;
  --measure: 42rem;
  --wide: 74rem;
  color-scheme: light;
}

@media (min-width: 48rem) {
  :root { --gutter: clamp(24px, 4vw, 64px); }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.45rem; }
main { display: block; }
main:focus { outline: none; }
[hidden] { display: none !important; }

/* Links, focus and the skip link */
a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--rust);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0.75rem); }

/* Type */
h1, h2, h3 {
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}
h2 {
  margin-top: 3.25rem;
  margin-bottom: 1.1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.7rem);
  letter-spacing: -0.01em;
}
h3 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
}
p { margin: 0 0 1.1rem; }
.kicker {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}
.lede {
  max-width: 38rem;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.45;
}

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 2rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 2.4rem; height: 2.4rem; flex: none; }
.mark-line { fill: none; stroke: var(--rust); stroke-width: 2.5; stroke-linejoin: round; }
.mark-node { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.4rem; letter-spacing: 0.01em; }
.brand-sub {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav li { margin: 0; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  font-size: 1rem;
}
.site-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration-thickness: 2px;
}

/* Layout */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.column { max-width: var(--measure); }

/* Cover story: a giant headline fills the first viewport, then one column */
.cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.25rem;
  min-height: 80vh;
  min-height: 80svh;
  padding: clamp(2rem, 6vh, 3.5rem) 0 clamp(2rem, 5vh, 3rem);
}
.cover-title {
  margin: 0;
  font-size: clamp(3.4rem, 17vw, 17rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-wrap: balance;
  animation: rise 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.cover-trail {
  width: 100%;
  height: auto;
  overflow: visible;
}
.trail-line {
  fill: none;
  stroke: var(--rust);
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: draw-trail 1400ms ease-out both;
}
.trail-node {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 3;
}
.cover-foot {
  display: grid;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.deck {
  max-width: 38rem;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.45;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}
@media (min-width: 52rem) {
  .cover-foot {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(0.5em); }
  to { opacity: 1; transform: none; }
}
@keyframes draw-trail {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

/* Inner page heading */
.page-head {
  display: grid;
  gap: 0.25rem;
  padding: clamp(2.5rem, 8vh, 5rem) 0 1.5rem;
}
.page-head h1 {
  margin: 0 0 1.25rem;
  max-width: 14ch;
  font-size: clamp(2.6rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.page-head .lede { margin-bottom: 0; }
.page-head .actions { margin-top: 1.75rem; }

/* Trail: five stations, drawn with CSS */
.trail {
  list-style: none;
  margin: 1.75rem 0 2rem;
  padding: 0;
}
.trail > li {
  position: relative;
  margin: 0;
  padding: 0 0 1.6rem 2.4rem;
}
.trail > li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.42rem;
  width: 0.95rem;
  height: 0.95rem;
  box-sizing: border-box;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}
.trail > li::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 1.45rem;
  bottom: 0;
  width: 2px;
  background: var(--rust);
}
.trail > li:last-child::after { display: none; }
.trail > li > h3 { margin-bottom: 0.35rem; }
.trail > li > p:last-child { margin-bottom: 0; }
.records { margin-top: 0.6rem; font-size: 0.97rem; color: var(--clay); }
.records strong { color: var(--ink); }

/* Tables */
.table-wrap {
  margin: 1.75rem 0 2rem;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}
caption {
  caption-side: top;
  padding-bottom: 0.75rem;
  text-align: left;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
}
th, td {
  padding: 0.75rem 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
thead th {
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
}
tbody th { font-weight: 700; }

/* Notes */
.note {
  margin: 2.25rem 0;
  padding: 1.25rem 1.4rem;
  border-left: 4px solid var(--rust);
  background: var(--blush);
  font-size: 0.97rem;
}
.note p { margin: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.btn:hover {
  border-color: var(--rust);
  background: var(--rust);
  color: var(--paper);
  text-decoration: none;
}
.btn-quiet {
  border-color: var(--rule);
  background: var(--paper);
  color: var(--ink);
}
.btn-quiet:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* Footer */
.site-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--rule);
}
.footer-inner {
  display: grid;
  gap: 0.6rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.25rem var(--gutter) 3rem;
  font-size: 0.95rem;
  color: var(--clay);
}
.footer-inner p { margin: 0; }
.footer-inner .footer-brand {
  font-size: 1.1rem;
  color: var(--ink);
}
.footer-inner a { color: var(--ink); }

/* Reference frames */
.frames {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
}
.frames figure { margin: 0; }
.frames svg {
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
}
.frame-bg { fill: var(--blush); }
.frame-cell { fill: var(--ink); }
.frames figcaption {
  margin-top: 0.45rem;
  font-size: 0.92rem;
  color: var(--clay);
}

/* Live grid (only shown when JavaScript runs) */
.no-js-note {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 0.97rem;
}
.js .no-js-note { display: none; }
.lab-tool { display: none; }
.js .lab-tool {
  display: block;
  margin-top: 1.25rem;
  padding: clamp(0.9rem, 2.5vw, 1.6rem);
  border: 1px solid var(--rule);
  background: var(--blush);
}
.life-canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
  background-color: var(--blush);
}
.readout {
  margin: 0.9rem 0 0;
  font-variant-numeric: tabular-nums;
}
.lab-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.pace {
  display: grid;
  gap: 0.4rem;
  margin-top: 1.1rem;
}
.pace label { font-size: 0.97rem; }
.pace input[type="range"] {
  width: 100%;
  min-height: 2rem;
  margin: 0;
  accent-color: var(--rust);
}
.pace output {
  font-size: 0.97rem;
  font-variant-numeric: tabular-nums;
  color: var(--clay);
}
@media (min-width: 40rem) {
  .pace {
    grid-template-columns: 11rem minmax(0, 1fr) 13rem;
    align-items: center;
    gap: 1rem;
  }
}
.motion-note {
  margin-top: 1.1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 0.97rem;
}
.status {
  min-height: 1.6em;
  margin: 1rem 0 0;
  font-size: 0.97rem;
}

/* Motion: every animation and transition has a static version */
@media (prefers-reduced-motion: reduce) {
  .cover-title { animation: none; }
  .trail-line {
    animation: none;
    stroke-dashoffset: 0;
  }
  .btn { transition: none; }
  html { scroll-behavior: auto; }
}
