/* ═══════════════════════════════════════════════════════════════
   Annotation Survey · paper browser
   Paper on a quiet desk: Lora for reading, Inter for interface,
   hairline rules, one navy accent and one warm annotation color.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #F5F4F0;
  --bg-2: #EFEDE7;
  --surface: #FBFAF7;
  --ink: #15171B;
  --ink-2: #3E4148;
  --ink-3: #5E6169;
  --line: #DCDAD2;
  --line-soft: #E8E6E0;
  --grid: rgba(21, 23, 27, 0.05);
  --accent: #24466F;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(36, 70, 111, 0.08);
  --accent-line: rgba(36, 70, 111, 0.28);
  --warm: #9E4E24;
  --highlight: rgba(214, 140, 72, 0.26);
  --scrim: rgba(21, 23, 27, 0.28);
  --glass: rgba(245, 244, 240, 0.86);

  /* papers stay paper in both themes */
  --paper: #FFFFFF;
  --paper-line: rgba(21, 23, 27, 0.08);
  --paper-shadow:
    0 1px 1px rgba(21, 23, 27, 0.05),
    0 3px 8px -2px rgba(21, 23, 27, 0.07),
    0 14px 28px -12px rgba(21, 23, 27, 0.16);
  --paper-shadow-up:
    0 1px 1px rgba(21, 23, 27, 0.05),
    0 12px 22px -6px rgba(21, 23, 27, 0.10),
    0 34px 56px -22px rgba(21, 23, 27, 0.28);
  --sheet-shadow: -24px 0 60px -20px rgba(21, 23, 27, 0.22);

  /* research areas: quiet inks that sit on paper */
  --c-survey: #6B6E76;
  --c-empirical: #2F6B5E;
  --c-tools: #24466F;
  --c-story: #9E4E24;
  --c-collab: #7A4E86;
  --c-eda: #3C7399;
  --c-prov: #8A6A1C;
  --c-dash: #56692E;
  --c-uncert: #A23E56;
  --c-interact: #2B7A80;

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --max-w: 1240px;
  --gutter: 32px;
  --toolbar-h: 64px;
  --radius: 10px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1013;
  --bg-2: #121519;
  --surface: #15181D;
  --ink: #ECEDEF;
  --ink-2: #C3C7CE;
  --ink-3: #8D939C;
  --line: #2A2E35;
  --line-soft: #1D2026;
  --grid: rgba(236, 237, 239, 0.045);
  --accent: #9DBBE0;
  --accent-ink: #0E1013;
  --accent-soft: rgba(157, 187, 224, 0.10);
  --accent-line: rgba(157, 187, 224, 0.32);
  --warm: #F0B07C;
  --highlight: rgba(240, 176, 124, 0.28);
  --scrim: rgba(4, 5, 7, 0.6);
  --glass: rgba(14, 16, 19, 0.84);
  --paper: #F7F6F2;
  --paper-shadow:
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 6px 14px -4px rgba(0, 0, 0, 0.45),
    0 20px 40px -14px rgba(0, 0, 0, 0.6);
  --paper-shadow-up:
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 16px 28px -8px rgba(0, 0, 0, 0.5),
    0 44px 72px -24px rgba(0, 0, 0, 0.8);
  --sheet-shadow: -24px 0 70px -16px rgba(0, 0, 0, 0.7);

  --c-survey: #A3A8B1;
  --c-empirical: #7CC2AE;
  --c-tools: #9DBBE0;
  --c-story: #F0B07C;
  --c-collab: #C9A2D6;
  --c-eda: #86BCE0;
  --c-prov: #DCC07A;
  --c-dash: #B2C784;
  --c-uncert: #EB98AC;
  --c-interact: #7FCBCF;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* theme switch: the new theme spreads from the toggle */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

h1,
h2,
h3 {
  font-weight: 400;
  margin: 0;
}

em {
  font-style: italic;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

html.has-modal {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}


.sep {
  color: var(--ink-3);
  opacity: 0.6;
  margin: 0 0.5em;
}

/* Underlines that draw in on hover */
.u {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--line), var(--line));
  background-size: 0% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.45s var(--ease-out), color 0.2s ease;
}

