:root {
  --bg: #0b0b0d;
  --panel: #131316;
  --ink: #ece9e2;
  --ink-dim: #9a978f;
  --ink-faint: #6a675f;
  --line: #262529;
  --line-soft: rgba(255, 255, 255, 0.05);
  --accent: #d9a441;   /* ochre — the longer thing */
  --accent-2: #8aa0b6; /* slate — the shorter thing */
  --maxw: 940px;
  --rail: 64px;
  --gut: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(36px, 7vw, 80px) clamp(20px, 5vw, 36px) 48px;
}

a { color: inherit; }

::selection { background: rgba(217, 164, 65, 0.28); }

/* ---------- Header ---------- */
.site-header {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-bottom: clamp(40px, 7vw, 72px);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 18px;
}
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: clamp(38px, 8.5vw, 78px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  color: var(--ink);
}
.subtitle {
  max-width: 56ch;
  margin: 0;
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--ink-dim);
}

/* ---------- Compare panel ---------- */
.compare {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(20px, 4vw, 32px);
  margin-bottom: clamp(52px, 9vw, 96px);
}

.compare-pickers {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.picker {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.picker span {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  font-weight: 600;
}
select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 13px 38px 13px 14px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='none' stroke='%236a675f' stroke-width='1.4' d='M1 1l4.5 4.5L10 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.15s;
}
select:hover { border-color: var(--ink-faint); }
select:focus { outline: none; border-color: var(--accent); }

.swap {
  flex: 0 0 auto;
  height: 48px;
  width: 48px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-dim);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.swap:hover { color: var(--accent); border-color: var(--accent); }

.readout {
  /* Always reserve two lines and centre within them, so the count-up and
     switching between short/long comparisons never shifts the layout below.
     The text lives in an inner element (a single flex item) so normal inline
     flow — and the spaces between words — is preserved. */
  margin: 30px 0 26px;
  min-height: calc(2 * 1.3 * clamp(21px, 4.2vw, 34px));
  display: flex;
  align-items: center;
  justify-content: center;
}
.readout-inner {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-size: clamp(21px, 4.2vw, 34px);
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}
.readout em { font-style: italic; color: var(--ink-dim); }
.readout .mult { font-weight: 600; white-space: nowrap; }
.readout .nameA { color: var(--accent); font-weight: 600; }
.readout .nameB { color: var(--accent-2); font-weight: 600; }

/* Comparison stats — the two actual durations, side by side */
.compare-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  border-left-width: 2px;
}
.stat-a { border-left-color: var(--accent); }
.stat-b { border-left-color: var(--accent-2); }
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-emoji { font-size: 17px; line-height: 1; }
.stat-name { font-weight: 600; font-size: 14px; }
.stat-dur {
  margin-top: 8px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(19px, 3.4vw, 26px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-a .stat-dur { color: var(--accent); }
.stat-b .stat-dur { color: var(--accent-2); }

.analogy {
  margin: 20px auto 0;
  max-width: 54ch;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.5;
  color: var(--ink-dim);
  text-align: center;
  text-wrap: balance;
}
.analogy strong { color: var(--ink); font-weight: 600; }

.surprise {
  display: block;
  margin: 22px auto 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.surprise:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Vertical timeline ---------- */
.scale-section { margin-bottom: 48px; }
.scale-head { margin-bottom: 10px; }
.scale-head h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(24px, 5vw, 34px);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.hint { color: var(--ink-faint); font-size: 13.5px; margin: 0; max-width: 50ch; }

.timeline {
  position: relative;
  margin-top: 28px;
}

.spine {
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--rail) + (100% - var(--rail)) / 2);
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line) 4%, var(--line) 96%, transparent);
  transform: translateX(-50%);
}

.grid { position: absolute; inset: 0; pointer-events: none; }
.gridline {
  position: absolute;
  left: var(--rail); right: 0;
  height: 1px;
  background: var(--line-soft);
}
.gridline span {
  position: absolute;
  left: 0;
  top: -7px;
  width: calc(var(--rail) - 10px);
  margin-left: calc(-1 * var(--rail));
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nodes { position: absolute; inset: 0; }

.node {
  position: absolute;
  left: 0; right: 0;
  transform: translateY(-50%);
}
.node-dot {
  position: absolute;
  left: calc(var(--rail) + (100% - var(--rail)) / 2);
  top: 0;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background 0.18s, transform 0.18s;
}

.node-card {
  position: absolute;
  top: 0;
  transform: translateY(-50%);
  cursor: pointer;
  padding: 2px 0;
}
.node.right .node-card {
  left: calc(var(--rail) + (100% - var(--rail)) / 2 + var(--gut));
  right: 8px;
  text-align: left;
}
.node.left .node-card {
  left: var(--rail);
  right: calc((100% - var(--rail)) / 2 + var(--gut));
  text-align: right;
}
.node-card::before {
  content: "";
  position: absolute;
  top: 50%;
  width: var(--gut);
  height: 1px;
  background: var(--line);
}
.node.right .node-card::before { right: 100%; }
.node.left .node-card::before { left: 100%; }

.node-head { display: flex; align-items: center; gap: 8px; }
.node.left .node-head { flex-direction: row-reverse; }
.node-emoji { font-size: 17px; line-height: 1; transition: transform 0.18s; }
.node-name { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
.node-dur {
  font-size: 12px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.node-fact {
  display: none;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-dim);
  margin-top: 6px;
  max-width: 36ch;
}
.node.left .node-fact { margin-left: auto; }

.node:hover, .node.active { z-index: 6; }
.node:hover .node-emoji, .node.active .node-emoji { transform: scale(1.22); }
.node:hover .node-name, .node.active .node-name { color: #fff; }
.node:hover .node-fact, .node.active .node-fact { display: block; }
.node:hover .node-dot, .node.active .node-dot { background: var(--ink); transform: scale(1.25); }

/* When a card expands its fact, float it as a solid popover so it stays legible
   over neighbouring labels (especially in the tight mobile columns). */
.node:hover .node-card, .node.active .node-card {
  background: #17171b;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 12px;
  margin: -9px -12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.node.sel-a .node-dot { background: var(--accent); transform: scale(1.4); }
.node.sel-b .node-dot { background: var(--accent-2); transform: scale(1.4); }
.node.sel-a .node-name { color: var(--accent); }
.node.sel-b .node-name { color: var(--accent-2); }

/* ---------- Honesty + footer ---------- */
.honesty {
  max-width: 62ch;
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.65;
}
.honesty strong { color: var(--ink-dim); font-weight: 600; }

.site-footer {
  padding: 26px clamp(20px, 5vw, 36px) 40px;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  color: var(--ink-faint);
  font-size: 13px;
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.15s, border-color 0.15s;
}
.site-footer a:hover { color: var(--accent); border-color: var(--accent); }
.site-footer .dot { opacity: 0.45; }

@media (max-width: 600px) {
  :root { --rail: 50px; --gut: 11px; }
  .compare-pickers { flex-direction: column; align-items: stretch; gap: 8px; }
  .picker { flex: 0 0 auto; }       /* don't let flex-basis become a tall height */
  .swap {
    align-self: center;
    height: 40px; width: 40px;
    transform: rotate(90deg);        /* point the swap arrows up/down between stacked selects */
  }
  .node-name { font-size: 13px; }
  .node-fact { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
