/* ============================================================
   Visual Reality — Tech for Tomorrow
   Light theme · HTML + CSS + JS only
   ============================================================ */

:root {
  --bg: #f7fbf8;
  --surface: #ffffff;
  --ink: #0b1f16;
  --ink-soft: #3d574b;
  --muted: #647c70;
  --brand: #0e9f6e;
  --brand-deep: #047857;
  --teal: #0d9488;
  --mint: #e7f6ee;
  --line: #e2ede6;
  --danger: #b42318;
  --grad: linear-gradient(135deg, #0ea672 0%, #0d9488 100%);
  --shadow-sm: 0 2px 10px rgba(11, 31, 22, 0.06);
  --shadow-md: 0 12px 34px rgba(11, 31, 22, 0.1);
  --shadow-lg: 0 24px 60px rgba(11, 31, 22, 0.14);
  --radius: 18px;
  --container: 1160px;
  --font-head: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 3.65rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.7rem, 3.1vw, 2.45rem);
  font-weight: 700;
}

h3 {
  font-size: 1.22rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--brand-deep);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--teal);
}

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(14, 159, 110, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1.2rem;
  background: var(--ink);
  color: #fff;
  border-radius: 0 0 12px 12px;
  font-weight: 600;
  transition: top 0.25s ease;
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* ---------- Utilities ---------- */
.grad-text {
  background: var(--grad);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 5.5s ease-in-out infinite;
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.accent-underline {
  position: relative;
  white-space: nowrap;
}

.accent-underline::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 0.08em;
  height: 0.32em;
  background: rgba(45, 212, 191, 0.35);
  border-radius: 999px;
  z-index: -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.eyebrow-light {
  color: #99f6e4;
}

.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.section-alt {
  background: linear-gradient(180deg, #f2f9f5 0%, #f8fcfa 100%);
}

.section-head {
  max-width: 640px;
  margin: 0 auto clamp(2.6rem, 5vw, 3.8rem);
  text-align: center;
}

.section-sub {
  font-size: 1.08rem;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease,
    color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.btn:hover {
  transform: translateY(-2px);
}

/* Arrow icons inside buttons nudge on hover */
.btn svg {
  transition: transform 0.25s ease;
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 24px rgba(13, 148, 136, 0.32);
}

/* Shine sweep across primary buttons on hover */
.btn-primary::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -70%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-22deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 135%;
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 14px 30px rgba(13, 148, 136, 0.42);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.6px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: #fff;
}

.btn-light {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 10px 26px rgba(4, 32, 22, 0.28);
}

.btn-light:hover {
  color: var(--brand-deep);
  transform: translateY(-2px);
}

.btn-outline-light {
  background: transparent;
  color: #fff;
  border: 1.6px solid rgba(255, 255, 255, 0.55);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: #fff;
}

.btn-sm {
  padding: 0.62rem 1.25rem;
  font-size: 0.9rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--brand-deep);
}

.text-link svg {
  transition: transform 0.2s ease;
}

.text-link:hover svg {
  transform: translateX(4px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 34px rgba(11, 31, 22, 0.07);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  white-space: nowrap;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-name em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-cta {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(3.4rem, 6vw, 5rem);
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.hero::before {
  width: 560px;
  height: 560px;
  top: -220px;
  left: -180px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, transparent 68%);
}

.hero::after {
  width: 640px;
  height: 640px;
  bottom: -300px;
  right: -220px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.12) 0%, transparent 68%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

.hero-copy .lead {
  font-size: 1.14rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin-bottom: 1.8rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2.1rem;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

.hero-facts svg {
  flex: none;
}

.hero-art {
  position: relative;
}

.hero-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 30px 50px rgba(13, 148, 136, 0.16));
}

.hero-orbit {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: orbit-spin 26s linear infinite;
}

.chip {
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 10px 18px rgba(11, 31, 22, 0.1));
}

.float-a {
  animation: float-y 6s ease-in-out infinite;
}

.float-b {
  animation: float-y 7s ease-in-out -1.6s infinite;
}

.float-c {
  animation: float-y 6.6s ease-in-out -3.2s infinite;
}

.sparkles path,
.sparkles circle {
  animation: twinkle 3.4s ease-in-out infinite;
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-13px);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.75;
  }
}

