:root {
  --bg: #f7f5f0;
  --paper: #ffffff;
  --ink: #111317;
  --muted: #666b73;
  --line: #dedbd4;
  --soft: #efede7;
  --accent: #f47a1f;
  --accent-2: #ff9b4a;
  --accent-soft: #fff1e6;
  --navy: #0c1727;
  --dark: #101418;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }
.narrow { max-width: 820px; }
.center { text-align: center; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 18, 31, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.09);
  color: white;
}
.nav { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; }
.brand img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
nav { display: flex; gap: 24px; align-items: center; }
nav a { text-decoration: none; font-size: 14px; transition: color .2s ease; }
nav a:hover { color: var(--accent-2); }
.nav-cta { background: var(--accent); padding: 9px 14px; border-radius: 10px; font-weight: 800; }
.nav-cta:hover { color: white; background: #dc6814; }

.hero {
  position: relative;
  min-height: 660px;
  display: flex;
  align-items: center;
  color: white;
  background: var(--navy);
  isolation: isolate;
  padding: 96px 0 115px;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(7,15,27,.96) 0%, rgba(7,15,27,.82) 35%, rgba(7,15,27,.35) 66%, rgba(7,15,27,.22) 100%),
    linear-gradient(180deg, rgba(6,14,26,.12) 0%, rgba(6,14,26,.42) 100%),
    url('charlotte-skyline-v3.png');
  background-size: cover;
  background-position: center center;
  z-index: 0;
  transform: scale(1.015);
}
.hero-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 56px; align-items: center; }
.hero-copy { max-width: 760px; }
.hero .eyebrow { color: var(--accent-2); }
.hero .lede { color: rgba(255,255,255,.9); max-width: 680px; }
.hero-micro { color: rgba(255,255,255,.7); }

.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: 12px; color: var(--accent); }
h1, h2, h3 { line-height: 1.06; margin-top: 0; }
h1 { font-size: clamp(54px, 7vw, 88px); letter-spacing: -.05em; margin-bottom: 24px; }
h2 { font-size: clamp(34px, 4vw, 54px); letter-spacing: -.04em; margin-bottom: 22px; }
h3 { font-size: 22px; }
.lede { font-size: 20px; color: #333; }
.mission-copy { font-size: 19px; color: #363b43; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 18px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 19px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.14); }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: #dc6814; }
.glass { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.32); backdrop-filter: blur(8px); }
.glass:hover { background: rgba(255,255,255,.14); }
.paypal { background: white; border-color: white; color: #101214; }
.paypal:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.14); }
.micro { font-size: 12px; color: var(--muted); }

.impact-card, .card, .contact-panel, .legal-card, .model-note, .pillar, .goal-card, .qr-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.dark-card { background: rgba(13,20,30,.78); border-color: rgba(255,255,255,.16); box-shadow: 0 24px 70px rgba(0,0,0,.24); backdrop-filter: blur(14px); }
.impact-card { padding: 28px; overflow: hidden; }
.card-label { font-size: 13px; font-weight: 800; color: var(--accent-2); }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 1px solid rgba(255,255,255,.14); padding: 16px 0; }
.stat strong { font-size: 34px; color: var(--accent-2); }
.stat span { color: rgba(255,255,255,.78); text-align: right; }
.card-note { font-size: 12px; color: rgba(255,255,255,.62); margin-bottom: 0; }

.section { padding: 92px 0; position: relative; }
.alt { background: var(--soft); }
.section-transition::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -1px;
  height: 52px;
  background: inherit;
  clip-path: polygon(0 45%, 17% 58%, 35% 34%, 53% 61%, 71% 40%, 88% 56%, 100% 44%, 100% 100%, 0 100%);
  transform: translateY(50%);
  z-index: 1;
}
.dark-to-light::after { background: var(--bg); }
.light-to-soft::after { background: var(--soft); }
.soft-to-dark::after { background: var(--dark); }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 42px; }
.pillar { text-align: center; padding: 26px 20px; box-shadow: 0 12px 30px rgba(0,0,0,.04); }
.pillar .icon { font-size: 30px; margin-bottom: 12px; }
.pillar p { margin-bottom: 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.card { padding: 28px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-5px); border-color: rgba(244,122,31,.55); box-shadow: 0 18px 36px rgba(0,0,0,.07); }
.number { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; margin-bottom: 34px; }
.model-note { margin-top: 20px; padding: 28px; border-left: 6px solid var(--accent); }

