/* ── Research · hover a sentence (index.html, #hover-cite) ───────────────
   The Research page in miniature: a brief window; the citation card that
   opens beside it, level with the hovered sentence's marker; and the page
   window beside the card, the cited page in it with every element outlined
   and the cited one boxed. Where things sit on the desk is set here; the
   card's height on it, the sheet's zoom and the walking pointer's place are
   set by js/hover-cite.js.

   The windows wear the app's frame (a title bar with close, minimize and the
   grip), in this site's colours: the app's blue is this site's ink, its red
   this site's accent. Under 1100px the desk is a column: the brief, the card,
   the window. */

.hc-frame {
  margin-top: 42px;
  border: 1px solid var(--line);
  background: var(--paper-dark);
}
.hc-desk {
  --brief-w: 37%;
  --card-w: 240px;
  /* the card reaches this far over the brief, no further than its padding */
  --over: 14px;
  position: relative;
  height: 470px;
  overflow: hidden;
  font-family: var(--sans);
  background-image: radial-gradient(rgba(22, 22, 22, 0.08) 1px, transparent 1.3px);
  background-size: 18px 18px;
}

/* ── the windows ─────────────────────────────────────────────────── */
.hc-win {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 16px 40px rgba(22, 22, 22, 0.1);
  overflow: hidden;
}
.hc-brief {
  left: 22px;
  top: 22px;
  bottom: 22px;
  width: var(--brief-w);
}
/* beside the card, its left edge a little under the card's right one */
.hc-pagewin {
  top: 48px;
  right: 22px;
  left: calc(22px + var(--brief-w) - var(--over) + var(--card-w) - 14px);
  height: 350px;
}
.hc-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px 0 8px;
  border-bottom: 1px solid var(--line);
}
.hc-ctl { display: flex; gap: 4px; color: #a5a59f; }
.hc-i {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hc-t { flex: 1; min-width: 0; padding-left: 2px; line-height: 1.25; }
.hc-t b {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hc-t i {
  display: block;
  font: normal 9.5px var(--mono);
  color: var(--graphite);
  white-space: nowrap;
}
.hc-nav,
.hc-zoom { flex: none; font: 9.5px var(--mono); color: var(--graphite); }

/* ── the brief ───────────────────────────────────────────────────── */
.hc-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
}
.hc-body p { margin: 0 0 10px; }
.hc-body .hc-sec {
  margin: 0 -14px 8px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--line);
  background: #f5f5f1;
  font-size: 12px;
  font-weight: 600;
}
.hc-body .hc-sec + p,
.hc-body .hc-sec + ul { margin-top: 2px; }
.hc-body * + .hc-sec { margin-top: 12px; border-top: 1px solid var(--line); }
.hc-list { margin: 0 0 10px; padding-left: 16px; }
.hc-list li { margin: 0 0 6px; padding-left: 2px; }
.hc-list li::marker { color: #b9b9b2; }
.hc-q { font-weight: 600; }
.hc-q b { margin-right: 3px; font: 11px var(--mono); color: var(--graphite); }
.hc-fade {
  -webkit-mask-image: linear-gradient(#000, transparent);
  mask-image: linear-gradient(#000, transparent);
}
.hc-piece {
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 0.2s;
}
.hc-piece.is-on { background: rgba(var(--accent-rgb), 0.08); }
/* the marker: primary in ink, conflicting in the accent */
.hc-mark {
  display: inline-block;
  margin: 0 1px 0 3px;
  padding: 2px 4px;
  border: 1px solid #cdcdc6;
  border-radius: 3px;
  background: #f5f5f1;
  font: 8.5px/1 var(--mono);
  color: var(--ink);
  vertical-align: 5px;
}
.hc-conf .hc-mark {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent);
}

/* ── the citation card: faint until the pointer is on it ─────────── */
.hc-card {
  position: absolute;
  z-index: 4;
  left: calc(22px + var(--brief-w) - var(--over));
  top: 96px;
  width: var(--card-w);
  box-sizing: border-box;
  padding: 10px 12px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(22, 22, 22, 0.16);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.2s, top 0.35s cubic-bezier(0.3, 0.7, 0.25, 1);
}
.hc-card.is-open { opacity: 0.82; }
.hc-card:hover { opacity: 1; }
.hc-card p { margin: 0; }
.hc-card .hc-card-tot { margin-bottom: 8px; font: 9.5px var(--mono); color: var(--graphite); }
.hc-card-doc { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.hc-thumb {
  flex: none;
  width: 22px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff repeating-linear-gradient(#fff 0 3px, #dcdcd6 3px 4px) 4px 5px / 13px 17px no-repeat;
}
.hc-card-doc b { display: block; font-size: 11.5px; font-weight: 600; }
.hc-card-doc i { display: block; font: normal 9.5px var(--mono); color: var(--graphite); }
.hc-card .hc-card-pg {
  margin: 0 0 2px 10px;
  font: 9px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a8a8a1;
}
.hc-card .hc-card-q {
  margin-left: 10px;
  padding: 1px 0 1px 8px;
  border-left: 2px solid var(--ink);
  color: #3c3c39;
}
.hc-card-q em { display: none; margin-left: 6px; font: normal 9px var(--mono); color: #a8a8a1; }
.hc-card.is-conf .hc-card-q { border-left-color: var(--accent); }
.hc-card.is-conf .hc-card-q em { display: inline; }
.hc-card .hc-card-act {
  display: flex;
  gap: 14px;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--graphite);
}
.hc-card-act span { display: inline-flex; align-items: center; gap: 4px; }
.hc-card-act .o { font-weight: 600; color: var(--ink); }
.hc-card-act .hc-i { width: 11px; height: 11px; }

/* ── the page window: a US Letter sheet, drawn at 612 × 792 ──────── */
.hc-view {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #f1f1ed;
}
.hc-sheet {
  position: absolute;
  left: 0;
  top: 0;
  width: 612px;
  height: 792px;
  box-sizing: border-box;
  padding: 40px 44px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(22, 22, 22, 0.08), 0 3px 10px rgba(22, 22, 22, 0.08);
  font: 9.5px/1.4 var(--sans);
  color: #2b2b29;
  transform-origin: 0 0;
  /* roughly the whole page, for a browser without the script; --s is the
     sheet's scale, so the outlines below keep their width on screen */
  --s: 0.33;
  transform: translate(92px, 12px) scale(0.33);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s, visibility 0.3s;
}
.hc-sheet.is-shown { opacity: 1; visibility: visible; }
.hc-sheet.hc-snap { transition: opacity 0.3s, visibility 0.3s; }
.hc-sheet p { margin: 0; }

/* The fingerprint: every element the reader found, outlined. The cited one
   is boxed and labelled, as the review room draws it. Both lines are 1px and
   2px on screen at any zoom. */
.hc-blk {
  position: relative;
  margin-bottom: 14px;
  outline: calc(1px / var(--s)) solid rgba(var(--accent-rgb), 0.32);
  outline-offset: 4px;
}
.hc-sheet .hc-hit {
  position: relative;
  outline: calc(2px / var(--s)) solid var(--accent);
  outline-offset: 3px;
  background: rgba(var(--accent-rgb), 0.07);
}
.hc-hit::after {
  content: attr(data-kind);
  position: absolute;
  left: -6px;
  bottom: calc(100% + 6px);
  padding: 3px 5px;
  background: var(--accent);
  font: 9px/1 var(--mono);
  letter-spacing: 0.06em;
  color: #fff;
  white-space: nowrap;
}

.hc-ln {
  display: block;
  height: 5px;
  margin: 0 0 6px;
  border-radius: 1px;
  background: #e6e6e1;
}
.hc-ln:last-child { margin-bottom: 0; }
.hc-ln.m { width: 82%; }
.hc-ln.s { width: 55%; }
.hc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #2b2b29;
}
.hc-head b { font-size: 13px; letter-spacing: -0.01em; }
.hc-head span { font-size: 8.5px; color: #6d6d68; }
.hc-shd {
  display: inline-block;
  padding: 2px 6px;
  background: #2b2b29;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}
.hc-sub { font-size: 9.5px; font-weight: 700; }
.hc-addr { width: 180px; }
.hc-tbl { width: 100%; border-collapse: collapse; font-size: 8.5px; }
.hc-tbl th,
.hc-tbl td {
  padding: 3px 5px;
  border: 1px solid #cfcfc9;
  font-weight: 400;
  text-align: left;
}
.hc-tbl th { background: #f2f2ee; font-weight: 600; }
.hc-tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.hc-field { width: fit-content; padding: 5px 9px; border: 1px solid #cfcfc9; }
.hc-field span { display: block; font-size: 8.5px; color: #55554f; }
.hc-field b { font-size: 13px; }
.hc-rows { width: 250px; }
.hc-rows p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px solid #e3e3de;
}
.hc-rows b { font-variant-numeric: tabular-nums; }
.hc-w2 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; border: 1.5px solid #2b2b29; }
.hc-w2 > div { min-height: 34px; padding: 3px 6px; border: 0.5px solid #8a8a85; }
.hc-w2 i { display: block; font-size: 7.5px; font-style: normal; color: #55554f; }
.hc-w2 b { display: block; margin-top: 3px; font: 600 10.5px var(--mono); }
.hc-w2-ghost > div { min-height: 30px; }
.hc-sign { display: flex; align-items: flex-end; gap: 10px; }
.hc-sign .hc-ln { flex: 0 0 180px; }

/* ── the walking pointer: shown until a visitor's own takes over ─── */
.hc-pointer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: 17px;
  height: 24px;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.25));
  transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.25, 1), opacity 0.3s;
}
.hc-pointer svg { display: block; width: 100%; height: 100%; }
.hc-pointer path { fill: var(--ink); stroke: #fff; stroke-width: 1.3; stroke-linejoin: round; }
.is-walking .hc-pointer { opacity: 1; }

/* ── the meter: where the cited element is, as a four-number box ── */
.hc-meter {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  font: 10px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
}
.hc-meter-box { color: var(--accent); text-transform: none; letter-spacing: 0.04em; }

/* ── a column under 1100px: the brief, the card, the window ──────── */
@media (max-width: 1099px) {
  .hc-desk { display: grid; gap: 14px; height: auto; padding: 16px; }
  .hc-win,
  .hc-card { position: static; width: auto; }
  .hc-card { opacity: 1; box-shadow: none; transition: none; }
  .hc-pagewin { height: 340px; }
  .hc-pointer { display: none; }
}
@media (max-width: 480px) {
  .hc-desk { padding: 10px; }
  .hc-meter { flex-direction: column; gap: 4px; padding: 12px 14px; }
}
@media (hover: none) {
  .hc-pointer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hc-sheet,
  .hc-card,
  .hc-piece,
  .hc-pointer { transition: none; }
}
