/* ============================================================
   WHITTIER NARROWS — Clean Rebuild
   Black & White Hand-Drawn Storytelling Theme
   ============================================================ */

/* ---- Variables ---- */
:root {
  --black: #0d0d0d;
  --off-black: #1a1a1a;
  --dark-gray: #2a2a2a;
  --mid-gray: #888;
  --light-gray: #ccc;
  --cream: #f5f2ec;
  --off-white: #faf9f6;
  --white: #ffffff;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-impact: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;

  --green: #4ade80;
  --header-h: 90px;
  --tl-nav-h: 0px; /* set by JS */
  --page-margin: clamp(1.5rem, 5vw, 5rem);
  --radius: 2px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--black);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Accessibility utilities ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--page-margin);
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--green);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}
.tl-arrow:disabled,
.gallery-carousel-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .quote-word,
  .fade-up,
  .tl-track,
  .tl-map-wrap,
  .gallery-item > img,
  .gallery-item .gallery-color {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 600;
  background: var(--off-white);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  height: auto;
  min-height: auto;
  padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0.65rem;
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: auto;
  min-height: 0;
  padding: 0 var(--page-margin);
  gap: 1.5rem;
}
.header-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
  padding: 0.15rem 0;
}
.header-eyebrow {
  font-family: var(--font-body);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid-gray);
  line-height: 1.4;
  display: block;
}
.header-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--black);
  line-height: 1.1;
  white-space: nowrap;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}
.header-nav--left {
  justify-content: flex-start;
}
.header-nav--right {
  justify-content: flex-end;
}
.header-nav a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid-gray);
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}
.header-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1.5px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1);
}
.header-nav a:hover { color: var(--black); }
.header-nav a:hover::after { transform: scaleX(1); }

/* ---- Hamburger button (hidden on desktop) ---- */
.header-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  grid-column: 3;
  justify-self: end;
}
.header-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.header-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.header-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Mobile slide-out drawer ---- */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100dvh;
  background: var(--off-white);
  z-index: 700;
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem 3rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
  box-shadow: -4px 0 32px rgba(0,0,0,0.15);
}
.mobile-drawer.open {
  transform: translateX(0);
}
.mobile-drawer-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--black);
  padding: 0;
  margin-bottom: 2.5rem;
}
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-drawer-nav a {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 700;
  color: var(--black);
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: color 0.2s, padding-left 0.2s;
  letter-spacing: -0.01em;
}
.mobile-drawer-nav a:hover {
  color: var(--mid-gray);
  padding-left: 0.5rem;
}
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 699;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   TIMELINE SECTION
   ============================================================ */
#timeline {
  height: calc(100dvh - var(--header-h, 72px));
  overflow: hidden;
  background: var(--off-white);
}

