:root {
  --bg: #f6f2e9; --ink: #222018; --muted: #5d584b; --line: #d9d1bf; --card: #fffdf7;
  --accent: #2f5d50; --accent-soft: #e2ece6; --warn: #8a4b12; --warn-soft: #f6e3cc;
  --he: "Noto Serif Hebrew", "SBL Hebrew", "Taamey Frank CLM", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
main, .top, .foot { max-width: 960px; margin: 0 auto; padding: 0 16px; }
section { margin: 40px 0; }
h1 { font-size: 2.2rem; margin: .1em 0 .2em; }
h1 [lang="he"] { font-family: var(--he); font-weight: 600; margin-inline-start: .3em; color: var(--accent); }
h2 { font-size: 1.4rem; margin: 0 0 .3em; }
.h3 { font-size: 1.05rem; margin: 22px 0 4px; }
.eyebrow { margin: 20px 0 0; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--muted); }
.lede { color: var(--muted); max-width: 46em; }
.note { color: var(--muted); font-size: .92rem; margin: .2em 0 .8em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }
:focus-visible { outline: 3px solid #c47a1d; outline-offset: 2px; }
a { color: var(--accent); }

.banner { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid #e6c9a4; padding: 10px 16px; font-size: .9rem; text-align: center; }

.video-frame { position: relative; background: #111; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.video-frame video { width: 100%; height: 100%; display: block; background: #111; }
.video-missing { position: absolute; inset: 0; display: grid; place-items: center; color: #eee; padding: 20px; text-align: center; }
.proof-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: .92rem; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-ok { background: var(--accent-soft); color: var(--accent); }
.proof-switch button { margin-inline-start: 4px; }

button { font: inherit; cursor: pointer; }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 10px; min-height: 40px; }
.btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled { cursor: default; opacity: .6; }
.seek { border: 1px solid var(--accent); color: var(--accent); background: transparent; border-radius: 8px; padding: 4px 10px; min-height: 36px; font-size: .88rem; }
.seek:disabled { border-color: var(--line); color: var(--muted); }

.moments { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.moments li button { width: 100%; text-align: start; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; min-height: 56px; }
.moments li button[aria-current="true"] { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.moments .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8rem; display: block; }
.moments .s { font-size: .78rem; display: block; }
.moments .playable { color: var(--accent); }
.moments .pending { color: var(--muted); }

.corners { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.corners li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }

.he { font-family: var(--he); font-size: 1.22rem; line-height: 1.8; direction: rtl; text-align: right; unicode-bidi: isolate; }
.corners .he { font-size: 1.35rem; }
.en-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 2px; }
.en { font-size: .95rem; }
.cite { font-size: .85rem; color: var(--muted); margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
mark { background: #f2dfa6; color: inherit; padding: 0 2px; border-radius: 3px; }

/* map */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.map { position: relative; aspect-ratio: 1 / 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map line { stroke: var(--line); stroke-width: .5; vector-effect: non-scaling-stroke; transition: stroke .2s, opacity .2s; }
.map line { stroke-width: 2; }
.map line.on { stroke: var(--accent); }
.map line.dim { opacity: .3; }
.node { position: absolute; transform: translate(-50%, -50%); border: 2px solid var(--accent); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 12px; min-height: 44px; min-width: 44px; max-width: 42%; line-height: 1.2; font-size: .9rem; text-align: center; transition: opacity .2s, background .2s; }
.node .nhe { display: block; font-family: var(--he); font-size: 1rem; }
.node.center { background: var(--accent); color: #fff; font-size: 1rem; padding: 10px 16px; }
.node[aria-pressed="true"] { background: #c47a1d; border-color: #c47a1d; color: #fff; }
.node.dim { opacity: .4; }
.map-panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 200px; }
.map-panel h3 { margin: 0 0 4px; }
.map-panel .link { font-style: italic; color: var(--muted); }
.map-panel .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.map-list { margin-top: 12px; }
.map-list summary { cursor: pointer; min-height: 40px; }

/* collection */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.theme { margin-bottom: 28px; }
.theme h3 { border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.card .src { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 4px; }
.held { font-size: .9rem; color: var(--muted); }
.foot { border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 40px; font-size: .88rem; color: var(--muted); }

@media (max-width: 720px) {
  h1 { font-size: 1.8rem; }
  .map-wrap { grid-template-columns: 1fr; }
  .node { font-size: .82rem; padding: 4px 8px; }
  .node .nhe { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.now { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; }
.now-h { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.now .src { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 2px; }
.now .he { font-size: 1.35rem; margin: .2em 0; }
.now .en-label:first-of-type { margin-top: 8px; }
.cite-full { margin: 0; font-size: .95rem; }
/* Phones: let the player run edge to edge so the burned-in card text keeps its designed size (12.8 px Hebrew at 390 px). */
@media (max-width: 600px) { .video-frame { margin-inline: -16px; border-radius: 0; } }
.video-missing[hidden] { display: none; }
