/* netrobots: main stylesheet.
   Colours are tokens on :root with a dark variant; fonts are vendored (SIL OFL). */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-italic-latin.woff2") format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Familjen Grotesk";
  src: url("../fonts/familjen-grotesk-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #eceee9;
  --surface: #f6f7f3;
  --ink: #1d282d;
  --muted: #56656b;
  --rule: #c9cfc8;
  --ochre: #9a6410;
  --strata-1: #d7dcd3;
  --strata-2: #c3cabf;
  --link: #255a86;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a1d; --surface: #1b2327; --ink: #e2e7e2; --muted: #9aa8ad; --rule: #2f3a3f;
    --ochre: #dcaa52; --strata-1: #232d31; --strata-2: #2c383d; --link: #8cbce6;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.65;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--link); text-underline-offset: 0.15em; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4, .sans, nav, summary, button, .kicker, .meta { font-family: var(--sans); }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--surface); padding: 0.4rem 0.8rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }
.wrap > * { max-width: 44rem; }
.wrap.wide > * { max-width: none; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--rule); }
.header-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; flex-wrap: wrap; }
.header-row > * { max-width: none; }
.wordmark { font-family: var(--sans); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
nav { display: flex; gap: 1.2rem; font-size: 0.98rem; }
nav a { color: var(--ink); text-decoration: none; }
nav a:hover { text-decoration: underline; }
.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.92rem; margin-top: 2rem; }
.site-footer p { margin: 0 0 0.5rem; }
.footer-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 1.5rem; }
h1 { font-size: clamp(2.8rem, 9vw, 6rem); line-height: 0.95; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 1rem; }
.home-hero h1 { font-size: clamp(3rem, 12vw, 7.5rem); }
.subtitle { font-size: clamp(1.2rem, 2.6vw, 1.5rem); line-height: 1.4; color: var(--muted); margin: 0 0 1rem; font-style: italic; }
.kicker { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.95rem; display: flex; gap: 0.6rem; align-items: center; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
.status { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid var(--ochre); color: var(--ochre); vertical-align: middle; }

/* Blocks and prose */
.block { padding: 2.5rem 0; border-top: 1px solid var(--rule); }
h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 1.1rem; font-weight: 700; }
.lede { font-size: 1.3rem; line-height: 1.55; }
.prose h2 { margin-top: 2.2rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.25rem; margin: 2rem 0 0.6rem; font-weight: 600; }
.prose > p:first-of-type { font-size: 1.25rem; line-height: 1.55; }
.prose ul { list-style: none; padding: 0; margin: 0 0 1rem; }
.prose ul li { padding: 0.5rem 0 0.5rem 1rem; border-left: 2px solid var(--rule); margin-bottom: 0.5rem; }
.prose strong { font-family: var(--sans); font-weight: 600; }

/* Essay lists */
.essay-list { list-style: none; padding: 0; margin: 0; }
.essay-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.essay-list h3 { margin: 0 0 0.2rem; font-size: 1.45rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.essay-list p { margin: 0.2rem 0; }
.list-subtitle { font-style: italic; color: var(--muted); }

/* Discussion */
.notes h3 { font-size: 1.25rem; margin: 1.8rem 0 0.4rem; font-weight: 600; }
.notes h3:first-child { margin-top: 0.5rem; }
.notes p { margin: 0 0 0.6rem; }
.origin { font-size: 0.92rem; color: var(--muted); }
.cite { white-space: nowrap; }
.decisions { margin-top: 2rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; font-size: 0.95rem; width: 100%; margin: 0.6rem 0 1rem; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); }
th { font-family: var(--sans); font-weight: 600; }