.impact-band { background: linear-gradient(135deg, #0f1318 0%, #151b22 60%, #35200f 100%); color: white; padding: 98px 0; }
.impact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.light-text { color: rgba(255,255,255,.88); }
.light-muted { color: rgba(255,255,255,.62); }
.impact-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.donate-side { display: grid; gap: 16px; }
.goal-card { padding: 24px 16px; text-align: center; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.goal-card strong { display: block; color: var(--accent-2); font-size: 31px; line-height: 1; margin-bottom: 9px; }
.goal-card span { color: rgba(255,255,255,.72); font-size: 12px; }

.split { display: grid; grid-template-columns: 1.25fr .75fr; gap: 44px; align-items: start; }
.contact-panel, .legal-card { padding: 30px; }
.contact-panel { background: var(--accent-soft); border-color: rgba(244,122,31,.28); }

.donate { background: linear-gradient(135deg, #0d1218 0%, #171c23 62%, #3d210d 100%); color: white; }
.donate .eyebrow { color: var(--accent-2); }
.donate-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: center; }
.qr-card { display: flex; align-items: center; gap: 20px; padding: 22px; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.15); }
.qr-card img { width: 145px; height: 145px; background: white; padding: 8px; border-radius: 12px; }
.qr-card strong { display: block; font-size: 22px; }
.qr-card span { color: rgba(255,255,255,.65); font-size: 13px; word-break: break-all; }

footer { border-top: 1px solid rgba(255,255,255,.08); padding: 28px 0 18px; background: #0b0f14; color: white; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; color: #bdbdbd; font-size: 12px; }
.photo-credit { color: #737982; font-size: 10px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .72s ease, transform .72s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .12s; }
.stagger-group .reveal:nth-child(2) { transition-delay: .08s; }
.stagger-group .reveal:nth-child(3) { transition-delay: .16s; }
.stagger-group .reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .button, .card { transition: none; }
}

@media (max-width: 900px) {
  nav a:not(.nav-cta) { display: none; }
  .hero { min-height: auto; padding: 76px 0 105px; }
  .hero-grid, .split, .cards, .pillars, .impact-grid, .donate-grid { grid-template-columns: 1fr; }
  .impact-numbers { grid-template-columns: repeat(3, 1fr); }
  .hero-backdrop { background-position: 58% center; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 18px; }
  .brand span { display: none; }
  h1 { font-size: 54px; }
  .section { padding: 72px 0; }
  .impact-numbers { grid-template-columns: 1fr; }
  .qr-card { flex-direction: column; text-align: center; }
  .footer-grid { flex-direction: column; }
}

/* ===== V4 cinematic scroll transitions ===== */
:root {
  --ease-cinematic: cubic-bezier(.22,.61,.36,1);
}

/* Give each major section its own stage and prevent transition effects from spilling. */
main > section {
  isolation: isolate;
  overflow: clip;
}

/* Subtle scroll progress bar, borrowing the polished sense of movement without changing the header design. */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 80;
  pointer-events: none;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--accent);
}

/* Cinematic section entrance: the whole section settles into place as it enters the viewport. */
.motion-section {
  --section-progress: 0;
}
.motion-section > .wrap {
  transform: translate3d(0, calc((1 - var(--section-progress)) * 38px), 0)
             scale(calc(.985 + (var(--section-progress) * .015)));
  opacity: calc(.55 + (var(--section-progress) * .45));
  transition: transform .08s linear, opacity .08s linear;
  will-change: transform, opacity;
}

/* A soft moving veil creates the visual handoff between sections. */
.motion-section::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  left: -12%;
  right: -12%;
  top: -118px;
  height: 210px;
  border-radius: 0 0 50% 50% / 0 0 70% 70%;
  background: rgba(255,255,255,.18);
  filter: blur(1px);
  transform: translate3d(0, calc((1 - var(--section-progress)) * -36px), 0)
             scaleY(calc(.78 + (var(--section-progress) * .22)));
  opacity: calc(.08 + (var(--section-progress) * .32));
  transform-origin: center top;
  will-change: transform, opacity;
}

/* Dark donation stage gets a warm orange light sweep instead of a white veil. */
#donate.motion-section::before {
  background: radial-gradient(circle at 50% 45%, rgba(244,122,31,.34), rgba(244,122,31,0) 68%);
  height: 280px;
  top: -150px;
  border-radius: 50%;
  filter: blur(12px);
  opacity: calc(.12 + (var(--section-progress) * .42));
}

/* Keep the first hero full strength while adding restrained skyline parallax. */
.hero > .wrap {
  transform: none;
  opacity: 1;
}
.hero-backdrop {
  transform: translate3d(0, var(--hero-parallax, 0px), 0) scale(1.045);
  will-change: transform;
}

/* Headings reveal with a small editorial rise, making each nav destination feel like a new chapter. */
.motion-section .eyebrow,
.motion-section h2 {
  transform: translate3d(0, calc((1 - var(--section-progress)) * 18px), 0);
  opacity: calc(.35 + (var(--section-progress) * .65));
  will-change: transform, opacity;
}

/* Cards float at slightly different speeds for depth. */
.motion-section .pillar,
.motion-section .card,
.motion-section .goal-card,
.motion-section .contact-panel,
.motion-section .legal-card,
.motion-section .model-note,
.motion-section .qr-card {
  transform: translate3d(0, calc((1 - var(--section-progress)) * 22px), 0);
}

/* Active navigation gives users a clear sense of which chapter is on screen. */
.site-header nav a.is-active:not(.nav-cta) {
  color: var(--accent-2);
}
.site-header nav .nav-cta.is-active {
  box-shadow: 0 0 0 3px rgba(244,122,31,.22);
}

