/* =========================================================
   ART THROUGH TIME — Design System
   Palette: Terracotta + Ink + Aged Paper
   Fonts: DM Serif Display (headings) · Source Serif 4 (body)
   ========================================================= */

/* ── Tokens ────────────────────────────────────────────── */
:root {
  --bg:       #f4f7f4;
  --surface:  #fafcfa;
  --surface2: #e4ede6;
  --text:     #141a15;
  --muted:    #4a5e4d;
  --accent:   #2d6a4f;      /* forest green */
  --line:     #c4d4c8;
  --shadow-card: 0 2px 12px rgba(20,26,21,0.08);
  --shadow-lift: 0 8px 32px rgba(20,26,21,0.13);
  --radius: 4px;
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg:       #0e1210;
  --surface:  #161d17;
  --surface2: #1e2820;
  --text:     #e8f0e9;
  --muted:    #7a9e80;
  --accent:   #40916c;      /* lighter green for dark bg */
  --line:     #2a3a2d;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lift: 0 8px 32px rgba(0,0,0,0.45);
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code { font-family: var(--font-mono); font-size: 0.88em; }

/* ── Typography Scale ───────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;           /* DM Serif Display has elegant regular weight */
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 6vw, 5.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 3.5vw, 3rem);  letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem);  letter-spacing: -0.01em; }

p { line-height: 1.72; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  height: 68px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
  z-index: 200;
}

.brand {
  font-family: var(--font-head);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* SVG brand mark replaces emoji */
.brand-mark svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
}

.site-header nav a {
  color: var(--muted);
  transition: color 0.18s;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: var(--text);
}

.site-header nav a.active {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.timeline-indicator {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: var(--radius);
}

/* Theme toggle — text label, not emoji */
.icon-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  width: 44px;
  height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-family: var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.18s, border-color 0.18s;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 80%, #000);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-outline:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* ── Eyebrow / Labels ───────────────────────────────────── */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 16px;
}

/* ── Index / Timeline Hero — asymmetric split ───────────── */
.page-hero {
  padding: 64px 6% 48px;
}

.page-hero h1 {
  max-width: 760px;
  margin: 8px 0 20px;
}

.page-hero > p {
  color: var(--muted);
  max-width: 600px;
  font-size: 1.05rem;
  line-height: 1.7;
  font-style: italic;
}

/* Index page hero — left-aligned, with a right-side number column */
.index-hero {
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: calc(100vh - 68px);
  border-bottom: 1px solid var(--line);
}

.index-hero-text {
  padding: 10vh 6% 8vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.index-hero-text .eyebrow { margin-bottom: 24px; }

.index-hero-text h1 {
  font-size: clamp(3.2rem, 6.5vw, 6.4rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}

.index-hero-text h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Right column: stats strip */
.index-hero-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vh 48px;
  gap: 0;
}

.hero-stat {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.hero-stat:last-child {
  border-bottom: none;
}

.hero-stat-num {
  font-family: var(--font-head);
  font-size: 3.6rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  display: block;
}

.hero-stat-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

/* ── Timeline Meta Pills ────────────────────────────────── */
.timeline-meta-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.meta-pill {
  background: var(--surface2);
  border: 1px solid var(--line);
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--font-body);
}

.meta-pill strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── Sections ────────────────────────────────────────────── */
.section { padding: 72px 6%; max-width: 1440px; margin: auto; }

/* Section: ruled heading row */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.text-link {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link:hover { color: var(--text); }

/* ── Navigation Links on home page ─────────────────────── */
.home-nav-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.home-nav-card {
  padding: 36px 5%;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: var(--text);
}

.home-nav-card:last-child { border-right: none; }
.home-nav-card:hover { background: var(--surface2); }

.home-nav-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--muted);
}

.home-nav-card h3 {
  font-size: 1.5rem;
  line-height: 1.15;
}

.home-nav-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.home-nav-card-arrow {
  font-size: 1.2rem;
  color: var(--accent);
  margin-top: auto;
  padding-top: 12px;
}

/* ── Timeline Controls ──────────────────────────────────── */
.timeline-section { padding-top: 16px; }

.timeline-controls-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.era-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 7px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.18s;
}

.filter.active,
.filter:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ── Timeline Structure ─────────────────────────────────── */
.timeline { position: relative; padding: 20px 0; }

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 12px 52px 44px;
}

.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

.timeline-dot {
  position: absolute;
  top: 26px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-dot  { right: -6px; }
.timeline-item:nth-child(even) .timeline-dot { left: -6px; }

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}

