/* ==========================================================================
   weagle.css — the Weagle Register design system
   One stylesheet. Every page imports it. style.html documents it.
   If a value is wrong here, every page is already wrong.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. TOKENS
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* --- color: birch fog ground, spruce ink, toll yellow signature --- */
  --paper:      #e4e6df;  /* page ground: cool birch fog, never cream   */
  --rime:       #f6f8f5;  /* raised surfaces: cards, panels, table rows */
  --ink:        #14201c;  /* body text: spruce black, never pure black  */
  --ink-2:      #33443c;  /* secondary text                            */
  --fog:        #59665f;  /* meta, captions, disabled. AA at 11px.     */
  --spruce:     #2f5d4e;  /* links, "documented" state                 */
  --toll:       #f0b429;  /* THE accent. Tickets, mileposts, "claimed" */
  --toll-deep:  #7d5807;  /* toll yellow when it must sit on light     */
  --hazard:     #b23a2b;  /* "disputed" only. Never a button.          */
  --line:       rgba(20, 32, 28, .16);
  --line-hard:  rgba(20, 32, 28, .38);
  --shade:      rgba(20, 32, 28, .07);

  /* --- type --- */
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body:    "Newsreader", Georgia, "Times New Roman", serif;
  --data:    "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --t-display: clamp(2.5rem, 7vw, 4.25rem);
  --t-h2:      clamp(1.55rem, 3.4vw, 2.15rem);
  --t-h3:      1.0625rem;
  --t-lead:    1.1875rem;
  --t-body:    1rem;
  --t-meta:    .8125rem;
  --t-micro:   .6875rem;

  /* --- space: 4px base, no half-steps --- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;

  /* --- structure --- */
  --measure: 68ch;   /* body copy never wider than this */
  --page:    1180px;
  --rail:    108px;  /* milepost rail gutter */
  --radius:  2px;    /* ledgers are square. 2px is the whole budget. */

  --version: "1.0.0";
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:     #101a17;
  --rime:      #1a2721;
  --ink:       #e7ece8;
  --ink-2:     #b6c3bc;
  --fog:       #8b9992;
  --spruce:    #79c4a5;
  --toll:      #f0b429;
  --toll-deep: #f0b429;
  --hazard:    #e0705c;
  --line:      rgba(231, 236, 232, .15);
  --line-hard: rgba(231, 236, 232, .34);
  --shade:     rgba(0, 0, 0, .28);
}

/* --------------------------------------------------------------------------
   1. RESET + BASE
   -------------------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.62;
  font-optical-sizing: auto;
  transition: background .18s linear, color .18s linear;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 88%;
  line-height: 1.02;
  letter-spacing: -.018em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--t-display); font-weight: 800; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.25; letter-spacing: -.005em; }

p { margin: 0 0 var(--s4); max-width: var(--measure); }

a { color: var(--spruce); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--toll-deep);
  outline-offset: 3px;
  border-radius: var(--radius);
}

hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }

::selection { background: var(--toll); color: #14201c; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: var(--s3);
  background: var(--toll); color: #14201c; padding: var(--s2) var(--s4);
  font-family: var(--data); font-size: var(--t-meta); z-index: 999;
}
.skip-link:focus { left: var(--s3); }

/* --------------------------------------------------------------------------
   2. TYPE ROLES
   -------------------------------------------------------------------------- */

.lead {
  font-size: var(--t-lead);
  font-weight: 350;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 58ch;
}

.meta,
.eyebrow {
  font-family: var(--data);
  font-size: var(--t-meta);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fog);
  line-height: 1.4;
}

.eyebrow { color: var(--toll-deep); margin: 0 0 var(--s3); display: block; }

.micro {
  font-family: var(--data);
  font-size: var(--t-micro);
  letter-spacing: .06em;
  color: var(--fog);
}

.num { font-family: var(--data); font-variant-numeric: tabular-nums; }

code, kbd, samp {
  font-family: var(--data);
  font-size: .875em;
  background: var(--shade);
  padding: .1em .35em;
  border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   3. LAYOUT
   -------------------------------------------------------------------------- */

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

.band { padding: var(--s8) 0; border-top: 1px solid var(--line); }
.band:first-of-type { border-top: 0; }
.band--tint { background: var(--shade); }

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s5);
  align-items: start;
}
.cols--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.stack > * + * { margin-top: var(--s4); }

/* Body copy inside a band keeps its measure; grids do not. */
.band > .page > p,
.band > .page > .lead { max-width: var(--measure); }