.u:hover {
  background-size: 100% 1px, 100% 1px;
}

.u.quiet {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
}

.u.quiet:hover {
  background-size: 100% 1px;
}

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

.link:hover {
  text-decoration-color: currentColor;
}

mark {
  background: linear-gradient(transparent 52%, var(--highlight) 52%);
  color: inherit;
  padding: 0 1px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.btn:hover {
  border-color: var(--ink-3);
  background: var(--accent-soft);
}

.btn:active {
  transform: translateY(1px);
}

.btn--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--solid:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
  border-color: transparent;
}

html[data-theme="dark"] .btn--solid:hover {
  background: color-mix(in srgb, var(--accent) 86%, white);
}

.btn--ghost {
  border-color: transparent;
  color: var(--ink-2);
}

.btn--ghost:hover {
  border-color: var(--line);
}

.btn--small {
  height: 34px;
  padding: 0 13px;
  font-size: 13px;
}

.btn svg,
.icon-btn svg,
.search svg,
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s;
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--line);
  color: var(--ink);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Top bar ──────────────────────────────────────────────────── */
.bar {
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 2;
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 17px;
  text-decoration: none;
  color: var(--ink);
}

.mark__glyph {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.bar__nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--ink-2);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s, transform 0.4s var(--ease-out);
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.theme-toggle:active {
  transform: rotate(-20deg);
}

.theme-toggle .i-moon,
html[data-theme="dark"] .theme-toggle .i-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .i-moon {
  display: block;
}

/* ── Masthead ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 64px 0 64px;
  overflow: hidden;
}

/* the desk: a faint grid that fades out toward the edges */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
}

.eyebrow {
  margin: 0 0 22px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow .sep {
  margin: 0 0.6em;
}

.hero__title {
  max-width: 21ch;
  font-family: var(--serif);
  font-size: clamp(38px, 6.2vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.hero__title em {
  font-style: italic;
  letter-spacing: -0.03em;
}

/* the title annotates itself */
.annotated {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.annotated__mark {
  position: absolute;
  left: -2%;
  bottom: -0.08em;
  width: 104%;
  height: 0.26em;
  overflow: visible;
  pointer-events: none;
}

.annotated__mark path {
  fill: none;
  stroke: var(--warm);
  stroke-width: 3.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 400;
  stroke-dashoffset: 0;
}

.js .annotated__mark path {
  stroke-dashoffset: 400;
  animation: draw 1.1s var(--ease-out) 0.75s forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.hero__sub {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2.2vw, 25px);
  line-height: 1.35;
  color: var(--ink-2);
}

.hero__authors {
  margin: 22px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}

.hero__authors a {
  color: var(--ink-2);
}

.hero__authors a:hover {
  color: var(--ink);
}

/* first author */
.hero__authors a:first-child {
  color: var(--ink);
  font-weight: 500;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px 64px;
  align-items: end;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.hero__lede p {
  max-width: 60ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
}

.hero__lede strong {
  font-weight: 600;
  color: var(--ink);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}


.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, auto));
  gap: 22px 40px;
  margin: 0;
}

.stats div {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.stats dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stats dd {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
  letter-spacing: -0.01em;
}


/* paper sheet */
.sheet {
  position: relative;
  background: var(--paper);
  border-radius: 3px;
  box-shadow: var(--paper-shadow);
  overflow: hidden;
}


/* entry motion */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.9s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 80ms + 60ms);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Section heads ────────────────────────────────────────────── */
.browser {
  padding: 24px 0 96px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 48px 0 22px;
}

.section-head h2,
.cite h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}


/* ── Toolbar ──────────────────────────────────────────────────── */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 12px var(--gutter);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--ink-3);
}

.search input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-right: -22px;
  cursor: pointer;
  background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.search__kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
  pointer-events: none;
  transition: opacity 0.15s;
}

.search input:focus~.search__kbd,
.search input:not(:placeholder-shown)~.search__kbd {
  opacity: 0;
}

.toolbar__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select {
  position: relative;
  display: inline-block;
}

.select select {
  height: 34px;
  padding: 0 32px 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}

