/* =========================================================================
   Stepansky Medical-Surgical Encyclopedia — stylesheet
   Black/white/gray, sans-serif, high readability.
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #ffffff;
  --bg-alt: #f6f6f6;
  --ink: #141414;
  --ink-1: #2a2a2a;
  --ink-2: #555555;
  --ink-3: #888888;
  --rule: #e4e4e4;
  --rule-strong: #cfcfcf;
  --accent: #141414;
  --hover: #000000;
  --selection: #ffe96a;

  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --measure: 38rem;

  --sans: Arial, Helvetica, sans-serif;
  --mono: Arial, Helvetica, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  font-feature-settings: "kern", "liga", "calt", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* Sticky-footer layout: pin the Mailman brand bar to the bottom of the
     viewport on short pages while letting it sit naturally below content
     on tall ones. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--hover);
}

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

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(1.1) blur(6px);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--ink);
  color: var(--bg);
  padding: 0.2rem 0.4rem;
  line-height: 1;
  border-radius: 2px;
}

.brand__name {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.masthead__nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}

.nav-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.nav-link.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- shell ---------- */
/* Push the colophon + brandbar to the bottom on short pages. */
main.shell { flex: 1 0 auto; }

.shell {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.5rem) var(--gutter) 4rem;
}

.section {
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin: 0 0 0.9rem;
}

.display {
  font-family: var(--sans);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.8rem;
  color: var(--ink);
}

.display__rule {
  font-weight: 700;
}

.lede {
  font-family: var(--sans);
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 36rem;
  margin: 0;
  line-height: 1.5;
}

.display__subtitle {
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-2);
  margin: 0.4rem 0 0;
  letter-spacing: 0.005em;
}

.display__version {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3, #888);
  margin: 0.3rem 0 0;
}

.entry__colon {
  font-weight: 700;
  color: var(--ink);
}

.about-body p {
  margin: 0 0 1.2em;
  line-height: 1.65;
  max-width: 42rem;
}

/* About page: tone down the masthead so it doesn't dominate the bio. */
.page--about .display {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
}
.page--about .eyebrow {
  font-size: 0.7rem;
}

