/* =============================================================
   Squadron 13 Legacy Society
   Faithful to the original, refined with classic design rules:
   full-bleed hero, clear hierarchy, balanced spacing & alignment.
   ============================================================= */

:root {
  --green:       #16562a;   /* signature Squadron 13 green */
  --green-deep:  #0f3d1d;
  --green-glow:  rgba(22, 86, 42, 0.9);
  --white:       #ffffff;
  --ink:         #111311;

  --font-display: "Jaro", "Arial Black", sans-serif;
  --font-serif:   "Merriweather", Georgia, serif;
  --font-ui:      "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-condensed: "Changa One", Impact, sans-serif;
  --font-pixel:   "Jersey 25", monospace;

  --measure: 62ch;        /* optimal reading line length */
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------- Shared type ---------- */
.display-title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--white);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-shadow: 0 3px 24px rgba(0,0,0,0.5);
}

.serif-body {
  font-family: var(--font-serif);
  color: var(--white);
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
  line-height: 1.8;
}

/* ---------- Section background layer (fixed, grayscale + scrim) ---------- */
.section-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;   /* image stays fixed while content scrolls */
  z-index: 0;
}
/* grayscale via backdrop-filter so background-attachment:fixed isn't broken by filter */
.section-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: grayscale(1) contrast(1.05);
  -webkit-backdrop-filter: grayscale(1) contrast(1.05);
  background: linear-gradient(180deg, rgba(10,12,10,0.55), rgba(10,12,10,0.7));
}
.section-bg--dim::after {
  backdrop-filter: grayscale(1) blur(6px) brightness(0.72);
  -webkit-backdrop-filter: grayscale(1) blur(6px) brightness(0.72);
  background: rgba(12,14,12,0.5);
}
/* lighter scrim so the figures on the sides stay visible */
.section-bg--soft::after {
  backdrop-filter: grayscale(1) contrast(1.08);
  -webkit-backdrop-filter: grayscale(1) contrast(1.08);
  background: linear-gradient(180deg, rgba(10,12,10,0.28), rgba(10,12,10,0.42));
}
@media (max-width: 768px) {
  .section-bg { background-attachment: scroll; }  /* fixed is unreliable on mobile */
}

/* ---------- Sticky shared photo (History + Timeline) ---------- */
.pinned { position: relative; }
/* full-height layer that spans both sections; the photo inside pins to the top */
.pinned-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.pinned-photo {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;              /* covers even when mobile browser bars retract */
  background-size: cover;
  background-position: center;
}
.pinned-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: grayscale(1) contrast(1.05);
  -webkit-backdrop-filter: grayscale(1) contrast(1.05);
  background: linear-gradient(180deg, rgba(10,12,10,0.5), rgba(10,12,10,0.64));
}
.pinned-content {
  position: relative;
  z-index: 1;
}

/* =============================================================
   HERO — full-bleed video, always fills the screen
   ============================================================= */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;          /* fallback */
  min-height: 100svh;
  height: 100svh;
  height: 100dvh;             /* exact visible viewport on any device */
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #000;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(1) contrast(1.05);
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.12) 30%,
                            rgba(0,0,0,0.12) 65%, rgba(0,0,0,0.55) 100%);
}

/* Top bar: logo (left) + donate (right) */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1.1rem, 3.5vw, 3rem);
}

.logo {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(66px, 9vw, 100px);
  aspect-ratio: 1 / 1;           /* guarantees a perfect circle */
  background: var(--white);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0,0,0,0.4);
  transition: transform 0.3s var(--ease);
}
.logo:hover { transform: scale(1.05); }
.logo img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  object-position: center;
}

.btn-donate {
  flex: none;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--white);
  background: var(--green);
  padding: 0.8rem 1.9rem;
  border-radius: 10px;
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.15rem);
  box-shadow: 0 10px 24px -10px var(--green-glow);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.btn-donate:hover,
.btn-donate:focus-visible { background: var(--green-deep); transform: translateY(-2px); }
.btn-donate--lg { padding: 1.05rem 3rem; font-size: clamp(1.15rem, 1rem + 1vw, 1.55rem); }

/* Marquee — big scrolling green display text, transparent, pinned to bottom */
.marquee {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  background: transparent;
  padding-bottom: clamp(0.4rem, 2vh, 1.4rem);
}
.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee 26s linear infinite;
}
.marquee-track span {
  flex: none;
  padding-right: 0.5em;          /* uniform spacing → seamless at -50% */
  font-family: var(--font-display);
  color: var(--green);
  font-size: clamp(3.5rem, 15vw, 11rem);
  line-height: 1.05;
  text-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vh, 34px);
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 14px;
  z-index: 3;
}
.scroll-cue span {
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: var(--white);
  border-radius: 2px;
  animation: cue 1.8s infinite;
}
@keyframes cue {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  80% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; }
}

