/* ==========================================================================
   PLESCO FOUNDATION — HISTORICAL MILESTONES (JOURNEY) DESIGN SYSTEM
   Heritage-inspired aesthetic, animated lines, floating cutouts & horizontal scroll
   Typography: Clash Display (universal family for all)
   ========================================================================== */

@import url('https://api.fontshare.com/v2/css?f[]=clash-display@200,300,400,500,600,700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/clash-display@5.0.0/index.min.css');

:root {
  /* Design System Palette */
  --bg-cream: #F7F1E8;
  --bg-cream-tint: #FAF6EF;
  --bg-card: rgba(255, 252, 247, 0.94);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --primary-brown: #7A4C20;           /* High-contrast accessible heritage brown (6.1:1, WCAG AA) */
  --ochre-accent: #C98B3A;
  --saffron-highlight: #E07B2A;
  --saffron-glow: rgba(224, 123, 42, 0.35);
  --deep-text: #3B2A1A;
  --text-muted: #6B5542;
  --muted-line: #D9C4A8;
  --muted-line-light: #E7D9C6;
  --border-subtle: rgba(138, 90, 43, 0.16);
  --shadow-warm: 0 12px 32px rgba(59, 42, 26, 0.08);
  --shadow-cutout: drop-shadow(0 0 1px #8A5A2B) drop-shadow(0 12px 18px rgba(59, 42, 26, 0.25));
  --shadow-cutout-hover: drop-shadow(0 0 2px #E07B2A) drop-shadow(0 18px 26px rgba(59, 42, 26, 0.32));

  /* Typography — Clash Display Universal */
  --font-family: 'Clash Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Clash Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Clash Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing Grid */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;

  /* Layout */
  --max-width: 1280px;
  --header-height: 76px;
  --progress-height: 4px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Transitions */
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-cream);
  color: var(--deep-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg-cream);
  color: var(--deep-text);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* Texture overlay for heritage parchment feeling */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: radial-gradient(var(--deep-text) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: 1;
}

img, picture, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Ensure no input or body copy ever drops below 16px */
p, li, span, a, input, button, textarea {
  font-size: 1rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(247, 241, 232, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: transform var(--transition-smooth), background-color var(--transition-smooth);
}

.header-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  min-height: 44px;
}

.brand-seal {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(59, 42, 26, 0.15));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--primary-brown);
  text-transform: uppercase;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ochre-accent);
}

/* Desktop Navigation */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--deep-text);
  padding: 8px 12px;
  border-radius: 6px;
  position: relative;
  transition: color var(--transition-smooth);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background-color: var(--saffron-highlight);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-smooth);
}

.nav-link:hover, .nav-link:focus-visible {
  color: var(--primary-brown);
}

.nav-link.active {
  color: var(--primary-brown);
}

.nav-link.active::after {
  transform: scaleX(1);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-helpline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background-color: var(--primary-brown);
  color: #FFFDF9;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 30px;
  border: 1px solid rgba(138, 90, 43, 0.4);
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(138, 90, 43, 0.2);
  min-height: 44px;
}

.btn-helpline:hover, .btn-helpline:focus-visible {
  background-color: #72471F;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(138, 90, 43, 0.28);
}

.btn-helpline svg {
  stroke: var(--saffron-highlight);
}

/* Hamburger Button */
.btn-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  position: relative;
  z-index: 120;
  border-radius: 8px;
  background: rgba(138, 90, 43, 0.08);
  border: 1px solid var(--border-subtle);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: background var(--transition-smooth);
}

.btn-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--primary-brown);
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.btn-menu-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.btn-menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.btn-menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Fullscreen Mobile Overlay Menu */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(247, 241, 232, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 110;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-height) + 24px) var(--space-4) var(--space-5);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.4s;
  overflow-y: auto;
}

.mobile-nav-overlay.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.mobile-nav-link {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--deep-text);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

.mobile-nav-link.active {
  color: var(--saffron-highlight);
}

.mobile-nav-link svg {
  stroke: var(--primary-brown);
}

.mobile-menu-footer {
  margin-top: auto;
  padding-top: var(--space-4);
}

/* ==========================================================================
   Sticky Progress Bar & Mobile Year Bar
   ========================================================================== */

.timeline-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: var(--progress-height);
  background: linear-gradient(90deg, var(--ochre-accent), var(--saffron-highlight));
  box-shadow: 0 0 10px var(--saffron-glow);
  z-index: 200;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* Mobile Sticky Year Counter Pill */