/* ---------- timeline year jumper (right sidebar, sticky) ---------- */
.timeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 2.5rem;
  align-items: start;
}
.timeline-layout > .body { max-width: none; }
.year-jump-wrap {
  position: sticky;
  top: 1rem;
  padding: 0.95rem 1rem 1.05rem;
  border: 1px solid var(--rule, #e5e5e5);
  border-radius: 0.5rem;
  background: var(--bg, #fff);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.year-jump-label {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3, #777);
  margin: 0 0 0.45rem;
}
.year-jump {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule, #ccc);
  border-radius: 0.35rem;
  background: #fff;
  color: var(--ink, #111);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.year-jump:focus {
  border-color: #0077c8;
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.18);
}
@media (max-width: 800px) {
  .timeline-layout { grid-template-columns: 1fr; }
  .year-jump-wrap { position: static; }
}
.year-jump:focus {
  border-color: var(--ink, #111);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.18);
}
.event--flash {
  animation: yearjump-flash 1.4s ease-out;
}
@keyframes yearjump-flash {
  0%   { background: #fff6c9; box-shadow: -0.6rem 0 0 #fff6c9, 0.6rem 0 0 #fff6c9; }
  100% { background: transparent; box-shadow: none; }
}

/* ---------- bibliography back-link (deep-arrival) ---------- */
.bib-item__back {
  display: inline-block;
  margin-left: 0.6rem;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: #0077c8;
  padding: 0.15em 0.55em;
  border-radius: 0.25rem;
  text-decoration: none;
  vertical-align: 0.18em;
}
.bib-item__back:hover {
  background: #1d4f91;
  text-decoration: none;
}

/* ---------- search page ---------- */
/* Search-page-specific overrides: bump shell to viewport-sized so the
   input can fill the visible content area, not the 72rem cap that the
   other pages use. */
.page--search .shell {
  max-width: none;
  width: 100%;
}
.search-shell {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.search-input-wrap {
  margin: 0 0 1.4rem;
  width: 100%;
  position: relative;
}
.search-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 1.18rem;
  padding: 0.95rem 1.2rem 0.95rem 3rem;
  border: 1px solid var(--rule, #d6d6d6);
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #111);
  outline: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.search-input::placeholder {
  color: #888;
}
.search-input:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.search-input:focus {
  border-color: #0077c8;
  box-shadow: 0 2px 14px rgba(0, 119, 200, 0.22);
}
.search-input__icon {
  position: absolute;
  top: 50%;
  left: 1.05rem;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  color: #777;
  pointer-events: none;
}
.search-input:focus ~ .search-input__icon,
.search-input-wrap:focus-within .search-input__icon {
  color: #0077c8;
}
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--ink-2, #555);
}
.search-filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.search-status {
  font-size: 0.85rem;
  color: var(--ink-2, #555);
  margin: 0 0 0.6rem;
}
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.search-result__link {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule, #e5e5e5);
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.1s;
}
.search-result__link:hover {
  border-color: var(--ink, #111);
}
.search-result__badge {
  display: inline-block;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15em 0.55em;
  border-radius: 0.25rem;
  margin-right: 0.5rem;
  vertical-align: 0.12em;
  color: #fff;
  background: #6b7a86;
}
.search-result__badge--enc { background: #1d4f91; }
.search-result__badge--tl  { background: #0077c8; }
.search-result__badge--bib { background: #4a4a4a; }
.search-result__title {
  font-weight: 600;
  font-size: 1.04rem;
}
.search-result__qual {
  font-weight: 500;
  color: var(--ink-2, #555);
}
.search-result__snippet {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-2, #444);
  line-height: 1.5;
}
.search-result mark {
  background: #fff6c9;
  color: inherit;
  padding: 0 0.05em;
  border-radius: 0.15rem;
}

/* ---------- sponsorship brand bar (Columbia Mailman) ---------- */
/* Color: Mailman Academic Primary, Pantone 3005c, #0077C8 */
.brandbar {
  background: #0077C8;
  color: #fff;
  padding: 1.4rem 1.5rem;
  margin-top: 0;
}
.brandbar__inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.brandbar__center {
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 22rem;
}
.brandbar__center:hover {
  text-decoration: none;
}
.brandbar__center-eyebrow {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.78;
}
.brandbar__center-name {
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 0.05em;
  width: max-content;
  max-width: 100%;
}
.brandbar__center:hover .brandbar__center-name {
  border-bottom-color: #fff;
}
.brandbar__school {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.brandbar__logo {
  height: 2.25rem;
  width: auto;
  /* The source SVG is Mailman blue; invert to white for the blue bar. */
  filter: brightness(0) invert(1);
  display: block;
}
@media (max-width: 600px) {
  .brandbar__inner { gap: 1.2rem; }
  .brandbar__logo { height: 1.85rem; }
  .brandbar__center-name { font-size: 0.95rem; }
}

/* ---------- layout rail + body ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 13rem;
    gap: 3.5rem;
  }
}

.body {
  max-width: 46rem;
  min-width: 0;
}

.rail {
  position: sticky;
  top: 4.5rem;
  align-self: start;
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
}

.rail__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin: 0 0 0.7rem;
}

.rail__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem 0.5rem;
}

.rail__stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rail__link {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.15rem 0;
  border-bottom: 1px solid transparent;
}

.rail__link--wide {
  font-size: 0.72rem;
}

.rail__link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- index cards / stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin: 0 0 2.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0;
}

.stat {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0.4rem;
  border-radius: 0.3rem;
  transition: background 0.12s, transform 0.12s;
}
.stat:hover, .stat:focus-visible {
  background: var(--rule, #f3f3f3);
  text-decoration: none;
  outline: none;
}
.stat:hover .stat__num {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

.stat__num {
  font-family: var(--sans);
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  line-height: 1;
  font-feature-settings: "tnum";
  color: var(--ink);
  letter-spacing: -0.02em;
}

.stat__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin: 0.4rem 0 0;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 760px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.4rem 1.4rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s;
}

.card:hover {
  border-color: var(--ink);
  background: var(--bg-alt);
}

.card__kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 0.5rem;
}

.card__title {
  font-family: var(--sans);
  font-size: 1.35rem;
  margin: 0 0 0.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card__body {
  font-size: 0.92rem;
  margin: 0 0 1rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.card__cta {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: auto 0 0;
}

.prose {
  border-top: 1px solid var(--rule);
  padding-top: 1.8rem;
  max-width: var(--measure);
}

.prose p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-1);
}

/* remove the old decorative drop cap in favor of clean reading */
.drop-cap::first-letter {
  font-weight: 700;
}

/* ---------- alphabet / era sections ---------- */
.alpha-section {
  margin: 0 0 2.8rem;
  scroll-margin-top: 5rem;
}

.alpha-heading {
  font-family: var(--sans);
  margin: 0 0 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  border-bottom: 1px solid var(--rule-strong);
  padding: 0 0 0.5rem;
}

.alpha-heading__letter {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  flex: 0 0 auto;
  letter-spacing: -0.01em;
}

.alpha-heading__letter--wide {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
}

/* ---------- bibliography ---------- */
.bib-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: bib;
}

.bib-item {
  counter-increment: bib;
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.8rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-1);
}

.bib-item::before {
  content: counter(bib);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  padding-top: 0.2rem;
  font-feature-settings: "tnum";
}

.bib-item__text {
  color: var(--ink-1);
}

/* ---------- timeline events ---------- */
.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 680px) {
  .event {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

.event__date {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  padding-top: 0.18rem;
  font-feature-settings: "tnum";
}

.event__body {
  font-size: 0.95rem;
  line-height: 1.62;
  color: var(--ink-1);
}

/* ---------- encyclopedia entries ---------- */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.entry {
  padding: 0.2rem 0 1.1rem;
  border-bottom: 1px solid var(--rule);
}

.entry__head {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.entry__headword {
  font-weight: 700;
  color: var(--ink);
}

.entry__qual {
  font-weight: 500;
  color: var(--ink-2);
}

.entry__body {
  font-size: 0.95rem;
  line-height: 1.64;
  margin: 0;
  color: var(--ink-1);
}

/* ---------- Entry of the Day ---------- */
.eotd {
  margin: 0 0 3rem;
}

.eotd__eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 0.8rem;
}

.eotd__card {
  display: block;
  padding: 1.6rem 1.6rem 1.5rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}

.eotd__card:hover {
  border-color: var(--ink);
  background: var(--bg-alt);
}

.eotd__headword {
  font-family: var(--sans);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.25rem;
  line-height: 1.15;
}

.eotd__qual {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-2);
  margin: 0 0 0.85rem;
  font-style: italic;
  line-height: 1.4;
}

.eotd__body {
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-1);
  margin: 0 0 1rem;
}

.eotd__more {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: 0;
}

/* ---------- Drill-down histogram (full-width, in flow) ---------- */

.drill {
  width: 100%;
  background: var(--bg);
  border-top: 1px solid var(--rule-strong);
  margin-top: 2rem;
}

.drill__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem var(--gutter) 0.5rem;
  min-height: 1.6rem;
  border-bottom: 1px solid var(--rule);
}

.drill__crumbs {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.drill__crumbs .crumb {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.drill__crumbs .crumb.is-current {
  color: var(--ink);
  font-weight: 600;
}

.drill__crumbs .crumb-sep {
  color: var(--ink-3);
}

.drill__zoom {
  display: flex;
  gap: 0.35rem;
}

.drill__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.drill__btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.drill__btn:disabled {
  color: var(--rule-strong);
  border-color: var(--rule);
  cursor: default;
  opacity: 0.65;
}

.drill__btn svg {
  display: block;
}

.drill__hint {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--ink-3);
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.drill__stage {
  position: relative;
  padding: 1.2rem var(--gutter) 1.4rem;
}

.drill__bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 120px;
  width: 100%;
}

.drill-bar {
  flex: 0 0 2px;
  height: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.drill-bar::before {
  content: "";
  display: block;
  width: 100%;
  height: var(--h, 6%);
  background: var(--ink-2);
  transition: background 0.08s, transform 0.08s;
  transform-origin: bottom;
}

.drill__bars[data-level="2"] .drill-bar::before {
  height: 100%;
}

.drill-bar:hover::before,
.drill-bar.is-active::before {
  background: var(--ink);
  transform: scaleX(3);
}

.drill__pop {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  width: 460px;
  background: #141414;
  color: #f2f2f2;
  padding: 0.8rem 0.95rem 0.9rem;
  font-family: var(--sans);
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.12s, transform 0.12s;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.32);
  border-radius: 2px;
}

.drill__pop.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.drill-pop__title {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.1rem;
  color: #fff;
  letter-spacing: -0.005em;
}

.drill-pop__sub {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9a9a9a;
  margin: 0 0 0.65rem;
}

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

.drill-pop__list li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.5rem;
  padding: 0.28rem 0;
  border-top: 1px solid #2a2a2a;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #e5e5e5;
}

.drill-pop__list li:first-child {
  border-top: 0;
}

.drill-pop__date {
  font-family: var(--mono);
  color: #b9b9b9;
  font-size: 0.62rem;
  padding-top: 0.1rem;
}

.drill-pop__more {
  grid-template-columns: 1fr !important;
  color: #9a9a9a;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.drill-pop__body {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #eaeaea;
  margin: 0;
}

/* encyclopedia entry anchor room */
.entry {
  scroll-margin-top: 5rem;
}

/* Deep-link target highlight intentionally disabled —
   no tinted background on entries arrived at via #anchor. */

/* ---------- citation links + tooltip ---------- */
.cite {
  position: relative;
  color: inherit;
  text-decoration: underline dotted var(--ink-3);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: help;
}

.cite:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.cite:hover::after {
  content: attr(data-cite);
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  z-index: 50;
  display: block;
  width: max-content;
  max-width: 26rem;
  padding: 0.7rem 0.85rem;
  background: #141414;
  color: #f4f4f4;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-decoration: none;
  white-space: normal;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

/* flip tooltip to the right edge when near the viewport right */
.cite:hover::before {
  content: "";
  position: absolute;
  top: calc(100% + 0.15rem);
  left: 0.35rem;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-bottom-color: #141414;
  z-index: 51;
  pointer-events: none;
}

/* bibliography entries are the anchor targets — leave room under the sticky masthead */
.bib-item {
  scroll-margin-top: 5rem;
}

/* Deep-link target highlight intentionally disabled. */

/* ---------- colophon ---------- */
.colophon {
  max-width: 72rem;
  margin: 1.5rem auto 0;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.colophon__line {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 0.2rem 0;
}
