/* Two Girls One Ghost transcript archive. A lacquered Ouija board: bone ink and
   brass lettering on near-black, spectral green reserved for what the planchette
   finds. Fraunces carries the board's print voice; Instrument Sans does the reading. */

:root {
  --board: #15100e;
  --surface: #1f1715;
  --raised: #2a201c;
  --ink: #ead9bd;
  --muted: #a3927f;
  --brass: #d4a853;
  --brass-dim: #8e6f32;
  --spectral: #8fe3cc;
  --spectral-ink: #0d1b17;
  --line: #3a2d27;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text: "Instrument Sans", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--board); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% -10%, #2a1d18 0%, transparent 60%),
    var(--board);
  font: 400 17px/1.6 var(--text);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brass); text-decoration-color: var(--brass-dim); text-underline-offset: 3px; }
a:hover { color: #e9c272; }
:focus-visible { outline: 2px solid var(--spectral); outline-offset: 3px; border-radius: 4px; }
mark { background: var(--spectral); color: var(--spectral-ink); padding: 0 3px; border-radius: 3px; }
b { font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main, .top, footer { max-width: 780px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); margin: 20px 0 10px; font-variation-settings: "opsz" 72; }
h2 { font-size: 1.35rem; margin: 36px 0 10px; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 60ch; margin: 8px 0 22px; }
.note { color: var(--muted); font-size: 0.9rem; max-width: 65ch; margin-top: 28px; }

/* Facts under a title: plain spans, spaced not punctuated */
.facts { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 0.9rem; margin: 0 0 14px; }

/* Header and footer */
.top { padding: 26px 16px 6px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.brand-name { font: 400 1.45rem/1.05 "IM Fell English", var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.brand-sub { color: var(--muted); font: 400 0.72rem/1.4 "IM Fell English", var(--display); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 3px; }
.brand-note { color: var(--muted); font-size: 0.8rem; margin-top: 6px; opacity: 0.85; }
.top nav { display: flex; gap: 20px; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--muted); padding: 4px 0; border-bottom: 1px solid transparent; }
.top nav a:hover, .top nav a[aria-current] { color: var(--brass); border-bottom-color: var(--brass-dim); }
footer { color: var(--muted); font-size: 0.85rem; padding-top: 56px; padding-bottom: 48px; text-align: center; }
/* Splash on the first page of a visit */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--board); cursor: pointer; transition: opacity 0.8s ease; }
html:not([data-splash="show"]) .splash { display: none; }
.splash p { margin: 0; font: italic 400 clamp(2rem, 6vw, 3.4rem) var(--display); font-variation-settings: "opsz" 144; color: var(--brass); letter-spacing: 0.04em; text-shadow: 0 0 28px rgba(143, 227, 204, 0.35); animation: splash-in 1.4s ease-out both; }
.splash.gone { opacity: 0; pointer-events: none; }
@keyframes splash-in { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .splash p { animation: none; } .splash { transition: none; } }
.goodbye { font: 500 1.3rem var(--display); letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass-dim); margin: 0 0 10px; }

/* ---------- The board ---------- */
.seance { margin-top: 8px; }
.board { display: block; width: 100%; height: auto; overflow: visible; }
.board .letter { font-family: var(--display); font-weight: 500; fill: var(--brass); text-anchor: middle; dominant-baseline: middle; transition: fill 0.3s; }
.board .corner { fill: none; stroke: var(--brass-dim); stroke-width: 2; }
.board .corner text { fill: var(--brass-dim); stroke: none; font: 500 22px var(--display); text-anchor: middle; letter-spacing: 0.15em; text-transform: uppercase; }
.board .planchette path { fill: rgba(42, 32, 28, 0.78); stroke: var(--brass); stroke-width: 2.5; }
.board .planchette .window { fill: var(--board); stroke: var(--spectral); stroke-width: 2.5; filter: drop-shadow(0 0 7px var(--spectral)); }
.board .planchette { transition: transform 0.55s cubic-bezier(0.3, 0.9, 0.3, 1); opacity: 0.9; }
.board .planchette.awake { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .board .planchette { transition: none; } }

.ask { margin: 22px 0 0; position: relative; }
@media (min-width: 700px) { .ask { margin-top: 34px; } }
#q {
  width: 100%;
  padding: 16px 18px 16px 52px;
  font: 500 1.1rem var(--text);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--brass-dim);
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(212, 168, 83, 0.06), 0 14px 40px rgba(0, 0, 0, 0.45);
}
#q::placeholder { color: var(--muted); }
#q:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 6px rgba(143, 227, 204, 0.12), 0 14px 40px rgba(0, 0, 0, 0.45); }
.ask::before {
  content: ""; position: absolute; left: 20px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  border: 2px solid var(--brass); border-radius: 50%; box-sizing: border-box;
}
.ask::after { content: ""; position: absolute; left: 33px; top: 50%; width: 9px; height: 2px; margin-top: 4px; background: var(--brass); transform: rotate(45deg); }
.home .lede { text-align: center; margin: 18px auto 10px; }