.select select:hover {
  border-color: var(--ink-3);
}

.select::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select select option {
  background: var(--surface);
  color: var(--ink);
}

.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.seg button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  transition: background-color 0.2s, color 0.2s;
}

.seg button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.seg button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.seg button:hover {
  color: var(--ink);
}

.export {
  position: relative;
}

.export summary {
  list-style: none;
}

.export summary::-webkit-details-marker {
  display: none;
}

.export summary svg {
  width: 14px;
  height: 14px;
  margin-right: -3px;
  transition: transform 0.25s var(--ease);
}

.export[open] summary svg {
  transform: rotate(180deg);
}

.export__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  width: 250px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--paper-shadow-up);
  animation: pop 0.22s var(--ease-out);
}

.export__menu button {
  display: grid;
  gap: 1px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.export__menu button:hover {
  background: var(--accent-soft);
}

.export__menu span {
  font-size: 14px;
  font-weight: 500;
}

.export__menu small {
  font-size: 12px;
  color: var(--ink-3);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.filters-open {
  display: none;
}

.filters-open svg {
  margin-left: -2px;
}

.filters-open__n {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
}

/* ── Layout ───────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 56px;
  padding-top: 28px;
}

/* ── Filters ──────────────────────────────────────────────────── */
.filters {
  position: sticky;
  top: calc(var(--toolbar-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--toolbar-h) - 40px);
  max-height: calc(100dvh - var(--toolbar-h) - 40px);
  display: flex;
  flex-direction: column;
}

.filters__head,
.sheet-handle,
.phone-only {
  display: none;
}

.filters__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-right: -12px;
  padding: 22px 12px 0 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  /* soft edges where the list scrolls */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 22px), transparent 100%);
}

.filters__foot {
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.filters__foot .btn--ghost {
  margin-left: -13px;
}

.filters__done {
  display: none;
}

.filters__note {
  margin: 0 0 24px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
}

.facet {
  margin: 0;
  padding: 0 0 22px;
  border: 0;
  min-width: 0;
}

.facet+.facet {
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.facet legend,
.facet__title {
  float: left;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.facet__opts {
  clear: both;
  display: grid;
  gap: 1px;
}

.facet__row {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
  margin: 0 -8px;
  padding: 6px 8px 7px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, opacity 0.2s;
}

.opt:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.opt__box {
  position: relative;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1.5px solid color-mix(in srgb, var(--opt-c, var(--ink-3)) 70%, transparent);
  border-radius: 4px;
  transition: background-color 0.15s, border-color 0.15s;
}

.opt__box::after {
  content: "";
  position: absolute;
  left: 4.2px;
  top: 1.2px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg) scale(0.4);
  opacity: 0;
  transition: transform 0.2s var(--ease-out), opacity 0.15s;
}

.opt input:checked+.opt__box {
  background: var(--opt-c, var(--accent));
  border-color: var(--opt-c, var(--accent));
}

.opt input:checked+.opt__box::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.opt input:focus-visible+.opt__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.opt input:checked~.opt__name {
  color: var(--ink);
  font-weight: 500;
}

.opt__n {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  padding-top: 1px;
}

/* each option carries a hairline bar: its share of all papers (track)
   and of the papers your other filters leave (ink) */
.opt__bar {
  grid-column: 2 / -1;
  position: relative;
  height: 2px;
  margin-top: 6px;
}

.opt__bar i {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s var(--ease-out), background-color 0.2s;
}

.opt__bar .t {
  background: var(--line-soft);
}

.opt__bar .n {
  background: color-mix(in srgb, var(--opt-c, var(--ink-3)) 55%, transparent);
}

.opt:hover .opt__bar .n,
.opt input:checked~.opt__bar .n {
  background: var(--opt-c, var(--accent));
}

.opt.is-zero {
  opacity: 0.42;
}

.facet__more {
  margin-top: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--accent);
}

.facet__more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pills {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pills label {
  position: relative;
}

.pills input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pills span {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pills input:checked+span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.pills input:focus-visible+span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filters-scrim {
  display: none;
}

/* ── Timeline (top of the filter panel) ───────────────────────── */
.timeline {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.timeline__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
  margin-bottom: 10px;
}

.timeline__head .label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.timeline__head .label.is-preview {
  color: var(--ink);
}

.timeline__head .link {
  flex: none;
  font-size: 13px;
}

.timeline__svg {
  display: block;
  width: 100%;
  height: 84px;
  overflow: visible;
  touch-action: pan-y;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.timeline__svg .bar-ghost {
  fill: var(--line);
  transition: fill 0.2s;
}

.timeline__svg .bar-on {
  fill: var(--accent);
  transition: height 0.35s var(--ease-out), y 0.35s var(--ease-out), opacity 0.25s;
}

.timeline__svg .bar-preview {
  fill: var(--preview-c, var(--accent));
  transition: height 0.3s var(--ease-out), y 0.3s var(--ease-out);
}

.timeline__svg.is-previewing .bar-on {
  opacity: 0.16;
}

.timeline__svg .is-hover .bar-ghost {
  fill: color-mix(in srgb, var(--line) 60%, var(--ink-3));
}

.timeline__svg .is-mark .bar-on,
.timeline__svg .is-mark .bar-ghost {
  fill: var(--warm);
}

.timeline__svg .axis {
  stroke: var(--line);
  stroke-width: 1;
}

.timeline__svg text {
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.timeline__svg .tip-bg {
  fill: var(--ink);
}

.timeline__svg .tip-text {
  fill: var(--bg);
  font-weight: 500;
}

.timeline__svg .brush {
  fill: var(--accent-soft);
  stroke: var(--accent-line);
  stroke-dasharray: 3 3;
}

.years {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 14px;
}

.years__to {
  font-size: 13px;
  color: var(--ink-3);
}

.years__hint {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--ink-3);
}

.select--small select {
  width: 84px;
  height: 32px;
}

/* ── Status + chips ───────────────────────────────────────────── */
.status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: 34px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.status__count {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink-2);
}

.status__count strong {
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s;
  animation: pop 0.25s var(--ease-out);
}

.chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chip-c, var(--accent));
}

.chip svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.6;
}