/* --------------------------------------------------------------------------
   4. MILEPOST RAIL  — the signature element
   The Auto Road is 7.6 miles. Every long page is measured in mileposts,
   0.0 at the toll house to 7.6 at the summit. Section index + scroll gauge.
   -------------------------------------------------------------------------- */

.milepost {
  position: fixed;
  left: max(var(--s5), calc((100vw - var(--page)) / 2 + var(--s5)));
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: none;
  padding-left: var(--s4);
}

.milepost::before {
  content: "";
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--line-hard);
}

.milepost__fill {
  position: absolute; left: 0; top: 4px;
  width: 2px; height: 0;
  background: var(--toll);
  transition: height .12s linear;
}

.milepost__stop {
  display: block;
  font-family: var(--data);
  font-size: var(--t-micro);
  letter-spacing: .04em;
  color: var(--fog);
  text-decoration: none;
  padding: var(--s1) 0;
  line-height: 1.5;
  position: relative;
}
.milepost__stop b { font-weight: 600; font-variant-numeric: tabular-nums; }
.milepost__stop span { opacity: 0; margin-left: var(--s2); transition: opacity .14s; }
.milepost__stop:hover span,
.milepost__stop[aria-current="true"] span { opacity: 1; }

.milepost__stop[aria-current="true"] { color: var(--ink); }
.milepost__stop[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: calc(var(--s4) * -1 - 3px);
  top: 50%;
  width: 8px; height: 8px;
  margin-top: -4px;
  background: var(--toll);
}

@media (min-width: 1120px) { .milepost { display: block; } }

/* --------------------------------------------------------------------------
   5. TICKET — primary action, cut from the Auto Road toll stub
   -------------------------------------------------------------------------- */

.ticket,
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--data);
  font-size: var(--t-meta);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--s3) var(--s5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.ticket {
  background: var(--toll);
  color: #14201c;
  padding-left: var(--s6);
  position: relative;
}
/* perforated stub edge */
.ticket::before {
  content: "";
  position: absolute; left: 10px; top: 5px; bottom: 5px;
  width: 1px;
  background-image: linear-gradient(rgba(20,32,28,.34) 50%, transparent 0);
  background-size: 1px 6px;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-hard);
}

.ticket:hover, .btn--ghost:hover { transform: translateY(-1px); }
.ticket:active, .btn--ghost:active { transform: translateY(0); }

.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0; }

/* --------------------------------------------------------------------------
   6. EVIDENCE STAMP — the intellectual spine of the site
   Weagle self-reported most of his records. Every claim on this site
   carries a grade. There is no such thing as an ungraded claim.
   -------------------------------------------------------------------------- */

.stamp {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s2);
  font-family: var(--data);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px var(--s2) 3px var(--s2);
  border-left: 3px solid var(--fog);
  background: var(--shade);
  color: var(--ink-2);
  white-space: nowrap;
}

.stamp--documented { border-left-color: var(--spruce); color: var(--spruce); }
.stamp--attested   { border-left-color: var(--ink-2);  color: var(--ink-2); }
.stamp--claimed    { border-left-color: var(--toll);   color: var(--toll-deep); }
.stamp--disputed   { border-left-color: var(--hazard); color: var(--hazard); }

/* --------------------------------------------------------------------------
   7. PANELS, ENTRIES, CALLOUTS
   -------------------------------------------------------------------------- */

.panel {
  background: var(--rime);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
}
.panel h3 { margin-bottom: var(--s2); }
.panel > :last-child { margin-bottom: 0; }

/* A register row. One first ascent, one line. */
.entry {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: var(--s2) var(--s4);
  align-items: baseline;
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry__year { font-family: var(--data); font-variant-numeric: tabular-nums; color: var(--fog); font-size: var(--t-meta); }
.entry__what { margin: 0; max-width: none; }
.entry__who  { display: block; font-family: var(--data); font-size: var(--t-micro); letter-spacing: .06em; color: var(--fog); text-transform: uppercase; margin-top: 2px; }

@media (max-width: 620px) {
  .entry { grid-template-columns: 1fr; }
}

.callout {
  border-left: 3px solid var(--toll);
  background: var(--shade);
  padding: var(--s4) var(--s5);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout--hazard { border-left-color: var(--hazard); }
.callout > :last-child { margin-bottom: 0; }

/* Dashed road centre line. Section break only, never decoration. */
.rule--road {
  height: 2px; border: 0; margin: var(--s7) 0;
  background-image: linear-gradient(90deg, var(--toll) 50%, transparent 0);
  background-size: 22px 2px;
  opacity: .8;
}

/* --------------------------------------------------------------------------
   8. FIGURES — archive photography
   Every historical photo carries its credit in the markup. No exceptions.
   -------------------------------------------------------------------------- */

.figure { margin: 0; }
.figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.04);
}
.figure figcaption {
  font-family: var(--data);
  font-size: var(--t-micro);
  letter-spacing: .04em;
  color: var(--fog);
  margin-top: var(--s2);
  line-height: 1.5;
}
.figure figcaption b { color: var(--ink-2); font-weight: 600; }