/* ---------- Results ---------- */
.results { margin-top: 10px; }
.results.open { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.summary { color: var(--muted); margin: 0 0 14px; }
.controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chips, .sorts { display: flex; flex-wrap: wrap; gap: 8px; }
.controls button {
  font: 500 0.85rem var(--text); color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.controls button i { font-style: normal; margin-left: 6px; opacity: 0.7; }
.controls button[aria-pressed="true"] { color: var(--board); background: var(--brass); border-color: var(--brass); }
.hits { list-style: none; padding: 0; margin: 0; }
.hit { padding: 20px 0; border-bottom: 1px solid var(--line); }
.hit .title { font: 500 1.2rem/1.3 var(--display); text-decoration: none; display: block; margin-bottom: 4px; }
.hit .facts { margin-bottom: 8px; }
.tag { color: var(--spectral); }
.moments { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.moments li { padding-left: 14px; border-left: 2px solid var(--line); }
.moments a { text-decoration: none; display: flex; gap: 12px; align-items: baseline; font-size: 0.9rem; }
.moments .when { font: 500 0.9rem var(--display); color: var(--brass); min-width: 3.2em; }
.moments .chap { color: var(--muted); }
.moments p, .excerpt { margin: 2px 0 0; font-size: 0.95rem; color: var(--ink); }
.more-moments { display: inline-block; margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.load { display: block; margin: 20px auto 0; font: 500 0.95rem var(--text); color: var(--brass); background: transparent; border: 1px solid var(--brass-dim); border-radius: 999px; padding: 10px 22px; cursor: pointer; }
.load:hover { border-color: var(--brass); }

/* ---------- Lists ---------- */
.all { margin: 28px 0 0; border-top: 1px solid var(--line); padding-top: 14px; }
.all summary { cursor: pointer; font: 500 1.05rem var(--display); color: var(--ink); }
#filter { width: 100%; margin: 12px 0; padding: 10px 14px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li a { text-decoration: none; }
.list .facts { margin: 2px 0 0; font-size: 0.82rem; }

/* ---------- Episode page ---------- */
.episode h1 { max-width: 28ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 24px; }
.watch { display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--brass); color: var(--board); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.watch:hover { background: #e9c272; color: var(--board); }
.hint { color: var(--muted); font-size: 0.85rem; }
.transcript { position: relative; max-width: 66ch; }
.transcript .chapter { font-size: 1.3rem; margin: 40px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.transcript .chapter a { text-decoration: none; color: var(--ink); }
.transcript .chapter a:hover { color: var(--brass); }
.transcript .mark { font: 500 0.8rem var(--display); color: var(--brass-dim); margin: 18px 0 2px; }
.transcript .mark a { text-decoration: none; color: inherit; }
.transcript .mark a:hover { color: var(--brass); }
.transcript p { margin: 0 0 12px; }
.transcript [data-t] { cursor: pointer; border-radius: 3px; transition: background 0.15s; }
.transcript [data-t]:hover { background: var(--raised); box-shadow: 0 0 0 3px var(--raised); }
.transcript [data-t]:hover::after { content: " ▶ " attr(data-c); color: var(--spectral); font: 500 0.78rem var(--text); white-space: nowrap; }
.transcript .lit { background: var(--surface); box-shadow: 0 0 0 8px var(--surface); border-radius: 4px; }
.transcript h2.lit, .transcript h3.lit { background: none; box-shadow: none; color: var(--spectral); }
@media (min-width: 900px) {
  .transcript .mark { position: absolute; left: -72px; width: 60px; text-align: right; margin: 4px 0 0; }
  .transcript h3.lit::after { content: " ◆"; }
}

/* ---------- Most mentioned ---------- */
.ranking { list-style: none; padding: 0; margin: 0; }
.ranking > li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ranking .rank { flex: 0 0 1.6em; text-align: right; color: var(--muted); font: 500 1.05rem var(--display); padding-top: 2px; }
.ranking .who { flex: 1; min-width: 0; }
.ranking summary { cursor: pointer; list-style: none; }
.ranking summary::-webkit-details-marker { display: none; }
.ranking .name { color: var(--brass); font: 500 1.15rem var(--display); }
.ranking .name::after { content: " ▸"; color: var(--brass-dim); font-size: 0.8em; }
.ranking details[open] .name::after { content: " ▾"; }
.bar { display: block; height: 6px; margin: 8px 0 6px; background: var(--raised); border-radius: 4px; }
.bar span { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--brass); border-radius: 4px; min-width: 4px; }
.ranking .nums { display: block; font-size: 0.85rem; color: var(--muted); }
.eps-head { margin: 12px 0 4px; color: var(--muted); font-size: 0.85rem; }
.eps { margin: 0; padding-left: 1.4em; font-size: 0.92rem; line-height: 1.5; }
.eps li { padding: 3px 0; overflow-wrap: anywhere; }
.eps li a { text-decoration: none; }
.eps span { color: var(--muted); }
.more { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }

/* ---------- By the numbers ---------- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 26px 0 10px; }
.fig { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 16px; }
.fig b { display: block; font: 400 2.4rem/1 var(--display); font-variation-settings: "opsz" 144; color: var(--brass); letter-spacing: -0.02em; }
.fig span { display: block; margin-top: 8px; color: var(--muted); font-size: 0.9rem; }
figure { margin: 40px 0 0; }
figcaption h2 { margin: 0 0 4px; }
figcaption p { margin: 0 0 14px; color: var(--muted); font-size: 0.92rem; }
.columns { width: 100%; height: auto; display: block; }
.columns rect { fill: var(--brass); }
.columns g:hover rect { fill: #e9c272; }
.columns .val { fill: var(--ink); font: 500 15px var(--text); }
.columns .axis { fill: var(--muted); font: 500 14px var(--text); }
.hbars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: center; font-size: 0.92rem; }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-name a { text-decoration: none; color: var(--ink); }
.hb-name a:hover { color: var(--brass); }
.hb-bar { display: block; height: 10px; background: var(--raised); border-radius: 4px; }
.hb-bar span { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--brass); border-radius: 4px; min-width: 4px; }
.hb-bar:hover span { background: #e9c272; }
.hb-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) {
  .hbars li { grid-template-columns: minmax(0, 1fr) auto; }
  .hb-bar { grid-column: 1 / -1; order: 3; }
  .hb-name { white-space: normal; }
}
