/* ==========================================================================
   V2A genealogy — styles

   Light theme. The left rail is a time ruler; each paper is a card whose
   left edge is coloured by the literature it belongs to:

     model       blue    --k-gen
     evaluation  green   --k-eval
     dataset     purple  --k-data
     other       grey    --k-other

   The edge colour is set per card in app.js as --edge, and the card border
   picks up a faint tint of the same hue.
   ========================================================================== */

:root {
  /* surface */
  --bg:        #FFFFFF;
  --bg-2:      #FBFCFD;
  --rule:      #D3D9DF;
  --rule-soft: #E6EAEE;

  /* ink */
  --ink:       #15191E;
  --ink-2:     #4B5661;
  --ink-3:     #7C8794;

  /* track colours — the card edge */
  --k-gen:     #0096FF;   /* model      */
  --k-eval:    #50C878;   /* evaluation */
  --k-data:    #FF7518;   /* dataset    */
  --k-other:   #6B7684;   /* other      */

  /* axis hues — chips and pills */
  --c-kind:    #5A6673;
  --c-rep:     #96670F;
  --c-inj:     #0E7C88;
  --c-bb:      #3D5A80;
  --c-ctrl:    #C81E52;
  --c-meas:    #147A56;

  /* control-surface ramp: cool (no control) → hot (interactive editing) */
  --ramp-none:        #8A939F;
  --ramp-text:        #4A7B95;
  --ramp-global:      #24857F;
  --ramp-curve:       #96670F;
  --ramp-span:        #C2562D;
  --ramp-interactive: #C81E52;

  --gutter: clamp(1rem, 3vw, 2.5rem);
  --radius: 3px;
}

* { box-sizing: border-box; }
 
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
 
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
}
 
a { color: inherit; }
 
.skip { position: absolute; left: -9999px; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }
 
:focus-visible { outline: 2px solid var(--k-gen); outline-offset: 2px; }
 
/* ───────────────────────────── masthead ───────────────────────────── */
 
.masthead { border-bottom: 1px solid var(--rule); }
.masthead-in {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.25rem) var(--gutter) clamp(1.25rem, 2.5vw, 1.75rem);
}
 
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: .7rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .55rem;
}
 
h1 {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 3.9rem);
  line-height: 1;
  letter-spacing: -.025em;
  margin: 0;
  text-wrap: balance;
}
 
.standfirst {
  max-width: 60ch;
  color: var(--ink-2);
  font-size: 1rem;
  margin: .7rem 0 1.35rem;
}
 
/* legend doubles as the running count */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: .69rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.legend li { display: flex; align-items: center; gap: .5rem; }
.legend .sw { width: 15px; height: 3px; border-radius: 2px; background: currentColor; }
.legend .tally {
  margin-left: auto;
  color: var(--ink-2);
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.legend .tally b { color: var(--ink); font-weight: 600; }
 
/* ─────────────────────────────── frame ────────────────────────────── */
 
.frame {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 var(--gutter) 5rem;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 350px;
  gap: 0 clamp(1.25rem, 2.5vw, 2.75rem);
  align-items: start;
}
 
/* ──────────────────────────── era ruler ───────────────────────────── */
 
.rail { position: sticky; top: 0; padding-top: 2.5rem; height: 100vh; }
.rail ol {
  list-style: none;
  margin: 0;
  padding: 0 0 0 .1rem;
  border-left: 1px solid var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}
.rail li { position: relative; }
.rail a {
  display: block;
  padding: .3rem 0 .3rem .85rem;
  font-size: .9rem;
  color: var(--ink-3);
  text-decoration: none;
  transition: color .16s ease;
}
.rail a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: .55rem; height: 1px;
  background: var(--rule);
  transition: width .16s ease, background .16s ease;
}
.rail a:hover { color: var(--ink-2); }
.rail a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.rail a[aria-current="true"]::before { width: .85rem; background: var(--k-gen); }
.rail .count { font-size: .63rem; color: var(--ink-3); margin-left: .4rem; }
 
/* ──────────────────────────── paper list ──────────────────────────── */
 
.list { padding-top: 2.5rem; min-width: 0; }
 