/* ---- Timeline Nav ---- */
.tl-nav {
  position: relative;
  z-index: 500;
  background: var(--black);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

/* Top strip */
.tl-nav-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.75rem var(--page-margin);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.tl-nav-section-label {
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

.tl-nav-progress-wrap {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}

.tl-nav-progress {
  height: 100%;
  background: var(--white);
  width: 0%;
  transition: width 0.55s cubic-bezier(0.76, 0, 0.24, 1);
}

.tl-nav-counter-inline {
  font-family: var(--font-impact);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
}

#tl-current {
  font-size: 1.3rem;
  color: #ffffff;
}

/* Chapter buttons row */
.tl-nav-items {
  display: flex;
  align-items: stretch;
  padding: 0 var(--page-margin);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tl-nav-items::-webkit-scrollbar { display: none; }

.tl-nav-item {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: none;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  padding: 1.4rem 0.75rem 1.9rem;
  position: relative;
  transition: background 0.2s;
  text-align: center;
  overflow: hidden;
}

.tl-nav-item:last-child { border-right: none; }
.tl-nav-item:hover { background: rgba(255,255,255,0.04); }

.tl-nav-year {
  font-family: var(--font-impact);
  font-size: clamp(1.1rem, 2vw, 2.4rem);
  letter-spacing: 0.05em;
  /* Inactive: white so it's readable */
  color: rgba(255,255,255,0.75);
  line-height: 1;
  transition: color 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: block;
  white-space: nowrap;
}

.tl-nav-item.active .tl-nav-year {
  /* Active: #4ade80 — WCAG AA contrast 8.5:1 against #0d0d0d black */
  color: #4ade80;
  transform: scale(1.12);
  text-shadow: 0 0 20px rgba(74,222,128,0.3);
}

.tl-nav-item:hover:not(.active) .tl-nav-year {
  color: #ffffff;
  transform: scale(1.04);
}

.tl-nav-label {
  font-family: var(--font-body);
  font-size: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  /* Inactive: white at reduced opacity */
  color: rgba(255,255,255,0.5);
  transition: color 0.3s;
  white-space: nowrap;
  display: block;
}

.tl-nav-item.active .tl-nav-label { color: rgba(74,222,128,0.8); }
.tl-nav-item:hover:not(.active) .tl-nav-label { color: rgba(255,255,255,0.8); }

.tl-nav-underline {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: #4ade80;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.76, 0, 0.24, 1);
}

.tl-nav-item.active .tl-nav-underline { transform: scaleX(1); }

/* Swipe hint — hidden on desktop, shown on mobile via media query */
.tl-swipe-hint { display: none; }
.tl-dot-nav { display: none; }
.tl-nav-counter-inline--mobile { display: none; }
.tl-nav-progress-wrap--mobile { display: none; }
.tl-sticky-nav { display: block; }

/* ---- Slides Track ---- */
.tl-track-outer {
  overflow: hidden;
  position: relative;
}

.tl-track {
  display: flex;
  transition: transform 0.65s cubic-bezier(0.76, 0, 0.24, 1);
  will-change: transform;
  align-items: stretch;
  position: relative;
}

/* ---- Individual Slide ---- */
.tl-slide {
  flex: 0 0 100%;
  width: 100%;
  /* Fill the remaining height inside the sticky #timeline after the nav */
  height: calc(100dvh - var(--header-h, 72px) - var(--tl-nav-h, 110px));
  max-height: calc(100dvh - var(--header-h, 72px) - var(--tl-nav-h, 110px));
  overflow: hidden;
  display: flex;
  align-items: stretch;
  position: relative;
}


.tl-slide--light { background: var(--cream); }
.tl-slide--dark  { background: var(--black); color: var(--white); }
.tl-slide--victory { background: var(--black); color: var(--white); }

.tl-slide-inner {
  width: 100%;
  /* Compact vertical padding — leave room for arrows at bottom */
  padding: 1.75rem var(--page-margin) 4.5rem;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.tl-slide-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.tl-slide-text {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tl-slide-chapter {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid-gray);
}

.tl-slide--dark .tl-slide-chapter,
.tl-slide--victory .tl-slide-chapter {
  color: rgba(255,255,255,0.4);
}

.tl-slide-heading {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--black);
}

.tl-slide--dark .tl-slide-heading,
.tl-slide--victory .tl-slide-heading { color: var(--white); }

.tl-heading-victory {
  font-size: clamp(2rem, 4vw, 4rem);
}

.tl-slide-text p {
  font-size: clamp(0.78rem, 1vw, 0.88rem);
  line-height: 1.65;
  color: #444;
  max-width: 520px;
}

.tl-slide--dark .tl-slide-text p,
.tl-slide--victory .tl-slide-text p {
  color: rgba(255,255,255,0.65);
}

.tl-quote {
  border-left: 2px solid var(--green);
  padding-left: 1.2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
}

.tl-quote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  margin-top: 0.5rem;
}

/* Stats row */
.tl-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.tl-slide--dark .tl-stats,
.tl-slide--victory .tl-stats {
  border-top-color: rgba(255,255,255,0.1);
}

.tl-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tl-stat-num {
  font-family: var(--font-impact);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  letter-spacing: 0.04em;
  color: var(--green);
  line-height: 1;
}

.tl-slide--dark .tl-stat-num,
.tl-slide--victory .tl-stat-num { color: var(--white); }

.tl-stat-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid-gray);
}

.tl-slide--dark .tl-stat-label,
.tl-slide--victory .tl-stat-label { color: rgba(255,255,255,0.35); }

/* Media column */
.tl-slide-media {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tl-slide-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.tl-slide-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: grayscale(100%) contrast(1.05);
  transition: filter 0.5s ease, transform 0.6s ease;
}

