:root {
  --bg: #0e0f12;
  --bg-elev: #17181d;
  --bg-elev-2: #15161a;
  --text: #ece8df;
  --text-dim: #c9c4b9;
  --muted: #8d897f;
  --faint: #9b978e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --gold: #f2b84b;
  --gold-ink: #16130b;
  --focus: #f2b84b;
  --myth: #ff7a6b;
  --myth-ink: #1a0f0d;
  --pop-bg: #2a1714;
  --pop-fg: #f0c1ba;
  --real-bg: #14231b;
  --real-fg: #bfe6cf;
  --green: #7ad3a8;
  --tabbar: rgba(14, 15, 18, 0.96);
  --accent: #f2b84b;
  --serif: "Fraunces", "Iowan Old Style", Palatino, "Noto Serif", serif;
  --sans: "IBM Plex Sans", Inter, "Noto Sans", sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f1ea;
  --bg-elev: #fffcf7;
  --bg-elev-2: #fffdf9;
  --text: #1a1915;
  --text-dim: #3d3a34;
  --muted: #5c574e;
  --faint: #5e594f;
  --line: rgba(28, 27, 23, 0.1);
  --line-strong: rgba(28, 27, 23, 0.16);
  --gold: #7a4e00;
  --gold-ink: #1c1404;
  --focus: #7a4e00;
  --myth: #b42318;
  --myth-ink: #fff8f6;
  --pop-bg: #fde8e4;
  --pop-fg: #6b241c;
  --real-bg: #e4f6ec;
  --real-fg: #0f3d2c;
  --green: #0d6b40;
  --tabbar: rgba(244, 241, 234, 0.96);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f1ea;
    --bg-elev: #fffcf7;
    --bg-elev-2: #fffdf9;
    --text: #1a1915;
    --text-dim: #3d3a34;
    --muted: #5c574e;
    --faint: #5e594f;
    --line: rgba(28, 27, 23, 0.1);
    --line-strong: rgba(28, 27, 23, 0.16);
    --gold: #7a4e00;
    --gold-ink: #1c1404;
    --focus: #7a4e00;
    --myth: #b42318;
    --myth-ink: #fff8f6;
    --pop-bg: #fde8e4;
    --pop-fg: #6b241c;
    --real-bg: #e4f6ec;
    --real-fg: #0f3d2c;
    --green: #0d6b40;
    --tabbar: rgba(244, 241, 234, 0.96);
    color-scheme: light;
  }
}

