/* ── The Timeline Museum ─────────────────────────────────────────────── */

:root {
  --bg: #15151a;
  --bg-soft: #1d1d24;
  --ink: #e8e2d5;
  --ink-dim: #9b958a;
  --accent: #d9a521;
  --card: #f5f0e6;
  --card-ink: #2a2520;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ── top bar ── */
#topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: linear-gradient(to bottom, rgba(6,6,12,.92), rgba(6,6,12,0));
  z-index: 20;
  pointer-events: none;
}
#topbar a, #topbar span { pointer-events: auto; }
#site-title { font-size: 19px; font-weight: normal; letter-spacing: 5px; margin: 0; }
#site-title a { color: var(--ink); text-decoration: none; }
#site-title a:hover { color: var(--accent); }
#site-subtitle {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 3px;
}
#sample-banner {
  margin-left: auto;
  font-size: 12px;
  font-family: system-ui, sans-serif;
  color: #1d1d24;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 3px;
}

/* ── views ── */
#app { position: fixed; inset: 0; }
.view { position: absolute; inset: 0; }

/* ── timeline ── */
#timeline-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#timeline-canvas.dragging { cursor: grabbing; }
#timeline-canvas.hovering { cursor: pointer; }
#timeline-tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--card);
  color: var(--card-ink);
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
  z-index: 30;
  max-width: 260px;
}
#timeline-tooltip b { font-size: 15px; }
#timeline-help {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-family: system-ui, sans-serif;
  color: var(--ink-dim);
  background: rgba(10,10,14,.6);
  padding: 4px 14px;
  border-radius: 12px;
}