.tl-slide-img-wrap:hover img {
  filter: grayscale(0%) contrast(1);
  transform: scale(1.02);
}

.tl-img-caption {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid-gray);
  margin-top: 0.5rem;
}

.tl-slide-illustration {
  display: flex;
  justify-content: center;
}

.tl-silhouette {
  width: 100%;
  max-width: 320px;
  max-height: 220px;
  object-fit: contain;
  opacity: 0.9;
  /* SVG is black-filled — keep as-is on light slide background */
  filter: none;
}

/* ---- Map SVG (The Place slide) ---- */
.tl-slide-media--map {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  gap: 0;
}

.tl-map-wrap {
  position: relative;
  width: 100%;
  /* Default: hidden, waiting for reveal class */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.tl-map-wrap.tl-map--revealed {
  opacity: 1;
  transform: translateY(0);
}

.tl-map-svg {
  width: 100%;
  max-width: 820px;
  height: auto;
  display: block;
  opacity: 0.92;
}

/* Bulldozer SVG is black on white — invert to white on the dark Threat slide */
.tl-bulldozer-svg {
  filter: invert(1);
  opacity: 0.88;
  max-width: 760px;
}

/* Victory slide specifics */
.tl-slide-content--victory {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: clamp(340px, 52vh, 520px);
}

.tl-slide-media--victory {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.tl-slide-media--victory .tl-slide-img-wrap {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.tl-slide-media--victory .tl-slide-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tl-victory-silhouette {
  width: 100%;
  max-width: 380px;
  opacity: 0.2;
  filter: invert(1);
}

.tl-victory-badge {
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.75rem 1.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-top: 0.5rem;
  max-width: 360px;
}

/* Arrow buttons — positioned inside the slide area, always visible */
.tl-track-outer {
  position: relative;
}

.tl-arrows {
  position: absolute;
  bottom: 1.25rem;
  left: var(--page-margin);
  display: flex;
  gap: 0.6rem;
  z-index: 20;
  pointer-events: all;
}

.tl-arrow {
  background: none;
  border: 1px solid rgba(0,0,0,0.25);
  color: var(--black);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.tl-arrow:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* Arrow color adapts to current slide theme — set via JS */
.tl-arrows.dark .tl-arrow {
  border-color: rgba(255,255,255,0.3);
  color: var(--white);
}

.tl-arrows.dark .tl-arrow:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

/* ============================================================
   QUOTE SECTION
   ============================================================ */
.section-quote {
  background: var(--black);
  color: var(--white);
  padding: clamp(2rem, 4vw, 4rem) var(--page-margin);
  position: relative;
  overflow: hidden;
}

/* Flashlight background photo for quote section */
.quote-bg-photo {
  position: absolute;
  inset: 0;
  background-image: url('../images/flashlight-bg.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
  pointer-events: none;
}

/* Film grain overlay on the quote section */
.quote-bg-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.18'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Canvas sits above the photo, draws the dark overlay with the flashlight hole */
.quote-flashlight-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Section content sits above the canvas */
.section-quote .section-inner {
  position: relative;
  z-index: 2;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.quote-mark {
  font-family: var(--font-display);
  font-size: clamp(5rem, 10vw, 10rem);
  line-height: 0.6;
  color: rgba(255,255,255,0.85);
  margin-bottom: 1rem;
  user-select: none;
}

.quote-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
  text-shadow:
    0 2px 12px rgba(0,0,0,0.9),
    0 4px 32px rgba(0,0,0,0.8),
    0 0 60px rgba(0,0,0,0.7);
}

.quote-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s, transform 0.5s;
}

.quote-word.visible {
  opacity: 1;
  transform: translateY(0);
}

.quote-attribution {
  font-family: var(--font-hand);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  color: rgba(255,255,255,0.45);
  margin-bottom: 2rem;
  text-shadow:
    0 1px 8px rgba(0,0,0,0.95),
    0 3px 20px rgba(0,0,0,0.85);
}

.quote-body {
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  line-height: 1.8;
  color: rgba(255,255,255,0.55);
  max-width: 680px;
  text-shadow:
    0 1px 6px rgba(0,0,0,0.95),
    0 3px 18px rgba(0,0,0,0.85);
}

/* ============================================================
   CONTRIBUTORS SECTION
   ============================================================ */
.section-contributors {
  background: var(--off-white);
  padding: clamp(4rem, 8vw, 8rem) var(--page-margin);
  border-top: 1px solid rgba(0,0,0,0.08);
}

.section-eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mid-gray);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ---- Two-column accordion layout ---- */
.contributors-layout {
  display: grid;
  grid-template-columns: 60fr 30fr;
  gap: clamp(2rem, 4vw, 5rem);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.contributors-accordion-col {
  min-width: 0;
}

/* ---- Accordion items ---- */
.contrib-accordion {
  margin-top: 0;
  border-top: 1px solid rgba(0,0,0,0.12);
}

.contrib-item {
  border-bottom: 1px solid rgba(0,0,0,0.12);
  overflow: hidden;
}

.contrib-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.4rem 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.contrib-header:hover {
  background: rgba(0,0,0,0.02);
}

.contrib-num {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--mid-gray);
  flex-shrink: 0;
  width: 2rem;
  transition: color 0.2s;
}

.contrib-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 800;
  color: var(--black);
  flex: 1;
  transition: color 0.2s;
}

.contrib-item--active .contrib-title {
  color: var(--black);
}
.contrib-item--active .contrib-num {
  color: var(--green);
}

.contrib-arrow {
  font-size: 1rem;
  color: var(--mid-gray);
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
  display: inline-block;
}

.contrib-item--active .contrib-arrow {
  transform: rotate(180deg);
  color: var(--green);
}

/* Accordion body — height animated via JS max-height trick */
.contrib-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.76, 0, 0.24, 1),
              opacity 0.4s ease,
              padding 0.4s ease;
  opacity: 0;
  padding: 0 0 0 3.25rem;
}

