/* =============================================
   CUSTOM PROPERTIES
   ============================================= */
:root {
  --papyrus:       #D4A96A;
  --papyrus-light: #E8C990;
  --papyrus-dark:  #B8894A;
  --papyrus-deep:  #9A6E35;
  --text-dark:     #3D1F00;
  --text-mid:      #6B3D0F;
  --gold:          #C9A227;
  --gold-light:    #E8C547;
  --teal:          #2E7D9E;
  --teal-light:    #4AA3C8;
  --red:           #8B1A1A;
  --red-light:     #B52020;
  --cream:         #F5E6C8;
  --shadow:        rgba(61, 31, 0, 0.25);
  --overlay:       rgba(30, 15, 0, 0.72);

  --font-display:  'Cinzel Decorative', serif;
  --font-heading:  'Cinzel', serif;
  --font-body:     'Lato', sans-serif;

  --card-width:    220px;
  --bar-height:    10px;
  --gap:           32px;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--papyrus);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255,220,140,0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(140,80,20,0.25) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23C9962A' opacity='0.04'/%3E%3Crect x='0' y='0' width='2' height='2' fill='%23D4A96A' opacity='0.06'/%3E%3C/svg%3E");
  color: var(--text-dark);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  position: relative;
  text-align: center;
  padding: 72px 120px 56px;
  border-bottom: 4px solid var(--gold);
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  /* Photo background */
  background-image: url('graphics/pyramids.jpg');
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Dark cinematic overlay — darker at top/bottom, lighter in centre */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(10, 5, 0, 0.72) 0%,
      rgba(20, 10, 0, 0.45) 38%,
      rgba(20, 10, 0, 0.52) 65%,
      rgba(0, 0, 0, 0.82) 100%
    );
  z-index: 0;
}

/* Decorative gold rule lines top & bottom of header */
.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  border-top: 2px solid rgba(201, 162, 39, 0.45);
  border-bottom: 2px solid rgba(201, 162, 39, 0.45);
  pointer-events: none;
  z-index: 1;
}

.header-text {
  position: relative;
  z-index: 2;
}

.header-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.header-corner--tl { top: 16px; left: 18px; }
.header-corner--tr { top: 16px; right: 18px; }
.header-corner--bl { bottom: 16px; left: 18px; }
.header-corner--br { bottom: 16px; right: 18px; }

.ankh {
  font-size: 2.8rem;
  color: var(--gold);
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
  text-shadow: 0 0 20px rgba(201,162,39,0.5);
}

.scarab {
  font-size: 2.4rem;
  color: var(--teal-light);
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
}
.scarab.small { font-size: 1.3rem; }

.hieroglyph-strip--v {
  width: 8px;
  height: 90px;
  background: repeating-linear-gradient(
    180deg,
    var(--gold) 0px, var(--gold) 3px,
    transparent 3px, transparent 8px,
    var(--teal-light) 8px, var(--teal-light) 11px,
    transparent 11px, transparent 16px
  );
  border-radius: 4px;
  opacity: 0.75;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 3rem);
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
  text-shadow:
    0 2px 8px rgba(0,0,0,0.8),
    0 0 40px rgba(201,162,39,0.35);
}

.site-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(0.9rem, 2vw, 1.35rem);
  color: #F0D88A;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 8px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

/* Decorative divider line between subtitle and description */
.site-subtitle::after {
  content: '';
  display: block;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 10px auto 0;
  opacity: 0.7;
}

.site-desc {
  font-size: 0.88rem;
  color: rgba(245, 225, 185, 0.85);
  font-style: italic;
  margin-top: 12px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* =============================================
   ERA FILTERS
   ============================================= */
.era-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 18px 16px 14px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(100,55,10,0.12) 0%, transparent 100%);
  border-bottom: 1px solid rgba(184, 137, 74, 0.35);
}

.filter-btn {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 18px;
  border: 2px solid var(--papyrus-dark);
  border-radius: 20px;
  background: transparent;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--gold);
  color: var(--text-dark);
  background: rgba(201,162,39,0.12);
}

.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--text-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(201,162,39,0.4);
}

/* =============================================
   TIMELINE SECTION
   ============================================= */