/* References */
ul.refs { padding-left: 1.1rem; margin: 0 0 1.4rem; font-size: 1rem; line-height: 1.55; }
ul.refs li { margin-bottom: 0.45rem; }
ul.refs li:target { background: var(--surface); outline: 2px solid var(--ochre); outline-offset: 4px; }
#reading h3 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; font-weight: 600; }
.core-note { display: block; color: var(--muted); font-size: 0.95rem; }
.avail { font-family: var(--sans); font-size: 0.8rem; color: var(--ochre); }
.flag { font-family: var(--sans); font-size: 0.8rem; color: var(--ochre); }
details { border-bottom: 1px solid var(--rule); }
#references details:first-of-type { border-top: 1px solid var(--rule); }
summary { cursor: pointer; padding: 0.9rem 0; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; gap: 1rem; align-items: baseline; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; color: var(--ochre); width: 1rem; flex: none; }
details[open] > summary::before { content: "−"; }
summary .count { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 0.85rem; white-space: nowrap; }
details h4 { font-size: 0.98rem; margin: 0.6rem 0 0.4rem; font-weight: 600; color: var(--muted); }

/* Disclosure */
.credit { background: var(--surface); border-left: 3px solid var(--ochre); padding: 1.4rem 1.5rem; }
.credit p { margin: 0 0 0.8rem; }
.credit p:last-child { margin-bottom: 0; }
.credit-link { font-size: 0.92rem; color: var(--muted); }

/* Explainer: deep-time clock */
.explainer { padding: 1.5rem 0 2.5rem; }
.explainer-title { font-size: 1.35rem; margin-bottom: 0.4rem; }
.explainer-text { max-width: 44rem; margin: 0 0 1.8rem; }
.scale-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.4rem; }
.scale-head h3 { font-size: 1.05rem; margin: 0; font-weight: 600; }
.scale-head span { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); text-align: right; }
.track { position: relative; height: 2.6rem; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--strata-1) 0 calc(25% - 1px), var(--strata-2) calc(25% - 1px) 25%); }
.track .zoom { position: absolute; top: 0; bottom: 0; right: 0; width: var(--w); min-width: 3px; background: var(--ochre); }
.ticks { display: flex; justify-content: space-between; font-family: var(--sans); font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.marks { position: relative; height: 5.6rem; }
.marks.one { height: 3.2rem; }
.mark { position: absolute; top: 0; font-family: var(--sans); font-size: 0.82rem; line-height: 1.25;
  padding-left: 0.45rem; border-left: 1px solid var(--ink); padding-top: calc(0.15rem + var(--dy, 0rem)); width: max-content; max-width: 11rem; }
.mark.r { border-left: none; border-right: 1px solid var(--ink); padding-left: 0; padding-right: 0.45rem; text-align: right; transform: translateX(-100%); }
.mark b { display: block; font-weight: 600; }
.mark.hot { border-color: var(--ochre); }
.mark.hot b { color: var(--ochre); }
.connector { height: 1.4rem; position: relative; }
.connector::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom right, transparent calc(50% - 1px), var(--ochre) 50%, transparent calc(50% + 1px)); opacity: 0.35; }
.explainer-data { margin-top: 1.4rem; }
.data-note { font-size: 0.9rem; color: var(--muted); }
.replay-row { margin: 1rem 0 0; }
.replay { font: inherit; font-family: var(--sans); font-size: 0.9rem; background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; padding: 0.35rem 0.8rem; cursor: pointer; }

/* Animation states, added by static/js/explainers/deep-time-clock.js.
   Without JavaScript, or with reduced motion, none of these apply. */
.clock.is-armed .zoom { width: 0; }
.clock.is-armed .mark, .clock.is-armed .connector { opacity: 0; }
.clock.is-playing .zoom { width: var(--w); transition: width 700ms ease-out; }
.clock.is-playing .mark, .clock.is-playing .connector { opacity: 1; transition: opacity 400ms ease-out; }
.clock.is-playing [data-step="1"] .zoom, .clock.is-playing [data-step="0"] + .connector { transition-delay: 900ms; }
.clock.is-playing [data-step="1"] .mark { transition-delay: 1300ms; }
.clock.is-playing [data-step="2"] .zoom, .clock.is-playing [data-step="1"] + .connector { transition-delay: 1800ms; }
.clock.is-playing [data-step="2"] .mark { transition-delay: 2200ms; }
.clock.is-playing [data-step="0"] .mark { transition-delay: 400ms; }

@media (max-width: 560px) {
  body { font-size: 1.06rem; }
  .mark { font-size: 0.74rem; max-width: 7.5rem; }
  .marks { height: 6.4rem; }
  .marks.one { height: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