.contrib-item--active .contrib-body {
  max-height: 300px;
  opacity: 1;
  padding: 0 0 1.5rem 3.25rem;
}

.contrib-body p {
  font-size: 0.88rem;
  line-height: 1.8;
  color: #555;
  max-width: 520px;
}

/* ---- Image panel ---- */
.contributors-image-col {
  align-self: center;
}

.contrib-image-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--black);
}

.contrib-img-slot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.76, 0, 0.24, 1),
              transform 0.6s cubic-bezier(0.76, 0, 0.24, 1);
  transform: scale(1.04);
}

.contrib-img-slot--active {
  opacity: 1;
  transform: scale(1);
}

.contrib-img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================================
   GALLERY SECTION
   ============================================================ */
.section-gallery {
  background: var(--cream);
  padding: clamp(4rem, 8vw, 8rem) var(--page-margin);
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* Masonry via CSS columns — images keep their natural aspect ratio */
.gallery-carousel-wrap {
  position: relative;
}
.gallery-grid {
  columns: 3;
  column-gap: 0.75rem;
  margin-top: 2.5rem;
}
/* Carousel controls — hidden on desktop */
.gallery-carousel-btn {
  display: none;
}
.gallery-carousel-dots {
  display: none;
}

.gallery-item {
  break-inside: avoid;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  margin-bottom: 0.75rem;
  display: block;
}

/* Base image: full width, natural height, grayscale */
.gallery-item > img {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
  filter: grayscale(100%) contrast(1.05);
  transition: transform 0.6s ease;
}
.gallery-item:hover > img { transform: scale(1.03); }

/* Color-reveal overlay */
.gallery-item .gallery-color {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.65s cubic-bezier(0.76, 0, 0.24, 1);
  pointer-events: none;
}
/* Activated by JS rotating spotlight — same wipe animation */
.gallery-item--color-active .gallery-color {
  clip-path: inset(0 0% 0 0);
}
.gallery-item .gallery-color img {
  filter: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none !important;
}

/* Lightbox */
.lightbox[hidden] {
  display: none !important;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}
/* Dark backdrop — separate element so clicks on it close the lightbox */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.93);
  cursor: zoom-out;
}
/* Image stage — sits above backdrop */
.lightbox-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 88vw;
  max-height: 88vh;
}
.lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  /* Images show in full color in the lightbox */
  filter: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.lightbox-img.transitioning {
  opacity: 0;
  transform: scale(0.97);
}
/* Close button */
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
}
/* Prev / Next arrows */
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  line-height: 1;
}
.lightbox-arrow:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-50%) scale(1.08);
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
@media (max-width: 600px) {
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .lightbox-arrow { width: 40px; height: 40px; font-size: 1.1rem; }
}
/* Image counter */
.lightbox-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(74,222,128,0.65);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--black);
  color: var(--white);
  padding: clamp(4rem, 8vw, 7rem) var(--page-margin) 3rem;
  position: relative;
  overflow: hidden;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 3; /* above the ::after overlay */
}