/* ---------- Stats ---------- */
.stats {
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: clamp(1.8rem, 4vw, 2.8rem) clamp(1.4rem, 4vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}

.stat {
  text-align: center;
  position: relative;
}

.stat + .stat::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: var(--line);
}

.stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- Pillars ---------- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.pillar-card {
  position: relative;
  padding: 2.1rem 1.9rem 1.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  overflow: hidden;
}

.pillar-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.pillar-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14, 159, 110, 0.35);
}

.pillar-card:hover::before {
  opacity: 1;
}

.pillar-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 1.4rem;
  border-radius: 22px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pillar-card:hover .pillar-icon {
  transform: rotate(-6deg) scale(1.1);
}

.icon-science {
  background: #e6f7ef;
  color: var(--brand-deep);
}

.icon-innovation {
  background: #e6f6f5;
  color: var(--teal);
}

.icon-sustain {
  background: #ecf9f0;
  color: #059669;
}

.pillar-kicker {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--brand-deep);
  margin-bottom: 0.7rem;
}

.pillar-card > p:not(.pillar-kicker) {
  font-size: 0.98rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.tag-row li {
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-deep);
  background: var(--mint);
  border-radius: 999px;
}

/* ---------- Innovations ---------- */
.innovations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
}

.innov-card {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.9rem 1.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.innov-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13, 148, 136, 0.35);
}

.innov-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.3rem;
}

.innov-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--mint);
  color: var(--brand-deep);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.innov-card:hover .innov-icon {
  transform: translateY(-4px) rotate(-5deg) scale(1.06);
}

.innov-card:nth-child(even) .innov-icon {
  background: #e6f6f5;
  color: var(--teal);
}

.innov-tag {
  padding: 0.32rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(13, 148, 136, 0.09);
  border-radius: 999px;
}

.innov-kicker {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--brand-deep);
  margin-bottom: 0.65rem;
}

.innov-card > p:not(.innov-kicker) {
  font-size: 0.98rem;
  flex: 1;
}

.innov-card .text-link {
  margin-top: 1.1rem;
}

/* ---------- Mission ---------- */
.mission {
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(4rem, 8vw, 6.5rem);
}

.mission-panel {
  position: relative;
  padding: clamp(2.6rem, 6vw, 4.6rem) clamp(1.6rem, 6vw, 5rem);
  border-radius: 30px;
  background: linear-gradient(130deg, #065f46 0%, #0b7a5e 45%, #0d9488 100%);
  color: #e8fff6;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.mission-panel::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.mission-deco {
  position: absolute;
  width: 340px;
  height: 340px;
  right: -70px;
  bottom: -120px;
  opacity: 0.9;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: slowSpin 48s linear infinite;
}

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

.mission-panel h2 {
  color: #fff;
  max-width: 21em;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.mission-copy {
  max-width: 42em;
  color: rgba(233, 255, 246, 0.88);
  font-size: 1.05rem;
}

.mission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}

/* ---------- Join the movement ---------- */
.join {
  padding-top: 0;
}

.join-card {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2.2rem, 5vw, 3.4rem) clamp(1.4rem, 5vw, 3.2rem) clamp(1.9rem, 4vw, 2.6rem);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.join-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--grad);
}

.join-badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0.4rem auto 1.2rem;
  border-radius: 20px;
  background: var(--mint);
  animation: joinFloat 5.2s ease-in-out infinite;
}

@keyframes joinFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(2.5deg); }
}

.join-sub {
  max-width: 36rem;
  margin: 0 auto 1.6rem;
  color: var(--muted);
}

.join-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  max-width: 36rem;
  margin: 0 auto;
  text-align: left;
}

.join-field-full {
  grid-column: 1 / -1;
}

.join-form input,
.join-form textarea {
  width: 100%;
  padding: 0.85rem 1.2rem;
  font: inherit;
  color: var(--ink);
  background: #fbfdfc;
  border: 1.6px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.join-form textarea {
  min-height: 110px;
  resize: vertical;
  border-radius: 18px;
  line-height: 1.55;
}

.join-form input::placeholder,
.join-form textarea::placeholder {
  color: #9ab3a5;
}

.join-form input:focus,
.join-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(14, 159, 110, 0.14);
}

