/* ================================================================
   QED Education Group — styles.css
   Single stylesheet: tokens → reset → base → components → responsive
   British English throughout.
   ================================================================ */

/* ================================================================
   1. DESIGN TOKENS (CSS custom properties)
   ================================================================ */
:root {
  /* Colours */
  --paper:       #FBFAF7;
  --white:       #FFFFFF;
  --ink:         #112F64;
  --navy-deep:   #0B1A47;
  --navy:        #13306C;
  --royal:       #1C46C2;
  --gold:        #E8A020;
  --gold-soft:   #F4B23E;
  --slate:       #3B4E7A;
  --slate-hover: #46588a;
  --card-dark:   #0E1E50;
  --card-alt:    #14296B;
  --grey-land:   #D2D2D2;
  --muted-dark:  rgba(255, 255, 255, 0.72);
  --muted-light: #5A6B8C;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;

  /* Spacing (4px base scale) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* Radii */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  /* Content width & side padding */
  --content-max: 1200px;
  --side-pad:    clamp(24px, 7.5vw, 96px);

  /* Transitions */
  --transition: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
}

/* Lenis overrides smooth scrolling on html when active */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

address {
  font-style: normal;
}

blockquote {
  margin: 0;
}

/* ================================================================
   3. TYPOGRAPHY
   ================================================================ */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.75rem);
}

.text-gold {
  color: var(--gold);
  font-style: italic;
  font-optical-sizing: auto;
}

/* ================================================================
   4. LAYOUT UTILITIES
   ================================================================ */
.content-width {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--side-pad);
  padding-right: var(--side-pad);
}

/* ================================================================
   5. BUTTONS — comment 8
   Primary: solid --ink. Secondary: outline.
   All need hover AND visible :focus-visible states.
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 14px 28px;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Primary */
.btn-primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: #1a3d7a;
  border-color: #1a3d7a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(17, 47, 100, 0.28);
}

/* Secondary — solid muted slate-blue (clearly visible, Figma "Login") */
.btn-secondary {
  background: var(--slate);
  color: var(--white);
  border-color: var(--slate);
}

.btn-secondary:hover {
  background: var(--slate-hover);
  border-color: var(--slate-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 78, 122, 0.3);
}

/* Size modifiers */
.btn-sm {
  padding: 9px 18px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1.0625rem;
}

/* ================================================================
   6. HEADER
   ================================================================ */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}

#site-header.is-scrolled {
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(17, 47, 100, 0.1), 0 2px 16px rgba(17, 47, 100, 0.06);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  height: 72px;
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
  transition: opacity var(--transition);
}

.logo-link:hover {
  opacity: 0.8;
}

.logo-link:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.main-nav a {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 4px 2px;
  transition: color var(--transition);
}

/* Gold underline slide-in on hover */
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width var(--transition);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  width: 100%;
}

.main-nav a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-shrink: 0;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  padding: 4px 8px;
  transition: color var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--gold);
  width: 0;
  transition: width var(--transition);
}

.nav-link:hover {
  color: var(--gold);
}

.nav-link:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

.lang-toggle {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  border: 1.5px solid rgba(17, 47, 100, 0.3);
  border-radius: 100px;
  padding: 5px 14px;
  transition: border-color var(--transition), color var(--transition);
}

.lang-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lang-toggle:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.hamburger:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ================================================================
   7. HERO — unified pinned scene (hero + intro)
   The default (no-JS / reduced-motion) layout below IS the END state:
   full navy card, intro paragraph left, Qin small on the right with her
   caption. JS then sets the START (hero) state and animates back to this.
   ================================================================ */
#hero {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  background: var(--paper);
  overflow: hidden;
  padding-top: 72px; /* header height */
}

/* Navy gradient card — END state: full-bleed background of the scene */
.hero-card {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--navy-deep) 0%,
    var(--navy) 55%,
    var(--royal) 100%
  );
  z-index: 0;
  will-change: width, height, top, left, border-radius;
}

.hero-stage {
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--sp-12);
}