/* ---- Birds flying GIF ---- */
.footer-birds {
  position: absolute;
  top: -60px;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  opacity: 0.75;
  /* White birds on transparent (green-keyed) background — screen blend
     makes the black/green background invisible on the dark footer */
}

/* 50% black overlay: above birds (z:1), below all text (z:3) */
.site-footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.70);
  pointer-events: none;
  z-index: 2;
}

.footer-silhouette {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  /* Show a tasteful horizon band at the bottom */
  height: 120px;
  overflow: hidden;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
}
.footer-silhouette img {
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  /* SVG already has fill="white" — no filter needed */
  filter: none;
  display: block;
}

.footer-content { position: relative; z-index: 3; /* above the ::after overlay */ }

.footer-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-about {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.75;
  color: rgba(255,255,255,0.9);
  max-width: 540px;
  text-align: left;
  margin-bottom: 1.25rem;
}

.footer-credit {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.75);
  text-align: left;
  margin-bottom: 0;
}

.footer-credit a {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-credit a:hover {
  color: var(--white);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 3; /* above the ::after overlay */
}

.footer-nav a {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--green); }

.footer-nav--right {
  justify-content: flex-end;
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--black);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================================
   ENTRANCE ANIMATIONS
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --page-margin: 1.25rem;
  }

  /* Header — collapse to title + hamburger on mobile */
  .site-header {
    height: auto;
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
    padding-bottom: 0.5rem;
  }
  .header-inner {
    grid-template-columns: 1fr auto;
    min-height: 52px;
    padding: 0 var(--page-margin);
  }
  .header-nav--left  { display: none; }
  .header-nav--right { display: none; }
  .header-hamburger  { display: flex; }
  .header-title-block {
    grid-column: 1;
    align-items: flex-start;
    text-align: left;
  }
  .header-eyebrow { display: none; }
  .header-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  /* Timeline — natural height: full text visible, page scrolls */
  #timeline {
    height: auto;
    min-height: 0;
    overflow: visible;
    display: block;
  }

  .tl-sticky-nav {
    position: sticky;
    top: var(--header-h, 52px);
    z-index: 500;
    background: var(--black);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }

  /* Timeline nav — hide desktop header row on mobile (counter moves to dot nav) */
  .tl-nav {
    box-shadow: none;
  }
  .tl-nav-items { display: none; }
  .tl-nav-header { display: none; }

  /* Dot nav — mobile only */
  .tl-dot-nav {
    display: flex;
    flex-direction: column;
    background: var(--black);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.55rem 1rem 0.4rem;
    gap: 0.2rem;
  }
  .tl-nav-counter-inline--mobile {
    display: flex;
    flex-shrink: 0;
    font-size: 0.75rem;
  }
  #tl-current-mobile {
    font-size: 1.1rem;
    color: #ffffff;
  }
  .tl-nav-progress-wrap--mobile {
    display: block;
    height: 2px;
    margin-top: 0.35rem;
  }
  .tl-dot-nav-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  .tl-dot-nav-label {
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--white);
    white-space: nowrap;
    flex: 1;
  }
  .tl-dots {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
  }
  .tl-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s;
    position: relative;
    display: block;
  }
  .tl-dot::after {
    content: '';
    position: absolute;
    inset: -9px;
  }
  .tl-dot--active {
    background: var(--green);
    transform: scale(1.4);
  }
  .tl-swipe-hint-bar {
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.52rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    transition: opacity 0.6s;
    padding: 0;
  }
  .tl-swipe-hint-bar.hidden {
    opacity: 0;
    pointer-events: none;
  }

  /* Slides — full content height, no clipping */
  .tl-track-outer {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .tl-track {
    height: auto;
    align-items: stretch;
  }

  .tl-slide {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    display: block;
    align-self: stretch;
  }

  .tl-slide-inner {
    display: block;
    align-items: flex-start;
    overflow: visible;
    padding: 1.5rem var(--page-margin) 1.25rem;
  }

  .tl-slide-content {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
  }

  .tl-slide-text {
    gap: 0.75rem;
  }

  .tl-slide-heading {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
    line-height: 1.15;
    overflow: visible;
  }

  .tl-slide-text p {
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: none;
  }

  .tl-slide-content--victory {
    grid-template-columns: 1fr;
  }

  .tl-slide-media--victory { display: none; }

  .tl-slide-img-wrap img {
    height: 200px;
  }

  .tl-heading-victory {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .tl-stats {
    gap: 1rem 1.5rem;
    padding-bottom: 0.25rem;
  }

  .tl-stat-num { font-size: 1.4rem; }

  /* Prev/next sit below slide content, not on top of stats */
  .tl-arrows {
    position: relative;
    bottom: auto;
    left: auto;
    flex-shrink: 0;
    justify-content: center;
    gap: 2.5rem;
    padding: 0.6rem var(--page-margin) calc(0.75rem + env(safe-area-inset-bottom, 0px));
    margin: 0;
    background: var(--cream);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .tl-arrows.dark {
    background: var(--black);
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .tl-arrow {
    width: 44px;
    height: 44px;
  }

  /* Quote */
  .quote-text { font-size: clamp(1.6rem, 6vw, 2.5rem); }

  /* Contributors accordion */
  .contributors-layout { grid-template-columns: 1fr; }
  .contributors-image-col { position: static; order: -1; }
  .contrib-image-panel { aspect-ratio: 16 / 9; }

  /* Gallery — switch to horizontal scroll-snap carousel */
  .section-gallery { padding-left: 0; padding-right: 0; }
  .section-gallery .section-inner { padding: 0; }
  .section-gallery .section-eyebrow,
  .section-gallery .section-heading { padding: 0 var(--page-margin); }
  .gallery-carousel-wrap { overflow: hidden; position: relative; }
  .gallery-grid {
    columns: unset;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 var(--page-margin) 1rem;
    margin-top: 1.5rem;
  }
  .gallery-grid::-webkit-scrollbar { display: none; }
  .gallery-item {
    flex: 0 0 78vw;
    max-width: 78vw;
    scroll-snap-align: center;
    margin-bottom: 0;
    height: 56vw;
  }
  .gallery-item > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .gallery-item .gallery-color img {
    object-fit: cover;
  }
  /* Show carousel prev/next buttons */
  .gallery-carousel-btn {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
  }
  .gallery-carousel-btn:hover { background: rgba(0,0,0,0.8); }
  .gallery-carousel-prev { left: 0.5rem; }
  .gallery-carousel-next { right: 0.5rem; }
  /* Dot indicators */
  .gallery-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0.75rem var(--page-margin) 0;
  }
  .gallery-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
    transition: background 0.25s, transform 0.25s;
    cursor: pointer;
  }
  .gallery-carousel-dot.active {
    background: var(--green);
    transform: scale(1.4);
  }

  /* Quote section */
  .section-quote { padding: clamp(2rem, 6vw, 3rem) var(--page-margin); }
  .quote-attribution { font-size: 0.7rem; }
  .quote-body { font-size: 0.82rem; }

  /* Contributors */
  .contrib-title { font-size: 1rem; }
  .contrib-body p { font-size: 0.82rem; }

  /* Footer */
  .footer-nav--right { justify-content: flex-start; }
  .footer-nav { gap: 1rem; }
  .footer-title { font-size: 1.4rem; }

  /* Section headings */
  .section-heading { font-size: clamp(1.6rem, 6vw, 2.5rem); margin-bottom: 1.5rem; }
}

@media (max-width: 480px) {
  .gallery-item { flex: 0 0 88vw; max-width: 88vw; height: 64vw; }
  .tl-nav-item { min-width: 48px; padding: 0.5rem 0.35rem 0.75rem; }
  .tl-nav-year { font-size: 0.72rem; }
  .tl-nav-label { font-size: 0.28rem; }
}
