/* ============================================================================
   Internet Archive — concept redesign
   Design system: editorial, minimal, light-first with a dark toggle.
   Zero external dependencies (system fonts, inline SVG).
   ========================================================================== */

/* ---- self-hosted type (Geist, OFL) ---------------------------------------- */
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/geist-sans.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ---- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

/* ---- tokens --------------------------------------------------------------- */
:root {
  --paper:   #fbfbfa;
  --paper-2: #f3f3f2;
  --card:    #ffffff;
  --ink:     #18181b;
  --ink-2:   #56565d;
  --muted:   #78787f;
  --faint:   #a1a1a8;
  --line:    #ebebea;
  --line-2:  #e0e0df;
  --rule:    #d4d4d3;

  --accent:      #cf3b2c;
  --accent-ink:  #b32e20;
  --accent-soft: #fbebe8;

  /* per-media-type accents — muted, tasteful */
  --web:      #4a6b8f;
  --texts:    #9a7a45;
  --video:    #a5546a;
  --audio:    #6c5f9a;
  --software: #4f7d63;
  --images:   #467882;

  --shadow: 0 1px 2px rgba(17,17,20,.04);
  --shadow-lg: 0 1px 3px rgba(17,17,20,.06), 0 18px 44px -18px rgba(17,17,20,.22);

  --radius:    8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --maxw: 1180px;

  --font-sans:  "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: var(--font-sans);   /* all-sans system; headings share the sans */
  --font-mono:  "Geist Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --header-h: 62px;
  --subnav-h: 46px;
}

:root[data-theme="dark"] {
  --paper:   #0b0b0c;
  --paper-2: #161618;
  --card:    #131315;
  --ink:     #f2f2f3;
  --ink-2:   #b0b0b8;
  --muted:   #8a8a92;
  --faint:   #62626a;
  --line:    #232326;
  --line-2:  #2d2d31;
  --rule:    #37373c;

  --accent:      #f0604e;
  --accent-ink:  #f5735f;
  --accent-soft: #2a1512;

  --web:      #6b93bd;
  --texts:    #bfa06a;
  --video:    #c77890;
  --audio:    #9184c2;
  --software: #6fa585;
  --images:   #6aa0ab;

  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 1px 3px rgba(0,0,0,.5), 0 24px 60px -20px rgba(0,0,0,.8);
}

/* ---- base ----------------------------------------------------------------- */
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); line-height: 1.02; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.35rem); }
h3 { font-size: 1.2rem; }

p { color: var(--ink-2); }
strong { font-weight: 600; color: var(--ink); }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

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

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 4vw, 40px); }
.section { padding-block: clamp(40px, 5vw, 62px); }
.section--tight { padding-block: clamp(30px, 3.5vw, 44px); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.hide { display: none !important; }
.serif { font-family: var(--font-serif); }

.eyebrow {
  font-family: var(--font-mono); font-size: .68rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); display: inline-block;
}

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 16px;
}
.section-head .eyebrow { margin-bottom: 10px; }
.section-head p { max-width: 46ch; margin-top: 6px; }
.section-head .link-more { color: var(--ink-2); font-weight: 500; font-size: .86rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: gap .15s, color .15s; }
.section-head .link-more:hover { gap: 9px; color: var(--accent); }