.mobile-sticky-year-bar {
  display: none;
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  background: rgba(59, 42, 26, 0.92);
  color: #FFFDF9;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 16px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid rgba(224, 123, 42, 0.4);
  box-shadow: 0 4px 16px rgba(59, 42, 26, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-sticky-year-bar.is-visible {
  opacity: 1;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + var(--space-6)) var(--space-3) var(--space-6);
  text-align: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(201, 139, 58, 0.08) 0%, rgba(247, 241, 232, 0) 70%);
}

.hero-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.hero-charter-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: rgba(138, 90, 43, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  margin-bottom: var(--space-3);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-brown);
}

.hero-charter-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--saffron-highlight);
  box-shadow: 0 0 8px var(--saffron-highlight);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 6.5vw, 5.25rem);
  font-weight: 800;
  color: var(--primary-brown);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.hero-subhead {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.8vw, 1.95rem);
  font-weight: 600;
  color: var(--ochre-accent);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-3);
}

.hero-tagline {
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  color: var(--deep-text);
  max-width: 720px;
  margin: 0 auto var(--space-5);
  line-height: 1.6;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--saffron-highlight);
  color: #FFFDF9;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 36px;
  transition: all var(--transition-smooth);
  box-shadow: 0 8px 24px var(--saffron-glow);
  min-height: 48px;
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: #C86718;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(224, 123, 42, 0.45);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: var(--primary-brown);
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid var(--primary-brown);
  border-radius: 36px;
  transition: all var(--transition-smooth);
  min-height: 48px;
}

.btn-secondary:hover, .btn-secondary:focus-visible {
  background: rgba(138, 90, 43, 0.06);
  transform: translateY(-2px);
}

/* Background Floating Cutout Silhouettes */
.hero-parallax-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.hero-cutout-silhouette {
  position: absolute;
  opacity: 0.18;
  filter: sepia(0.6) hue-rotate(345deg) saturate(1.4) drop-shadow(0 8px 16px rgba(59, 42, 26, 0.15));
  will-change: transform;
  pointer-events: none;
}

.silhouette-left {
  bottom: 8%;
  left: -2%;
  width: clamp(200px, 24vw, 360px);
  animation: heroFloatLeft 18s ease-in-out infinite alternate;
}

.silhouette-right {
  bottom: 12%;
  right: -2%;
  width: clamp(190px, 22vw, 340px);
  animation: heroFloatRight 22s ease-in-out infinite alternate;
}

.silhouette-center-gate {
  top: 15%;
  right: 18%;
  width: clamp(140px, 16vw, 240px);
  opacity: 0.12;
  animation: heroFloatCenter 26s ease-in-out infinite alternate;
}

@keyframes heroFloatLeft {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-20px) rotate(-1.5deg); }
}

@keyframes heroFloatRight {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-24px) rotate(1.5deg); }
}

@keyframes heroFloatCenter {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-16px) scale(1.03); }
}

/* Hero Scroll Cue */
.hero-scroll-cue {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--primary-brown);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 3;
  transition: opacity var(--transition-smooth);
}

.scroll-cue-arrow {
  width: 28px;
  height: 28px;
  animation: bounceDown 2s infinite ease-in-out;
}

@keyframes bounceDown {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(8px); }
  60% { transform: translateY(4px); }
}

/* ==========================================================================
   Historical Milestones Section (Pinned Horizontal Scroll)
   ========================================================================== */

.milestones-section {
  position: relative;
  background-color: var(--bg-cream);
  width: 100%;
}

.milestones-header-intro {
  padding: var(--space-8) var(--space-3) var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.milestones-section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  font-weight: 800;
  color: var(--primary-brown);
  line-height: 1.15;
  margin-bottom: var(--space-2);
}

.milestones-section-intro {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Timeline Desktop Pinning Container */
.timeline-pin-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* The horizontal track that GSAP ScrollTrigger translates horizontally */
.timeline-track-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
  touch-action: pan-x;
}

.milestones-track {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0 10vw;
  height: 100%;
  position: relative;
  will-change: transform;
}

/* Central Continuous Baseline SVG */
.timeline-baseline-svg {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 5;
}

.baseline-line-bg {
  stroke: var(--muted-line);
  stroke-width: 2px;
}