/* =============================================================
   HISTORY
   ============================================================= */
.history {
  position: relative;
  padding: clamp(3.5rem, 9vw, 8rem) clamp(1.25rem, 6vw, 5rem);
}
.history-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin-inline: auto;
  padding: clamp(1.75rem, 4.5vw, 3.25rem) clamp(1.5rem, 4vw, 3.25rem);
  background: rgba(20, 20, 22, 0.4);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 24px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.7);
}
.history .display-title {
  font-size: clamp(2.8rem, 9vw, 6rem);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  text-align: center;
}
.history .serif-body { max-width: none; }
.history .serif-body strong { font-weight: 900; }

/* =============================================================
   TIMELINE
   ============================================================= */
.timeline-section {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) 1rem;
}
.timeline {
  position: relative;
  z-index: 1;
  list-style: none;
  padding: 0;
  max-width: 960px;
  margin-inline: auto;
  --line-x: clamp(120px, 20vw, 220px);   /* line offset from the left */
}
/* green track — spans exactly from first node to last node */
.timeline::before {
  content: "";
  position: absolute;
  top: var(--line-top, 0px);
  left: var(--line-x);
  width: 4px;
  height: var(--line-height, 100%);
  margin-left: -2px;
  background: var(--green);
  border-radius: 4px;
}
/* white bar — follows scroll, growing from the top */
.timeline::after {
  content: "";
  position: absolute;
  top: var(--line-top, 0px);
  left: var(--line-x);
  width: 4px;
  height: var(--tl-fill, 0px);
  margin-left: -2px;
  background: var(--white);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255,255,255,0.6);
  transition: height 0.12s linear;
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--line-x) 1fr;   /* date column ends at the line */
  align-items: center;
  column-gap: 0;
  padding-block: clamp(2.25rem, 6vw, 4.5rem);
}
.tl-item:first-child { padding-top: 0; }
.tl-item:last-child { padding-bottom: 0; }

.tl-year {
  grid-column: 1;
  justify-self: end;
  text-align: right;
  padding-right: clamp(0.75rem, 2vw, 1.25rem);
  font-family: var(--font-display);
  color: var(--white);
  font-size: clamp(2.1rem, 6vw, 4rem);
  line-height: 1;
  text-shadow: 0 3px 18px rgba(0,0,0,0.55);
}
.tl-desc {
  grid-column: 2;
  text-align: left;
  padding-left: clamp(1rem, 2.5vw, 1.75rem);
  font-family: var(--font-condensed);
  color: var(--white);
  font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.tl-node {
  position: absolute;
  left: var(--line-x);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  background: var(--white);
  border: 3px solid var(--green);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 6px rgba(0,0,0,0.18);
}
.tl-item--memorial .tl-node {
  background: var(--green);
  border-color: var(--white);
  box-shadow: 0 0 0 6px rgba(22,86,42,0.4), 0 0 16px var(--green-glow);
}

/* =============================================================
   LEGACY SOCIETY
   ============================================================= */
.legacy {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 8rem) clamp(1rem, 4vw, 3rem);
  display: grid;
  place-items: center;
}
.legacy-card {
  position: relative;
  z-index: 1;
  max-width: 840px;
  width: 100%;
  text-align: center;
  padding: clamp(2.25rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3.5rem);
  background: rgba(20, 20, 22, 0.42);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 28px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.75);
}
.legacy-title {
  /* sized to sit comfortably inside the card (no overflow) */
  font-size: clamp(2.1rem, 6.5vw, 4.2rem);
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}
.legacy-card .serif-body {
  max-width: 60ch;
  margin-inline: auto;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

/* =============================================================
   FOOTER
   ============================================================= */
.site-footer {
  background: var(--white);
  color: var(--ink);
  text-align: center;
  padding: clamp(0.9rem, 2.2vw, 1.4rem) 1rem;
}
.footer-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
}
.footer-credit { font-family: var(--font-serif); font-size: 0.78rem; color: #555; }
.radar {
  font-family: var(--font-pixel);
  font-size: 1.15em;
  letter-spacing: 0.05em;
  font-style: italic;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 640px) {
  .timeline { --line-x: clamp(96px, 26vw, 140px); }
  .tl-year { font-size: clamp(1.7rem, 9vw, 2.6rem); }
  .tl-desc { font-size: clamp(0.95rem, 3.6vw, 1.15rem); }
  .legacy-card { border-radius: 20px; }
  .marquee-track { animation-duration: 20s; }
}

/* =============================================================
   MOTION PREFERENCES
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; transform: translate3d(-12%, 0, 0); }
  .scroll-cue span { animation: none; }
  .timeline::after { transition: none; }
}