/* Left column: headline and intro paragraph share the same cell (cross-fade) */
.hero-left {
  display: grid;
}

.hero-headline,
.intro-text {
  grid-area: 1 / 1;
  align-self: center;
}

.hero-headline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  z-index: 2;
}

.hero-headline h1 {
  color: var(--ink);
  max-width: 460px;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.hero-ctas .btn {
  width: 400px;
  max-width: 100%;
}

/* Intro paragraph — END state: visible white text on navy */
.intro-text {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--white);
  max-width: 540px;
  z-index: 1;
}

/* Right column: Qin + caption */
.hero-right {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-portrait-wrap {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* END state size of Qin (intro spot). JS scales her UP for the hero. */
  width: 240px;
  will-change: transform;
}

.hero-portrait {
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.4));
}

.intro-caption {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-dark);
  margin-top: var(--sp-3);
  text-align: center;
}

/* Scroll hint — gentle bobbing chevron, bottom-centre */
.scroll-hint {
  position: absolute;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  pointer-events: none;
}

.scroll-hint__label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.scroll-hint__chevron {
  width: 14px;
  height: 14px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  animation: scroll-bob 1.6s ease-in-out infinite;
}

@keyframes scroll-bob {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50%      { transform: rotate(45deg) translate(4px, 4px); }
}

/* ================================================================
   8. DARK SECTION
   ================================================================ */
.dark-section {
  background: linear-gradient(
    to bottom,
    var(--navy-deep) 0%,
    var(--navy) 45%,
    var(--royal) 100%
  );
  color: var(--white);
  position: relative;
}

/* ================================================================
   10. MAP — comment 3 (vertically centred; map scales up over text)
   ================================================================ */
#map {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: var(--sp-12) 0;
  overflow: hidden; /* clip the scaling map to section bounds */
  position: relative;
}

.map-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  align-items: center;
  position: relative;
  width: 100%;
}

.map-text {
  position: relative;
  z-index: 1;
}

.map-text p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--white);
  max-width: 480px;
}

.map-visual-wrapper {
  position: relative;
  z-index: 2; /* sits above .map-text as the text fades out */
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
}

.world-map {
  width: 100%;
  height: auto;
  transform-origin: center center;
  will-change: transform;
}

/* ================================================================
   11. STATS — comment 5
   ================================================================ */
#stats {
  padding: 0 0 var(--sp-12);
}

/* Pinned stage — vertically centred in the viewport */
.stats-stage {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.stats-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16);
  align-items: center;
  width: 100%;
}

.stats-text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.stats-text p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--white);
}

.stats-viewport-outer {
  position: relative;
}

.stats-viewport {
  height: 540px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.stats-cards-track {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  will-change: transform;
}

/* Individual stat card */
.stat-card {
  background: var(--card-dark);
  border-radius: var(--radius);
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(232, 160, 32, 0.25);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  font-weight: 600;
  line-height: 1;
  color: var(--gold);
  font-optical-sizing: auto;
}

.stat-rule {
  display: block;
  width: 40px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.stat-label {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.45;
}

/* NEW card — gold background, navy text, badge */
.stat-card--new {
  background: var(--gold);
  position: relative;
}

.stat-card--new:hover {
  box-shadow: 0 6px 24px rgba(232, 160, 32, 0.45), 0 0 0 1px rgba(17, 47, 100, 0.2);
}

.stat-card--new .stat-number {
  color: var(--ink);
}

.stat-card--new .stat-rule {
  background: var(--ink);
}

.stat-card--new .stat-label {
  color: var(--ink);
}

.stat-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--white);
  padding: 3px 9px;
  border-radius: 100px;
  align-self: flex-start;
  margin-bottom: var(--sp-1);
}

.stats-footnote {
  font-size: 0.8125rem;
  color: var(--muted-dark);
  margin-top: var(--sp-12);
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: var(--sp-24);
}

/* ================================================================
   12. CHART — comment 6
   ================================================================ */
#chart {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: var(--sp-12) 0;
}