.baseline-line-active {
  stroke: var(--saffron-highlight);
  stroke-width: 3px;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.15s linear;
}

/* Milestone Panel Item */
.milestone-panel {
  flex: 0 0 60vw;
  width: 60vw;
  max-width: 860px;
  min-width: 580px;
  height: 82vh;
  margin: 0 4vw;
  position: relative;
  display: grid;
  grid-template-rows: 1fr 24px 1fr;
  align-items: center;
  justify-items: center;
  z-index: 10;
  padding: var(--space-2) 0;
}

/* Finale panel is slightly larger */
.milestone-panel.is-finale {
  flex: 0 0 68vw;
  width: 68vw;
  max-width: 960px;
}

/* Alignment variation: Above vs Below baseline */
.milestone-panel.align-above .panel-content-wrap {
  grid-row: 1;
  align-self: end;
  margin-bottom: var(--space-3);
}

.milestone-panel.align-above .panel-cutout-wrap {
  grid-row: 3;
  align-self: start;
  margin-top: var(--space-3);
}

.milestone-panel.align-below .panel-content-wrap {
  grid-row: 3;
  align-self: start;
  margin-top: var(--space-3);
}

.milestone-panel.align-below .panel-cutout-wrap {
  grid-row: 1;
  align-self: end;
  margin-bottom: var(--space-3);
}

.milestone-panel.align-center {
  grid-template-rows: 1fr 24px 1fr;
}

/* Baseline Junction Slot */
.panel-baseline-junction {
  grid-row: 2;
  position: relative;
  width: 100%;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

/* Dot Pin */
.dot-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--warm-white, #FFFDF9);
  border: 3px solid var(--primary-brown);
  position: relative;
  z-index: 18;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 4px rgba(247, 241, 232, 0.9);
}

.dot-pin::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--saffron-highlight);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.4s ease;
  z-index: -1;
}

.milestone-panel.is-active .dot-pin {
  border-color: var(--saffron-highlight);
  background: var(--saffron-highlight);
  transform: scale(1.25);
  box-shadow: 0 0 12px var(--saffron-highlight);
}