/* ---- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { opacity: .86; }
/* Donate keeps the brand red as the single colour CTA */
.header-actions .btn-primary, .drawer .btn-primary { background: var(--accent); color: #fff; }
.header-actions .btn-primary:hover, .drawer .btn-primary:hover { background: var(--accent-ink); opacity: 1; }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--rule); }
/* on the always-dark Wayback band, primary CTA uses brand red for contrast */
.wb-spotlight .btn-primary { background: var(--accent); color: #fff; }
.wb-spotlight .btn-primary:hover { background: var(--accent-ink); opacity: 1; }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: var(--accent); color: #fbf7ee; }
.btn-sm { padding: 8px 14px; font-size: .82rem; }
.btn-block { width: 100%; }

/* ---- pill / chip ---------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2);
  font-size: .84rem; font-weight: 500; transition: all .14s ease;
}
.pill:hover { color: var(--ink); border-color: var(--rule); }
.pill[aria-pressed="true"], .pill.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--radius-xs);
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--paper-2); color: var(--muted); border: 1px solid var(--line);
}
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ============================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.1) blur(16px);
  backdrop-filter: saturate(1.1) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-bar { height: var(--header-h); display: flex; align-items: center; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand .mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand .wordmark { font-family: var(--font-serif); font-weight: 600; font-size: 1.16rem; letter-spacing: -.01em; }
.brand .chip {
  font-family: var(--font-mono); font-size: .56rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); padding: 2px 5px; border-radius: 0;
  align-self: center;
}
@media (max-width: 560px) { .brand .wordmark { display: none; } }

.header-search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 9px;
  padding: 8px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--card); color: var(--muted); transition: border-color .15s;
}
.header-search:hover { border-color: var(--rule); }
.header-search svg { width: 17px; height: 17px; flex-shrink: 0; }
.header-search .kbd { margin-left: auto; }
.header-search .ph { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .header-search { max-width: none; } }

.kbd {
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px;
  background: var(--paper-2);
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.header-actions .txt-link { font-size: .9rem; font-weight: 600; color: var(--ink-2); padding: 8px 6px; }
.header-actions .txt-link:hover { color: var(--accent); }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center;
  color: var(--ink-2); border: 1px solid transparent; transition: background .14s, color .14s, border-color .14s;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

.hamburger { display: none; }
@media (max-width: 760px) {
  .header-search { display: none; }
  .header-actions .txt-link { display: none; }
  .hamburger { display: grid; }
}

/* subnav */
.subnav { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); }
.subnav-bar { height: var(--subnav-h); display: flex; align-items: center; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.subnav-bar::-webkit-scrollbar { display: none; }
.subnav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 9px;
  font-size: .88rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: background .14s, color .14s;
}
.subnav a:hover { background: var(--paper-2); color: var(--ink); }
.subnav a.is-active { color: var(--accent); background: var(--accent-soft); }
.subnav a .mt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.subnav .spacer { flex: 1; }
.subnav .save-link { color: var(--accent); }

/* mobile drawer */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(84vw, 320px);
  background: var(--paper); border-left: 1px solid var(--line); padding: 20px;
  transform: translateX(100%); transition: transform .24s ease; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.drawer.open { transform: none; }
.drawer .drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer a { padding: 11px 12px; border-radius: 10px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.drawer a:hover { background: var(--paper-2); color: var(--ink); }
.drawer hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }

/* ============================================================================
   COMMAND PALETTE
   ========================================================================== */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,19,16,.45);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
  opacity: 0; pointer-events: none; transition: opacity .16s;
}
.cmdk-backdrop.open { opacity: 1; pointer-events: auto; }
.cmdk {
  width: min(600px, 100%); background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  transform: translateY(-8px) scale(.99); transition: transform .18s ease;
}
.cmdk-backdrop.open .cmdk { transform: none; }
.cmdk-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-input-row svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.cmdk-input-row input { flex: 1; border: none; outline: none; background: none; font-size: 1.05rem; }
.cmdk-input-row input::placeholder { color: var(--faint); }
.cmdk-list { max-height: min(52vh, 420px); overflow-y: auto; padding: 8px; }
.cmdk-group-label { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 10px 12px 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  width: 100%; text-align: left; color: var(--ink-2);
}
.cmdk-item .ci-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--paper-2); flex-shrink: 0; }
.cmdk-item .ci-icon svg { width: 16px; height: 16px; }
.cmdk-item .ci-title { font-weight: 600; color: var(--ink); }
.cmdk-item .ci-sub { font-size: .8rem; color: var(--muted); }
.cmdk-item.is-active, .cmdk-item:hover { background: var(--paper-2); }
.cmdk-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }
.cmdk-empty { padding: 30px; text-align: center; color: var(--muted); }

/* ============================================================================
   HOME — hero, stats, media grid, curated rows
   ========================================================================== */
.hero { position: relative; padding-block: clamp(40px, 6vw, 72px); border-bottom: 1.5px solid var(--rule); }
/* editorial dateline strip above the headline */
.dateline {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  padding-bottom: 16px; margin-bottom: 26px; border-bottom: 1px solid var(--line);
}
.dateline .sep { color: var(--faint); }
.dateline b { color: var(--accent); font-weight: 600; }
.hero-inner { max-width: 940px; }
.hero h1 { margin-top: 0; }
.hero h1 .accent { color: var(--ink); font-style: normal; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.hero .lede { font-size: clamp(1.05rem, 1.8vw, 1.28rem); color: var(--ink-2); margin-top: 22px; max-width: 60ch; line-height: 1.5; }

/* universal search */
.usearch { margin-top: 32px; max-width: 680px; }
.usearch-field {
  display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.usearch-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--paper-2); }