.timeline-section {
  padding: 0 0 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.timeline-wrapper {
  min-width: max-content;
  padding: 20px 48px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- Track: two rows of cards + the bar between them ---- */
.timeline-track {
  display: grid;
  grid-template-rows: auto var(--bar-height) auto;
  position: relative;
}

/* The bar row */
.timeline-bar {
  display: flex;
  align-items: center;
  position: relative;
  height: var(--bar-height);
  margin: 0 calc(var(--card-width) / 2);
  background: linear-gradient(90deg,
    var(--red) 0%,
    var(--red) var(--old-end, 25%),
    var(--teal) var(--old-end, 25%),
    var(--teal) var(--middle-end, 50%),
    var(--gold) var(--middle-end, 50%),
    var(--gold) 100%
  );
  border-radius: 5px;
  box-shadow: 0 2px 6px var(--shadow);
}

.bar-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--cream);
  border: 3px solid var(--teal);
  border-radius: 50%;
  transform: translateX(-50%);
  top: 50%;
  margin-top: -9px;
  z-index: 2;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.era-label {
  position: absolute;
  bottom: -22px;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  white-space: nowrap;
  transform: translateX(-50%);
}

/* =============================================
   EVENT CARDS
   ============================================= */
.cards-row {
  display: flex;
  align-items: flex-end;
  gap: var(--gap);
  padding-bottom: 14px;
}
.cards-row.bottom {
  align-items: flex-start;
  padding-bottom: 0;
  padding-top: 14px;
}

.event-card {
  width: var(--card-width);
  flex-shrink: 0;
  background: linear-gradient(160deg, #FDF3DC 0%, var(--cream) 100%);
  border: 1px solid var(--papyrus-dark);
  border-top: 4px solid var(--papyrus-dark); /* overridden per-era below */
  border-radius: 6px;
  padding: 0;                 /* portrait bleeds edge-to-edge */
  overflow: hidden;           /* clips portrait to border-radius */
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 2px 5px 14px var(--shadow);
  position: relative;
}

/* Era-coloured top accent bar */
.event-card[data-era="Old Kingdom"]    { border-top-color: var(--red); }
.event-card[data-era="Middle Kingdom"] { border-top-color: var(--teal); }
.event-card[data-era="New Kingdom"]    { border-top-color: var(--gold); }

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 4px 10px 24px rgba(61,31,0,0.38);
  border-color: var(--gold);
  border-top-color: var(--gold);
}

.event-card.active {
  border-color: var(--gold);
  border-top-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.45), 4px 10px 24px var(--shadow);
}

/* ---- Portrait image block ---- */
.card-portrait {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Gradient fade so the portrait blends into the cream card body */
.card-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.05) 0%,
    rgba(0,0,0,0.0)  45%,
    rgba(245,230,200,0.85) 88%,
    rgba(245,230,200,1)    100%
  );
  pointer-events: none;
}

/* Fallback portrait for events without a photo */
.card-portrait--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #B8894A 0%, #7A4E20 60%, #4A2C0A 100%);
}

/* Decorative hieroglyph-like repeat pattern on fallback */
.card-portrait--fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(201,162,39,0.08) 0px, rgba(201,162,39,0.08) 2px,
    transparent 2px, transparent 14px
  );
  pointer-events: none;
}

.card-fallback-emoji {
  font-size: 3rem;
  line-height: 1;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* ---- Card text body (replaces old card-level padding) ---- */
.card-body {
  padding: 10px 14px 12px;
}

/* Connector line from card to bar — uses a separate .card-connector element
   (::after is now used by .card-portrait for its gradient fade overlay) */
.card-connector {
  position: absolute;
  left: 50%;
  width: 2px;
  background: var(--papyrus-dark);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
.cards-row:not(.bottom) .card-connector {
  bottom: -14px;
  height: 14px;
}
.cards-row.bottom .card-connector {
  top: -14px;
  height: 14px;
}

/* Spacer card (invisible, keeps grid columns aligned) */
.event-card.spacer {
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}
.event-card.spacer .card-connector { display: none; }

.card-date {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--red);
  display: block;
  text-align: center;
  margin-bottom: 4px;
}

.card-era-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  margin: 0 auto 8px;
  display: block;
  text-align: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.era-old    { background: rgba(139,26,26,0.12); color: var(--red); border: 1px solid var(--red); }
.era-middle { background: rgba(46,125,158,0.12); color: var(--teal); border: 1px solid var(--teal); }
.era-new    { background: rgba(201,162,39,0.15); color: #8A6D00; border: 1px solid var(--gold); }

.card-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.35;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.72rem;
  color: var(--text-mid);
  line-height: 1.5;
  text-align: center;
}

.card-cta {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border-top: 1px solid var(--papyrus-dark);
  padding-top: 8px;
}

/* Hidden card state (era filter) */
.event-card.hidden {
  display: none;
}

/* =============================================
   GLOSSARY FOOTER
   ============================================= */
.glossary {
  display: flex;
  gap: 0;
  border-top: 3px solid var(--gold);
  background: linear-gradient(180deg, rgba(140,80,20,0.1) 0%, transparent 100%);
  padding: 16px 32px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.glossary-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dark);
  font-weight: 700;
  padding-right: 24px;
  border-right: 2px solid var(--papyrus-dark);
  margin-right: 24px;
  min-width: 80px;
  padding-top: 4px;
}