.milestone-panel.is-active .dot-pin::after {
  opacity: 0.7;
  transform: scale(1);
  animation: pulseDotOnce 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulseDotOnce {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(2.4); opacity: 0.45; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Leader Line from Year to Dot Pin - draws when panel enters viewport / active */
.leader-line {
  position: absolute;
  width: 2px;
  background-color: var(--primary-brown);
  opacity: 0.3;
  z-index: 12;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, background-color 0.4s ease;
}

.align-above .leader-line {
  bottom: 12px;
  height: 52px;
  transform-origin: top;
  transform: scaleY(0);
}

.align-below .leader-line {
  top: 12px;
  height: 52px;
  transform-origin: bottom;
  transform: scaleY(0);
}

.milestone-panel.is-active .leader-line {
  opacity: 0.95;
  background-color: var(--saffron-highlight);
  transform: scaleY(1);
}

/* ==========================================================================
   Panel Content (Text, Year, Stats, Source)
   ========================================================================== */

.panel-content-wrap {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-warm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  position: relative;
}

.milestone-panel.is-active .panel-content-wrap {
  border-color: rgba(201, 139, 58, 0.4);
  box-shadow: 0 16px 36px rgba(59, 42, 26, 0.12);
}

.panel-year-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 6px;
}

/* Large Kinetic Year Numerals */
.year-display {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5.2vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  color: var(--primary-brown);
  letter-spacing: -0.03em;
  display: inline-flex;
}

.year-digit {
  display: inline-block;
  transform: translateY(32px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.milestone-panel.is-active .year-digit {
  transform: translateY(0);
  opacity: 1;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(138, 90, 43, 0.08);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-brown);
}

.milestone-title {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  font-weight: 700;
  color: var(--deep-text);
  line-height: 1.25;
  margin-bottom: 8px;
  overflow: hidden;
}

.milestone-title .word-reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.milestone-title .word-reveal span {
  display: inline-block;
  transform: translateY(105%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.milestone-panel.is-active .milestone-title .word-reveal span {
  transform: translateY(0);
  opacity: 1;
}

.milestone-desc {
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  color: var(--deep-text);
  line-height: 1.55;
  margin-bottom: var(--space-2);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 200ms, opacity 0.5s ease 200ms;
}

.milestone-panel.is-active .milestone-desc {
  transform: translateY(0);
  opacity: 1;
}

/* Stat Callouts */
.milestone-stats-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-2) 0;
  flex-wrap: wrap;
}

.stat-callout-item {
  display: flex;
  flex-direction: column;
  padding: 6px 14px;
  background: rgba(201, 139, 58, 0.1);
  border-left: 3px solid var(--ochre-accent);
  border-radius: 0 8px 8px 0;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--saffron-highlight);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Source Line: fade in last, small caps, 60% opacity */
.milestone-source {
  font-size: 0.76rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(12px);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
  margin-top: 8px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 350ms, opacity 0.5s ease 350ms;
}

.milestone-panel.is-active .milestone-source {
  transform: translateY(0);
  opacity: 0.6;
}

/* ==========================================================================
   Cutout Figure & Orbit Circle Styling
   ========================================================================== */

.panel-cutout-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transform: translateY(40px);
  opacity: 0.35;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.milestone-panel.is-active .panel-cutout-wrap {
  transform: translateY(0);
  opacity: 1;
}

/* Dashed Orbit Circle */
.orbit-circle-svg {
  position: absolute;
  width: clamp(230px, 22vw, 320px);
  height: clamp(230px, 22vw, 320px);
  pointer-events: none;
  z-index: 2;
  transform-origin: center;
  animation: rotateOrbit 24s linear infinite;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.orbit-circle-path {
  fill: none;
  stroke: var(--muted-line);
  stroke-width: 1.8px;
  stroke-dasharray: 8 9;
  transition: stroke 0.4s ease, stroke-width 0.4s ease;
}

.milestone-panel.is-active .orbit-circle-path {
  stroke: var(--ochre-accent);
  stroke-width: 2.2px;
}

@keyframes rotateOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Floating Loop Container for PNG Cutout Figure */
.cutout-float-container {
  position: relative;
  z-index: 6;
  width: clamp(200px, 20vw, 290px);
  height: clamp(170px, 18vw, 240px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gentleFloat 5s ease-in-out infinite alternate;
}

@keyframes gentleFloat {
  0% { transform: translateY(-7px); }
  100% { transform: translateY(7px); }
}

/* Distinct phase offsets for floating */
.milestone-panel:nth-child(2) .cutout-float-container { animation-duration: 4.6s; animation-delay: -1.2s; }
.milestone-panel:nth-child(3) .cutout-float-container { animation-duration: 5.4s; animation-delay: -2.4s; }
.milestone-panel:nth-child(4) .cutout-float-container { animation-duration: 4.8s; animation-delay: -0.8s; }
.milestone-panel:nth-child(5) .cutout-float-container { animation-duration: 5.8s; animation-delay: -3.1s; }
.milestone-panel:nth-child(6) .cutout-float-container { animation-duration: 4.9s; animation-delay: -1.8s; }
.milestone-panel:nth-child(7) .cutout-float-container { animation-duration: 5.2s; animation-delay: -2.7s; }
.milestone-panel:nth-child(8) .cutout-float-container { animation-duration: 6.0s; animation-delay: -1.5s; }

/* The Cutout Image with Brown Outline and Drop Shadow */
.cutout-figure-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--shadow-cutout);
  border-radius: 12px;
  transition: transform var(--transition-smooth), filter var(--transition-smooth);
}

/* For JPG photos, cameo mask framing with warm-brown outline */
.cutout-figure-cameo {
  width: 100%;
  height: 100%;
  border-radius: 46% 46% 14px 14px;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--primary-brown), 0 14px 24px rgba(59, 42, 26, 0.24);
  position: relative;
  background-color: var(--bg-cream-tint);
}

.cutout-figure-cameo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Hover effects wrapped in @media (hover: hover) */
@media (hover: hover) {
  .milestone-panel:hover .cutout-figure-img {
    transform: scale(1.03);
    filter: var(--shadow-cutout-hover);
  }
  .milestone-panel:hover .cutout-figure-cameo img {
    transform: scale(1.04);
  }
}

/* Insignia Badge */
.cutout-insignia-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: rgba(255, 253, 249, 0.95);
  border: 1.5px solid var(--primary-brown);
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(59, 42, 26, 0.2);
  z-index: 10;
  transition: transform var(--transition-smooth);
}

.cutout-insignia-badge.trust-seal {
  width: 72px;
  height: 72px;
  border-color: var(--saffron-highlight);
  box-shadow: 0 6px 18px var(--saffron-glow);
}