.cat-origins-of-names { --accent: #f2b84b; }
.cat-coined-terms { --accent: #7ad3a8; }
.cat-firsts-and-accidents { --accent: #7fb2ff; }
.cat-famous-outages-and-bugs { --accent: #ff7a6b; }
.cat-easter-eggs { --accent: #c79bff; }
.cat-people-behind-the-tools { --accent: #ffd27a; }

:root[data-theme="light"] .cat-origins-of-names,
:root[data-theme="light"] .cat-people-behind-the-tools { --accent: #8a5a00; }
:root[data-theme="light"] .cat-coined-terms { --accent: #0d6b40; }
:root[data-theme="light"] .cat-firsts-and-accidents { --accent: #1d4e9a; }
:root[data-theme="light"] .cat-famous-outages-and-bugs { --accent: #b42318; }
:root[data-theme="light"] .cat-easter-eggs { --accent: #6b3fa0; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .cat-origins-of-names,
  :root:not([data-theme="dark"]) .cat-people-behind-the-tools { --accent: #8a5a00; }
  :root:not([data-theme="dark"]) .cat-coined-terms { --accent: #0d6b40; }
  :root:not([data-theme="dark"]) .cat-firsts-and-accidents { --accent: #1d4e9a; }
  :root:not([data-theme="dark"]) .cat-famous-outages-and-bugs { --accent: #b42318; }
  :root:not([data-theme="dark"]) .cat-easter-eggs { --accent: #6b3fa0; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
::selection { background: rgba(242, 184, 75, 0.35); }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
img, svg { max-width: 100%; }
a { color: var(--gold); }
h1, h2, h3, p { overflow-wrap: anywhere; }

.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 {
  position: absolute;
  left: 12px;
  top: -48px;
  background: #f2b84b;
  color: #16130b;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 50;
  text-decoration: none;
  font-weight: 600;
}
.skip:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 16px;
  background: var(--bg);
  width: min(1040px, 100%);
  margin: 0 auto;
}
.brand {
  margin-right: auto;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--gold); }
.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text);
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}
.back-label { display: none; font-family: var(--sans); font-size: 14px; font-weight: 500; }
.where {
  flex: 1;
  min-width: 0;
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}
.where a { color: var(--text-dim); text-decoration: none; }
.theme-btn .when-light { display: none; }
:root[data-theme="light"] .theme-btn .when-dark { display: none; }
:root[data-theme="light"] .theme-btn .when-light { display: inline; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .when-dark { display: none; }
  :root:not([data-theme="dark"]) .theme-btn .when-light { display: inline; }
}
.theme-btn, .icon-btn {
  font-family: var(--mono);
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  min-height: 36px;
}
.theme-btn {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
}
.icon-btn {
  width: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: calc(64px + env(safe-area-inset-bottom));
  padding: 8px 6px env(safe-area-inset-bottom);
  background: var(--tabbar);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 64px;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.tab.on { color: var(--gold); }
.tab-icon { width: 22px; height: 22px; }
.saved-count {
  position: absolute;
  top: 0;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: #f2b84b;
  color: #16130b;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-wide, .layout-prose, .site-footer {
  width: min(1040px, calc(100% - 40px));
  margin-inline: auto;
}
.layout-prose { width: min(720px, calc(100% - 40px)); }
.layout-wide, .layout-prose { padding-top: 6px; padding-bottom: 12px; }

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 8vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 2px 0 0;
}
.lede { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 6px 0 0;
}
.kicker a { color: var(--muted); text-decoration: none; }
.note, .empty, .body-copy { color: var(--text-dim); }
.checked { margin: 0; color: var(--muted); font-size: 12px; }

.search {
  margin-top: 14px;
  height: 46px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}
.search-icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 15px;
  padding: 0;
}
.search input:focus { outline: none; }
.search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 32%, transparent);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.q-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.results, .index-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.index-list { margin-top: 0; }
.result, .index-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.index-list li:last-child .index-row,
.results .result:last-child { border-bottom: 0; }
.index-row { border-left: 3px solid var(--accent); align-items: center; }
.y {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  width: 42px;
  flex: none;
}
.index-main, .result-main { min-width: 0; }
.index-title, .result-title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
}
.index-meta, .result-meta, .snip {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  margin-top: 2px;
}
.snip { color: var(--text-dim); }
mark {
  background: rgba(242, 184, 75, 0.28);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}
.no-hits { margin: 0; padding: 14px; color: var(--text-dim); }

.block { margin-top: 4px; }
.sec {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 18px 0 10px;
}
.sec h2 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.sec a {
  color: var(--gold);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}
.sec .conf {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.conf-high { color: var(--green); }
.conf-medium { color: var(--gold); }
.sec.tight { margin-top: 16px; margin-bottom: 4px; }

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile {
  min-height: 92px;
  border-radius: 16px;
  padding: 11px 12px;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--accent) 18%, transparent), var(--bg-elev) 64%);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
}
.tile .g {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  color: var(--accent);
}
.tile .n {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding-right: 8px;
}
.tile .c {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.tl-scroll {
  overflow-x: auto;
  margin-inline: -4px;
  padding: 0 4px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.tl-track { position: relative; width: max-content; min-width: 100%; }
.tl-axis {
  position: absolute;
  left: 0;
  right: 0;
  top: 31px;
  height: 2px;
  background: linear-gradient(90deg, var(--line-strong), var(--gold) 62%, var(--line-strong));
}
.tl { display: flex; list-style: none; margin: 0; padding: 0; }
.ev { width: 112px; flex: none; scroll-snap-align: start; }
.ev a { display: block; text-decoration: none; color: inherit; min-height: 44px; }
.yy {
  display: block;
  height: 18px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  color: var(--gold);
}
.pin {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  margin: 8px 0 8px;
  position: relative;
  z-index: 1;
}
.tt {
  display: block;
  width: 100px;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--text-dim);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  text-decoration: none;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.chip.myth {
  background: var(--myth);
  color: var(--myth-ink);
  border: none;
  font-weight: 700;
}
.story h1 { margin-top: 12px; }
.hook {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
}
.sub {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.quote {
  margin: 16px 0 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--green);
}
.quote p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
}
.today-story > h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 7vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 12px 0 0;
  text-transform: none;
  color: var(--text);
}
.body p, .body-copy { font-size: 15.5px; line-height: 1.55; color: var(--text-dim); }
.body p { margin: 12px 0 0; }
.mythbox { margin-top: 16px; }
.mythbox h2, .why h2, .people h2, .related h2 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.why h2 { color: var(--gold); margin-bottom: 4px; }
.mythgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.mythgrid.one { grid-template-columns: 1fr; }
.mythgrid h3 {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mythgrid p { margin: 0; font-size: 12.5px; line-height: 1.4; }
.mythgrid .pop { background: var(--pop-bg); color: var(--pop-fg); padding: 10px 12px; }
.mythgrid .real { background: var(--real-bg); color: var(--real-fg); padding: 10px 12px; }
.why {
  margin-top: 14px;
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 10px 12px;
}
.why p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text-dim); }
.sources ol { margin: 8px 0 0; padding-left: 1.25rem; }
.sources li { margin-top: 10px; padding-left: 2px; }
.sources a { color: var(--text); }
.sources .host {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.tag-list, .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.tag-list a, .tag-cloud a {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
}
.tag-cloud span { color: var(--muted); }
.people, .related { margin-top: 18px; }
.mentor-list { display: flex; flex-direction: column; gap: 8px; }
.mentor {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  border-radius: 16px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
}
.av {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f2b84b;
  color: #15130c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  flex: none;
}
.mentor-copy { min-width: 0; }
.mentor .n { display: block; font-weight: 600; font-size: 14.5px; }
.mentor .r { font-family: var(--mono); font-size: 11px; color: var(--gold); font-weight: 500; }
.mentor .w { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.35; }
.on-watch { color: var(--gold); }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  flex: 1;
  min-height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  padding: 0 12px;
}
.btn.primary {
  background: #f2b84b;
  color: #16130b;
  border-color: transparent;
}
.btn[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  font-size: 14px;
}
.pager a { color: var(--text-dim); text-decoration: none; max-width: 48%; }
.pager .next { margin-left: auto; text-align: right; }
.hero-mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  color: var(--accent);
  margin: 10px 0;
}
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 14px;
  padding-bottom: 4px;
}
.filters button {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  padding: 8px 12px;
  min-height: 36px;
}
.filters button[aria-pressed="true"] {
  background: #f2b84b;
  color: #16130b;
  border-color: transparent;
}
.vtl { list-style: none; margin: 16px 0 0; padding: 0 0 0 4px; }
.vtl li { padding: 4px 0 12px; }
.vtl a {
  display: grid;
  grid-template-columns: 48px 18px 1fr;
  gap: 8px;
  align-items: start;
  text-decoration: none;
  color: inherit;
}
.vtl .yy { height: auto; padding-top: 1px; }
.vtl .pin { margin-top: 3px; }
.vtl-copy { min-width: 0; }
.full-link { display: inline-block; margin-top: 14px; font-weight: 600; }
.saved-row { display: flex; align-items: stretch; }
.saved-row .index-row { flex: 1; border-radius: 0; }
.unsave {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 0 12px;
}
.site-footer {
  color: var(--muted);
  font-size: 12.5px;
  padding-bottom: 8px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--muted); }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13.5px;
  z-index: 30;
  max-width: calc(100% - 32px);
}

@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tile { min-height: 108px; }
}
@media (min-width: 900px) {
  body { padding-bottom: 48px; }
  h1 { font-size: 46px; }
  .story h1 { font-size: 42px; }
  .tabbar {
    position: static;
    height: auto;
    width: auto;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    gap: 2px;
  }
  .tab {
    flex-direction: row;
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
    gap: 6px;
  }
  .tab-icon { width: 18px; height: 18px; }
  .saved-count { position: static; }
  .site-header { width: min(1040px, calc(100% - 48px)); padding-inline: 0; }
  .layout-wide, .site-footer { width: min(1040px, calc(100% - 48px)); }
  .layout-prose { width: min(720px, calc(100% - 48px)); }
  .back-label { display: inline; }
  .hook { font-size: 20px; }
}
@media (max-width: 359px) {
  .layout-wide, .layout-prose, .site-footer { width: min(1040px, calc(100% - 32px)); }
  .where { letter-spacing: 0.02em; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tl-scroll { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .btn.primary, .tile, .chip, .mentor, .index-row, .tabbar { border: 1px solid ButtonText; }
  .pin, .dot, .av { forced-color-adjust: none; }
}