/* --------------------------------------------------------------------------
   9. HEADER / FOOTER
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding: var(--s3) var(--s5);
  max-width: var(--page); margin: 0 auto;
}
.wordmark {
  font-family: var(--display); font-weight: 800; font-stretch: 85%;
  font-size: 1.0625rem; letter-spacing: -.01em; text-decoration: none; color: var(--ink);
}
.wordmark i { font-style: normal; color: var(--toll-deep); }

.topnav { display: flex; gap: var(--s4); align-items: center; }
.topnav a {
  font-family: var(--data); font-size: var(--t-micro);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fog); text-decoration: none;
}
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 720px) { .topnav a:not(.topnav__key) { display: none; } }

.themetoggle {
  font-family: var(--data); font-size: var(--t-micro); letter-spacing: .08em;
  text-transform: uppercase; background: transparent; color: var(--fog);
  border: 1px solid var(--line-hard); border-radius: var(--radius);
  padding: 5px var(--s3); cursor: pointer;
}
.themetoggle:hover { color: var(--ink); }

.foot {
  border-top: 2px solid var(--ink);
  padding: var(--s6) 0 var(--s8);
  margin-top: var(--s8);
}
.foot .page { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; align-items: end; }

/* --------------------------------------------------------------------------
   10. REGISTER CONTROLS
   -------------------------------------------------------------------------- */

.entry__note {
  margin: var(--s2) 0 0;
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--ink-2);
  border-left: 2px solid var(--line-hard);
  padding-left: var(--s3);
  max-width: var(--measure);
}
.entry__src { margin: var(--s2) 0 0; }
.entry__src a { color: var(--fog); }
.entry__src a:hover { color: var(--spruce); }

.filters {
  display: flex; flex-wrap: wrap; gap: var(--s5);
  align-items: flex-end;
  padding: var(--s5) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: var(--s6) 0 var(--s5);
}
.filterset { display: flex; flex-direction: column; gap: var(--s2); }
.filterset__label {
  font-family: var(--data); font-size: var(--t-micro);
  letter-spacing: .1em; text-transform: uppercase; color: var(--fog);
}
.filterset__row { display: flex; flex-wrap: wrap; gap: var(--s2); }

.chipbtn {
  font-family: var(--data); font-size: var(--t-micro); font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-hard); border-radius: var(--radius);
  padding: 5px var(--s3); cursor: pointer;
  transition: none;
}
.chipbtn:hover { border-color: var(--ink); }
.chipbtn[aria-pressed="true"] {
  background: var(--toll); color: #14201c; border-color: var(--toll); font-weight: 600;
}

.searchbox {
  font-family: var(--data); font-size: var(--t-meta);
  background: var(--rime); color: var(--ink);
  border: 1px solid var(--line-hard); border-radius: var(--radius);
  padding: 7px var(--s3); min-width: 15rem;
}
.searchbox::placeholder { color: var(--fog); }

.count { font-family: var(--data); font-size: var(--t-micro); letter-spacing: .06em; color: var(--fog); }

.empty {
  padding: var(--s8) 0; text-align: center;
  border-bottom: 1px solid var(--line);
}
.empty p { max-width: none; }

/* --------------------------------------------------------------------------
   11. LISTS
   -------------------------------------------------------------------------- */

.ticklist { list-style: none; padding: 0; margin: 0; }
.ticklist li {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.ticklist li:last-child { border-bottom: 0; }
.ticklist li::before {
  content: "\2713";
  color: var(--toll-deep);
  font-family: var(--data);
  margin-right: var(--s3);
}

.bullets { margin: 0; padding-left: 1.1em; color: var(--ink-2); }
.bullets li { margin: var(--s2) 0; }
.bullets li::marker { color: var(--toll-deep); }