/* Prev / Next Floating Navigation Controls for Timeline */
.timeline-nav-controls {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: 50;
  background: rgba(247, 241, 232, 0.9);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 14px rgba(59, 42, 26, 0.1);
}

.btn-timeline-arrow {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--primary-brown);
  color: #FFFDF9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(138, 90, 43, 0.2);
}

.btn-timeline-arrow:hover:not(:disabled), .btn-timeline-arrow:focus-visible:not(:disabled) {
  background: var(--saffron-highlight);
  transform: scale(1.08);
}

.btn-timeline-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.timeline-nav-counter {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-brown);
  padding: 0 6px;
  min-width: 70px;
  text-align: center;
}

/* ==========================================================================
   Charter Closing Section
   ========================================================================== */

.charter-closing-section {
  position: relative;
  background: linear-gradient(180deg, var(--bg-cream) 0%, #EFE5D6 50%, var(--bg-cream) 100%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-10) var(--space-3);
  text-align: center;
  overflow: hidden;
}

/* Connecting Line Animation from 2012 to 2026 Seal */
.connecting-charter-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  width: 2.5px;
  height: 90px;
  background: linear-gradient(180deg, var(--saffron-highlight), var(--primary-brown));
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(224, 123, 42, 0.35);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.connecting-charter-line.is-drawn {
  transform: translateX(-50%) scaleY(1);
}

.charter-closing-container {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.charter-seal-large {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-3);
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(138, 90, 43, 0.25));
  animation: gentlePulse 4s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.charter-closing-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.2vw, 3.2rem);
  font-weight: 800;
  color: var(--primary-brown);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.charter-closing-subhead {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 600;
  color: var(--ochre-accent);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}

.charter-closing-body {
  font-size: 1.12rem;
  color: var(--deep-text);
  line-height: 1.7;
  margin-bottom: var(--space-5);
}

.charter-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
  text-align: left;
}

.charter-pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--space-3);
  box-shadow: var(--shadow-warm);
}

.pillar-icon {
  width: 36px;
  height: 36px;
  color: var(--saffron-highlight);
  margin-bottom: 8px;
}

.pillar-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-brown);
  margin-bottom: 4px;
}

.pillar-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: #2D2014;
  color: #EDE2D3;
  padding: var(--space-8) var(--space-3) var(--space-4);
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-main-row {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-5);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid rgba(237, 226, 211, 0.12);
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-logo-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-seal-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.footer-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFFDF9;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-pimple-saudagar-note {
  font-size: 0.94rem;
  line-height: 1.6;
  color: #C8B9A6;
  max-width: 380px;
}

.footer-sources-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--ochre-accent);
  margin-top: 4px;
}

