:root {
  --bg-base: #05060a;
  --text-primary: #f0e6ff;
  --text-muted: #8a8aa8;
  --font-mono: 'Exo 2', 'Courier New', monospace;
  --font-serif: Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: clip;
  width: 100%;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 280px;
  padding: 60px 32px;
  background: #000;
  overflow: hidden;
  text-align: center;
  border-bottom: 1px solid #1a1a2a;
  /* Flex centering for the hero text. .hero-controls is absolute-positioned
     so it's not affected by this. */
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(40,30,100,0.5), transparent 70%),
    radial-gradient(ellipse at 20% 30%, rgba(80,40,120,0.3), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(180,60,80,0.2), transparent 50%);
}

.hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, white, transparent),
    radial-gradient(1px 1px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 80% 10%, white, transparent),
    radial-gradient(2px 2px at 40% 80%, white, transparent),
    radial-gradient(1px 1px at 90% 40%, white, transparent),
    radial-gradient(1px 1px at 10% 60%, white, transparent),
    radial-gradient(1px 1px at 35% 15%, white, transparent),
    radial-gradient(2px 2px at 15% 85%, white, transparent),
    radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(1px 1px at 25% 45%, white, transparent),
    radial-gradient(1px 1px at 85% 65%, white, transparent);
  background-repeat: no-repeat;
}

.hero-controls {
  position: absolute; top: 18px; right: 20px;
  display: flex; gap: 8px; z-index: 2;
}
.hero-btn {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  color: #ccc;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 6px 14px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.hero-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.hero-btn.audio-on { color: #ffe082; border-color: rgba(255,224,130,0.5); }
.hero-btn.audio-off { color: #8a8a8a; }
.hero-btn.audio-off:hover { color: #ccc; }

.hero-text { position: relative; z-index: 1; }
.hero-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 6px;
  /* Classic Star Wars opening-crawl blue. */
  color: #4baee8;
  text-shadow: 0 0 16px rgba(75,174,232,0.35);
  margin: 0 0 14px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: 42px;
  color: #ffe082;
  letter-spacing: 8px;
  /* Offset the trailing letter-spacing so text-align:center reads visually
     centered (without this, the 8px space after the final "S" shifts the
     whole word slightly left of true center). */
  text-indent: 8px;
  font-weight: 600;
  text-shadow: 0 0 30px rgba(255,200,60,0.4);
  margin: 0;
}
.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin: 8px 0 0;
}

/* --- Timeline --- */
#timeline {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 0 90px;
  position: relative;
}

/* Vertical spine */
#timeline::before {
  content: '';
  position: absolute;
  left: 54px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    #8c6438 8%, #6aa0e0 22%,
    #78ff8c 36%, #c8d0d8 50%,
    #ffb43c 62%, #5a8be0 74%,
    #dc2632 86%, #9be8b8 96%,
    transparent 100%);
}

/* Era header */
.era-header {
  position: relative;
  margin: 28px 0 14px -66px;
  padding-left: 66px;
  display: flex; align-items: center; gap: 12px;
}
.era-header .era-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.era-header .era-name {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 3px;
  font-weight: 600;
}
.era-header .era-range {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(240, 240, 250, 0.85);
  letter-spacing: 2px;
  margin-top: 2px;
}

/* Card */
.entry {
  position: relative;
  margin: 12px 0;
}
.entry-marker {
  position: absolute;
  left: -45px; top: 14px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent, #888);
}
.entry-marker .era-logo-img,
.era-header .era-logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.entry-marker.unwatched .era-logo-img { opacity: 0.35; filter: grayscale(1); }

.entry-card {
  background: rgba(20,15,40,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent, #555);
  padding: 14px 16px;
  border-radius: 3px;
  cursor: pointer;
}
.entry-card.locked { cursor: default; }
.entry-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent, #888);
}
.entry-title {
  font-family: var(--font-serif);
  font-size: 15px;
  margin-top: 3px;
}
.entry-row {
  display: flex; justify-content: space-between; align-items: baseline;
}
.entry-status {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}
.entry-status-sub {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
}