.chip:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.chip:hover svg {
  opacity: 1;
}

.chip--clear {
  border-color: transparent;
  background: none;
  color: var(--accent);
  padding: 0 6px;
}

/* ── Cards: grid ──────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 44px 28px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card__sheet {
  aspect-ratio: 612 / 560;
  margin-bottom: 16px;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}

.card__sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.card__sheet img.is-loaded {
  opacity: 1;
}

/* a paper with no thumbnail gets a typeset cover */
.sheet {
  container-type: inline-size;
}

.cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14% 12%;
  color: #2A2C31;
  text-align: center;
}

.cover b {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(7px, 7.2cqw, 15px);
  line-height: 1.3;
}

.cover span {
  margin-top: 0.8em;
  font-size: clamp(6px, 4.6cqw, 10px);
  color: #6B6E76;
}

.card__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
}

.card__meta .year {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.card__meta .venue {
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.003em;
  text-wrap: pretty;
}

.card__link {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease-out);
}

/* the whole card is the link */
.card__link::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 6px;
}

.card__link:focus-visible {
  outline: none;
}

.card__link:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card__authors {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--ink-2);
}

.cats li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.cats i,
.dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cat-c);
}

@media (hover: hover) {
  .card:hover .card__sheet {
    transform: translateY(-4px);
    box-shadow: var(--paper-shadow-up);
  }

  .card:hover .card__link {
    background-size: 100% 1px;
  }
}

.card.is-new {
  animation: fade 0.5s var(--ease-out) both;
  animation-delay: min(calc(var(--i, 0) * 22ms), 400ms);
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.card--skeleton {
  pointer-events: none;
}

.card--skeleton .card__sheet {
  background: var(--line-soft);
  box-shadow: none;
}

.sk {
  display: block;
  height: 10px;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--line-soft);
}

.sk--meta {
  width: 38%;
  height: 8px;
  margin-top: 0;
}

.sk--title {
  width: 94%;
  height: 14px;
}

.sk--short {
  width: 62%;
}