.glossary-items {
  display: flex;
  flex: 1;
  gap: 24px;
  flex-wrap: wrap;
}

.glossary-item {
  flex: 1;
  min-width: 200px;
}

.glossary-item strong {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dark);
  display: block;
  margin-bottom: 4px;
}

.glossary-item p {
  font-size: 0.72rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.glossary-item + .glossary-item {
  border-left: 1px solid var(--papyrus-dark);
  padding-left: 24px;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay[hidden] { display: none; }

.modal-overlay.open {
  opacity: 1;
}

.modal-panel {
  background: var(--cream);
  background-image: radial-gradient(ellipse at 10% 5%, rgba(255,220,140,0.3) 0%, transparent 55%);
  border: 2px solid var(--gold);
  border-radius: 8px;
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px 36px 36px;
  position: relative;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--papyrus-dark) transparent;
}

.modal-overlay.open .modal-panel {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: 2px solid var(--papyrus-dark);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  color: var(--text-mid);
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.modal-emoji {
  font-size: 2.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.modal-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-era-badge {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 12px;
  width: fit-content;
}

.modal-dynasty {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-mid);
  letter-spacing: 0.06em;
}

.modal-date {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.08em;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--papyrus-dark);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.modal-tag {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  background: rgba(201,162,39,0.15);
  border: 1px solid var(--gold);
  border-radius: 12px;
  color: #7A5E00;
}

.modal-overview {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.modal-achievements h3,
.modal-legacy h3 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-achievements h3::before { content: '▶'; font-size: 0.55rem; }
.modal-legacy h3::before { content: '▶'; font-size: 0.55rem; }

.modal-achievements ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding-left: 0;
}

.modal-achievements li {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-dark);
  padding-left: 20px;
  position: relative;
}

.modal-achievements li::before {
  content: '𓆃';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.75rem;
  top: 2px;
}

.modal-legacy {
  margin-bottom: 20px;
}

.modal-legacy p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-dark);
}

.modal-fact {
  background: linear-gradient(135deg, rgba(201,162,39,0.12), rgba(46,125,158,0.08));
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
}

.fact-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.modal-fact p {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-dark);
  font-style: italic;
}

/* =============================================
   NATIVE SCROLLBAR — HIDDEN (replaced by Nile)
   ============================================= */
.timeline-section { scrollbar-width: none; }
.timeline-section::-webkit-scrollbar { display: none; }

.modal-panel::-webkit-scrollbar { width: 4px; }
.modal-panel::-webkit-scrollbar-thumb {
  background: var(--papyrus-dark);
  border-radius: 2px;
}

/* =============================================
   NILE RIVER SCROLLBAR
   ============================================= */
.nile-scrollbar {
  position: relative;
  display: flex;
  align-items: center;
  padding: 4px 12px 20px;
  background: var(--papyrus);
}

/* "drag to scroll" hint text */
.nile-scrollbar::after {
  content: '— drag the boat to scroll —';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  color: var(--papyrus-deep);
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0.75;
}

/* ---- Banks (flanking decorations + arrow buttons) ---- */
.nile-bank {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
  padding: 0 6px;
}
.nile-bank--left  { flex-direction: row; }
.nile-bank--right { flex-direction: row-reverse; }

.nile-plant {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
  pointer-events: none;
  user-select: none;
}

.nile-oar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--papyrus-dark);
  border: 2px solid var(--gold);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, transform 0.15s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.nile-oar:hover  { background: var(--gold); transform: scale(1.1); }
.nile-oar:active { transform: scale(0.93); }

/* ---- River wrap: positions thin water + floating boat ---- */
.nile-river-wrap {
  flex: 1;
  position: relative;
  height: 60px;   /* total height: river (22px at bottom) + boat sail above */
  cursor: pointer;
}

/* The water strip — thin, at the bottom of the wrap */
.nile-river {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    #0E5470 0%,
    #1A7CA8 40%,
    #2292C4 70%,
    #176C90 100%
  );
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.45),
    inset 0 -1px 3px rgba(255,255,255,0.07),
    0 2px 6px rgba(0,0,0,0.2);
}

