/* ─── signature.css (iter65) ──────────────────────────────────────────
 * Shared patterns for the "above-and-beyond" sub-page treatments.
 * Loaded only on pages that use them.
 *
 * Patterns:
 *   .drawer-list / .drawer       — apothecary cabinet accordion (science)
 *   .scroll-spy-toc              — sticky scroll-spy table of contents
 *   .gauge-meter                 — SVG arc + needle for status meters
 *   .timeline-rail               — vertical SVG path that draws on scroll
 *   .tard-anchor                 — positioning helper for [data-tard-companion]
 *   [data-reveal]                — opacity reveal-on-scroll (works with animate.js)
 *   .citation-card / .citation-hover — wax-seal citation hover preview
 * ──────────────────────────────────────────────────────────────────── */

/* ── Drawer list (apothecary cabinet) ──────────────────────────── */
.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer {
  position: relative;
  background: #FFFFFF;
  border: 1px solid rgba(14, 30, 30, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}
.drawer:hover {
  border-color: rgba(15, 148, 139, 0.32);
  box-shadow: 0 10px 28px -10px rgba(14, 30, 30, 0.16);
}
.drawer[open] {
  border-color: rgba(15, 148, 139, 0.45);
  box-shadow: 0 12px 36px -10px rgba(15, 148, 139, 0.18);
}

.drawer > summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 18px 22px;
  font-family: var(--display);
  position: relative;
}
.drawer > summary::-webkit-details-marker { display: none; }

.drawer .drawer-num {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--teal-100, #DDEEEA);
  color: var(--teal-deep, #086E66);
  font-family: var(--serif, "Domine", Georgia, serif);
  font-style: italic;
  font-size: 16px;
  font-weight: 400;
}
.drawer[open] .drawer-num {
  background: var(--teal-deep, #086E66);
  color: #fff;
}

.drawer .drawer-title {
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink, #15161A);
}
.drawer .drawer-meta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute, #6E707A);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.drawer .drawer-meta .pill {
  background: rgba(15, 148, 139, 0.08);
  color: var(--teal-deep, #086E66);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* Pull handle — apothecary detail */
.drawer .drawer-handle {
  position: relative;
  width: 28px; height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(14, 30, 30, 0.04);
  color: var(--ink-mute, #6E707A);
  transition: background 240ms ease, color 240ms ease, transform 240ms ease;
}
.drawer .drawer-handle::before {
  content: "";
  width: 10px; height: 2px;
  background: currentColor;
  border-radius: 999px;
}
.drawer .drawer-handle::after {
  content: "";
  width: 2px; height: 10px;
  background: currentColor;
  border-radius: 999px;
  position: absolute;
  transition: transform 240ms cubic-bezier(.4, 0, .2, 1);
}
.drawer[open] .drawer-handle {
  background: var(--teal-deep, #086E66);
  color: #fff;
}
.drawer[open] .drawer-handle::after { transform: scaleY(0); }

.drawer .drawer-content {
  padding: 4px 22px 22px;
  color: var(--ink-2, #2A2C33);
  font-size: 15px;
  line-height: 1.65;
}
.drawer .drawer-content > :first-child { margin-top: 12px; }
.drawer .drawer-content h3 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink, #15161A);
  margin: 22px 0 6px;
}

/* ── Citation card with wax-seal hover preview ─────────────────── */
.drawer .drawer-content blockquote.cite,
blockquote.cite {
  position: relative;
  margin: 14px 0;
  padding: 14px 18px 14px 44px;
  background: rgba(15, 148, 139, 0.04);
  border-left: 2px solid var(--teal-deep, #086E66);
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2, #2A2C33);
  transition: background 200ms ease;
}
blockquote.cite::before {
  /* Wax-seal teal circle */
  content: "";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--teal-deep, #086E66);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4),
              0 1px 3px rgba(14, 30, 30, 0.18);
}
blockquote.cite::after {
  content: "P";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  font-family: var(--serif, "Domine", Georgia, serif);
  font-style: italic;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
}
blockquote.cite:hover {
  background: rgba(15, 148, 139, 0.08);
}

/* ── Scroll-spy TOC ────────────────────────────────────────────── */
.scroll-spy-toc {
  position: sticky;
  top: 110px;
  align-self: start;
  padding: 12px 0;
  font-family: var(--display);
  font-size: 13px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.scroll-spy-toc h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute, #6E707A);
  margin: 0 0 12px;
}
.scroll-spy-toc a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-2, #2A2C33);
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.scroll-spy-toc a:hover {
  background: rgba(15, 148, 139, 0.06);
  color: var(--teal-deep, #086E66);
}
.scroll-spy-toc a.is-active {
  background: rgba(15, 148, 139, 0.10);
  color: var(--teal-deep, #086E66);
  border-left-color: var(--teal-deep, #086E66);
  font-weight: 600;
}
.scroll-spy-toc a .cite-count {
  font-family: var(--serif, "Domine", Georgia, serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-mute, #6E707A);
}

/* ── Tardigrade anchor (positioning helper) ────────────────────── */
.tard-anchor {
  position: relative;
  display: inline-block;
}
.tard-anchor[data-anchor="margin-right"] {
  position: sticky;
  top: 140px;
  align-self: start;
  width: 72px;
  height: 72px;
  z-index: 5;
}
.tard-anchor[data-anchor="inline"] {
  display: inline-block;
  vertical-align: middle;
  width: 48px;
  height: 48px;
}
.tard-anchor[data-anchor="hero-corner"] {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 80px;
  height: 80px;
}

/* ── [data-reveal] fade-up ─────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms cubic-bezier(.2, .9, .3, 1),
              transform 700ms cubic-bezier(.2, .9, .3, 1);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ── Timeline rail (changelog P2) ──────────────────────────────── */
.timeline-rail {
  position: relative;
  padding-left: 32px;
}
.timeline-rail::before {
  content: "";
  position: absolute;
  left: 11px; top: 0; bottom: 0;
  width: 2px;
  background: rgba(15, 148, 139, 0.18);
  border-radius: 999px;
}
.timeline-rail-node {
  position: relative;
}
.timeline-rail-node::before {
  content: "";
  position: absolute;
  left: -27px; top: 18px;
  width: 12px; height: 12px;
  border-radius: 999px;
  background: var(--teal-deep, #086E66);
  box-shadow: 0 0 0 4px var(--bg, #FAFAF6),
              0 0 0 5px rgba(15, 148, 139, 0.18);
}

/* ── Gauge meter (status P3) ───────────────────────────────────── */
.gauge-meter {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
}
.gauge-meter svg { width: 100%; height: 100%; display: block; }
.gauge-meter .gauge-needle {
  transform-origin: 50% 100%;
  transition: transform 800ms cubic-bezier(.2, .9, .3, 1);
}