.timeline-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.timeline-card-inner {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.timeline-thumb {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.timeline-body { flex: 1; }

.timeline-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-card h3 {
  font-size: 1.2rem;
  margin: 4px 0 6px;
  line-height: 1.2;
}

.date {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.era-badge {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--muted);
  font-family: var(--font-body);
}

.era-badge.era-ancient     { color: #7a5c1a; border-color: rgba(122,92,26,0.3);  background: rgba(122,92,26,0.07);  }
.era-badge.era-medieval    { color: #6b3b5e; border-color: rgba(107,59,94,0.3);  background: rgba(107,59,94,0.07);  }
.era-badge.era-modern      { color: #2d6a4f; border-color: rgba(45,106,79,0.3);  background: rgba(45,106,79,0.07);  }
.era-badge.era-contemporary{ color: #1a5276; border-color: rgba(26,82,118,0.3);  background: rgba(26,82,118,0.07);  }

.card-footer-prompt {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Timeline Empty State ───────────────────────────────── */
.timeline-empty {
  text-align: left;
  padding: 56px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 560px;
  margin: 30px auto;
}

.empty-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.empty-sub {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.reset-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.18s, color 0.18s;
}
.reset-btn:hover { background: var(--accent); color: #fff; }

/* ── Gallery ─────────────────────────────────────────────── */
.gallery-tools {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.artifact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.artifact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.card-visual {
  width: 100%;
  height: 220px;
  background: var(--surface2);
  overflow: hidden;
  position: relative;
}

.card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.38s ease;
}

.artifact-card:hover .card-visual img { transform: scale(1.04); }

.symbol-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 4rem;
  color: var(--accent);
  opacity: 0.4;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  font-size: 1.25rem;
  margin: 6px 0 10px;
  line-height: 1.2;
}

.card-body p {
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
  line-height: 1.65;
}

.tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

/* ── Empty State (gallery) ──────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: left;
  padding: 52px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.empty-state p { font-size: 1.05rem; margin: 4px 0; }
.muted { color: var(--muted); }

/* ── Map ─────────────────────────────────────────────────── */
.map-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 28px;
  align-items: start;
}

.map-container-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.leaflet-map-view {
  height: 580px;
  width: 100%;
  background: var(--surface2);
}

[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3);
}

.custom-map-pin {
  width: 30px;
  height: 30px;
  background: var(--pin-color, #b5451b);
  color: white;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  cursor: pointer;
  transition: transform 0.2s;
}
.custom-map-pin:hover { transform: rotate(-45deg) scale(1.15); }
.custom-map-pin span  { transform: rotate(45deg); font-weight: 600; font-size: 0.72rem; font-family: var(--font-mono); }

.map-popup-card { min-width: 200px; max-width: 240px; font-family: var(--font-body); }
.map-popup-img  { width: 100%; height: 120px; object-fit: cover; border-radius: 2px; margin-bottom: 8px; }
.map-popup-info h4 { margin: 4px 0; font-family: var(--font-head); font-size: 1rem; }
.map-popup-info p  { margin: 2px 0 8px; color: #555; font-size: 0.85rem; }

.map-info {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 300px;
}

.map-info-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: var(--surface2);
  border-radius: var(--radius);
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

.map-info-meta { font-size: 0.88rem; color: var(--accent); margin: 6px 0 14px; font-family: var(--font-mono); }
.map-info-actions { margin-top: 22px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10,8,6,0.8);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 500;
}
.modal.open { display: flex; }

.modal-box {
  max-width: 940px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  box-shadow: var(--shadow-lift);
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 16px;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.18s, border-color 0.18s;
}
.modal-close:hover { color: var(--text); border-color: var(--text); }

.modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.modal-box h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 4px 0 0;
  line-height: 1.1;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.detail-visual-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.modal-image {
  width: 100%;
  height: 360px;
  object-fit: contain;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}

.detail-visual {
  height: 360px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 6rem;
  color: var(--accent);
  opacity: 0.5;
  border-radius: var(--radius);
}

.image-credit {
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--surface2);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-body);
}

.image-credit a { color: var(--accent); font-weight: 600; text-decoration: underline; }

.license-badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

/* Related inside modal */
.related-section {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.related-heading {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.related-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.related-card {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, border-color 0.2s;
  color: var(--text);
}
.related-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.related-visual {
  height: 100px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

.related-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.related-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; font-family: var(--font-head); }

.modal-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.modal-nav button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── About page ──────────────────────────────────────────── */
/* Two-column grid for sections — but NOT uniform */
.about-lead {
  padding: 72px 6% 40px;
  max-width: 840px;
}

.about-lead h1 { margin: 12px 0 20px; }
.about-lead p  { font-size: 1.1rem; color: var(--muted); font-style: italic; }

/* Stacked sections with ruled separators */
.about-section {
  padding: 48px 6%;
  border-top: 1px solid var(--line);
  max-width: 1440px;
  margin: auto;
}

.about-section-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

.about-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  padding-top: 6px;
}

.about-section h2 {
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.clean-list {
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}
.clean-list li { margin: 8px 0; line-height: 1.6; }

.sources {
  max-width: 1440px;
  margin: auto;
}

/* About grid (old class kept for JS compat) */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 40px 6%;
  max-width: 1440px;
  margin: auto;
}
.about-grid > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.about-grid h2 { font-size: 1.5rem; margin-top: 0; margin-bottom: 12px; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  padding: 28px 6%;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--font-body);
  letter-spacing: 0.03em;
}

.footer-brand {
  font-family: var(--font-head);
  font-size: 0.95rem;
  color: var(--text);
}

/* ── Focus States ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Journey Button (timeline.js adds this) ─────────────── */
.journey-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 7px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.18s;
  white-space: nowrap;
}
.journey-btn:hover,
.journey-btn.active { background: var(--text); border-color: var(--text); color: var(--bg); }

.journey-progress {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0 8px;
}

/* Search within timeline/gallery controls */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 280px;
}

.search-wrap input {
  width: 100%;
  padding: 7px 14px 7px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.18s;
}
.search-wrap input:focus { border-color: var(--muted); }
.search-wrap input::placeholder { color: var(--muted); }

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .index-hero { grid-template-columns: 1fr; min-height: auto; }
  .index-hero-text { border-right: none; padding: 10vh 6% 6vh; }
  .index-hero-preview {
    border-top: 1px solid var(--line);
    padding: 40px 6%;
    display: flex;
    align-items: center;
    gap: 24px;
  }
  .rotating-card-stack { width: 240px; flex-shrink: 0; }
}

@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
  .modal-image { height: 260px; }
  .related-strip { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .about-section-inner { grid-template-columns: 1fr; gap: 16px; }
  .home-nav-strip { grid-template-columns: 1fr; }
  .home-nav-card { border-right: none; border-bottom: 1px solid var(--line); }

  .timeline::before { left: 16px; }
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    left: 0;
    padding-left: 48px;
    padding-right: 0;
  }
  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 10px;
    right: auto;
  }

  .era-chapter { padding-left: 48px; }
  .era-chapter::before { left: 16px; transform: none; }
}