.join-form input.input-error,
.join-form textarea.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1);
}

.join-send {
  justify-self: center;
  min-width: 220px;
  margin-top: 0.2rem;
}

.join-send.is-sent svg {
  animation: joinCheck 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes joinCheck {
  0% { transform: scale(0.4) rotate(-30deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.join-card.sent {
  animation: joinSent 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes joinSent {
  0% { box-shadow: var(--shadow-md); }
  40% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.18), var(--shadow-md); }
  100% { box-shadow: var(--shadow-md); }
}

.form-note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-msg {
  min-height: 1.5em;
  margin: 0.5rem 0 0;
  font-size: 0.93rem;
  font-weight: 600;
}

.form-msg.success {
  color: var(--brand-deep);
}

.form-msg.error {
  color: var(--danger);
}

/* ---------- Footer ---------- */
.site-footer {
  background: #082417;
  color: #b7d6c5;
  padding: clamp(3rem, 6vw, 4.5rem) 0 1.6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-bottom: 2.6rem;
  border-bottom: 1px solid rgba(183, 214, 197, 0.16);
}

.brand-footer .brand-name {
  color: #fff;
}

.footer-blurb {
  margin-top: 1.1rem;
  max-width: 24rem;
  font-size: 0.95rem;
  color: #9fc4b0;
}

.footer-col h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.1rem;
}

.footer-col ul {
  display: grid;
  gap: 0.65rem;
}

.footer-col a,
.footer-col li {
  color: #9fc4b0;
  font-size: 0.96rem;
}

.footer-col a:hover {
  color: #5eead4;
}

.social-row {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.social-link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #9fc4b0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(183, 214, 197, 0.18);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
  color: #06281d;
  background: #5eead4;
  transform: translateY(-3px);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.6rem;
  font-size: 0.88rem;
  color: #7fa78f;
}

.footer-bottom p {
  margin: 0;
}

.footer-credit a {
  color: #5eead4;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed rgba(94, 234, 212, 0.45);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-credit a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

/* ---------- Compact footer (City / Timeline pages) ---------- */
.city-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid rgba(183, 214, 197, 0.16);
}

.city-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.city-footer-links a {
  color: #9fc4b0;
  font-weight: 600;
  font-size: 0.95rem;
}

.city-footer-links a:hover {
  color: #5eead4;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 6.6rem; /* sits above the TerraSense AI chat button */
  z-index: 70;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 26px rgba(13, 148, 136, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  transform: translateY(-3px);
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0s);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy .lead,
  .hero-facts {
    margin-inline: auto;
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-art {
    max-width: 480px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 880px) {
  .stats-card {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.8rem 1rem;
  }

  .stat:nth-child(3)::before {
    display: none;
  }

  .pillars-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-inline: auto;
  }

  .innovations-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  html {
    scroll-padding-top: 84px;
  }

  .nav {
    height: 68px;
  }

  .nav-cta {
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
  }

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

  .brand .logo-mark {
    width: 34px;
    height: 34px;
  }

  .hero {
    padding-top: 2.4rem;
  }

  .hero-facts {
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
  }

  .stats-card {
    grid-template-columns: 1fr 1fr;
    padding: 1.6rem 1rem;
  }

  .stat + .stat::before {
    display: none;
  }

  .join-form {
    grid-template-columns: 1fr;
  }

  .join-send {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-orbit,
  .chip,
  .sparkles path,
  .sparkles circle,
  .btn,
  .btn svg,
  .pillar-card,
  .pillar-icon,
  .innov-card,
  .innov-icon,
  .grad-text,
  .mission-deco,
  .brand:hover .logo-mark {
    animation: none !important;
    transition: none !important;
  }

  .btn-primary::after {
    display: none;
  }

  .leaf-fall {
    display: none;
  }

  .js .section-head h2::after {
    transform: translateX(-50%) scaleX(1);
    transition: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Simulator banner (homepage) ---------- */
.sim-banner {
  padding: 0 0 clamp(3rem, 6vw, 4.5rem);
}

.sim-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.8rem;
  padding: clamp(2rem, 4.5vw, 3rem) clamp(1.5rem, 5vw, 3.4rem);
  border-radius: 26px;
  background: linear-gradient(120deg, #eafaf1 0%, #e2f6f3 100%);
  border: 1px solid rgba(14, 159, 110, 0.22);
  box-shadow: var(--shadow-sm);
}

.sim-banner-copy h2 {
  margin-bottom: 0.45em;
}

.sim-banner-copy p:not(.eyebrow) {
  max-width: 34rem;
  margin: 0;
  color: var(--ink-soft);
}

.sim-banner-copy .eyebrow {
  margin-bottom: 0.6rem;
}

.sim-banner-btn {
  flex: none;
}

/* Timeline promo banner variant (teal-tinted) */
.tl-banner-inner {
  background: linear-gradient(120deg, #e7f4fb 0%, #e6f8f1 100%);
  border-color: rgba(13, 148, 136, 0.24);
}

/* Carbon calculator promo banner variant (deep green-tinted) */
.cf-banner-inner {
  background: linear-gradient(120deg, #eafaf1 0%, #ddf3ee 100%);
  border-color: rgba(4, 120, 87, 0.28);
}

/* Museum promo banner variant (violet-tinted) */
.ms-banner-inner {
  background: linear-gradient(120deg, #f1effb 0%, #e7f6f0 100%);
  border-color: rgba(139, 92, 246, 0.24);
}

/* Impact simulator promo banner variant (gold-green tinted) */
.im-banner-inner {
  background: linear-gradient(120deg, #fdf6e3 0%, #e6f7f0 100%);
  border-color: rgba(217, 119, 6, 0.22);
}

/* Games promo banner variant (amber-to-green tinted, dual CTA) */
.play-banner-inner {
  background: linear-gradient(120deg, #fdf3e0 0%, #e4f8ee 100%);
  border-color: rgba(217, 119, 6, 0.24);
}

.play-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: none;
}

@media (max-width: 720px) {
  .play-banner-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .sim-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   SITE-WIDE ANIMATION POLISH
   Scroll progress · hero leaves · heading underline · logo sway
   ============================================================ */

/* ---------- Reading progress bar (all pages) ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 300;
  pointer-events: none;
}

/* ---------- Section headings: gradient underline draws in ---------- */
.js .section-head h2 {
  position: relative;
}

.js .section-head h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.42em;
  width: 84px;
  height: 4px;
  border-radius: 4px;
  background: var(--grad);
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}

.js .section-head.in h2::after {
  transform: translateX(-50%) scaleX(1);
}

/* ---------- Brand logo: leaf sways on hover ---------- */
.logo-mark {
  transform-origin: 50% 88%;
}

.brand:hover .logo-mark {
  animation: leafSway 1.1s ease-in-out;
}

@keyframes leafSway {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-8deg); }
  65% { transform: rotate(7deg); }
}

/* ---------- Hero: ambient falling leaves (homepage) ---------- */
.leaf-fall {
  position: absolute;
  top: -28px;
  width: 14px;
  height: 14px;
  border-radius: 0 60% 0 60%;
  background: linear-gradient(135deg, #34d399, #0d9488);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  animation: leafFall var(--t, 12s) linear var(--dl, 0s) infinite;
  will-change: transform, opacity;
}

@keyframes leafFall {
  0% {
    transform: translate3d(0, -28px, 0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: var(--o, 0.4);
  }
  50% {
    transform: translate3d(var(--dx, 40px), calc(var(--fy, 620px) * 0.55), 0)
      rotate(190deg);
  }
  88% {
    opacity: var(--o, 0.4);
  }
  100% {
    transform: translate3d(calc(var(--dx, 40px) * -0.6), var(--fy, 620px), 0)
      rotate(370deg);
    opacity: 0;
  }
}

/* ---------- Hero art: gentle cursor parallax ---------- */
.hero-art .hero-svg {
  transition: transform 0.35s ease-out;
}

/* ============================================================
   Hamburger navigation (all pages)
   ============================================================ */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* --- Toggle button --- */
.nav-toggle {
  --bar-w: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.25s ease, background 0.25s ease,
    box-shadow 0.25s ease, transform 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.nav-toggle:active {
  transform: scale(0.94);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.nav-toggle-bar {
  width: var(--bar-w);
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.2s ease,
    background 0.25s ease;
}

.nav-toggle:hover .nav-toggle-bar {
  background: var(--brand-deep);
}

/* morph to X when open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.4);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --- Dropdown panel --- */
.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  max-height: calc(100dvh - 90px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 48px rgba(11, 31, 22, 0.13);
  opacity: 0;
  transform: translateY(-12px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.28s;
}

.nav-menu.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-menu-inner {
  padding: 1.1rem 0 1.25rem;
}

.nav-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

/* Links are ALWAYS visible and clickable — no entrance animation, no moving
   targets: taps can never race an in-flight transform or delay. */
.nav-links a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.22s ease, border-color 0.22s ease,
    transform 0.22s ease, box-shadow 0.22s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* NOTE: no per-link entrance animation on purpose — moving targets race
   against touch hit-testing; the panel fade/slide is the only motion. */

.nav-links a:hover {
  background: var(--mint);
  border-color: rgba(14, 159, 110, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.nav-links a .nl-t {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.nav-links a .nl-d {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
}

/* current page chip */
.nav-links a[aria-current="page"] {
  background: var(--grad);
  box-shadow: 0 8px 22px rgba(14, 159, 110, 0.32);
}

.nav-links a[aria-current="page"] .nl-t {
  color: #ffffff;
}

.nav-links a[aria-current="page"] .nl-d {
  color: rgba(255, 255, 255, 0.82);
}

.nav-links a[aria-current="page"]:hover {
  transform: none;
}

/* big CTA inside the panel — mobile only */
.nav-menu-cta {
  display: none;
  width: 100%;
  margin-top: 0.9rem;
  justify-content: center;
  text-align: center;
}

@media (max-width: 880px) {
  .nav-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  /* bar CTA moves into the panel */
  .nav-right .nav-cta {
    display: none;
  }

  .nav-menu-cta {
    display: inline-flex;
  }

  .nav-links {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .nav-links a {
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
  }

  .nav-links a .nl-t {
    font-size: 0.95rem;
  }

  .nav-links a .nl-d {
    font-size: 0.78rem;
  }
}

@media (hover: none) {
  /* touch devices: no sticky hover lift */
  .nav-links a:hover {
    transform: none;
  }
}

/* ============================================================
   Desktop (>= 1024px): proper inline nav bar — no hamburger.
   The same .nav-menu block renders as a centered row of links
   between the brand and the CTA. Short labels (.nl-s) replace
   the long ones; descriptions stay mobile-only.
   ============================================================ */
/* short labels only exist for the desktop bar */
.nav-links a .nl-s {
  display: none;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: none;
    overflow: visible;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: none;
  }

  .nav-menu-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.1rem;
    width: 100%;
  }

  .nav-links a {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.55rem;
    border-radius: 10px;
  }

  .nav-links a .nl-t,
  .nav-links a .nl-d {
    display: none;
  }

  .nav-links a .nl-s {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    white-space: nowrap;
    transition: color 0.2s ease;
  }

  .nav-links a:hover {
    background: var(--mint);
    border-color: transparent;
    transform: none;
    box-shadow: none;
  }

  .nav-links a:hover .nl-s {
    color: var(--brand-deep);
  }

  .nav-links a[aria-current="page"] {
    background: var(--mint);
    border-color: rgba(14, 159, 110, 0.28);
    box-shadow: none;
  }

  .nav-links a[aria-current="page"] .nl-s {
    color: var(--brand-deep);
  }

  .nav-menu-cta {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle,
  .nav-toggle-bar,
  .nav-menu,
  .nav-links a {
    transition: none !important;
    animation: none !important;
  }
}

/* the closed dropdown stays hidden under reduced motion too
   (desktop inline bar is excluded — it is always visible) */
@media (max-width: 1023.98px) and (prefers-reduced-motion: reduce) {
  .nav-menu:not(.open) {
    opacity: 0;
    visibility: hidden;
  }
}

/* While the menu is open, keep the floating chat button out of the way
   so it can never sit on top of menu items on short screens. */
body.nav-open .ts-fab {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.82);
}