.sk--line {
  width: 76%;
  height: 9px;
  margin-top: 14px;
}

.card--skeleton>* {
  animation: pulse 1.6s ease-in-out infinite;
}

.card--skeleton:nth-child(2n)>* {
  animation-delay: 0.2s;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

/* the card you were last reading, marked when the detail closes */
.card {
  isolation: isolate;
}

.card.is-flash::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 12px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  pointer-events: none;
  animation: flash 2s var(--ease) forwards;
}

@keyframes flash {

  0%,
  55% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* ── Cards: list ──────────────────────────────────────────────── */
.cards[data-view="list"] {
  display: block;
}

.cards[data-view="list"] .card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(0, 190px);
  gap: 4px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}

.cards[data-view="list"] .card:first-child {
  padding-top: 0;
}

.cards[data-view="list"] .card__sheet {
  display: none;
}

.cards[data-view="list"] .card__meta {
  display: contents;
}

.cards[data-view="list"] .card__meta .year {
  grid-column: 1;
  grid-row: 1 / span 3;
  padding-top: 3px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.cards[data-view="list"] .card__meta .sep {
  display: none;
}

.cards[data-view="list"] .card__meta .venue {
  grid-column: 3;
  grid-row: 1;
  padding-top: 4px;
  text-align: right;
  white-space: normal;
}

.cards[data-view="list"] .card__title,
.cards[data-view="list"] .card__authors,
.cards[data-view="list"] .cats {
  grid-column: 2;
}

.cards[data-view="list"] .card__title {
  grid-row: 1;
}

.cards[data-view="list"] .card__authors {
  margin-top: 2px;
  -webkit-line-clamp: 1;
}

.cards[data-view="list"] .cats {
  margin-top: 6px;
}

.cards[data-view="list"] .card__link::after {
  inset: 0 -12px;
}

@media (hover: hover) {
  .cards[data-view="list"] .card:hover {
    background: linear-gradient(90deg, transparent, var(--accent-soft) 12%, var(--accent-soft) 88%, transparent);
  }
}

/* ── Empty ────────────────────────────────────────────────────── */
.empty {
  padding: 64px 0;
  text-align: center;
  color: var(--ink-3);
}

.empty__title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
}

/* ── Cite ─────────────────────────────────────────────────────── */
.cite {
  padding: 88px 0;
  background: var(--bg-2);
  border-top: 1px solid var(--line-soft);
}

.cite__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 48px 72px;
  align-items: start;
}

.cite__ref {
  max-width: 54ch;
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
}

.bib {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.bib__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.bib pre,
.detail pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
  tab-size: 2;
}

/* ── Footer ───────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--ink-3);
}

.foot__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 32px;
}

.foot p {
  margin: 0;
}

/* ── Detail sheet ─────────────────────────────────────────────── */
.detail {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(620px, 100vw);
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sheet-shadow);
  overflow: hidden;
}

.detail[open] {
  display: flex;
  flex-direction: column;
  animation: slide-in 0.5s var(--ease-out);
}

.detail::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fade-in 0.35s ease;
}

