:root {
  --bg: #14161c; --panel: #1c1f27; --border: #2c2f3a; --text: #e6e8ee;
  --muted: #9aa0ae; --accent: #c9a24b; --accent-soft: #3a3220;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font: 16px/1.55 Arial, Helvetica, sans-serif; }
header { padding: 14px 24px; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:space-between; flex-wrap: wrap; gap: 10px; }
/* Sticky global header: shared #site-header, used by every page including index.html now. */
header#site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); }
.brand { display:flex; align-items:center; gap:8px; color: var(--text); text-decoration:none; font-size:1rem; letter-spacing:.06em; font-family: system-ui, sans-serif; }
.brand img { width:24px; height:24px; }
header h1 { margin:0 0 4px; font-size: 1.6rem; font-weight: 700; }
header p { margin:0; color:var(--muted); font-family: system-ui, sans-serif; font-size: .9rem; }
/* No margin-top: this nav sits beside .brand in one flex row (align-items:center handles the
   vertical centering) - the old margin-top was left over from an earlier stacked header design
   (a big h1 title + tagline paragraph, with nav below them) that no page still uses, and was
   inflating every page's header height for no visible reason. */
nav { display:flex; gap:16px; flex-wrap: wrap; font-family: system-ui, sans-serif; font-size:.85rem; }
nav a { color: var(--accent); text-decoration:none; cursor:pointer; }
nav a.active { text-decoration: underline; }
nav a:focus-visible, .brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
@media (max-width: 600px) {
  header { padding: 12px 16px; }
  header h1 { font-size: 1.3rem; }
  main { padding: 16px; }
}
section { display:none; }
section.active { display:block; }

.layout { display:grid; grid-template-columns: 1fr 380px; gap: 24px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.video-pane { position: sticky; top: 24px; align-self: start; }
.video-pane .frame-wrap { position:relative; padding-top:56.25%; background:#000; border-radius:8px; overflow:hidden; border:1px solid var(--border); }
.video-pane iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.video-meta { margin-top:10px; font-family: system-ui, sans-serif; font-size:.82rem; color: var(--muted); }
.video-meta .title { color: var(--text); font-weight:600; display:block; margin-bottom:4px; }
.badge { font-family: system-ui, sans-serif; font-size:.72rem; padding:2px 8px; border-radius:10px; background:#22303a; color:#7fb8d6; }

.claim { background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:18px 20px; margin-bottom:16px; }
.claim .meta { display:flex; gap:10px; align-items:center; font-family: system-ui, sans-serif; font-size:.78rem; color: var(--muted); margin-bottom:8px; flex-wrap: wrap; }
.ts-btn { background: var(--accent-soft); color: var(--accent); border:1px solid #4a3f24; border-radius:6px; padding:3px 9px; font-family: system-ui, sans-serif; font-size:.78rem; cursor:pointer; }
.ts-btn:hover { background:#4a3f24; }
.claim p { margin: 0 0 8px; }
.refs { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.ref { position:relative; display:inline-block; color: var(--accent); border-bottom: 1px dotted var(--accent); cursor: help; font-family: system-ui, sans-serif; font-size:.85rem; }
.ref .tip { display:none; position:absolute; bottom: 130%; left:0; width: 300px; max-height: 60vh; overflow-y: auto; background:#0e0f13; border:1px solid var(--border); border-radius:8px; padding:12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); font-family: Arial, Helvetica, sans-serif; font-size:.92rem; line-height:1.5; z-index: 50; }
.ref .tip .label { display:block; font-family: system-ui, sans-serif; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color: var(--muted); margin-bottom:6px; }
/* Scoped to real hover-capable pointers (a mouse) only. Without this, a touch tap on a chip that
   has both a :hover style and a click handler makes WebKit fake a hover state first - as part of
   that simulation it auto-scrolls the chip into view, and the tap that would normally open the
   chapter modal gets consumed just registering "hover", forcing a second tap. Scoping the tooltip
   to (hover: hover) means touch devices never trigger that simulation at all: a single tap goes
   straight to the click handler (the full chapter modal), with no scroll jump and no second tap. */
@media (hover: hover) {
  .ref:hover .tip, .ref.pinned .tip { display:block; }
}
.ref .tip .placeholder { color: var(--muted); font-style: italic; }
.verse-nextpage { display: inline-block; margin-top: 8px; color: var(--accent); font-family: system-ui, sans-serif; font-size: .8rem; text-decoration: none; }
.verse-nextpage:hover { text-decoration: underline; }
/* Flipped downward (via JS, when there isn't enough room above the chip) instead of the default
   "open upward", so the tooltip never renders hidden behind the sticky header or off-screen. */
.ref.tip-below .tip { bottom: auto; top: 130%; }
.certainty { font-family: system-ui, sans-serif; font-size:.82rem; color:var(--muted); border-left:2px solid var(--border); padding-left:10px; margin-top:10px; }
.caveat { font-family: system-ui, sans-serif; font-size:.78rem; color:#c98d4b; border-left:2px solid #4a3320; padding-left:10px; margin-top:6px; }

.place-card, .teacher-card { background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:16px 20px; margin-bottom:14px; }
.place-card h3, .teacher-card h3 { margin:0 0 10px; font-size:1.05rem; }
.view-row { font-family: system-ui, sans-serif; font-size:.88rem; padding:8px 0; border-top:1px solid var(--border); }
.view-row:first-of-type { border-top:none; }
.view-row .who { color: var(--accent); font-weight:600; }
.view-row .note { color: var(--muted); font-size:.82rem; margin-top:2px; }

footer { max-width:1200px; margin: 0 auto; padding: 20px 24px 40px; color: var(--muted); font-family: system-ui, sans-serif; font-size:.78rem; text-align: center; border-top: 1px solid var(--border); }
footer a { color: var(--accent); text-decoration: none; }
