:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-2: #edf1f8;
  --text: #1b2338;
  --muted: #55607a;
  --line: #dde3ee;
  --bible: #1e3f75;
  --bible-soft: #e4ebf7;
  --world: #0f6e78;
  --world-soft: #dcf0f1;
  --spine: #c7d0e0;
  --anchor: #1f6b4a;  --anchor-bg: #dff1e7;
  --approx: #56617a;  --approx-bg: #e7ebf2;
  --debated: #9a5a00; --debated-bg: #fcebcc;
  --tradition: #6a4a8c; --tradition-bg: #ece4f5;
  --shadow: 0 1px 2px rgba(15, 30, 60, .06), 0 4px 14px rgba(15, 30, 60, .07);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gold: #c99a32;
  --heading: #0f1f40;
  --accent: #b0852a;
  --header-bg: #0f2147; --header-fg: #ffffff; --header-muted: #c8d3e8;
  --era-bg: #0f2147; --era-fg: #ffffff; --era-muted: #c8d3e8; --era-accent: #f0c766;
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1120; --surface: #141b2e; --surface-2: #1c2540; --text: #e9edf6; --muted: #a2acc2;
    --line: #283350; --bible: #f0c766; --bible-soft: #2a2614; --world: #7cc9d1; --world-soft: #10303a;
    --spine: #34405c; --anchor: #7fd3a8; --anchor-bg: #1c3328; --approx: #b8c0d2; --approx-bg: #222b42;
    --debated: #f0b459; --debated-bg: #3a2c14; --tradition: #c3a6e6; --tradition-bg: #2d2438; --heading: #ffffff; --accent: #f0c766; --header-bg: #0a1022; --header-fg: #ffffff; --header-muted: #a2acc2; --era-bg: #1c2a4f; --era-fg: #ffffff; --era-muted: #c3cde2; --era-accent: #f0c766;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1120; --surface: #141b2e; --surface-2: #1c2540; --text: #e9edf6; --muted: #a2acc2;
  --line: #283350; --bible: #f0c766; --bible-soft: #2a2614; --world: #7cc9d1; --world-soft: #10303a;
  --spine: #34405c; --anchor: #7fd3a8; --anchor-bg: #1c3328; --approx: #b8c0d2; --approx-bg: #222b42;
  --debated: #f0b459; --debated-bg: #3a2c14; --tradition: #c3a6e6; --tradition-bg: #2d2438; --heading: #ffffff; --accent: #f0c766; --header-bg: #0a1022; --header-fg: #ffffff; --header-muted: #a2acc2; --era-bg: #1c2a4f; --era-fg: #ffffff; --era-muted: #c3cde2; --era-accent: #f0c766;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 140px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); box-shadow: inset 0 3px 0 var(--gold); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px/1 var(--serif); color: var(--bible); }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; padding: 6px 10px; border-radius: 8px; }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* Hero */
.hero { padding-top: 48px; padding-bottom: 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--bible); margin: 0 0 10px; }
.hero h1 { font: 700 clamp(30px, 5vw, 46px)/1.12 var(--serif); margin: 0 0 16px; max-width: 18em; letter-spacing: -.01em; text-wrap: balance; }
.lede { font-size: 18px; color: var(--muted); max-width: 44em; margin: 0; }

/* Controls */
.controls { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin-top: 20px; }
.controls-inner { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; padding-top: 12px; padding-bottom: 12px; }
.control { display: flex; flex-direction: column; gap: 4px; }
.control.grow { flex: 1 1 180px; }
.control-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button { font: 500 14px/1 var(--sans); border: 0; background: transparent; color: var(--muted); padding: 9px 13px; border-radius: 8px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--world); outline-offset: 2px; }
select, input[type="search"] {
  font: 15px/1.2 var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; width: 100%; min-height: 40px;
}

/* Legend */
.legend { margin-top: 18px; }
.legend details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.legend summary { cursor: pointer; font-weight: 600; }
.legend-body { font-size: 15px; color: var(--muted); }
.legend-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.legend-list .badge { margin-right: 8px; }

/* Badges */
.badge { display: inline-block; font: 600 11px/1 var(--sans); padding: 4px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.badge.anchor { color: var(--anchor); background: var(--anchor-bg); }
.badge.approx { color: var(--approx); background: var(--approx-bg); }
.badge.debated { color: var(--debated); background: var(--debated-bg); }
.badge.tradition { color: var(--tradition); background: var(--tradition-bg); }

/* Timeline */
.timeline-wrap { padding: 28px 0 60px; }
.lane-heads { display: grid; grid-template-columns: 1fr 96px 1fr; margin-bottom: 8px; }
.lane-head { font: 700 14px/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; padding: 8px 0; }
.lane-head.bible { color: var(--bible); text-align: right; }
.lane-head.world { color: var(--world); }

.timeline { list-style: none; margin: 0 auto; position: relative; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--spine); }