@keyframes slide-in {
  from {
    transform: translateX(36px);
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.detail__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.detail__nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.detail__tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.detail__hint {
  display: none;
  align-items: center;
  gap: 4px;
  margin-right: 10px;
  font-size: 12px;
  color: var(--ink-3);
}

.detail__hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 11px;
}

@media (hover: hover) and (min-width: 701px) {
  .detail__hint {
    display: inline-flex;
  }
}

.detail__pos {
  min-width: 72px;
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.detail__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px 40px calc(48px + env(safe-area-inset-bottom));
}

.detail__body.is-swap {
  animation: fade 0.35s var(--ease-out);
}

.detail__sheet {
  max-width: 340px;
  aspect-ratio: 612 / 560;
  margin-bottom: 30px;
}

.detail__sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.detail__meta {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.detail__meta .year {
  color: var(--ink-2);
}

.detail h2 {
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 28px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

.detail__authors {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

.detail__venue {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-3);
}

.detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.facts {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  margin: 32px 0 0;
  border-top: 1px solid var(--line-soft);
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.facts dt {
  color: var(--ink-3);
}

.facts dd {
  color: var(--ink);
}

.facts a {
  word-break: break-all;
}

.facts .cats {
  margin: 0;
  font-size: 14px;
  gap: 6px 14px;
}

.facts .cats button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.facts .cats button:hover {
  text-decoration-color: var(--line);
}

.detail__section {
  margin-top: 32px;
}

.detail__section h3 {
  margin-bottom: 10px;
}

.abstract {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-2);
  hyphens: auto;
}

.detail details {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}

.detail summary::-webkit-details-marker {
  display: none;
}

.detail summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
}

.detail details[open] summary::after {
  transform: rotate(-135deg);
}

.detail details pre {
  border-top: 1px solid var(--line-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ═══ Responsive ═══════════════════════════════════════════════ */

@media (max-width: 1080px) {
  .hero__grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .stats {
    grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: start;
  }

  .cite__inner {
    grid-template-columns: 1fr;
  }
}

/* Tablets and phones: filters move into a sheet */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 22px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search {
    flex-basis: 100%;
  }

  .toolbar__row {
    flex: 1;
  }

  .filters-open {
    display: inline-flex;
    margin-right: auto;
  }

  .search__kbd {
    display: none;
  }

  .filters {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    z-index: 60;
    max-height: 86vh;
    max-height: 86dvh;
    padding: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, 0.35);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.45s var(--ease-out), visibility 0s linear 0.45s;
  }

  .filters.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.45s var(--ease-out), visibility 0s;
  }

  .filters__head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 14px 8px 24px;
    touch-action: none;
    cursor: grab;
  }

  .sheet-handle {
    display: block;
    position: absolute;
    left: 50%;
    top: 8px;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--line);
  }

  .filters .timeline {
    padding: 6px 24px 16px;
  }

  .filters__body {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .filters__head h3 {
    font-family: var(--serif);
    font-size: 22px;
  }

  .filters__close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
  }

  .filters__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
  }

  .filters__body {
    margin: 0;
    padding: 6px 24px 8px;
  }

  .filters__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  }

  .filters__foot .btn--ghost {
    margin-left: 0;
  }

  .filters__done {
    display: inline-flex;
    height: 44px;
    padding: 0 22px;
    font-size: 14px;
  }

  .opt {
    padding: 9px 8px;
    font-size: 15px;
  }

  .filters-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: var(--scrim);
    animation: fade-in 0.3s ease;
  }

  .filters-scrim[hidden] {
    display: none;
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 18px;
  }

  .bar__inner {
    height: 56px;
  }

  .bar__nav {
    gap: 16px;
  }

  .bar__nav a:not(.bar__ext) {
    display: none;
  }

  .hero {
    padding: 44px 0 48px;
  }

  .hero__grid {
    margin-top: 30px;
    padding-top: 26px;
  }

  .hero__lede p {
    font-size: 16px;
  }

  .hero__actions .btn {
    flex: 1 1 auto;
  }

  .hero__actions .btn--ghost {
    flex-basis: 100%;
    border-color: var(--line);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
  }

  .stats dd {
    font-size: 26px;
  }


  .section-head {
    padding-top: 40px;
  }

  .toolbar {
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 10px;
  }

  .export__menu {
    width: min(250px, calc(100vw - 36px));
  }

  .card__title {
    font-size: 15.5px;
  }

  .card__sheet {
    margin-bottom: 12px;
  }

  .card__meta {
    font-size: 10.5px;
  }

  .card .cats {
    display: none;
  }

  .cards[data-view="list"] .card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 2px 14px;
  }

  .cards[data-view="list"] .card__meta .venue {
    grid-column: 2;
    grid-row: 2;
    padding: 0;
    text-align: left;
    font-size: 11px;
    margin-top: 4px;
  }

  .cards[data-view="list"] .card__meta .year {
    grid-row: 1 / span 4;
  }

  .cards[data-view="list"] .card__authors {
    grid-row: 3;
  }

  .cards[data-view="list"] .cats {
    display: flex;
    grid-row: 4;
  }

  .detail__bar {
    position: relative;
    padding-top: 18px;
    touch-action: none;
  }

  /* detail becomes a bottom sheet */
  .detail {
    inset: auto 0 0 0;
    width: 100vw;
    height: auto;
    max-height: 92vh;
    max-height: 92dvh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
  }

  .detail[open] {
    animation: rise-up 0.5s var(--ease-out);
  }

  @keyframes rise-up {
    from {
      transform: translateY(40px);
      opacity: 0;
    }
  }

  .detail__body {
    padding: 24px 20px calc(40px + env(safe-area-inset-bottom));
  }

  .detail__sheet {
    max-width: 220px;
    margin-bottom: 24px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .facts dt {
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 12px;
  }

  .facts dd {
    padding-top: 2px;
  }

  .cite {
    padding: 64px 0;
  }

  .foot__inner {
    flex-direction: column;
  }
}