.usearch-field > svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.usearch-field input { flex: 1; border: none; outline: none; background: none; font-size: 1.04rem; padding: 9px 0; }
.usearch-field input::placeholder { color: var(--faint); }
.usearch-scopes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; align-items: center; }
.usearch-scopes .scope-label { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-right: 4px; }
.usearch-scopes .pill { cursor: pointer; }

/* search suggest dropdown */
.suggest {
  position: relative;
}
.suggest-panel {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 40;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; display: none;
}
.suggest-panel.open { display: block; }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; width: 100%; text-align: left; }
.suggest-item:hover, .suggest-item.is-active { background: var(--paper-2); }
.suggest-item .si-ico { color: var(--muted); display: grid; place-items: center; width: 22px; }
.suggest-item .si-ico svg { width: 16px; height: 16px; }
.suggest-item .si-title { color: var(--ink); font-weight: 500; }
.suggest-item .si-title mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 2px; }
.suggest-item .si-meta { margin-left: auto; font-size: .78rem; color: var(--faint); }

/* stat band */
.stat-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.stat { background: var(--paper); padding: 28px 24px; }
.stat .num { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.stat .num .suffix { color: var(--accent); }
.stat .lbl { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); margin-top: 12px; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* media type grid — catalog tiles */
.media-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 980px) { .media-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
.media-card {
  --mc: var(--muted);
  display: flex; flex-direction: column; gap: 14px; padding: 20px 18px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--card); transition: background .15s; position: relative;
}
.media-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--mc); transition: width .16s ease; }
.media-card:hover { background: var(--paper-2); }
.media-card:hover::after { width: 3px; }
.media-card .mc-ico {
  width: 40px; height: 40px; border-radius: var(--radius-xs); display: grid; place-items: center;
  color: var(--mc); background: color-mix(in srgb, var(--mc) 11%, transparent); border: 1px solid color-mix(in srgb, var(--mc) 28%, transparent);
}
.media-card .mc-ico svg { width: 22px; height: 22px; }
.media-card .mc-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.1rem; }
.media-card .mc-count { font-family: var(--font-mono); font-size: .71rem; color: var(--muted); margin-top: auto; text-transform: uppercase; letter-spacing: .06em; }
.media-card .mc-count b { color: var(--mc); font-weight: 600; }

/* featured editorial hero */
.featured {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); overflow: hidden;
}
.featured .feat-media { aspect-ratio: 4/3; position: relative; }
.featured .feat-media svg, .featured .feat-media img { width: 100%; height: 100%; object-fit: cover; }
.featured .feat-body { padding: clamp(24px, 3.5vw, 46px) clamp(24px, 3.5vw, 46px) clamp(24px, 3.5vw, 46px) 0; }
.featured h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 14px 0 12px; }
.featured .feat-body p { font-size: 1.02rem; }
.featured .feat-meta { display: flex; gap: 16px; margin: 20px 0 24px; font-size: .86rem; color: var(--muted); flex-wrap: wrap; }
.featured .feat-meta span { display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 820px) {
  .featured { grid-template-columns: 1fr; }
  .featured .feat-body { padding: clamp(22px, 5vw, 34px); padding-top: 0; }
}

/* curated row (horizontal scroll) */
.rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 18px; margin: -4px -4px 0; scrollbar-width: thin; }
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.rail > * { scroll-snap-align: start; flex: 0 0 auto; width: 210px; }
@media (max-width: 520px) { .rail > * { width: 158px; } }