/* --- Dialogs --- */
dialog {
  background: rgba(10,10,20,0.97);
  color: var(--text-primary);
  border: 1px solid rgba(180,140,255,0.3);
  border-radius: 8px;
  padding: 22px;
  min-width: 320px;
  max-width: 480px;
}
dialog::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: #ffe082;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(180,140,255,0.2);
}
.modal-btn {
  background: transparent;
  border: 1px solid rgba(180,140,255,0.5);
  color: #b48cff;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  padding: 6px 14px;
  border-radius: 3px;
  cursor: pointer;
}
.modal-btn.primary { color: #ffe082; border-color: rgba(255,224,130,0.5); }
.modal-btn:hover { background: rgba(255,255,255,0.05); }
.modal-input {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(180,140,255,0.4);
  color: var(--text-primary);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: 3px;
  width: 100%;
}

.entry-card.expanded {
  background: linear-gradient(135deg, rgba(40,24,80,0.85), rgba(25,14,50,0.7));
  border-color: rgba(255,255,255,0.2);
}
.entry-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.season-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}
.season-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  background: rgba(0,0,0,0.25);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.season-row.watched {
  background: var(--accent-bg, rgba(180,140,255,0.15));
  border-color: var(--accent, #b48cff);
  color: var(--text-primary);
}
.season-row .season-label {
  min-width: 32px;
  font-weight: 600;
}
.season-row .season-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  min-width: 110px;
}
.season-row input[type=date] {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 3px;
}
.season-row .spacer { flex: 1; }
.edit-row {
  display: flex; gap: 8px; align-items: center; margin-top: 10px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted);
}
.edit-row input[type=date] {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-primary);
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: 3px;
}
.edit-row .spacer { flex: 1; }

/* ============================================================
   Per-era visual treatments
   Each era applies its own UI personality, not just color.
   ============================================================ */

/* Section wrapper: per-era background watermark + accent tint.
   Each section sets --era-accent, --era-bg, --era-bg-url inline (see render.js).
   The logo image is rendered very faintly behind all entries, while a radial
   accent glow tints the upper area in that era's colour. */
.era-section {
  position: relative;
  padding: 18px 0 40px;
  isolation: isolate;
}
/* The before/after pseudo-elements break out of #timeline's 760px column to
   paint across the full viewport width using the "50vw bleed" trick:
   left/right pulled outward by half the difference between viewport and parent. */
.era-section::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  /* #timeline has padding 24px right / 90px left, so the section sits
     33px = (90 - 24) / 2 right of viewport center. Pull ::before that far
     further left and widen to compensate. */
  left: calc(50% - 50vw - 33px);
  width: calc(100vw + 66px);
  z-index: -1;
  background:
    radial-gradient(70% 70% at 50% 0%, color-mix(in srgb, var(--era-accent) 28%, transparent) 0%, transparent 75%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--era-accent) 14%, var(--era-bg)) 0%,
      color-mix(in srgb, var(--era-accent) 8%, var(--era-bg)) 100%);
  pointer-events: none;
}
.era-section::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: calc(50% - 50vw - 33px);
  width: calc(100vw + 66px);
  z-index: -1;
  background-image: var(--era-bg-url);
  background-repeat: no-repeat;
  /* Negative X pulls the logo's centre off the left edge; ~55% of it
     remains inside the viewport. */
  background-position: 40px 50%;
  background-size: 372px;
  opacity: 0.09;
  filter: grayscale(0.3);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle 240px at 40px 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(circle 240px at 40px 50%, #000 55%, transparent 100%);
}

/* Horizontal dividers removed per design — era-header has no trailing dash line. */
.era-header .era-divider { display: none !important; }

/* ---------- 1. The Old Republic — stone & bronze ---------- */
.era-section.era-the-old-republic::before {
  background:
    radial-gradient(60% 80% at 50% 0%, color-mix(in srgb, var(--era-accent) 22%, transparent) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(180,140,90,0.03) 22px 23px),
    repeating-linear-gradient(90deg, transparent 0 60px, rgba(0,0,0,0.2) 60px 61px),
    var(--era-bg);
}
.era-section.era-the-old-republic .era-ornament {
  font-family: 'Palatino', 'Georgia', serif;
  font-weight: bold;
  font-size: 88px;
  color: #8c6438;
  opacity: 0.22;
  text-shadow: 0 0 16px rgba(80,100,80,0.4);
}
.entry.era-the-old-republic .entry-card {
  border: 1px solid rgba(140,100,60,0.35);
  border-left: 3px solid var(--accent);
  background:
    linear-gradient(rgba(20,14,10,0.92), rgba(20,14,10,0.92)),
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(200,160,80,0.04) 8px 9px);
  border-radius: 1px;
  box-shadow: inset 0 0 0 1px rgba(80,100,80,0.12);
}
.entry.era-the-old-republic .entry-title {
  font-family: 'Palatino', 'Georgia', serif;
  font-style: italic;
  letter-spacing: 1px;
  color: #d8c0a0;
}
.entry.era-the-old-republic .entry-meta {
  color: #c89060;
}
.era-header.era-the-old-republic .era-name { font-style: italic; }
.era-header.era-the-old-republic .era-divider {
  background:
    linear-gradient(90deg, currentColor 0 12px, transparent 12px 18px, currentColor 18px 22px, transparent 22px);
  background-size: 26px 1px;
  background-repeat: repeat-x;
  opacity: 0.5;
}