@media (max-width: 640px) {
  .site-header { height: 60px; }
  .timeline-controls-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .era-filters { overflow-x: auto; padding-bottom: 6px; }
  .search-wrap { max-width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .timeline-card-inner { flex-direction: column; }
  .timeline-thumb { width: 100%; height: 160px; }
  .modal-box { padding: 20px; }
  .modal-box h2 { font-size: 1.6rem; }
  .site-footer { flex-direction: column; gap: 8px; text-align: center; }
  .about-grid { grid-template-columns: 1fr; }
  .index-hero-preview { display: none; }  /* hide on small screens */
  .hero-bg-numeral { font-size: clamp(6rem, 30vw, 14rem); }
}

/* ═══════════════════════════════════════════════════════════
   NEW FEATURE STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Era Chapter Headers (Timeline) ──────────────────── */
.era-chapter {
  position: relative;
  padding: 48px 52px 20px;
  width: 100%;                /* breaks out of the 50% timeline-item width */
  left: 0 !important;
  clear: both;
}

/* Extend the vertical spine through the chapter header */
.era-chapter::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.era-chapter-inner {
  display: flex;
  align-items: baseline;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  position: relative;
  z-index: 1;
}

.era-chapter-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.era-chapter-name {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.era-chapter-range {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 4px;
  white-space: nowrap;
}

/* First chapter header — no top border (no previous section) */
.era-chapter:first-child .era-chapter-inner {
  border-top: none;
  padding-top: 0;
}

/* ── 2. Hero Background Numeral ─────────────────────────── */
.index-hero-text {
  position: relative; /* already set, but ensure overflow clip */
  overflow: hidden;
}

.hero-bg-numeral {
  position: absolute;
  top: 50%;
  left: -2%;
  transform: translateY(-52%);
  font-family: var(--font-head);
  font-size: clamp(10rem, 22vw, 22rem);
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--accent);
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}

/* Make sure text content sits above the numeral */
.index-hero-text .eyebrow,
.index-hero-text h1,
.index-hero-text .hero-desc,
.index-hero-text .hero-actions {
  position: relative;
  z-index: 1;
}

/* ── 3. Rotating Artifact Card Preview (Hero Right Column) ─ */
.index-hero-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 48px;
  gap: 16px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  min-height: 100%;
}

.rotating-card-stack {
  position: relative;
  width: 280px;
  height: 380px;
  cursor: default;
}

/* Ghost cards for the stacked depth effect */
.rotating-card-stack::before,
.rotating-card-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface2);
}
.rotating-card-stack::before {
  transform: rotate(3deg) translateY(6px);
  z-index: 0;
  opacity: 0.6;
}
.rotating-card-stack::after {
  transform: rotate(-2deg) translateY(3px);
  z-index: 0;
  opacity: 0.4;
}

/* The actual cycling card */
.rc-card {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.rc-card--visible {
  opacity: 1;
  transform: translateY(0);
}

.rc-card--exit {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.rc-img-wrap {
  flex: 1;
  overflow: hidden;
  background: var(--surface2);
}

.rc-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.rc-meta {
  padding: 10px 14px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rc-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

.rc-title {
  font-family: var(--font-head);
  font-size: 1rem;
  padding: 0 14px;
  margin: 0;
  line-height: 1.2;
  color: var(--text);
}

.rc-period {
  font-size: 0.76rem;
  color: var(--muted);
  padding: 4px 14px 14px;
  margin: 0;
  font-style: italic;
}

.rotating-card-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-align: center;
}
