/* ═══════════════════════════════════════════════════════════════
   Designing Annotations in Visualization · considerations and examples
   A sibling of the Annotation Survey site: 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.32);
  --glass: rgba(245, 244, 240, 0.88);

  /* charts and sketches stay on paper in both themes */
  --paper: #FFFFFF;
  --sketch: #FBFBFB;
  --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: 0 30px 80px -20px rgba(21, 23, 27, 0.35);

  --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;
  --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.66);
  --glass: rgba(14, 16, 19, 0.86);
  --paper: #F7F6F2;
  --sketch: #F4F3EF;
  --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: 0 30px 90px -16px rgba(0, 0, 0, 0.8);
}

/* ── 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;
}

::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 {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

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

.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;
  transition: text-decoration-color 0.2s;
}

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

/* circled consideration numbers, as in the paper's Figure 1 */
.num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.9em;
  height: 1.9em;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* ── 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;
}

.icon-btn svg,
.theme-toggle svg {
  width: 18px;
  height: 18px;
  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: 38px;
  height: 38px;
  padding: 0;
  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;
}

/* ── 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: 24px;
  height: 24px;
  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;
  padding: 0;
  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 svg {
  width: 16px;
  height: 16px;
}

.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 72px;
  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: 17ch;
  font-family: var(--serif);
  font-size: clamp(40px, 6.6vw, 80px);
  line-height: 1.03;
  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 {
  max-width: 36ch;
  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);
  text-wrap: balance;
}

.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);
}

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

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

.hero__lede p {
  max-width: 62ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink-2);
  text-wrap: pretty;
}

.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;
  }
}

/* sections fade up once as they enter the view */
.js .in-view {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 70ms);
}

.js .in-view.is-in {
  opacity: 1;
  transform: none;
}

/* ── Section heads ────────────────────────────────────────────── */
.considerations,
.examples {
  border-top: 1px solid var(--line-soft);
}

.considerations {
  padding: 24px 0 104px;
}

.examples {
  padding: 24px 0 112px;
  outline: none;
}

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

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

.section-head__note {
  max-width: 50ch;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* ── Considerations ───────────────────────────────────────────── */
.cons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 72px 56px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.con {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.con__sheet {
  margin-bottom: 26px;
  background: var(--sketch);
}

.con__sheet img {
  width: 100%;
  height: auto;
}

.con__name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.con__name .num {
  font-size: 12px;
  color: var(--accent);
}

.con h3 {
  max-width: 30ch;
  font-family: var(--serif);
  font-size: clamp(21px, 2.1vw, 25px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.con__text {
  max-width: 60ch;
  margin: 14px 0 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}

.con__go {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 6px 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.con__go span:first-child {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.45s var(--ease-out);
}

.con__go svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease-out);
}

.con__arrow {
  display: inline-flex;
}

.con__go:hover span:first-child {
  background-size: 100% 1px;
}

.con__go:hover svg {
  transform: translateY(2px);
}

/* ── Toolbar ──────────────────────────────────────────────────── */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 calc(-1 * var(--gutter));
  padding: 14px 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);
}

.toolbar__scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toolbar__div {
  display: none;
}

.facet {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

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

.facet__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.chip--text {
  padding: 0 14px;
}

.chip .num {
  font-size: 10px;
  width: 20px;
  height: 20px;
}

.chip__n {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

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

.chip[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--ink);
}

.chip[aria-pressed="true"] .num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip[aria-pressed="true"] .chip__n {
  color: var(--ink-2);
}

.chip:disabled {
  opacity: 0.38;
  cursor: default;
}

/* ── Status ───────────────────────────────────────────────────── */
.status {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 26px 0 30px;
}

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

.status__count strong {
  font-weight: 500;
  color: var(--ink);
}

.status__clear {
  font-size: 14px;
}

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

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

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

.card__sheet picture {
  position: absolute;
  inset: 7%;
}

.card__sheet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.6s ease;
}

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

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

.card__meta .year {
  font-variant-numeric: tabular-nums;
}

.card__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.004em;
  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: -10px;
  border-radius: 8px;
}

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

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

.card__why {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-3);
}

.card__nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.card__nums .num {
  width: 22px;
  height: 22px;
  font-size: 10.5px;
}

.card__nums .num.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* the card you were last reading */
.card.is-last .card__sheet {
  box-shadow: var(--paper-shadow), 0 0 0 2px var(--bg), 0 0 0 3px var(--accent-line);
}

@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.55s var(--ease-out) both;
  animation-delay: min(calc(var(--i, 0) * 30ms), 360ms);
}

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

/* ── Empty ────────────────────────────────────────────────────── */
.empty {
  padding: 40px 0 24px;
  color: var(--ink-2);
}

.empty p {
  margin: 0;
}

.empty__title {
  margin-bottom: 6px !important;
  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.05fr);
  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);
}

.cite__more {
  max-width: 54ch;
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-3);
}

.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 {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-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 ───────────────────────────────────────────────────── */
.detail {
  width: min(1200px, calc(100vw - 48px));
  height: min(880px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sheet-shadow);
  overflow: hidden;
}

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

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

@keyframes lift-in {
  from {
    transform: translateY(18px) scale(0.985);
    opacity: 0;
  }
}

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

.sheet-handle {
  display: none;
}

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

.detail__nav,
.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: 821px) {
  .detail__hint {
    display: inline-flex;
  }
}

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