/* ---- item card — catalog entry -------------------------------------------- */
.card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); overflow: hidden; transition: border-color .15s, background .15s;
}
.card:hover { border-color: var(--rule); }
.card:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.card .card-cover { position: relative; aspect-ratio: 3/4; overflow: hidden; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.card .card-cover svg, .card .card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card .mt-badge {
  position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: var(--radius-xs); font-family: var(--font-mono); font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  background: var(--card); color: var(--ink-2); border: 1px solid var(--line-2);
}
.card .mt-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.card .card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .card-meta { font-family: var(--font-mono); font-size: .64rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.card .card-title { font-family: var(--font-serif); font-weight: 600; font-size: 1rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .card-sub { font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card .card-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: .68rem; color: var(--faint); }
.card .card-foot span { display: inline-flex; align-items: center; gap: 4px; }
.card .card-foot svg { width: 12px; height: 12px; }

/* ============================================================================
   WAYBACK SPOTLIGHT / PAGE
   ========================================================================== */
.wb-spotlight {
  background: var(--ink); color: var(--paper); border-radius: calc(var(--radius) + 6px); overflow: hidden;
  padding: clamp(28px, 4vw, 52px); position: relative;
}
:root[data-theme="dark"] .wb-spotlight { background: #0c0b09; border: 1px solid var(--line); }
.wb-spotlight h2 { color: #fff; }
:root[data-theme="dark"] .wb-spotlight h2 { color: var(--ink); }
.wb-spotlight p { color: rgba(255,255,255,.7); }
:root[data-theme="dark"] .wb-spotlight p { color: var(--muted); }
.wb-spotlight .wb-inner { max-width: 620px; position: relative; z-index: 1; }
.wb-timeinput {
  display: flex; gap: 10px; margin-top: 22px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 7px 7px 7px 18px; align-items: center;
}
:root[data-theme="dark"] .wb-timeinput { background: var(--card); border-color: var(--line-2); }
.wb-timeinput svg { width: 20px; color: rgba(255,255,255,.7); flex-shrink: 0; }
:root[data-theme="dark"] .wb-timeinput svg { color: var(--muted); }
.wb-timeinput input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 1rem; }
:root[data-theme="dark"] .wb-timeinput input { color: var(--ink); }
.wb-timeinput input::placeholder { color: rgba(255,255,255,.5); }
:root[data-theme="dark"] .wb-timeinput input::placeholder { color: var(--faint); }

/* wayback page hero */
.wb-hero { padding-block: clamp(40px, 6vw, 72px); text-align: center; }
.wb-hero .usearch { margin-inline: auto; }
.wb-searchbar {
  display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 8px 8px 8px 20px; box-shadow: var(--shadow); max-width: 680px; margin: 26px auto 0;
}
.wb-searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.wb-searchbar > svg { width: 20px; color: var(--muted); flex-shrink: 0; }
.wb-searchbar input { flex: 1; border: none; outline: none; background: none; font-size: 1.02rem; }
.wb-quick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.wb-quick button { font-size: .82rem; }

/* result panel */
.wb-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wb-panel-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wb-panel-head .fav { width: 30px; height: 30px; border-radius: 7px; background: var(--paper-2); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.wb-url { font-family: var(--font-mono); font-size: .92rem; color: var(--ink); word-break: break-all; }
.wb-panel-head .wb-summary { margin-left: auto; font-size: .84rem; color: var(--muted); text-align: right; }
.wb-panel-head .wb-summary b { color: var(--accent); font-size: 1.05rem; font-family: var(--font-serif); }

/* year strip */
.wb-years { display: flex; gap: 4px; padding: 16px 22px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.wb-years::-webkit-scrollbar { display: none; }
.wb-year-btn {
  flex: 0 0 auto; min-width: 62px; text-align: center; padding: 8px 10px; border-radius: 10px;
  border: 1px solid transparent; transition: background .14s, border-color .14s;
}
.wb-year-btn:hover { background: var(--paper-2); }
.wb-year-btn.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.wb-year-btn .y { font-weight: 700; font-size: .95rem; }
.wb-year-btn.is-active .y { color: var(--accent-ink); }
.wb-year-btn .c { font-size: .72rem; color: var(--faint); }
.wb-year-btn .bar { height: 4px; border-radius: 3px; background: var(--line-2); margin-top: 6px; overflow: hidden; }
.wb-year-btn .bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* calendar heatmap */
.wb-heatmap { padding: 22px; }
.wb-heat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 12px; }
.wb-heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13px, 1fr)); gap: 4px; }
.wb-cell { aspect-ratio: 1; border-radius: 3px; background: var(--paper-2); transition: transform .1s; cursor: pointer; }
.wb-cell:hover { transform: scale(1.35); outline: 2px solid var(--accent); z-index: 2; }
.wb-cell.l1 { background: color-mix(in srgb, var(--accent) 22%, var(--paper-2)); }
.wb-cell.l2 { background: color-mix(in srgb, var(--accent) 45%, var(--paper-2)); }
.wb-cell.l3 { background: color-mix(in srgb, var(--accent) 70%, var(--paper-2)); }
.wb-cell.l4 { background: var(--accent); }
.wb-cell.is-sel { outline: 2.5px solid var(--ink); outline-offset: 1px; z-index: 3; }
.wb-legend { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); }
.wb-legend .wb-cell { width: 13px; cursor: default; }
.wb-legend .wb-cell:hover { transform: none; outline: none; }

/* scrubber slider */
.wb-scrub { padding: 6px 22px 22px; }
.wb-scrub-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.wb-range { width: 100%; accent-color: var(--accent); height: 6px; }
input[type="range"].wb-range { -webkit-appearance: none; appearance: none; background: var(--line-2); border-radius: 999px; height: 6px; }
input[type="range"].wb-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--card); box-shadow: var(--shadow); cursor: grab; }
input[type="range"].wb-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--card); cursor: grab; }