/* V4 replaces the older jagged transition edge with cleaner cinematic overlap. */
.section-transition::after { display: none; }

@media (max-width: 900px) {
  .motion-section > .wrap {
    transform: translate3d(0, calc((1 - var(--section-progress)) * 24px), 0);
  }
  .motion-section::before { height: 160px; top: -90px; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .motion-section > .wrap,
  .motion-section .eyebrow,
  .motion-section h2,
  .motion-section .pillar,
  .motion-section .card,
  .motion-section .goal-card,
  .motion-section .contact-panel,
  .motion-section .legal-card,
  .motion-section .model-note,
  .motion-section .qr-card,
  .hero-backdrop {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .motion-section::before { display: none; }
}

/* ===== V4.1 mobile optimization ===== */
.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: white;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .24s ease, opacity .18s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .site-header { backdrop-filter: blur(18px); }
  .nav { min-height: 68px; gap: 14px; }
  .brand { min-width: 0; }
  .brand img { width: 46px; height: 46px; }
  .brand span { font-size: 14px; line-height: 1.2; max-width: 200px; }

  .menu-toggle { display: inline-flex; flex: 0 0 auto; }
  .primary-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 24px;
    right: 24px;
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: rgba(8,18,31,.985);
    box-shadow: 0 24px 60px rgba(0,0,0,.32);
    transform: translateY(-8px) scale(.985);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease, visibility .22s ease;
  }
  .primary-nav.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .primary-nav a,
  .primary-nav a:not(.nav-cta) {
    display: flex;
    min-height: 48px;
    align-items: center;
    padding: 11px 14px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 700;
  }
  .primary-nav a:hover,
  .primary-nav a:focus-visible { background: rgba(255,255,255,.07); }
  .primary-nav .nav-cta { justify-content: center; margin: 2px 0; }

  .hero {
    padding: 64px 0 84px;
    min-height: 590px;
  }
  .hero-grid { gap: 28px; }
  .hero-copy { max-width: 640px; }
  .hero .lede { font-size: 18px; }
  .hero-backdrop {
    background-position: 61% center;
    transform: scale(1.025);
  }
  .impact-card { max-width: 560px; }

  .section { padding: 78px 0; }
  .impact-band { padding: 82px 0; }
  .cards, .pillars { gap: 14px; }
  .card, .pillar, .contact-panel, .legal-card, .model-note { padding: 24px; }

  .motion-section > .wrap {
    transform: translate3d(0, calc((1 - var(--section-progress)) * 16px), 0);
    opacity: calc(.72 + (var(--section-progress) * .28));
  }
  .motion-section .eyebrow,
  .motion-section h2 {
    transform: translate3d(0, calc((1 - var(--section-progress)) * 10px), 0);
  }
  .motion-section .pillar,
  .motion-section .card,
  .motion-section .goal-card,
  .motion-section .contact-panel,
  .motion-section .legal-card,
  .motion-section .model-note,
  .motion-section .qr-card {
    transform: translate3d(0, calc((1 - var(--section-progress)) * 12px), 0);
  }
  .motion-section::before { opacity: calc(.04 + (var(--section-progress) * .18)); }

  .button {
    min-height: 48px;
    padding: 13px 18px;
  }
}

@media (max-width: 620px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .primary-nav { left: 18px; right: 18px; }
  .brand span { display: block; max-width: 145px; font-size: 12px; }

  .hero {
    padding: 52px 0 70px;
    min-height: 560px;
  }
  .hero-backdrop {
    background-image:
      linear-gradient(90deg, rgba(7,15,27,.96) 0%, rgba(7,15,27,.80) 48%, rgba(7,15,27,.46) 100%),
      linear-gradient(180deg, rgba(6,14,26,.15) 0%, rgba(6,14,26,.56) 100%),
      url('charlotte-skyline-v3.png');
    background-position: 63% center;
  }
  h1 { font-size: clamp(44px, 14vw, 58px); }
  h2 { font-size: clamp(32px, 10vw, 44px); }
  .lede, .mission-copy { font-size: 17px; }
  .hero .lede { font-size: 17px; }
  .actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .actions .button { width: 100%; }
  .hero-micro { max-width: 92%; }

  .impact-card { padding: 22px; }
  .stat strong { font-size: 30px; }
  .stat span { font-size: 13px; }
  .section { padding: 64px 0; }
  .impact-band { padding: 68px 0; }
  .impact-grid, .split { gap: 28px; }
  .impact-numbers { gap: 10px; }
  .goal-card { padding: 20px 14px; }
  .qr-card { padding: 18px; }
  .qr-card img { width: 132px; height: 132px; }
  .footer-grid { gap: 8px; }

  /* Parallax is intentionally disabled on small phones for smoother scrolling. */
  .hero-backdrop { transform: none !important; }
  .motion-section::before { display: none; }
}

@media (max-width: 380px) {
  .brand span { display: none; }
  .hero { min-height: 530px; }
  .primary-nav { left: 14px; right: 14px; }
}