/* Animated horizontal ripple stripes */
.nile-ripple-layer {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent            0px,
    transparent            16px,
    rgba(255,255,255,0.06) 18px,
    transparent            20px,
    transparent            34px,
    rgba(255,255,255,0.03) 36px,
    transparent            38px
  );
  animation: nile-flow 4.5s linear infinite;
}

/* Gold sun shimmer on the water surface */
.nile-river::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 38%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201,162,39,0.22) 20%,
    rgba(255,220,100,0.42) 50%,
    rgba(201,162,39,0.22) 80%,
    transparent 100%
  );
  animation: shimmer-shift 6s ease-in-out infinite alternate;
}

/* Dark vignette at curved ends */
.nile-river::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0%   50%, rgba(0,0,0,0.4) 0%, transparent 25%),
    radial-gradient(ellipse at 100% 50%, rgba(0,0,0,0.4) 0%, transparent 25%);
  pointer-events: none;
}

@keyframes nile-flow {
  from { background-position-x: 0; }
  to   { background-position-x: 76px; }
}
@keyframes shimmer-shift {
  from { opacity: 0.55; }
  to   { opacity: 1; }
}

/* ---- The reed boat (draggable scroll thumb) ---- */
.nile-boat {
  position: absolute;
  bottom: 0;        /* hull base at water level */
  left: 0;
  width: 76px;
  cursor: grab;
  z-index: 5;
  user-select: none;
  touch-action: none;
  will-change: left, transform;
  animation: boat-bob 3.2s ease-in-out infinite;
}
.nile-boat:focus-visible {
  outline: 2px dashed var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}
.nile-boat.is-dragging {
  cursor: grabbing;
  animation-play-state: paused;
}

.boat-svg {
  width: 76px;
  height: auto;       /* preserves viewBox aspect ratio */
  display: block;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.45));
}

@keyframes boat-bob {
  0%,  100% { transform: translateY(0px)  rotate(-0.4deg); }
  30%        { transform: translateY(-5px) rotate( 0.5deg); }
  70%        { transform: translateY(-3px) rotate(-0.6deg); }
}

/* Hide on mobile (vertical layout scrolls natively) */
@media (max-width: 768px) {
  .nile-scrollbar { display: none; }
}

/* =============================================
   SITE FOOTER
   ============================================= */
.site-footer {
  text-align: center;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--papyrus-dark);
  background: linear-gradient(180deg, transparent, rgba(100,55,10,0.07));
}

.footer-copyright {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-mid);
}

.footer-disclaimer {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--papyrus-deep);
  font-style: italic;
  margin-top: 5px;
  opacity: 0.85;
}

/* =============================================
   RESPONSIVE — VERTICAL TIMELINE
   ============================================= */
@media (max-width: 768px) {
  .site-header {
    padding: 48px 56px 40px;
    min-height: 240px;
    background-position: center center;
  }
  .hieroglyph-strip--v { height: 50px; }

  .timeline-section { overflow-x: visible; }
  .timeline-wrapper {
    min-width: unset;
    padding: 16px 24px 24px;
  }

  /* Vertical layout: single column of cards with left border */
  .timeline-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 4px solid var(--gold);
    margin-left: 16px;
    padding-left: 0;
  }

  .cards-row,
  .cards-row.bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 16px;
  }

  .timeline-bar { display: none; }

  .event-card {
    width: calc(100vw - 80px);
    max-width: 420px;
    margin-left: 20px;
    position: relative;
  }

  .event-card::after {
    content: '';
    position: absolute;
    left: -22px;
    top: 50%;
    width: 18px;
    height: 2px;
    background: var(--gold);
    transform: none;
  }

  .event-card::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--cream);
    border: 3px solid var(--teal);
    border-radius: 50%;
    transform: translateY(-50%);
  }

  .cards-row.bottom .event-card::after { top: 50%; bottom: auto; }

  .event-card.spacer { display: none; }

  .glossary {
    flex-direction: column;
    padding: 16px 20px;
  }
  .glossary-label {
    flex-direction: row;
    border-right: none;
    border-bottom: 2px solid var(--papyrus-dark);
    padding-right: 0;
    padding-bottom: 10px;
    margin-right: 0;
    margin-bottom: 14px;
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }
  .glossary-items { flex-direction: column; gap: 14px; }
  .glossary-item + .glossary-item {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--papyrus-dark);
    padding-top: 14px;
  }

  .modal-panel { padding: 24px 20px 28px; }
}