.footer-col-heading {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFDF9;
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link-list a {
  color: #C8B9A6;
  font-size: 0.92rem;
  transition: color var(--transition-smooth);
}

.footer-link-list a:hover, .footer-link-list a:focus-visible {
  color: var(--saffron-highlight);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: #C8B9A6;
  margin-bottom: 10px;
}

.footer-contact-item svg {
  stroke: var(--saffron-highlight);
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-bottom-bar {
  padding-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.84rem;
  color: #9E8C78;
}

/* ==========================================================================
   RESPONSIVE BEHAVIOR (Phone, Tablet, Desktop, Landscape)
   ========================================================================== */

/* Tablet (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .milestone-panel {
    flex: 0 0 80vw;
    width: 80vw;
    min-width: auto;
    margin: 0 3vw;
  }
  .milestone-panel.is-finale {
    flex: 0 0 85vw;
    width: 85vw;
  }
  .panel-cutout-wrap {
    transform: scale(0.85);
  }
  .orbit-circle-svg {
    width: 240px;
    height: 240px;
  }
  .footer-main-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Phone (under 768px) - NATIVE SWIPE CONTAINER */
@media (max-width: 767px) {
  /* Hide Desktop Nav & Show Hamburger */
  .nav-desktop, .header-cta .btn-helpline span {
    display: none;
  }

  .btn-menu-toggle {
    display: flex;
  }

  .mobile-sticky-year-bar {
    display: block;
  }

  /* Reset timeline pinning wrapper to normal flow on phones */
  .timeline-pin-wrapper {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  /* Native horizontal scroll container with snap-swipe */
  .timeline-track-container {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none; /* Firefox */
    padding: var(--space-4) 0 var(--space-6);
  }

  .timeline-track-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }

  .milestones-track {
    display: flex;
    padding: 0 7.5vw;
    gap: 16px;
    height: auto;
    transform: none !important; /* Disable GSAP track translation on phones */
  }

  /* SVG baseline adjusted for native swipe */
  .timeline-baseline-svg {
    display: none; /* Stack baseline is handled per panel */
  }

  /* Mobile Milestone Panel: 85vw wide with 16px gutters */
  .milestone-panel {
    flex: 0 0 85vw;
    width: 85vw;
    min-width: 85vw;
    max-width: 85vw;
    height: auto;
    margin: 0;
    scroll-snap-align: center;
    scroll-snap-stop: normal;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: var(--space-4) var(--space-3);
    box-shadow: var(--shadow-warm);
  }

  .milestone-panel.is-finale {
    flex: 0 0 88vw;
    width: 88vw;
    min-width: 88vw;
    border-color: var(--ochre-accent);
  }

  /* Stack layout vertically: Cutout image first, then text */
  .panel-cutout-wrap {
    order: 1;
    max-height: 35vh;
    height: 35vh;
    min-height: 200px;
    margin-bottom: var(--space-2);
  }

  .orbit-circle-svg {
    width: 180px;
    height: 180px;
    animation-duration: 30s; /* Slower on mobile */
  }

  .cutout-float-container {
    width: 170px;
    height: 160px;
  }

  .panel-baseline-junction {
    order: 2;
    height: 20px;
    margin: 4px 0 12px;
  }

  .leader-line {
    position: relative;
    top: auto;
    bottom: auto;
    width: 2px;
    height: 18px;
    margin: 0 auto;
  }

  .dot-pin {
    width: 12px;
    height: 12px;
  }

  .panel-content-wrap {
    order: 3;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .year-display {
    font-size: 3.2rem;
  }

  .milestone-title {
    font-size: 1.35rem;
  }

  .timeline-nav-controls {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin: var(--space-3) auto 0;
    width: fit-content;
  }

  /* Footer stack */
  .footer-main-row {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .charter-closing-section {
    padding: var(--space-8) var(--space-3);
  }
}

/* Phone Small (under 380px) */
@media (max-width: 379px) {
  .milestone-panel {
    flex: 0 0 88vw;
    width: 88vw;
    min-width: 88vw;
    padding: var(--space-3) var(--space-2);
  }
  .panel-cutout-wrap {
    height: 28vh;
    min-height: 170px;
  }
  .orbit-circle-svg {
    width: 150px;
    height: 150px;
  }
  .cutout-float-container {
    width: 140px;
    height: 130px;
  }
  .year-display {
    font-size: 2.6rem;
  }
  .milestone-title {
    font-size: 1.2rem;
  }
}

/* Disable Parallax on phones under 480px to save battery & keep 60fps scrolling */
@media (max-width: 479px) {
  .hero-parallax-bg {
    display: none;
  }
}

/* Landscape Phones (height under 500px) */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --header-height: 54px;
  }

  .site-header {
    height: 54px;
  }

  .brand-seal {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 0.95rem;
  }

  .hero-section {
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: 24px;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-tagline {
    font-size: 0.95rem;
    margin-bottom: var(--space-3);
  }

  .hero-parallax-bg {
    display: none; /* Hide decorative hero cutouts in landscape */
  }

  .timeline-pin-wrapper {
    height: 100vh;
    height: 100dvh;
  }

  .milestone-panel {
    height: 88vh;
    padding: 4px 0;
  }

  .panel-content-wrap {
    padding: 10px 16px;
  }

  .year-display {
    font-size: 2.2rem;
  }

  .panel-cutout-wrap {
    max-height: 160px;
  }

  .orbit-circle-svg {
    width: 150px;
    height: 150px;
  }

  .cutout-float-container {
    width: 150px;
    height: 130px;
  }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .orbit-circle-svg {
    animation: none !important;
  }

  .cutout-float-container {
    animation: none !important;
  }

  .silhouette-left, .silhouette-right, .silhouette-center-gate {
    animation: none !important;
  }

  .scroll-cue-arrow {
    animation: none !important;
  }

  .year-digit, .milestone-title .word-reveal span {
    transform: none !important;
    opacity: 1 !important;
  }
}