/* ---------- 2. The High Republic — ivory & Jedi blue ---------- */
.era-section.era-the-high-republic::before {
  background:
    radial-gradient(40% 60% at 50% 30%, rgba(220,210,180,0.16), transparent 70%),
    radial-gradient(60% 80% at 50% 100%, rgba(90,140,220,0.18), transparent 70%),
    var(--era-bg);
}
.era-section.era-the-high-republic .era-ornament {
  font-size: 72px;
  color: #f4ecd8;
  opacity: 0.4;
  text-shadow: 0 0 18px rgba(120,180,255,0.6);
}
.entry.era-the-high-republic .entry-card {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(120,180,255,0.1), transparent 60%),
    rgba(14,16,22,0.88);
  border: 1px solid rgba(220,210,180,0.4);
  border-left: 3px solid var(--accent);
  box-shadow: 0 0 18px rgba(120,180,255,0.12);
}
.entry.era-the-high-republic .entry-title {
  font-family: 'Optima', 'Georgia', serif;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: #f4ecd8;
}
.entry.era-the-high-republic .entry-meta {
  color: #b8d8ff;
}
.era-header.era-the-high-republic .era-name {
  color: #f4ecd8;
}
.era-header.era-the-high-republic .era-divider {
  background:
    radial-gradient(circle at 50% 50%, currentColor 0 1px, transparent 2px) 0 50%/8px 8px repeat-x;
  height: 8px;
  opacity: 0.6;
}

/* ---------- 3. Fall of the Jedi — smoky battlefield ---------- */
.era-section.era-fall-of-the-jedi::before {
  /* Smoky-battlefield atmosphere + drifting embers. Layered so the
     shared ::after era-logo watermark stays intact on top of this. */
  background:
    radial-gradient(1.5px 1.5px at 30% 40%, rgba(255,180,80,0.55), transparent 50%),
    radial-gradient(1px 1px at 60% 55%, rgba(255,140,60,0.5), transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 35%, rgba(255,200,100,0.4), transparent 50%),
    radial-gradient(1px 1px at 45% 70%, rgba(255,160,70,0.4), transparent 50%),
    radial-gradient(2px 2px at 18% 80%, rgba(255,160,70,0.5), transparent 50%),
    radial-gradient(ellipse at 50% 25%, rgba(255,140,60,0.32), transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(180,60,20,0.42), transparent 55%),
    var(--era-bg);
}
.entry.era-fall-of-the-jedi .entry-card {
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255,140,60,0.03) 2px 3px),
    rgba(20,12,6,0.92);
  border: 1px solid rgba(240,200,140,0.35);
  border-left: 2px solid var(--accent);
  border-radius: 0;
  box-shadow: -2px 0 14px rgba(120,255,140,0.18);
  clip-path: none;
}
.entry.era-fall-of-the-jedi .entry-title {
  font-family: var(--font-serif);
  letter-spacing: 1px;
  color: #f5e6c8;
}
.entry.era-fall-of-the-jedi .entry-meta {
  color: var(--accent);
  text-transform: uppercase;
}
.era-header.era-fall-of-the-jedi .era-divider {
  background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px);
  height: 1px;
  opacity: 0.5;
}

/* ---------- 4. Reign of the Empire — Imperial steel grey ---------- */
.era-section.era-reign-of-the-empire::before {
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(180,190,200,0.1), transparent 70%),
    linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 30%),
    var(--era-bg);
}
.entry.era-reign-of-the-empire .entry-card {
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(180,190,200,0.04) 3px 4px),
    rgba(20,22,26,0.92);
  border: 1px solid rgba(180,190,200,0.28);
  border-left: 2px solid var(--accent);
  border-radius: 0;
  position: relative;
}
.entry.era-reign-of-the-empire .entry-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 18px; height: 18px;
  background: var(--accent);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  opacity: 0.5;
}
.entry.era-reign-of-the-empire .entry-title {
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  font-weight: 200;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #e8ecf0;
}
.entry.era-reign-of-the-empire .entry-meta {
  color: var(--accent);
}
.era-header.era-reign-of-the-empire .era-name {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 200;
  letter-spacing: 5px;
}
.era-header.era-reign-of-the-empire .era-divider {
  background: linear-gradient(90deg, currentColor, currentColor 40%, transparent);
  height: 2px;
  opacity: 0.7;
}