#chart h2 {
  color: var(--white);
  margin-bottom: var(--sp-16);
  text-align: center;
}

.chart-container {
  position: relative;
}

/* Bars area: fixed height; bars align at bottom */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 2vw, 28px);
  height: 340px;
}

.chart-bar-group {
  flex: 1 1 0;
  min-width: 0; /* allow equal distribution regardless of label length */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  height: 100%;
  cursor: default;
}

/* The bar itself; --bar-h is set via inline style on the group.
   Fixed width so every bar is identical regardless of its label text;
   the bar is centred within its (wider) group, label centres beneath it.
   JS animates scaleY 0 -> 1 on scroll; default (no-JS) is full height. */
.chart-bar {
  width: 56px;
  height: var(--bar-h, 0px);
  background: linear-gradient(to top, var(--gold) 0%, var(--gold-soft) 100%);
  border-radius: 6px 6px 0 0;
  transform-origin: bottom;
  box-shadow: 0 0 0 1px rgba(232, 160, 32, 0.15);
  transition: background var(--transition), box-shadow var(--transition), filter var(--transition);
}

.chart-bar-group:hover .chart-bar {
  filter: brightness(1.15);
  box-shadow: 0 0 22px rgba(244, 178, 62, 0.55);
}

.chart-value {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  transition: color var(--transition);
  order: -1; /* value above bar */
}

.chart-bar-group:hover .chart-value {
  color: var(--white);
}

.chart-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-dark);
  text-align: center;
  line-height: 1.3;
  padding-top: var(--sp-2);
}

.chart-baseline {
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin-top: 0;
}

/* ================================================================
   13. MARQUEE — comment 7
   Auto-scrolling rows; CSS animation; row hover pauses; card hover highlights.
   ================================================================ */
#marquee {
  padding: var(--sp-24) 0 var(--sp-16);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  overflow: hidden;
}

.marquee-row {
  overflow: hidden;
  padding: 12px 0; /* Room for hover expansion without clipping */
}

.marquee-track {
  display: flex;
  gap: var(--sp-4);
  width: max-content;
}

/* Leftward scroll (rows 1 and 3): 0 → -50% */
[data-direction="left"] .marquee-track {
  animation: marquee-left 45s linear infinite;
}

/* Row 3 is slightly slower for visual variety */
.marquee-row:last-child .marquee-track {
  animation-duration: 55s;
}

/* Rightward scroll (row 2): -50% → 0 */
[data-direction="right"] .marquee-track {
  animation: marquee-right 38s linear infinite;
}

/* Pause the hovered row */
.marquee-row:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes marquee-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* All marquee cards share these base styles */
.marquee-card {
  flex-shrink: 0;
  width: 280px;
  border-radius: var(--radius);
  padding: var(--sp-6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}

.marquee-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 0 0 2px var(--gold), 0 8px 28px rgba(0, 0, 0, 0.35);
  z-index: 2;
  position: relative;
}

/* Stat mini-card */
.stat-card-mini {
  background: var(--card-dark);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  justify-content: center;
  align-items: flex-start;
}

.mini-number {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  font-optical-sizing: auto;
}

.mini-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.4;
}

/* NEW mini-card */
.stat-card-mini--new {
  background: var(--gold);
  position: relative;
}

.stat-card-mini--new .mini-number {
  color: var(--ink);
}

.stat-card-mini--new .mini-label {
  color: var(--ink);
}

.mini-badge {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: var(--sp-1);
}

/* Testimonial placeholder card — UNMISTAKABLY a placeholder */
.testimonial-card {
  background: var(--card-alt);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  border: 1.5px dashed rgba(232, 160, 32, 0.45);
}

.testimonial-eyebrow {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.4;
}

.testimonial-card blockquote p {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--white);
  line-height: 1.5;
}

.testimonial-attribution {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--muted-dark);
  margin-top: auto;
}

/* ================================================================
   14. FOOTER / CONTACT
   ================================================================ */
#contact {
  background: var(--paper);
  color: var(--ink);
  padding: var(--sp-32) 0 0;
}