.row { display: grid; grid-template-columns: 1fr 96px 1fr; align-items: start; position: relative; margin: 10px 0; }
.row .spine-year {
  grid-column: 2; grid-row: 1; justify-self: center; margin-top: 14px; position: relative; z-index: 1;
  font: 600 12px/1 var(--sans); color: var(--muted); background: var(--bg); border: 1px solid var(--spine);
  border-radius: 999px; padding: 5px 8px; white-space: nowrap;
}
.row .spine-year:empty { display: none; }
.row.bible .card { grid-column: 1; grid-row: 1; }
.row.world .card { grid-column: 3; grid-row: 1; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px 14px; box-shadow: var(--shadow);
}
.card.bible { border-top: 3px solid var(--bible); }
.card.world { border-top: 3px solid var(--world); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.when { font-weight: 600; font-size: 14px; color: var(--muted); }
.card.bible .when { color: var(--bible); }
.card.world .when { color: var(--world); }
.alt-date { margin: 4px 0 0; font-size: 13px; color: var(--debated); }
.alt-date span { font-weight: 600; }
.card h3 { font: 600 20px/1.25 var(--serif); margin: 8px 0 4px; padding-right: 18px; }
.card p { margin: 6px 0 0; font-size: 15px; }
.refs { font-size: 13px !important; color: var(--bible); font-weight: 500; font-style: italic; }
.region { display: inline-block; font-size: 12px !important; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--world); }
.badges { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge.video { color: #fff; background: #c4302b; }
.card-video { margin: 12px 0 0; }
.yt-play, .yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.yt-play { position: relative; padding: 0; cursor: pointer; overflow: hidden; }
.yt-play img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.yt-play:hover img { transform: scale(1.03); }
.yt-icon { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 14px; background: rgba(196, 48, 43, .92); box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.yt-icon::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.yt-play:hover .yt-icon, .yt-play:focus-visible .yt-icon { background: #c4302b; }
.card-video figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--bible); margin-top: 6px; }
.card-video figcaption a { color: var(--muted); font-weight: 500; }
.note { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.note summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.note p { font-size: 14px !important; color: var(--muted); }
.permalink { position: absolute; bottom: 10px; right: 14px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 600; }
.card:hover .permalink, .permalink:focus { opacity: .7; }
.card.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--debated-bg), var(--shadow); } 100% { box-shadow: var(--shadow); } }

/* Packed two-lane layout (desktop) */
.timeline.packed > li { position: absolute; left: var(--gutter); right: var(--gutter); margin: 0; }
.timeline.packed > .row { display: block; }
.timeline.packed .row .card { width: calc(50% - 48px); }
.timeline.packed .row.world .card { margin-left: auto; }
.timeline.packed .row .spine-year { position: absolute; left: 50%; transform: translateX(-50%); top: 0; }
.timeline.packed .row.bible .card::after, .timeline.packed .row.world .card::after {
  content: ""; position: absolute; top: 24px; width: 30px; height: 2px; background: var(--spine);
}
.timeline.packed .row.bible .card::after { right: -31px; }
.timeline.packed .row.world .card::after { left: -31px; }