.detail__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

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

/* the chart, on paper, on the desk */
.detail__figure {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 28px;
  background: var(--bg);
  border-right: 1px solid var(--line-soft);
}

.detail__zoom {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 5%;
  border: 0;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: var(--paper-shadow);
  cursor: zoom-in;
}

.detail__zoom picture {
  display: contents;
}

.detail__zoom img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.detail__credit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 2px 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.detail__full {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s;
}

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

.detail__fullicon {
  display: inline-flex;
}

.detail__full svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.detail__text {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 36px 44px 56px;
}

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

.detail h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.014em;
  text-wrap: balance;
}

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

.detail__lead {
  margin: 26px 0 0;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}

.detail__section {
  margin-top: 40px;
}

.detail__section > .label {
  display: block;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.notice {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: n;
}

.notice li {
  position: relative;
  padding: 14px 0 14px 34px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  counter-increment: n;
}

.notice li::before {
  content: counter(n);
  position: absolute;
  left: 0;
  top: 15px;
  font-family: var(--serif);
  font-size: 14px;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--warm);
}

.why {
  margin: 0;
  padding: 0;
  list-style: none;
}

.why li {
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--line-soft);
}

.why__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.why__head .num {
  margin-top: 1px;
  font-size: 11px;
  color: var(--accent);
}

.why li.is-on .why__head .num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.why__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.why__title {
  display: block;
  margin-top: 1px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-3);
}

.why p {
  margin: 12px 0 0 36px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}

.types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.types li {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
}

/* ── Full-size chart ──────────────────────────────────────────── */
.zoom {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.zoom[open] {
  animation: fade-in 0.3s ease;
}

.zoom::backdrop {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.zoom__stage {
  width: 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  place-items: center;
  padding: 64px 24px calc(24px + env(safe-area-inset-bottom));
  cursor: zoom-out;
}

.zoom__stage img {
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  border-radius: 3px;
  box-shadow: var(--paper-shadow-up);
  cursor: zoom-in;
}

.zoom__stage.is-actual {
  place-items: start;
}

.zoom__stage.is-actual img {
  max-width: none;
  max-height: none;
  margin: auto;
  cursor: zoom-out;
}

.zoom__close {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 2;
  border-color: var(--line);
  background: var(--surface);
}

/* ── 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: 1000px) {
  .hero__grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .cons {
    gap: 64px 36px;
  }

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

/* below the width where every chip fits on one line: one scrolling row of filters */
@media (max-width: 1230px) {
  .toolbar {
    padding: 10px 0;
  }

  .toolbar__scroll {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 var(--gutter);
    scroll-padding: 0 var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent);
  }

  .toolbar__scroll::-webkit-scrollbar {
    display: none;
  }

  .toolbar__div {
    display: block;
    flex: none;
    width: 1px;
    height: 22px;
    background: var(--line);
  }

  .facet {
    flex: none;
    gap: 10px;
  }

  .facet__label {
    width: auto;
    font-size: 10.5px;
  }

  .facet__opts {
    flex-wrap: nowrap;
  }

  .facet:last-child {
    padding-right: var(--gutter);
  }

  .chip {
    height: 36px;
  }

}

/* tablets and phones: the detail stacks, chart above the text */
@media (max-width: 820px) {
  .cons {
    grid-template-columns: 1fr;
    gap: 64px;
  }

  .con__sheet {
    max-width: 640px;
  }

  .detail__body {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .detail__figure {
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .detail__zoom {
    flex: none;
    height: min(52vh, 460px);
  }

  .detail__text {
    overflow: visible;
    padding: 30px 32px calc(48px + env(safe-area-inset-bottom));
  }
}

@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 52px;
  }

  .hero__title {
    font-size: clamp(38px, 11vw, 52px);
  }

  .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: 40px 0 28px;
  }

  .considerations {
    padding-bottom: 80px;
  }

  .con__sheet {
    margin: 0 calc(-1 * var(--gutter) + 6px) 22px;
  }

  .con__text {
    font-size: 15px;
  }

  .status {
    padding: 22px 0 24px;
  }

  .status__count {
    font-size: 17px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .card__sheet {
    margin: 0 calc(-1 * var(--gutter) + 6px) 16px;
  }

  .card__title {
    font-size: 18.5px;
  }

  .card__why {
    font-size: 14.5px;
  }

  /* the detail becomes a bottom sheet */
  .detail {
    position: fixed;
    inset: auto 0 0 0;
    width: 100vw;
    height: calc(100dvh - 28px - env(safe-area-inset-top));
    margin: 0;
    border: 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(48px);
      opacity: 0;
    }
  }

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

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

  .detail__figure {
    padding: 14px;
  }

  .detail__zoom {
    height: auto;
    max-height: 56vh;
    aspect-ratio: var(--ar, 4 / 3);
    padding: 4%;
  }

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

  .detail__lead {
    font-size: 17px;
  }

  .why p {
    margin-left: 0;
  }

  .cite {
    padding: 64px 0;
  }

  .cite__ref {
    font-size: 16px;
  }

  .bib pre {
    font-size: 11.5px;
  }

  .foot__inner {
    flex-direction: column;
  }
}

@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;
  }

  .js .in-view {
    opacity: 1;
    transform: none;
  }
}

@media print {

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

  .reveal,
  .in-view {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── 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;
  }
}