.era-head {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  margin: 2.4rem 0 .85rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--rule);
}
.era-head:first-child { margin-top: 0; }
.era-head {
  transition:
    opacity .2s ease,
    transform .2s ease,
    max-height .26s ease,
    margin .26s ease,
    padding .26s ease;
}
.era-head h2 {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.era-head .era-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
 
.card {
  --edge: var(--k-other);
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  gap: 0 1.1rem;
  background: var(--bg-2);
  border: 1px solid color-mix(in srgb, var(--edge) 20%, var(--rule-soft));
  border-radius: var(--radius);
  margin-bottom: .55rem;
  overflow: hidden;
  transition:
    opacity .2s ease,
    transform .2s ease,
    max-height .26s ease,
    margin .26s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}
.card:hover {
  border-color: color-mix(in srgb, var(--edge) 45%, var(--rule));
  box-shadow: 0 1px 3px rgba(21, 25, 30, .07);
}
 
.edge { background: var(--edge); }
 
.card-body { padding: .9rem 1.1rem .95rem 0; min-width: 0; }
 
.card-top { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -.005em; }
.card .yr {
  font-family: "IBM Plex Mono", monospace;
  font-size: .74rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.card .grp { font-size: .78rem; color: var(--ink-3); }
.unver { color: var(--c-rep); cursor: help; font-family: "IBM Plex Mono", monospace; }
 
.card .note { margin: .35rem 0 .65rem; color: var(--ink-2); font-size: .9rem; max-width: 74ch; }
 
.pills { display: flex; flex-wrap: wrap; gap: .3rem; }
.pill {
  font-family: "IBM Plex Mono", monospace;
  font-size: .67rem;
  letter-spacing: .04em;
  padding: .2rem .5rem;
  border-radius: 2px;
  border: 1px solid currentColor;
  background: none;
  cursor: pointer;
  opacity: .78;
  transition: opacity .14s ease, background .14s ease;
  white-space: nowrap;
}
.pill:hover { opacity: 1; }
.pill.on { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
 
.links {
  display: flex;
  gap: .9rem;
  margin-top: .6rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.links a {
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color .14s ease, border-color .14s ease;
}
.links a:hover { color: var(--ink); border-color: var(--ink-3); }
 
.empty {
  color: var(--ink-2);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.empty em { color: var(--ink); font-style: normal; font-weight: 600; }
 
.colophon {
  margin-top: 3.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: .79rem;
}
.colophon p { margin: 0 0 .45rem; }
.colophon code { font-family: "IBM Plex Mono", monospace; color: var(--ink-2); }
 
/* ─────────────────────────── filter panel ─────────────────────────── */
 
.panel { 
  min-width: 0; 
  align-self: stretch;
  border-left: 1px solid var(--rule);
  padding-left: 0.8rem;
}
.panel-in {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 2.5rem 0 2rem clamp(1rem, 2vw, 1.65rem);
}
 
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
}
.panel-head h2 {
  font-family: "IBM Plex Mono", monospace;
  font-size: .81rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  margin: 0;
}
.clear {
  font-family: "IBM Plex Mono", monospace;
  font-size: .77rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--c-ctrl);
  cursor: pointer;
  padding: 0;
}
.clear:disabled { color: var(--ink-3); cursor: default; }
 
.panel-note { font-size: .86rem; color: var(--ink-3); margin: .6rem 0 1.1rem; }
 
.group { margin-bottom: 1.05rem; }
.group h3 {
  font-family: "IBM Plex Mono", monospace;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 0 0 .1rem;
}
.group .group-note { font-size: .82rem; color: var(--ink-3); margin: 0 0 .35rem; }
 
.chips { display: flex; flex-direction: column; gap: .1rem; }
.chip {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: .21rem .35rem;
  border-radius: 2px;
  color: var(--ink-2);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  transition: color .14s ease, background .14s ease;
}
.chip:hover { background: var(--rule-soft); color: var(--ink); }
.chip .led {
  flex: none;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid currentColor;
  color: var(--dot);
  transition: background .14s ease, box-shadow .14s ease;
}
.chip[aria-pressed="true"] { color: var(--ink); background: var(--rule-soft); }
.chip[aria-pressed="true"] .led {
  background: var(--dot);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 20%, transparent);
}
.chip .n {
  margin-left: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: .69rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.chip.zero { color: var(--ink-3); }
.chip.zero .led { opacity: .45; }
.chip.zero .n { color: var(--c-ctrl); }
 
/* the disclosure summary is a narrow-screen affordance only */
.panel-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: .8rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.panel-toggle::-webkit-details-marker { display: none; }
.panel-toggle .badge {
  font-size: .67rem;
  letter-spacing: .1em;
  color: var(--ink-3);
  text-transform: none;
}
details[open] > .panel-toggle .badge::after { content: "  \25B2"; }
details:not([open]) > .panel-toggle .badge::after { content: "  \25BC"; }
 
/* ───────────────────────────── responsive ─────────────────────────── */
 
@media (max-width: 1080px) {
  .frame { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rail { display: none; }
  .panel { order: -1; }
  .panel-in {
    position: static;
    max-height: none;
    overflow: visible;
    padding-top: 1.5rem;
    padding-bottom: 0;
  }
  .panel-toggle { display: flex; }
  #groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.5rem; }
  .list { padding-top: 1.5rem; }
  .era-head { position: sticky; top: 0; background: var(--bg); z-index: 2; padding-top: .5rem; }
  .legend .tally { margin-left: 0; width: 100%; }
}
 
@media (max-width: 620px) {
  body { font-size: 20px; }
  .card { grid-template-columns: 4px minmax(0, 1fr); gap: 0 .85rem; }
  .card-body { padding: .8rem .85rem .85rem 0; }
}
 
@media print {
  body { background: #fff; color: #000; }
  .panel, .rail, .skip { display: none; }
  .frame { display: block; }
  .card { border: 1px solid #ccc; }
}
 
/* ─── enter and leave ────────────────────────────────────────────────
   Filtering animates in two directions at once: papers dropping out fade
   and collapse their own height, papers coming in fade up on a short
   stagger. app.js sets .is-leaving / .is-entering and clears them once
   the transition has run. Both are inert under prefers-reduced-motion,
   which the global rule at the top of this file already flattens. */
.card.is-entering,
.era-head.is-entering {
  opacity: 0;
  transform: translateY(8px);
}
.card.is-leaving,
.era-head.is-leaving {
  opacity: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  pointer-events: none;
}
 
/* ─── filtered-out papers leave the list entirely ─────────────────────
   Last in the file so these win over the display rules above, including
   the sticky .era-head override inside the media query. */
.card[hidden],
.era-head[hidden],
.rail li[hidden] { display: none !important; }
 