/* Era headers */
.era { position: relative; z-index: 2; margin: 36px 0 18px; }
.era-inner { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; text-align: center; max-width: 620px; margin: 0 auto; }
.era h2 { font: 700 26px/1.2 var(--serif); margin: 4px 0; }
.era p { margin: 0; color: var(--muted); font-size: 15px; }
.era-range { font: 600 12px/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Single-lane view */
.timeline[data-lane="bible"]::before, .timeline[data-lane="world"]::before { left: 48px; }
.timeline[data-lane="bible"] .row, .timeline[data-lane="world"] .row { grid-template-columns: 96px 1fr; }
.timeline[data-lane="bible"] .row .card, .timeline[data-lane="world"] .row .card { grid-column: 2; }
.timeline[data-lane="bible"] .row .spine-year, .timeline[data-lane="world"] .row .spine-year { grid-column: 1; }
.timeline-wrap:has(.timeline[data-lane="bible"]) .lane-heads,
.timeline-wrap:has(.timeline[data-lane="world"]) .lane-heads { display: none; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 4px 0; }
.fine { font-size: 13px; }

/* Phones and small tablets: one column, spine on the left */
@media (max-width: 760px) {
  html { scroll-padding-top: 220px; }
  .hero { padding-top: 32px; }
  .lede { font-size: 16px; }
  .controls-inner { gap: 10px 14px; }
  .control.grow { flex: 1 1 140px; }
  .seg button { padding: 8px 10px; font-size: 13px; }
  .lane-heads { display: none; }
  .timeline::before, .timeline[data-lane]::before { left: calc(var(--gutter) + 6px); }
  .row, .timeline[data-lane] .row { grid-template-columns: 1fr; padding-left: 24px; }
  .row .spine-year, .timeline[data-lane] .row .spine-year { grid-column: 1; grid-row: 1; justify-self: start; margin: 0 0 6px; }
  .row .card, .row.bible .card, .row.world .card, .timeline[data-lane] .row .card { grid-column: 1; grid-row: 2; }
  .row .spine-year:empty + .card { grid-row: 1; }
  .card h3 { font-size: 18px; }
  .card.bible::before, .card.world::before {
    position: absolute; top: -11px; right: 12px; font: 700 10px/1 var(--sans); letter-spacing: .1em;
    text-transform: uppercase; padding: 4px 7px; border-radius: 999px;
  }
  .card.bible::before { content: "Bible"; color: var(--bible); background: var(--bible-soft); }
  .card.world::before { content: "World"; color: var(--world); background: var(--world-soft); }
  .era { margin: 28px 0 14px; }
  .era-inner { padding: 14px 16px; }
  .era h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .card.flash { animation: none; } }

/* Classic Navy & Gold: stronger hierarchy (2026-11-27) */
.site-header { background: var(--header-bg); border-bottom: 3px solid var(--gold); box-shadow: none; }
.brand { color: var(--header-fg); font-size: 20px; }
.brand span { font-family: var(--display); font-weight: 700; }
.site-nav a { color: var(--header-muted); }
.site-nav a:hover { color: var(--header-fg); }
.site-nav a[aria-current="page"] { color: #0f2147; background: #f0c766; }
.hero { padding-top: 56px; padding-bottom: 28px; }
.eyebrow { font: 700 13px/1 var(--sans); letter-spacing: .16em; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-family: var(--display); font-size: clamp(34px, 5.4vw, 54px); line-height: 1.08; letter-spacing: -.015em; color: var(--heading); max-width: 16em; }
.lede { font-size: 19px; line-height: 1.6; }
.lane-head { font: 800 13px/1 var(--sans); letter-spacing: .14em; padding: 10px 0; }
.era-inner { background: var(--era-bg); border: 0; border-radius: 14px; padding: 22px 26px; }
.era h2 { font-family: var(--display); font-size: 30px; color: var(--era-fg); letter-spacing: -.01em; }
.era p { color: var(--era-muted); font-size: 16px; }
.era-range { color: var(--era-accent); font-weight: 700; letter-spacing: .14em; }
.card { border-radius: 12px; padding: 16px 18px; }
.card.bible { border-top: 0; border-left: 4px solid var(--bible); }
.card.world { border-top: 0; border-left: 4px solid var(--world); }
.card h3 { font-family: var(--display); font-size: 22px; line-height: 1.22; color: var(--heading); margin: 10px 0 6px; }
.card p { font-size: 16px; line-height: 1.55; }
.when { font: 700 12px/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; }
.refs { font-style: normal; font-weight: 600; font-size: 14px !important; }
@media (max-width: 760px) {
  .hero h1 { font-size: 32px; }
  .era h2 { font-size: 24px; }
  .card h3 { font-size: 20px; }
}

/* Light/dark toggle */
.site-nav { display: flex; align-items: center; gap: 2px; }
.theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: 8px; border: 1px solid color-mix(in srgb, var(--header-muted) 45%, transparent); border-radius: 999px; background: transparent; color: var(--header-fg); cursor: pointer; }
.theme-toggle:hover { border-color: #f0c766; color: #f0c766; }
.theme-toggle:focus-visible { outline: 2px solid #f0c766; outline-offset: 2px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
@media (max-width: 440px) {
  .brand { font-size: 17px; gap: 8px; }
  .brand span { white-space: nowrap; }
  .site-nav a { padding: 6px 8px; font-size: 14px; }
  .theme-toggle { margin-left: 4px; width: 32px; height: 32px; }
}