/* snapshot preview + compare */
.wb-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .wb-preview-grid { grid-template-columns: 1fr; } }
.wb-shot { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); }
.wb-shot-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .84rem; }
.wb-shot-head .date { font-weight: 700; }
.wb-shot-head .swap { color: var(--accent); font-weight: 600; font-size: .8rem; }
.wb-shot-frame { aspect-ratio: 16/10; background: var(--paper-2); position: relative; }
.wb-shot-frame svg, .wb-shot-frame img { width: 100%; height: 100%; object-fit: cover; }
.wb-shot-foot { padding: 10px 14px; font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; }

/* ============================================================================
   BROWSE — layout, facets, toolbar, grid/list
   ========================================================================== */
.browse-layout { display: grid; grid-template-columns: 250px 1fr; gap: 34px; align-items: start; }
@media (max-width: 860px) { .browse-layout { grid-template-columns: 1fr; } }

.facets { position: sticky; top: calc(var(--header-h) + var(--subnav-h) + 16px); display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 860px) { .facets { position: static; display: none; } .facets.open { display: flex; } }
.facet h4 { font-family: var(--font-sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 10px; font-weight: 700; }
.facet-list { display: flex; flex-direction: column; gap: 2px; }
.facet-opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; width: 100%; text-align: left; font-size: .9rem; color: var(--ink-2); transition: background .12s; }
.facet-opt:hover { background: var(--paper-2); }
.facet-opt .box { width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 5px; flex-shrink: 0; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.facet-opt .box svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.facet-opt.is-on .box { background: var(--accent); border-color: var(--accent); }
.facet-opt.is-on .box svg { opacity: 1; }
.facet-opt .mt-dot { width: 8px; height: 8px; border-radius: 50%; }
.facet-opt .cnt { margin-left: auto; font-size: .78rem; color: var(--faint); }
.facet-opt.is-on { color: var(--ink); font-weight: 600; }
.facet-year { display: flex; align-items: center; gap: 10px; }
.facet-year input { width: 100%; }
.facet-year .yr-out { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); white-space: nowrap; }

.browse-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.browse-toolbar .count { font-size: .92rem; color: var(--muted); }
.browse-toolbar .count b { color: var(--ink); }
.browse-toolbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.select {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); font-size: .88rem; font-weight: 600;
}
.select select { border: none; background: none; outline: none; font-weight: 600; }
.viewtoggle { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.viewtoggle button { padding: 8px 10px; color: var(--muted); }
.viewtoggle button.is-active { background: var(--ink); color: var(--paper); }
.viewtoggle svg { width: 17px; height: 17px; }
.filter-mobile-btn { display: none; }
@media (max-width: 860px) { .filter-mobile-btn { display: inline-flex; } }

.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.active-chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: .82rem; font-weight: 600;
}
.chip button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--accent-ink); }
.chip button:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.chip svg { width: 12px; height: 12px; }
.chip-clear { color: var(--accent); font-weight: 600; font-size: .82rem; padding: 5px 8px; }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
@media (max-width: 520px) { .results-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* list view */
.results-grid.is-list { grid-template-columns: 1fr; gap: 10px; }
.results-grid.is-list .card { flex-direction: row; align-items: stretch; }
.results-grid.is-list .card .card-cover { width: 90px; aspect-ratio: 3/4 !important; flex-shrink: 0; }
.results-grid.is-list .card .card-body { padding: 14px 16px; }
.results-grid.is-list .card .card-title { -webkit-line-clamp: 1; font-size: 1rem; }
.results-grid.is-list .card .mt-badge { display: none; }
.results-grid.is-list .card .card-sub { -webkit-line-clamp: 2; }

.no-results { text-align: center; padding: 60px 20px; color: var(--muted); }
.no-results svg { width: 40px; height: 40px; margin-bottom: 12px; color: var(--faint); }

/* ============================================================================
   ITEM DETAIL
   ========================================================================== */
.item-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) 340px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .item-layout { grid-template-columns: 1fr; } }