/* ---------- 5. Age of Rebellion — rebel comms / stencil ---------- */
.era-section.era-age-of-rebellion::before {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(255,180,60,0.18), transparent 60%),
    var(--era-bg);
}
.entry.era-age-of-rebellion .entry-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(255,180,60,0.1), transparent 50%),
    rgba(40,22,6,0.6);
  border: 1px dashed rgba(255,180,60,0.4);
  border-left: 4px solid var(--accent);
  border-radius: 2px;
}
.entry.era-age-of-rebellion .entry-title {
  font-family: 'Impact', 'Oswald', 'Arial Black', sans-serif;
  font-weight: normal;
  letter-spacing: 2px;
  transform: skewX(-4deg);
  display: inline-block;
}
.entry.era-age-of-rebellion .entry-meta {
  font-family: 'Impact', sans-serif;
  letter-spacing: 3px;
}
.era-header.era-age-of-rebellion .era-name {
  font-family: 'Impact', sans-serif;
  transform: skewX(-4deg);
  display: inline-block;
  letter-spacing: 2px;
}
.era-header.era-age-of-rebellion .era-divider {
  background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 10px);
  height: 2px;
  opacity: 0.55;
}

/* ---------- 6. The New Republic — cobalt naval ---------- */
.era-section.era-the-new-republic::before {
  background:
    radial-gradient(ellipse at 50% 60%, rgba(60,110,200,0.22), transparent 65%),
    linear-gradient(180deg, rgba(120,170,255,0.08), transparent 30%),
    var(--era-bg);
}
.entry.era-the-new-republic .entry-card {
  background:
    linear-gradient(180deg, rgba(120,170,255,0.06), transparent 30%),
    rgba(6,16,32,0.92);
  border: 1px solid rgba(100,150,235,0.42);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(160,200,255,0.08);
}
.entry.era-the-new-republic .entry-card::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  opacity: 0.7;
}
.entry.era-the-new-republic .entry-title {
  font-family: 'Trebuchet MS', 'Helvetica Neue', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #e0eaff;
}
.entry.era-the-new-republic .entry-meta {
  color: #7aa8f0;
}
.era-header.era-the-new-republic .era-divider {
  background: linear-gradient(90deg, currentColor, rgba(120,170,255,0.4), currentColor, transparent);
  height: 2px;
  border-radius: 1px;
  opacity: 0.6;
}

/* ---------- 7. Rise of the First Order — Snoke crimson ---------- */
.era-section.era-rise-of-the-first-order::before {
  /* Snoke-throne atmosphere: ceiling bloom + vertical scan bars + floor
     glow. Folded into ::before so the shared ::after era-logo watermark
     stays intact on top. */
  background:
    radial-gradient(80% 60% at 50% 100%, rgba(220,30,40,0.3), transparent 60%),
    radial-gradient(ellipse at 50% 30%, rgba(180,20,30,0.4), transparent 65%),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(220,30,40,0.06) 38px 40px),
    var(--era-bg);
}
.entry.era-rise-of-the-first-order .entry-card {
  background:
    linear-gradient(135deg, rgba(220,30,40,0.05), transparent 50%),
    rgba(20,2,4,0.93);
  border: none;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  box-shadow: 0 0 22px rgba(220,30,40,0.22), inset 0 0 0 1px rgba(220,30,40,0.25);
  clip-path: none;
  position: relative;
}
.entry.era-rise-of-the-first-order .entry-card::before {
  content: none;
}
.entry.era-rise-of-the-first-order .entry-title {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fff;
}
.entry.era-rise-of-the-first-order .entry-meta {
  color: var(--accent);
}
.era-header.era-rise-of-the-first-order .era-name {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 300;
  letter-spacing: 6px;
  color: var(--accent);
}
.era-header.era-rise-of-the-first-order .era-divider {
  background:
    linear-gradient(90deg, var(--accent), transparent);
  height: 1px;
  opacity: 0.6;
}