.footer-inner {
  padding-bottom: var(--sp-24);
}

.footer-contact h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.75rem);
  color: var(--ink);
  margin-bottom: var(--sp-8);
}

.footer-contact address p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
}

.footer-contact address a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(17, 47, 100, 0.3);
  transition: text-decoration-color var(--transition), color var(--transition);
}

.footer-contact address a:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.footer-contact address a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.footer-contact .btn {
  margin-top: var(--sp-8);
}

.footer-legal {
  border-top: 1px solid rgba(17, 47, 100, 0.12);
  padding: var(--sp-6) var(--side-pad);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-8);
  justify-content: space-between;
}

.footer-legal p {
  font-size: 0.8125rem;
  color: var(--muted-light);
  line-height: 1.6;
}

.footer-legal a {
  color: var(--muted-light);
  text-decoration: underline;
  text-decoration-color: rgba(90, 107, 140, 0.4);
  transition: color var(--transition);
}

.footer-legal a:hover {
  color: var(--gold);
}

.footer-legal a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ================================================================
   15. PREFERS-REDUCED-MOTION
   When set: disable marquee scroll, show chart bars in final state,
   skip hero parallax (handled in JS; GSAP simply won't animate).
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none !important;
    /* Show all cards as a static, slightly-offset flex row */
    transform: translateX(0) !important;
  }

  .chart-bar {
    transform: scaleY(1) !important;
  }

  /* The hero is shown as the static navy intro composition, so keep the
     header legible with a solid paper background. */
  #site-header {
    background: var(--paper);
    box-shadow: 0 1px 0 rgba(17, 47, 100, 0.1), 0 2px 16px rgba(17, 47, 100, 0.06);
  }

  html {
    scroll-behavior: auto;
  }
}

/* ================================================================
   16. RESPONSIVE
   Below ~900px: stack two-column sections to one column.
   Header collapses to hamburger.
   ================================================================ */
@media (max-width: 900px) {

  /* --- Header --- */
  .hamburger {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    padding: var(--sp-4) var(--side-pad) var(--sp-6);
    box-shadow: 0 8px 24px rgba(17, 47, 100, 0.12);
    border-top: 1px solid rgba(17, 47, 100, 0.1);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
    padding: var(--sp-3) 0;
    font-size: 1.0625rem;
    border-bottom: 1px solid rgba(17, 47, 100, 0.08);
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  .header-actions {
    gap: var(--sp-2);
  }

  /* Hide secondary nav links on mobile to avoid clutter */
  .header-actions .nav-link {
    display: none;
  }

  /* --- Hero (mobile): stack text over Qin; card stays full-bleed --- */
  #hero {
    height: auto;
    min-height: 100vh;
  }

  .hero-stage {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
    align-items: center;
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-12);
  }

  .hero-headline h1 {
    max-width: none;
  }

  .hero-ctas .btn {
    width: 100%;
  }

  .hero-right {
    order: -1;
    height: auto;
  }

  .hero-portrait-wrap {
    width: 200px;
  }

  /* --- Map --- */
  .map-inner {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }

  /* --- Stats --- */
  .stats-inner {
    grid-template-columns: 1fr;
  }

  .stats-text {
    position: static;
  }

  .stats-viewport-outer {
    position: static;
  }

  .stats-viewport {
    height: 400px;
  }

  /* --- Chart --- */
  .chart-bars {
    height: 200px;
    gap: 6px;
  }

  .chart-bar {
    width: 38px;
  }

  .chart-bar-group {
    gap: var(--sp-1);
  }

  .chart-value {
    font-size: 0.875rem;
  }

  .chart-label {
    font-size: 0.6875rem;
  }

  /* --- Footer --- */
  .footer-legal {
    flex-direction: column;
    gap: var(--sp-2);
  }
}

@media (max-width: 480px) {

  .hero-ctas {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }

  .marquee-card {
    width: 240px;
  }

  .chart-bar {
    width: 30px;
  }
}