.reader {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.reader-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.reader-toolbar .r-title { font-weight: 600; color: var(--ink); }
.reader-toolbar .r-tools { margin-left: auto; display: flex; gap: 4px; }
.reader-stage { aspect-ratio: 3/4; background: var(--paper-2); position: relative; display: grid; place-items: center; }
.reader-stage svg, .reader-stage img { width: 100%; height: 100%; object-fit: contain; }
.reader--video .reader-stage, .reader--audio .reader-stage { aspect-ratio: 16/9; }
.reader-controls { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.reader-controls .play { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
:root[data-theme="dark"] .reader-controls .play { color: #1a0f0c; }
.reader-controls .progress { flex: 1; height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.reader-controls .progress > i { display: block; height: 100%; width: 34%; background: var(--accent); border-radius: 999px; }
.reader-controls .time { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }

.item-side { display: flex; flex-direction: column; gap: 18px; }
.item-head .tag { margin-bottom: 12px; }
.item-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.item-head .creator { color: var(--muted); margin-top: 8px; font-size: 1.02rem; }
.item-head .creator a { color: var(--accent); font-weight: 600; }
.item-metrics { display: flex; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.item-metrics .m .v { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; }
.item-metrics .m .k { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.item-actions { display: flex; flex-direction: column; gap: 10px; }
.item-actions .row { display: flex; gap: 10px; }
.item-actions .row > * { flex: 1; }
.rating { display: flex; align-items: center; gap: 6px; color: var(--texts); }
.rating svg { width: 16px; height: 16px; }
.download-list { display: flex; flex-direction: column; gap: 2px; }
.download-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: background .12s; }
.download-opt:hover { background: var(--paper-2); }
.download-opt .fmt { width: 44px; height: 32px; border-radius: 6px; background: var(--paper-2); display: grid; place-items: center; font-size: .64rem; font-weight: 800; color: var(--muted); flex-shrink: 0; }
.download-opt .d-name { font-weight: 600; font-size: .9rem; }
.download-opt .d-size { font-size: .78rem; color: var(--muted); }
.download-opt .dl { margin-left: auto; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 34px 0 22px; }
.tab { padding: 12px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-color: var(--accent); }
.tabpane { display: none; }
.tabpane.is-active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.prose { max-width: 68ch; }
.prose p { margin-bottom: 14px; }
.meta-table { width: 100%; border-collapse: collapse; }
.meta-table td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
.meta-table td:first-child { width: 160px; color: var(--muted); font-weight: 600; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* reviews */
.review { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.review .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.review .r-name { font-weight: 600; }
.review .r-date { font-size: .8rem; color: var(--faint); }
.review .r-body { margin-top: 6px; }

/* ============================================================================
   ABOUT / redesign notes
   ========================================================================== */
.about-hero { padding-block: clamp(48px, 7vw, 90px); max-width: 760px; }
.about-hero h1 { margin: 16px 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 8px 0; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.compare .col { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--card); }
.compare .col.before { background: var(--paper-2); }
.compare .col h4 { font-family: var(--font-sans); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.compare .col.before h4 { color: var(--muted); }
.compare .col.after h4 { color: var(--accent); }
.compare ul { display: flex; flex-direction: column; gap: 10px; }
.compare li { display: flex; gap: 10px; font-size: .92rem; color: var(--ink-2); }
.compare li svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.compare .before li svg { color: var(--faint); }
.compare .after li svg { color: var(--software); }

.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 700px) { .feature-list { grid-template-columns: 1fr; } }
.feature {
  display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.feature:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.feature .f-num { font-family: var(--font-serif); font-size: 1.4rem; color: var(--accent); font-weight: 600; line-height: 1; flex-shrink: 0; width: 34px; }
.feature h3 { font-family: var(--font-sans); font-size: 1.02rem; margin-bottom: 5px; }
.feature p { font-size: .9rem; }

/* ============================================================================
   FOOTER
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-2); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; padding-block: clamp(40px, 5vw, 60px); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { font-size: .9rem; max-width: 34ch; }
.footer-brand .social { display: flex; gap: 8px; margin-top: 16px; }
.footer-col h5 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 14px; font-weight: 700; }
.footer-col a { display: block; padding: 5px 0; font-size: .9rem; color: var(--ink-2); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bottom .disclaimer { font-size: .82rem; color: var(--muted); max-width: 60ch; }
.footer-bottom .disclaimer b { color: var(--ink-2); }

/* generic reveal on scroll — scoped to .js so no-JS users always see content */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 120;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast svg { width: 17px; height: 17px; color: var(--software); }

/* skip link */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { left: 16px; }