/* ---------- 8. New Jedi Order — dawn mint ---------- */
.era-section.era-new-jedi-order::before {
  /* Dawn glow + drifting particles. Folded into ::before so the shared
     ::after era-logo watermark stays intact on top. */
  background:
    radial-gradient(1.5px 1.5px at 20% 25%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(1px 1px at 70% 35%, rgba(155,232,184,0.6), transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 60%, rgba(255,255,255,0.4), transparent 50%),
    radial-gradient(1px 1px at 40% 75%, rgba(155,232,184,0.5), transparent 50%),
    radial-gradient(60% 80% at 50% 100%, rgba(155,232,184,0.22), transparent 65%),
    var(--era-bg);
}
.entry.era-new-jedi-order .entry-card {
  background:
    radial-gradient(ellipse at 0% 50%, rgba(155,232,184,0.12), transparent 60%),
    rgba(8,24,14,0.88);
  border: 1px solid rgba(155,232,184,0.3);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(155,232,184,0.1);
}
.entry.era-new-jedi-order .entry-title {
  font-family: 'Georgia', 'Cambria', serif;
  font-weight: 400;
  letter-spacing: 0.5px;
  font-style: normal;
}
.entry.era-new-jedi-order .entry-meta {
  color: var(--accent);
}
.era-header.era-new-jedi-order .era-name {
  font-family: 'Georgia', serif;
  font-weight: 500;
}
.era-header.era-new-jedi-order .era-divider {
  background: linear-gradient(90deg, currentColor, rgba(155,232,184,0.6), transparent);
  height: 2px;
  border-radius: 2px;
  opacity: 0.5;
  filter: blur(0.5px);
}

/* Ensure positioning context for the era pseudo-element decorations */
.entry-card { position: relative; }

/* ============================================================
   Per-era ship art
   A large, atmospheric ship image floats behind each era's
   timeline cards. Positioned absolutely inside .era-section
   (which is `isolation: isolate`), it bleeds beyond the 760px
   timeline column using the same -50vw trick as the bg watermark.
   ============================================================ */
.era-ship {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50vw;
  max-width: 740px;
  aspect-ratio: 16 / 9;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  /* Right-bleed anchor: shift element so its right edge sits ~2vw inside
     the viewport's right edge, breaking out of the 760px timeline column. */
  --ship-x: calc(50vw - 100% - 2vw);
  /* Base transform matches era-ship-drift's `from` keyframe — without this
     the element sits with its top-left at 50%/50% during the drift's 1s
     delay, then snaps to the centered position when drift starts. */
  transform: translate(var(--ship-x, 0), calc(-50% - 6px)) rotate(var(--ship-rot, 0deg));
  animation: era-ship-fade 1.6s ease-out 0.2s forwards,
             era-ship-drift 22s ease-in-out 1s infinite alternate;
}
.era-ship img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 32px color-mix(in srgb, var(--era-accent) 40%, transparent));
}
@keyframes era-ship-fade {
  to { opacity: var(--ship-opacity, 0.22); }
}
@keyframes era-ship-drift {
  from { transform: translate(var(--ship-x, 0), calc(-50% - 6px)) rotate(var(--ship-rot, 0deg)); }
  to   { transform: translate(var(--ship-x, 0), calc(-50% + 10px)) rotate(calc(var(--ship-rot, 0deg) + 0.6deg)); }
}

/* ---------- 1. The Old Republic — aged manuscript ---------- */
.era-ship.era-the-old-republic {
  --ship-opacity: 0.10;
  --ship-rot: -1.5deg;
  filter: sepia(0.9) contrast(0.9);
  mix-blend-mode: luminosity;
}

/* ---------- 2. The High Republic — radiant gold ---------- */
.era-ship.era-the-high-republic {
  --ship-opacity: 0.13;
  filter: sepia(0.6) hue-rotate(-10deg) saturate(1.6) brightness(1.05);
  mix-blend-mode: screen;
}
.era-ship.era-the-high-republic img {
  filter: drop-shadow(0 0 60px rgba(106,160,224,0.4));
}