/* ── placard ── */
#view-placard { overflow-y: auto; padding: 84px 18px 60px; }
.placard-wrap { max-width: 760px; margin: 0 auto; }
.back-link {
  display: inline-block;
  color: var(--ink-dim);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  margin-bottom: 14px;
}
.back-link:hover { color: var(--ink); }
.placard {
  background: var(--card);
  color: var(--card-ink);
  border-radius: 3px;
  box-shadow: 0 14px 50px rgba(0,0,0,.6);
  overflow: hidden;
}
.placard-body { padding: 34px 40px 26px; }
.period-chip {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #a1762a;
  margin-bottom: 8px;
}
.placard-head { display: flex; gap: 26px; align-items: flex-start; }
.placard-head .portrait {
  width: 118px;
  border: 5px solid #2a2520;
  outline: 1px solid #c9c2b2;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  flex: none;
}
.placard h2 { margin: 0 0 6px; font-size: 32px; font-weight: normal; }
.placard .dates {
  color: #7a6f5d;
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.placard .summary { font-size: 15px; line-height: 1.7; margin-top: 20px; }
.placard-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #221f1b;
  color: #8d8678;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  padding: 16px 40px;
}
.enter-gallery {
  display: inline-block;
  background: transparent;
  color: var(--card);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 3px;
  padding: 10px 20px;
  border: 1px solid #5b554a;
  border-radius: 2px;
}
.enter-gallery:hover { background: var(--accent); color: #1d1d24; border-color: var(--accent); }
.no-works { margin-top: 22px; font-style: italic; color: #7a6f5d; }

.works-strip {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid #d8d0c0;
  overflow-x: auto;
}
.works-strip img, .works-strip .thumb-ph {
  height: 90px;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  flex: none;
}
.works-strip .thumb-ph {
  width: 72px;
  background: #ddd5c4;
  color: #8a8071;
  font-size: 10px;
  font-family: system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
}

/* ── gallery ── */
#view-gallery { background: #000; }
.gallery-canvas { position: absolute; inset: 0; }
.gallery-canvas canvas { display: block; }

.gallery-topbar {
  position: absolute;
  top: 10px; left: 14px; right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}
.gallery-topbar span {
  font-size: 14px;
  letter-spacing: 1px;
  color: rgba(232,226,213,.85);
  text-shadow: 0 1px 4px #000;
}
.gallery-topbar button { pointer-events: auto; }

.g-btn {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  background: rgba(20,20,26,.8);
  color: var(--ink);
  border: 1px solid rgba(232,226,213,.3);
  border-radius: 3px;
  padding: 7px 16px;
  cursor: pointer;
}
.g-btn:hover { background: rgba(60,60,72,.9); }
.g-btn.primary { background: var(--accent); color: #1d1d24; border-color: transparent; font-weight: 600; }
.g-btn.primary:hover { filter: brightness(1.1); }

.crosshair {
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  box-shadow: 0 0 4px rgba(0,0,0,.8);
  z-index: 5;
  pointer-events: none;
}

.gallery-pause {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8,8,12,.78);
  z-index: 8;
  text-align: center;
  padding: 20px;
}
.gallery-pause h2 { font-weight: normal; font-size: 30px; margin: 0; letter-spacing: 2px; }
.gallery-pause .sub { color: var(--ink-dim); margin: 0 0 8px; }
.gallery-pause .keys {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-dim);
  max-width: 460px;
  line-height: 1.7;
  margin: 0 0 14px;
}
.gallery-pause .keys kbd {
  background: #2c2c36;
  border: 1px solid #44444f;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 12px;
}
.pause-actions { display: flex; gap: 12px; }

.artwork-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5,5,8,.94);
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
/* the two flanking museum cards: artist (left) + this work (right) */
.artwork-overlay .ao-info,
.artwork-overlay .ao-work {
  flex: 0 0 320px;
  max-width: 30%;
  background: var(--card);
  color: var(--card-ink);
  padding: 48px 26px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.artwork-overlay .ao-info { box-shadow: 6px 0 30px rgba(0,0,0,.6); }
.artwork-overlay .ao-work { box-shadow: -6px 0 30px rgba(0,0,0,.6); }
.artwork-overlay .ao-panel-label {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #a1762a;
  margin-bottom: 10px;
}
.artwork-overlay .ao-artist,
.artwork-overlay .ao-title {
  font-size: 24px;
  font-weight: normal;
  line-height: 1.25;
  margin: 0 0 8px;
}
.artwork-overlay .ao-title { font-style: italic; }
.artwork-overlay .ao-meta,
.artwork-overlay .ao-work-meta {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: .5px;
  color: #6a6052;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #d8d0c0;
}
.artwork-overlay .ao-work-meta .ao-year { color: #a1762a; font-weight: 600; }
.artwork-overlay .ao-bio,
.artwork-overlay .ao-text { font-size: 15px; line-height: 1.7; }
.artwork-overlay .ao-bio p,
.artwork-overlay .ao-text p { margin: 0 0 12px; }
.artwork-overlay .ao-muted { font-style: italic; color: #8a8071; }
.artwork-overlay .ao-credit {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  color: #8a8071;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #d8d0c0;
}
/* centre: artwork stage */
.artwork-overlay .ao-stage {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 30px 30px;
}
.artwork-overlay .ao-stage img {
  max-width: 100%;
  max-height: 84%;
  box-shadow: 0 12px 60px rgba(0,0,0,.9);
  background: #111;
}
.artwork-overlay .ao-cap {
  margin-top: 16px;
  font-size: 14px;
  font-style: italic;
  color: var(--ink-dim);
  text-align: center;
}
.artwork-overlay .ao-close {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 28px;
  line-height: 1;
  background: none;
  border: none;
  color: var(--ink-dim);
  cursor: pointer;
  z-index: 2;
}
.artwork-overlay .ao-close:hover { color: #fff; }
/* narrow screens: stack image, then the two cards */
@media (max-width: 1000px) {
  .artwork-overlay { flex-direction: column; }
  .artwork-overlay .ao-info,
  .artwork-overlay .ao-work {
    flex: none;
    max-width: none;
    max-height: 38%;
    padding: 30px 20px 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,.6);
  }
  .artwork-overlay .ao-stage { padding: 14px; order: -1; }
  .artwork-overlay .ao-stage img { max-height: 100%; }
}

/* ── loading / toast ── */
#loading {
  position: fixed;
  bottom: 18px; right: 22px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-dim);
  z-index: 40;
}
#toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #8b3a3a;
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 4px;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