/* Phones: grid cards become compact rows, a small sheet beside the text */
@media (max-width: 560px) {

  /* one quiet row: search and filters; sort and export live in the sheet */
  .toolbar {
    flex-wrap: nowrap;
  }

  .search {
    flex-basis: auto;
  }

  .toolbar__row {
    flex: none;
  }

  .toolbar__row .select,
  .seg,
  .export {
    display: none;
  }

  .filters-open {
    margin-right: 0;
    height: 40px;
  }

  .phone-only {
    display: block;
  }

  .cards[data-view="grid"] .card--skeleton .sk {
    grid-column: 2;
  }

  .cards[data-view="grid"] {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .cards[data-view="grid"] .card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .cards[data-view="grid"] .card:first-child {
    padding-top: 0;
  }

  .cards[data-view="grid"] .card__sheet {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: start;
    margin: 2px 0 0;
  }

  .cards[data-view="grid"] .card__meta,
  .cards[data-view="grid"] .card__title,
  .cards[data-view="grid"] .card__authors {
    grid-column: 2;
  }

  .cards[data-view="grid"] .card__authors {
    -webkit-line-clamp: 1;
    margin-top: 4px;
  }

  .cards[data-view="grid"] .card__link::after {
    inset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .annotated__mark path {
    stroke-dashoffset: 0;
  }
}

@media print {

  .bar,
  .toolbar,
  .filters,
  .timeline,
  .hero__actions,
  .foot {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* touch screens: 16px fields so iOS doesn't zoom on focus */
@media (pointer: coarse) {

  .search input,
  .select select {
    font-size: 16px;
  }

  .select--small select {
    width: 96px;
  }
}

/* ── Family: the way home and the sibling sites ───────────────────
   Shared by every annotation site on dilshadur.com. Keep identical. */
.bar__start {
  display: flex;
  align-items: center;
  min-width: 0;
}

.home {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  outline-offset: 3px;
  transition: transform 0.4s var(--ease-out), box-shadow 0.2s;
}

.home img {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 999px;
}

.home:hover {
  transform: translateX(-2px);
  box-shadow: 0 0 0 1px var(--line);
}

.bar__div {
  flex: none;
  width: 1px;
  height: 18px;
  margin: 0 14px;
  background: var(--line);
}

.bar__start .mark {
  min-width: 0;
}

.bar__start .mark span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family + .foot__inner {
  justify-content: flex-end;
}

.family {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 14px 40px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.family__home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.family__home img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
}

.family__home span {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease-out);
}

.family__home:hover span {
  background-size: 100% 1px;
}

.family__set {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.family__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.family__set a,
.family__set [aria-current] {
  font-size: 13.5px;
  white-space: nowrap;
}

.family__set [aria-current] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.family__set [aria-current]::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--warm);
}

@media (max-width: 760px) {
  .family {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .family__set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: start;
    gap: 10px 16px;
  }

  .family__label {
    grid-column: 1 / -1;
  }
}

.bar__start + .bar__nav {
  flex: none;
}

.bar__inner:has(.bar__start) {
  gap: 16px;
}

@media (max-width: 600px) {
  .bar__start + .bar__nav .bar__ext {
    display: none;
  }
}

@media (max-width: 520px) {
  .bar__div {
    margin: 0 10px;
  }
}