/* ---------- 3. Fall of the Jedi — smoke-lit ---------- */
.era-ship.era-fall-of-the-jedi {
  --ship-opacity: 0.28;
  --ship-rot: 2deg;
  mix-blend-mode: screen;
}
.era-ship.era-fall-of-the-jedi img {
  filter:
    drop-shadow(0 0 24px rgba(120,255,140,0.55))
    saturate(1.2) brightness(1.2);
}
.era-ship.era-fall-of-the-jedi::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg,
    transparent 0 2px,
    rgba(120,255,140,0.12) 2px 3px);
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---------- 4. Reign of the Empire — propaganda silhouette ---------- */
.era-ship.era-reign-of-the-empire {
  --ship-opacity: 0.22;
  --ship-rot: -2deg;
  filter: grayscale(1) brightness(0.45);
  mix-blend-mode: screen;
}
.era-ship.era-reign-of-the-empire img {
  filter:
    drop-shadow(0 0 50px rgba(200,210,220,0.5))
    drop-shadow(0 0 8px rgba(200,210,220,0.8));
}

/* ---------- 5. Age of Rebellion — sun-bleached, painted ---------- */
.era-ship.era-age-of-rebellion {
  --ship-opacity: 0.20;
  --ship-rot: -3deg;
  filter: sepia(0.5) saturate(1.3) contrast(1.1);
  mix-blend-mode: screen;
}
.era-ship.era-age-of-rebellion img {
  filter: drop-shadow(0 0 40px rgba(255,180,60,0.45));
}

/* ---------- 6. The New Republic — clean, beskar light ---------- */
.era-ship.era-the-new-republic {
  --ship-opacity: 0.18;
  --ship-rot: 1.5deg;
  filter: saturate(0.6) brightness(1.1);
  mix-blend-mode: screen;
}
.era-ship.era-the-new-republic img {
  filter: drop-shadow(0 0 40px rgba(120,170,255,0.4));
}

/* ---------- 7. Rise of the First Order — chrome menace ---------- */
.era-ship.era-rise-of-the-first-order {
  --ship-opacity: 0.20;
  --ship-rot: -1deg;
  filter: contrast(1.15) brightness(0.85) saturate(1.1);
  mix-blend-mode: screen;
}
.era-ship.era-rise-of-the-first-order img {
  filter: drop-shadow(0 0 36px rgba(220,30,40,0.5));
}

/* ---------- 8. New Jedi Order — luminous dawn ---------- */
.era-ship.era-new-jedi-order {
  --ship-opacity: 0.24;
  --ship-rot: 2deg;
  filter: saturate(0.7) brightness(1.15);
  mix-blend-mode: screen;
}
.era-ship.era-new-jedi-order img {
  filter: drop-shadow(0 0 50px rgba(155,232,184,0.5));
}

/* Smaller screens: keep ships present but tucked further out and dimmer
   so they decorate without competing with the cards. */
@media (max-width: 880px) {
  .era-ship {
    width: 78vw;
    --ship-opacity: 0.10 !important;
  }
}

/* Phones (<600px): shrink card typography, and scale the era-logo watermark
   + ship art down 20% with tighter edge offsets so both decorative images
   fit side-by-side with only minimal overlap. Placed after the 880px block
   so its ship width wins the cascade. */
@media (max-width: 600px) {
  .hero-title   { font-size: 38px; }
  .entry-meta   { font-size: 9px; }
  .entry-status { font-size: 9px; min-width: 50px; }
  .entry-title  { font-size: 13px; }

  /* Era header: smaller logo icon (56px -> 50px) and name (14px -> 13px). */
  .era-header .era-icon { width: 50px; height: 50px; }
  .era-header .era-name { font-size: 13px; }

  /* Left-side era-logo watermark: 372px -> 268px (-20%, then another -10%),
     pulled tighter to the left edge (40px -> 20px) with the mask radius
     scaled to match. */
  .era-section::after {
    background-size: 200px;
    background-position: 5px 50%;
    -webkit-mask-image: radial-gradient(circle 173px at 10px 50%, #000 55%, transparent 100%);
    mask-image: radial-gradient(circle 173px at 10px 50%, #000 55%, transparent 100%);
  }

  /* Right-side ship art: 20% narrower than the 880px rule, then another 10%
     (78vw -> 62vw -> 56vw), tucked flush to the right edge (drop the 2vw
     inset) to clear the logo. */
  .era-ship {
    width: 56vw;
    --ship-x: calc(50vw - 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .era-ship { animation: era-ship-fade 0.4s ease-out forwards; }
}

/* ============================================================
   Central ornament — aria-hidden decorative glyph centered in
   each era's section (Old Republic ⚔, High Republic ✦).
   ============================================================ */
.era-ornament {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  color: var(--era-accent, var(--text-muted));
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  font-family: var(--font-serif);
}

/* The era-section is the positioning context for corners and ornament.
   Existing rule sets `position: relative; isolation: isolate;` already. */

