/* ==========================================================================
   Intent United — Claymorphism redesign
   Palette: "Vibrant Growth" — Leaf Green · Harvest Gold · Peacock Teal
            on soft cream. 60-30-10:
              60% leaf green + cream  (branding + backgrounds)
              30% peacock teal        (ink: headings, body, logos, authority)
              10% harvest gold        (CTAs, buttons, highlights)
   Soft, hand-shaped, tactile "clay" surfaces.
   ========================================================================== */

:root {
  /* --- type --- */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* --- surfaces --- */
  --bg: #efe4d1;            /* warm oat background */
  --bg-2: #f4ecdb;
  --surface: #faf3e7;       /* raised cream card */
  --surface-strong: #fdf9f1;
  --surface-inset: #e9dbc4; /* recessed wells */

  /* --- ink (peacock teal — structure & donor-trust authority) --- */
  --heading: #123f3c;       /* deep peacock teal */
  --text: #244f4c;          /* teal-slate body text */
  --muted: #5c817e;         /* soft teal-grey */

  /* --- clay colors --- */
  /* The "terracotta" slots now carry LEAF GREEN — the main branding colour,
     so every existing accent usage becomes green with no selector churn. */
  --terracotta: #5c9e31;
  --terracotta-deep: #43781f;
  --terracotta-soft: #cfe3b4;

  --marigold: #f4a92c;      /* harvest gold — reserved for CTAs & accents */
  --marigold-deep: #e08e12;

  --leaf: #5c9e31;          /* leaf green */
  --leaf-deep: #43781f;

  --teal: #10807a;          /* peacock teal (surfaces / logos) */
  --teal-deep: #0c5f5a;

  /* --- clay shadow ingredients --- */
  --sh-warm: rgba(150, 98, 55, 0.26);
  --sh-warm-strong: rgba(140, 88, 48, 0.32);
  --hi: rgba(255, 251, 243, 0.9);

  /* raised clay surface */
  --clay:
    9px 9px 22px var(--sh-warm),
    -8px -8px 20px var(--hi),
    inset 2px 2px 5px rgba(255, 255, 255, 0.65),
    inset -6px -6px 13px rgba(150, 98, 55, 0.13);

  /* raised, larger (hover) */
  --clay-lg:
    16px 18px 38px var(--sh-warm-strong),
    -10px -10px 26px var(--hi),
    inset 2px 2px 6px rgba(255, 255, 255, 0.72),
    inset -7px -7px 16px rgba(150, 98, 55, 0.15);

  /* small raised (pills, buttons) */
  --clay-sm:
    5px 5px 14px var(--sh-warm),
    -5px -5px 12px var(--hi),
    inset 2px 2px 4px rgba(255, 255, 255, 0.6),
    inset -3px -3px 8px rgba(150, 98, 55, 0.12);

  /* pressed-in / recessed well */
  --clay-inset:
    inset 5px 5px 12px rgba(150, 98, 55, 0.22),
    inset -5px -5px 12px rgba(255, 255, 255, 0.75);

  --radius: 30px;
  --radius-sm: 20px;
  --max: 1180px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(closest-side at 12% -6%, rgba(244, 169, 44, 0.22), transparent 70%),
    radial-gradient(closest-side at 92% 2%, rgba(16, 128, 122, 0.16), transparent 66%),
    radial-gradient(closest-side at 78% 96%, rgba(92, 158, 49, 0.16), transparent 70%),
    linear-gradient(180deg, #f5ecda 0%, var(--bg) 46%, #ead9bf 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.65;
  font-weight: 500;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--heading);
  font-weight: 600;
  line-height: 1.08;
}

strong { font-weight: 800; }

::selection {
  background: rgba(92, 158, 49, 0.22);
  color: var(--heading);
}

:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(92%, var(--max));
  margin: 0 auto;
}

.page-section {
  padding: 4.8rem 0;
}

.logo-image {
  width: 210px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(3px 5px 8px rgba(150, 98, 55, 0.28));
  transition: transform 0.4s var(--ease-spring);
}

.brand:hover .logo-image {
  transform: rotate(-2deg) scale(1.03);
}

/* ---------- motion / reveal ---------- */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes grow-bar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes soft-pulse {
  0%, 100% { transform: rotate(8deg) scale(1); }
  50%      { transform: rotate(8deg) scale(1.04); }
}

/* scroll-reveal (JS adds .in). .js gate prevents any flash of hidden content. */
.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  /* box-shadow included so revealed cards (this rule outranks the generic card
     transition) still ease their island water-shadow on hover instead of snapping */
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out),
              box-shadow 0.7s var(--ease-out);
  will-change: opacity, transform;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* header + hero animate immediately on load */
header .brand,
header nav li,
.hero .tag,
.hero h1,
.hero p,
.hero-actions,
.hero-stats .stat-pill,
.hero .visual-card,
.hero .lesson-box,
.hero .speech-bubble,
#tutor-container {
  animation: fade-up 0.9s var(--ease-out) both;
}

header .brand { animation-delay: 0.02s; }
header nav li:nth-child(1) { animation-delay: 0.06s; }
header nav li:nth-child(2) { animation-delay: 0.11s; }
header nav li:nth-child(3) { animation-delay: 0.16s; }
header nav li:nth-child(4) { animation-delay: 0.21s; }
header nav li:nth-child(5) { animation-delay: 0.26s; }
header nav li:nth-child(6) { animation-delay: 0.31s; }
header nav li:nth-child(7) { animation-delay: 0.36s; }
header nav li:nth-child(8) { animation-delay: 0.41s; }

.hero .tag { animation-delay: 0.10s; }
.hero h1 { animation-delay: 0.18s; }
.hero p { animation-delay: 0.28s; }
.hero-actions { animation-delay: 0.38s; }
.hero-stats .stat-pill:nth-child(1) { animation-delay: 0.48s; }
.hero-stats .stat-pill:nth-child(2) { animation-delay: 0.58s; }
.hero-stats .stat-pill:nth-child(3) { animation-delay: 0.68s; }
.hero .visual-card,
#tutor-container { animation-delay: 0.26s; }
.hero .lesson-box:first-of-type { animation-delay: 0.6s; }
.hero .speech-bubble { animation-delay: 0.74s; }
.hero .lesson-box:last-of-type { animation-delay: 0.88s; }

.soft-hover {
  transition: transform 0.35s var(--ease-out), box-shadow 0.7s var(--ease-out);
}

/* ---------- tag pill ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--terracotta-deep);
  box-shadow: var(--clay-sm);
}

/* ---------- header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 236, 219, 0.78);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  border-bottom: 1px solid rgba(150, 98, 55, 0.12);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 0.9rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem 0.5rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

nav a:hover {
  color: var(--terracotta-deep);
  background: rgba(92, 158, 49, 0.10);
}

nav a.active {
  color: var(--terracotta-deep);
  background: var(--surface);
  box-shadow: var(--clay-inset);
}

nav a.btn-primary,
nav a.btn-primary:hover {
  color: var(--heading);
  background: linear-gradient(145deg, #f8bd57, var(--marigold-deep));
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.55rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.28s var(--ease-spring),
    box-shadow 0.28s var(--ease-out),
    filter 0.28s var(--ease-out);
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-22deg);
  transition: left 0.8s var(--ease-out);
  pointer-events: none;
}

.btn:hover::after { left: 155%; }

.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px) scale(0.98); }

.btn-primary {
  color: var(--heading);
  background: linear-gradient(145deg, #f8bd57, var(--marigold));
  box-shadow:
    7px 8px 18px rgba(190, 130, 25, 0.34),
    -5px -5px 13px rgba(255, 240, 205, 0.55),
    inset 2px 2px 5px rgba(255, 255, 255, 0.5),
    inset -5px -6px 13px rgba(190, 120, 15, 0.4);
}
.btn-primary:hover {
  box-shadow:
    10px 12px 24px rgba(190, 130, 25, 0.4),
    -6px -6px 15px rgba(255, 240, 205, 0.6),
    inset 2px 2px 6px rgba(255, 255, 255, 0.55),
    inset -5px -6px 14px rgba(190, 120, 15, 0.42);
}
.btn-primary:active {
  box-shadow:
    inset 5px 5px 12px rgba(190, 120, 15, 0.42),
    inset -4px -4px 10px rgba(255, 240, 205, 0.4);
}

.btn-secondary {
  color: var(--heading);
  background: var(--surface);
  box-shadow: var(--clay-sm);
}
.btn-secondary:hover { box-shadow: var(--clay); }
.btn-secondary:active { box-shadow: var(--clay-inset); }

/* ---------- layout groups ---------- */

.hero { padding: 5.2rem 0 4rem; }

.hero-grid,
.split-grid,
.two-col,
.impact-grid,
.cta-grid {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.hero-grid > * { flex: 1 1 420px; }

.split-grid > *,
.two-col > *,
.impact-grid > *,
.cta-grid > * { flex: 1 1 320px; }

.hero-grid { align-items: center; }

.hero h1,
.page-hero h1 {
  font-size: clamp(2.6rem, 5.2vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 1.1rem 0 1.2rem;
  max-width: 13ch;
  color: var(--heading);
}

.hero h1 .accent,
.page-hero h1 .accent {
  color: var(--terracotta);
  font-style: italic;
  position: relative;
}

.hero p,
.page-hero p {
  color: var(--muted);
  max-width: 58ch;
  font-size: 1.12rem;
  margin-bottom: 1.7rem;
}

.hero-actions,
.button-row,
.hero-stats,
.stat-row,
.partner-stats-flex,
.partners-flex,
.grid-3,
.grid-4,
.mission-layout,
.steps,
.impact-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.hero-stats,
.stat-row { margin-top: 1.7rem; }

/* ---------- clay cards ---------- */

.visual-card,
.card,
.image-panel,
.founder-card,
.feature-card,
.metric-card,
.story-card,
.cta-card,
.contact-card,
.partner-card,
.impact-number {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--clay);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.7s var(--ease-out);
}

/* soft moving sheen on hover */
.visual-card::after,
.card::after,
.feature-card::after,
.metric-card::after,
.founder-card::after,
.partner-card::after,
.contact-card::after,
.cta-card::after,
.impact-number::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.3) 50%, transparent 80%);
  opacity: 0;
  transform: translateX(-35%);
  transition: opacity 0.4s ease, transform 0.8s var(--ease-out);
  pointer-events: none;
}

.card:hover,
.feature-card:hover,
.metric-card:hover,
.founder-card:hover,
.partner-card:hover,
.contact-card:hover,
.cta-card:hover,
.impact-number:hover,
.story-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--clay-lg);
}

.card:hover::after,
.feature-card:hover::after,
.metric-card:hover::after,
.founder-card:hover::after,
.partner-card:hover::after,
.contact-card:hover::after,
.cta-card:hover::after,
.impact-number:hover::after {
  opacity: 1;
  transform: translateX(35%);
}

.card,
.feature-card,
.metric-card,
.founder-card,
.contact-card,
.story-card,
.cta-card,
.partner-card {
  padding: 1.7rem;
}

/* ---------- stat pills ---------- */

.stat-pill {
  flex: 1 1 155px;
  min-width: 0;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--clay-sm);
}
.stat-pill:hover,
.lesson-box.soft-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--clay);
}

.stat-pill strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--terracotta-deep);
  line-height: 1.1;
}

.stat-pill span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ---------- homepage / AI hero visual ---------- */

.visual-card {
  padding: 1.6rem;
  min-height: 520px;
  /* No preserve-3d: children are flat 2D, so it adds nothing visually but
     triggers a browser compositing bug that made the card vanish mid-scroll.
     The JS tilt keeps its own perspective() and still reads as 3D. */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation: fade-up 0.95s var(--ease-out) 0.26s both,
             gentle-float 6.5s ease-in-out 1.6s infinite;
}

.map-shape {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  width: 120px;
  height: 160px;
  background: linear-gradient(165deg, rgba(92, 158, 49, 0.28), rgba(244, 169, 44, 0.32));
  border-radius: 40% 36% 42% 50% / 28% 34% 56% 50%;
  transform: rotate(8deg);
  box-shadow: inset 3px 3px 8px rgba(255, 255, 255, 0.5),
              inset -4px -4px 10px rgba(150, 70, 40, 0.2);
  animation: soft-pulse 4.5s ease-in-out infinite;
  z-index: 2;
}

.map-shape::after {
  content: "India";
  position: absolute;
  bottom: 14px;
  left: 20px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--terracotta-deep);
  transform: rotate(-8deg);
}

.screen {
  position: absolute;
  left: 1.6rem;
  right: 1.6rem;
  bottom: 1.6rem;
  top: 1.6rem;
  border-radius: 26px;
  background: linear-gradient(180deg, #fefaf3, #f3ead9);
  overflow: hidden;
  display: flex;
  box-shadow: var(--clay-inset);
}

.screen-main {
  flex: 1 1 62%;
  min-width: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  background:
    radial-gradient(circle at 82% 16%, rgba(244, 169, 44, 0.14), transparent 30%),
    linear-gradient(180deg, #fffdf8, #fbf4e8);
}

.screen-main:only-child { flex: 1 1 100%; width: 100%; }

.screen-side {
  flex: 0 0 38%;
  min-width: 220px;
  background: linear-gradient(165deg, #0c5f5a, #14827a);
  color: #fff;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}
.screen-side:empty { display: none; }
.screen-side h3, .screen-side p { color: #fff; }

.mini-ui { display: flex; align-items: center; gap: 0.5rem; }

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(150, 98, 55, 0.25);
  box-shadow: inset 1px 1px 2px rgba(150, 98, 55, 0.4);
}
.dot:nth-child(1) { background: rgba(16, 128, 122, 0.6); }  /* teal */
.dot:nth-child(2) { background: rgba(244, 169, 44, 0.6); }  /* gold */
.dot:nth-child(3) { background: rgba(92, 158, 49, 0.6); }   /* green */

.lesson-box {
  padding: 1.1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff4df, #fffaf0);
  box-shadow:
    4px 4px 12px rgba(150, 98, 55, 0.14),
    -3px -3px 9px rgba(255, 255, 255, 0.8),
    inset 1px 1px 3px rgba(255, 255, 255, 0.7);
  transition: transform 0.35s var(--ease-out), box-shadow 0.7s var(--ease-out);
}

.side-box {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}
.side-box h3, .side-box p { color: #fff; }

.lesson-box h3,
.side-box h3,
.card h3,
.founder-card h3,
.feature-card h3,
.metric-card h3,
.contact-card h3,
.partner-card h3 {
  margin-bottom: 0.55rem;
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--heading);
}

.lesson-box p,
.card p,
.feature-card p,
.founder-card p,
.metric-card p,
.contact-card p,
.partner-card p {
  color: var(--muted);
  font-weight: 500;
}

.progress {
  margin-top: 0.9rem;
  height: 12px;
  width: 100%;
  border-radius: 999px;
  background: var(--surface-inset);
  overflow: hidden;
  box-shadow: var(--clay-inset);
}

.progress span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--marigold), var(--terracotta));
  transform-origin: left;
  animation: grow-bar 1.3s var(--ease-out) 1.1s both;
}

.speech-bubble {
  align-self: flex-start;
  padding: 0.95rem 1.15rem;
  border-radius: 20px 20px 20px 7px;
  background: linear-gradient(160deg, #eef3e2, #e4edcf);
  color: var(--leaf-deep);
  max-width: 82%;
  font-weight: 700;
  box-shadow:
    3px 4px 10px rgba(95, 122, 61, 0.18),
    -2px -2px 7px rgba(255, 255, 255, 0.7);
}

/* ---------- section headers ---------- */

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.4rem;
  flex-wrap: wrap;
}

.section-header h2,
.page-hero h2 {
  font-size: clamp(1.95rem, 3.1vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-top: 0.9rem;
  color: var(--heading);
}

.section-header p {
  color: var(--muted);
  max-width: 54ch;
  font-weight: 500;
}

.grid-3 > *,
.steps > *,
.mission-layout > *,
.impact-panel > *,
.partner-stats-flex > * { flex: 1 1 270px; }

.grid-4 { justify-content: center; }

.grid-4 > *,
.founder-card {
  flex: 1 1 220px;
  max-width: 285px;
}

.feature-card,
.partner-card,
.contact-card,
.cta-card {
  display: flex;
  flex-direction: column;
}

/* ---------- icon chips ---------- */

.icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
  color: var(--terracotta-deep);
  background: linear-gradient(145deg, #fbe0bd, #f6c98d);
  box-shadow:
    5px 5px 13px rgba(150, 98, 55, 0.2),
    -4px -4px 11px rgba(255, 255, 255, 0.85),
    inset 2px 2px 4px rgba(255, 255, 255, 0.6),
    inset -3px -3px 7px rgba(180, 120, 60, 0.18);
  transition: transform 0.4s var(--ease-spring);
  flex-shrink: 0;
}

.icon-wrap svg { width: 28px; height: 28px; }

.card:hover .icon-wrap,
.feature-card:hover .icon-wrap,
.partner-card:hover .icon-wrap {
  transform: scale(1.08) rotate(-6deg);
}

/* ---------- feature lists ---------- */

.feature-list,
.donate-list,
.contact-card ul {
  list-style: none;
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.feature-list li::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(92, 158, 49, 0.16);
  color: var(--leaf-deep);
  font-weight: 900;
  font-size: 0.8rem;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.6);
}

/* ---------- metric / impact numbers ---------- */

.metric-card strong,
.impact-number strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  font-weight: 600;
  line-height: 1;
  color: var(--terracotta);
  margin-bottom: 0.5rem;
}

/* ---------- story card ---------- */

.story-card {
  background: linear-gradient(160deg, #0c4f4a, #12726a);
  color: #fff;
  box-shadow:
    12px 14px 30px rgba(10, 60, 55, 0.4),
    inset 2px 2px 6px rgba(180, 235, 228, 0.22),
    inset -6px -8px 16px rgba(6, 40, 36, 0.5);
}

.story-card::before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(244, 169, 44, 0.4), transparent 70%);
  right: -90px;
  top: -90px;
}

.story-card p,
.story-card small,
.story-card h3 { color: #fff; position: relative; }
.story-card h3 { font-style: italic; }
.story-card small { opacity: 0.75; }

.story-badge {
  display: inline-flex;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  margin-bottom: 1.1rem;
  font-weight: 800;
  font-size: 0.88rem;
  color: #ffe6c9;
  box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.2);
}

.impact-number {
  flex: 1 1 220px;
  padding: 1.4rem;
  border-radius: 24px;
}

.impact-number span {
  color: var(--muted);
  font-weight: 700;
}

/* ---------- founders ---------- */

.founder-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 1.1rem;
  background: linear-gradient(145deg, rgba(244, 169, 44, 0.3), rgba(92, 158, 49, 0.2));
  box-shadow: inset 3px 3px 8px rgba(150, 98, 55, 0.15);
  transition: transform 0.5s var(--ease-out);
}

.founder-card:hover .founder-image,
.partner-card:hover .partner-image { transform: scale(1.04); }

.founder-role,
.partner-label {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(92, 158, 49, 0.16);
  color: var(--leaf-deep);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.5);
}

/* ---------- contact / donate ---------- */

.contact-card li,
.donate-list li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.contact-card li span,
.donate-list li span {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: rgba(92, 158, 49, 0.15);
  color: var(--leaf-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow:
    3px 3px 7px rgba(150, 98, 55, 0.14),
    -2px -2px 6px rgba(255, 255, 255, 0.8),
    inset 1px 1px 2px rgba(255, 255, 255, 0.6);
  transition: transform 0.3s var(--ease-spring), background 0.3s ease;
}
.contact-card li span svg,
.donate-list li span svg { width: 18px; height: 18px; }

.contact-card:hover li span,
.cta-card:hover .donate-list li span {
  transform: translateY(-2px) rotate(-4deg);
  background: rgba(92, 158, 49, 0.24);
}

/* ---------- steps ---------- */

.steps { counter-reset: step; }

.step {
  position: relative;
  padding-top: 3.6rem;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--marigold), var(--marigold-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow:
    5px 6px 14px rgba(200, 130, 30, 0.32),
    inset 2px 2px 4px rgba(255, 255, 255, 0.5),
    inset -3px -4px 8px rgba(180, 110, 20, 0.4);
  transition: transform 0.4s var(--ease-spring);
}
.step:hover::before { transform: translateY(-3px) scale(1.06); }

/* ---------- CTA ---------- */

.cta-card {
  background:
    radial-gradient(circle at 8% 0%, rgba(244, 169, 44, 0.2), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(92, 158, 49, 0.2), transparent 36%),
    var(--surface);
}

.cta-card p {
  color: var(--muted);
  max-width: 54ch;
  margin: 0.85rem 0 1.35rem;
  font-weight: 500;
}

.cta-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--clay);
}

/* ---------- partners ---------- */

.partners-flex { align-items: stretch; }

.partner-card { flex: 1 1 340px; }

.partner-top {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.partner-logo-box {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  background: linear-gradient(145deg, #17968f, var(--teal-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow:
    6px 7px 15px rgba(10, 70, 65, 0.3),
    inset 2px 2px 4px rgba(255, 255, 255, 0.3),
    inset -4px -5px 10px rgba(8, 55, 50, 0.4);
  transition: transform 0.4s var(--ease-spring);
}
.partner-card:hover .partner-logo-box { transform: rotate(-6deg) scale(1.06); }

.partner-image-wrap {
  margin: 0.3rem 0 1.1rem;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: var(--clay-inset);
}

.partner-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(244, 169, 44, 0.3), rgba(92, 158, 49, 0.2));
  transition: transform 0.5s var(--ease-out);
}

.partner-points {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.partner-point {
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--clay-sm);
  transition: transform 0.3s var(--ease-out), box-shadow 0.7s var(--ease-out);
}
.partner-point:hover {
  transform: translateY(-3px);
  box-shadow: var(--clay);
}

.partner-point strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--heading);
}

.partner-point span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ---------- footer ---------- */

footer {
  padding: 2.4rem 0 3.2rem;
  margin-top: 1rem;
  color: var(--muted);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.7rem 1.9rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--clay);
}

.footer-grid > div:first-child strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--heading);
}
.footer-grid p { font-weight: 500; }

.footer-links {
  display: flex;
  gap: 0.4rem 0.6rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.25s ease, background 0.25s ease;
}
.footer-links a:hover {
  color: var(--terracotta-deep);
  background: rgba(92, 158, 49, 0.1);
}

/* ---------- AI page tutor frame ---------- */

#tutor-container {
  width: 100%;
  height: 600px;
  min-height: 520px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--clay), var(--clay-inset);
  padding: 6px;
}

/* ---------- auth / login ---------- */

.auth-section {
  padding: 4.5rem 0 5rem;
  min-height: calc(100vh - 300px);
  display: flex;
  align-items: center;
}

.auth-grid {
  display: flex;
  gap: 3rem;
  align-items: center;
  flex-wrap: wrap;
}

.auth-visual {
  flex: 1 1 420px;
}

.auth-visual h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 1.1rem 0 1.1rem;
  max-width: 14ch;
  color: var(--heading);
}

.auth-visual h1 .accent {
  color: var(--terracotta);
  font-style: italic;
}

.auth-visual > p {
  color: var(--muted);
  max-width: 46ch;
  font-size: 1.06rem;
  margin-bottom: 2rem;
}

.auth-visual-card {
  position: relative;
  padding: 1.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--clay);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 440px;
}

.auth-card {
  flex: 1 1 400px;
  max-width: 460px;
  margin-left: auto;
  padding: 2.4rem 2.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--clay);
}

/* The site sets display:flex on .field/.field-row, which would otherwise beat
   the [hidden] attribute (equal specificity, later source). Re-assert hidden. */
.auth-card [hidden] { display: none !important; }

/* Crossfade the title/fields/switch-line when toggling Log In <-> Sign Up,
   instead of the content instantly snapping to the other mode. */
.auth-body {
  transition: opacity 0.18s ease, transform 0.22s ease;
}

.auth-body.is-switching {
  opacity: 0;
  transform: translateY(8px);
}

@media (prefers-reduced-motion: reduce) {
  .auth-body { transition: none; }
}

.auth-tabs {
  position: relative;
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem;
  margin-bottom: 1.6rem;
  border-radius: 999px;
  background: var(--surface-inset);
  box-shadow: var(--clay-inset);
}

.auth-tab-indicator {
  position: absolute;
  top: 0.4rem;
  left: 0;
  bottom: 0.4rem;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #f8bd57, var(--marigold));
  box-shadow:
    4px 5px 12px rgba(190, 130, 25, 0.28),
    inset 2px 2px 4px rgba(255, 255, 255, 0.4),
    inset -3px -4px 9px rgba(190, 120, 15, 0.35);
  scale: 1 1;
  transition:
    translate 0.5s cubic-bezier(0.34, 1.68, 0.64, 1),
    width 0.35s ease,
    scale 0.45s cubic-bezier(0.34, 1.68, 0.64, 1);
}

/* while squashing, skip the scale transition so the pinch itself lands instantly
   and only the release (back to scale 1 1) gets the bouncy easing above */
.auth-tab-indicator.is-squashing {
  transition:
    translate 0.5s cubic-bezier(0.34, 1.68, 0.64, 1),
    width 0.35s ease;
}

.auth-tab {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s ease, scale 0.15s ease;
}

.auth-tab.is-active {
  color: var(--heading);
}

.auth-tab:active {
  scale: 0.94;
}

@media (prefers-reduced-motion: reduce) {
  .auth-tab-indicator, .auth-tab-indicator.is-squashing, .auth-tab { transition: none; }
}

.auth-card h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.1rem);
  margin-bottom: 0.4rem;
}

.auth-error {
  padding: 0.8rem 1.05rem;
  margin-bottom: 1.3rem;
  border-radius: var(--radius-sm);
  background: rgba(185, 85, 47, 0.12);
  color: var(--terracotta-deep);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: inset 2px 2px 5px rgba(150, 70, 40, 0.12);
}

.auth-notice {
  padding: 0.8rem 1.05rem;
  margin-bottom: 1.3rem;
  border-radius: var(--radius-sm);
  background: rgba(92, 158, 49, 0.16);
  color: var(--leaf-deep);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: inset 2px 2px 5px rgba(95, 122, 61, 0.12);
}

.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.pw-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 0.8rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pw-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 0.25s ease;
}

.pw-check-icon {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-inset);
  box-shadow: var(--clay-inset);
  position: relative;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.pw-check-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
}

/* the "not met" cross — two diagonal gradient bands forming an X */
.pw-check-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 8px;
  height: 8px;
  background:
    linear-gradient(45deg, transparent 42%, #fff 42%, #fff 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, #fff 42%, #fff 58%, transparent 58%);
  transform: scale(0);
  transition: transform 0.2s ease;
}

.pw-check.is-met {
  color: var(--leaf-deep);
}

.pw-check.is-met .pw-check-icon {
  background: linear-gradient(145deg, var(--leaf), var(--leaf-deep));
  box-shadow: 0 2px 4px rgba(67, 120, 31, 0.35);
  transform: scale(1.05);
}

.pw-check.is-met .pw-check-icon::after {
  transform: rotate(45deg) scale(1);
}

/* warm orange, not var(--terracotta) — that token was repurposed to leaf
   green above, so it would read as "met" (green) if reused here. */
.pw-check.is-unmet {
  color: #c4620f;
}

.pw-check.is-unmet .pw-check-icon {
  background: linear-gradient(145deg, #f5a24a, #d9791c);
  box-shadow: 0 2px 4px rgba(190, 115, 20, 0.35);
}

.pw-check.is-unmet .pw-check-icon::before {
  transform: scale(1);
}

.auth-sub {
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1.8rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.3rem;
}

.field span {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--heading);
}

.field input {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.9rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  box-shadow: var(--clay-inset);
  transition: box-shadow 0.25s ease;
}

.field input::placeholder {
  color: var(--muted);
  font-weight: 500;
  opacity: 0.8;
}

.field input:focus {
  outline: none;
  box-shadow:
    inset 5px 5px 12px rgba(150, 98, 55, 0.22),
    inset -5px -5px 12px rgba(255, 255, 255, 0.75),
    0 0 0 3px rgba(92, 158, 49, 0.3);
}

.password-wrap {
  position: relative;
  display: flex;
}

.password-wrap input {
  flex: 1;
  padding-right: 2.9rem;
}

.toggle-pw {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.toggle-pw svg { width: 20px; height: 20px; }
.toggle-pw:hover { color: var(--terracotta-deep); }
.toggle-pw.is-visible { color: var(--terracotta); }

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -0.3rem 0 1.5rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--terracotta);
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  padding: 1rem 1.5rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.8rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.auth-switch a {
  color: var(--terracotta-deep);
  font-weight: 800;
}
.auth-switch a:hover { opacity: 0.8; }

/* nav controls injected by auth.js on signed-in pages */
.nav-greeting {
  font-weight: 700;
  font-size: 0.98rem;
  align-self: center;
}
/* The greeting links to the account page, so it gets a subtle link affordance. */
.nav-greeting a {
  display: inline-block;
  color: var(--muted);
  padding: 0.5rem 0.4rem 0.5rem 0.6rem;
  transition: color 0.25s ease;
}
.nav-greeting a:hover { color: var(--heading); }

.nav-logout a {
  color: var(--leaf-deep);
  font-weight: 800;
  font-size: 0.98rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: rgba(92, 158, 49, 0.14);
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.4);
  transition: color 0.25s ease, background 0.25s ease;
}
.nav-logout a:hover {
  color: #fff;
  background: linear-gradient(145deg, var(--leaf), var(--leaf-deep));
}

@media (max-width: 960px) {
  .auth-card { margin-left: 0; }
}

@media (max-width: 720px) {
  .auth-card { padding: 1.8rem 1.5rem; }
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .hero h1,
  .page-hero h1 { max-width: none; }

  .visual-card {
    min-height: 0;
    padding-bottom: 1.6rem;
    animation: fade-up 0.95s var(--ease-out) 0.26s both;
  }

  .screen {
    position: static;
    margin-top: 0;
    min-height: 0;
    flex-direction: column;
  }

  .screen-main,
  .screen-side { flex: 1 1 100%; min-width: 0; }
}

@media (max-width: 720px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }
  nav ul { justify-content: flex-start; width: 100%; }

  .logo-image { width: 180px; }

  .hero { padding-top: 3.2rem; }

  .hero-grid > *,
  .split-grid > *,
  .two-col > *,
  .impact-grid > *,
  .cta-grid > *,
  .grid-3 > *,
  .grid-4 > *,
  .partners-flex > *,
  .partner-stats-flex > *,
  .mission-layout > *,
  .impact-panel > *,
  .steps > * {
    flex-basis: 100%;
    max-width: 100%;
  }

  .visual-card { padding: 1.3rem; }
  .map-shape { width: 96px; height: 132px; }
  .screen { margin-top: 0; }
  .partner-top { align-items: flex-start; }
  .footer-grid { flex-direction: column; align-items: flex-start; }
  .section-header { align-items: flex-start; }
}

/* ==========================================================================
   Enhancement layer — animated aurora backdrop, livelier page heroes,
   shimmering accents, and a scroll-progress bar. Layered on the clay base;
   all of it bows out under prefers-reduced-motion (see block below).
   ========================================================================== */

/* --- slow-drifting aurora behind everything (subtle, readability-safe) --- */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 42% at 18% 22%, rgba(92, 158, 49, 0.16), transparent 70%),
    radial-gradient(34% 38% at 82% 26%, rgba(16, 128, 122, 0.15), transparent 70%),
    radial-gradient(42% 46% at 72% 84%, rgba(244, 169, 44, 0.16), transparent 70%);
  animation: aurora-drift 26s ease-in-out infinite;
}

/* the login card sits right where the aurora blob drifts into view — mute it there */
body.auth-page::before {
  display: none;
}

@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(2%, -3%, 0) scale(1.06); }
  66%      { transform: translate3d(-2%, 2%, 0) scale(1.03); }
}

/* --- thin gradient scroll-progress bar (element injected by main.js) --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 200;
  background: linear-gradient(90deg, var(--leaf), var(--marigold), var(--teal));
  box-shadow: 0 1px 8px rgba(92, 158, 49, 0.45);
  pointer-events: none;
}

/* --- water ripple surface (canvas injected by main.js) ------------------ */
/* A realistic height-field water simulation that sits behind all content
   and reacts to the moving pointer. Painted as soft specular highlights so
   it reads as light rippling across the warm background gradient. */
.ripple-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;              /* above the body gradient, behind all content */
  pointer-events: none;
  /* upscaled from a small buffer — let the browser smooth it into water */
  image-rendering: auto;
}

/* --- richer page heroes (fixes the "blank / bland at the top" feel) --- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding-top: 5.4rem;
  padding-bottom: 3.2rem;
}

/* two soft floating orbs give text-only heroes depth without new markup */
.page-hero::before,
.page-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  filter: blur(46px);
  pointer-events: none;
}
.page-hero::before {
  width: 360px;
  height: 360px;
  top: -140px;
  right: -50px;
  background: radial-gradient(circle at 40% 40%, rgba(244, 169, 44, 0.5), transparent 70%);
  animation: orb-float 15s ease-in-out infinite;
}
.page-hero::after {
  width: 320px;
  height: 320px;
  bottom: -170px;
  left: -70px;
  background: radial-gradient(circle at 50% 50%, rgba(16, 128, 122, 0.42), transparent 70%);
  animation: orb-float 19s ease-in-out infinite reverse;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(26px, -30px) scale(1.1); }
}

/* animate the hero text in on load so the top never reads as empty */
.js .page-hero .tag,
.js .page-hero h1,
.js .page-hero h2,
.js .page-hero > .container > p {
  animation: fade-up 0.9s var(--ease-out) both;
}
.js .page-hero .tag { animation-delay: 0.06s; }
.js .page-hero h1,
.js .page-hero h2 { animation-delay: 0.16s; }
.js .page-hero > .container > p { animation-delay: 0.28s; }

/* --- shimmering gradient accent on the big display headings --- */
.hero h1 .accent,
.page-hero h1 .accent {
  background: linear-gradient(100deg,
    var(--leaf-deep) 0%, var(--marigold-deep) 42%, var(--teal) 68%, var(--leaf-deep) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: accent-shimmer 7s linear infinite;
}

@keyframes accent-shimmer {
  to { background-position: 220% center; }
}

/* --- sliding underline on nav links (skips the pill CTA) --- */
nav a:not(.btn) {
  position: relative;
}
nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.28rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--leaf), var(--marigold));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s var(--ease-out);
}
nav a:not(.btn):hover::after,
nav a.active:not(.btn)::after {
  transform: scaleX(1);
}

/* --- give the scroll-reveal a touch more life --- */
.js .reveal {
  transform: translateY(30px) scale(0.985);
}
.js .reveal.in {
  transform: none;
}

/* ==========================================================================
   Islands on the ripple
   The pointer stirs the background water (see main.js); every clay box now
   reads as a little island resting on that surface — a deep-teal water-shadow
   it casts into the ripple, a warm sandy shoreline hugging its base, and a
   slow, desynced bob as the swell passes under it. The bob rides the
   independent `translate` property so it composes with (never fights) the
   hover / scroll-reveal `transform`. All motion stops under reduced-motion.
   ========================================================================== */
:root {
  /* teal water-shadow — same deep teal the ripple paints (main.js loR/loG/loB) */
  --water-halo:    0 20px 40px -16px rgba(12, 63, 60, 0.32);
  --water-halo-lg: 0 34px 60px -18px rgba(12, 63, 60, 0.42);
  --water-halo-sm: 0 12px 26px -13px rgba(12, 63, 60, 0.28);
  /* warm sand at the waterline + a faint wet-teal band right at the base */
  --shore:
    inset 0 -18px 26px -22px rgba(198, 150, 90, 0.60),
    inset 0 -2px 6px -3px rgba(12, 63, 60, 0.10);
}

@keyframes island-bob {
  0%, 100% { translate: 0 0;     rotate: -0.7deg; }
  50%      { translate: 0 -14px; rotate:  0.7deg; }
}
@keyframes island-bob-b {
  0%, 100% { translate: 0 -2px;  rotate:  0.6deg; }
  50%      { translate: 0 -20px; rotate: -0.6deg; }
}
@keyframes island-drift {
  0%, 100% { translate: -5px 0;   rotate:  0.5deg; }
  50%      { translate:  5px -16px; rotate: -0.5deg; }
}

/* --- coloration: water-shadow beneath + sandy shoreline at the base --- */
.visual-card, .card, .image-panel, .founder-card, .feature-card,
.metric-card, .story-card, .cta-card, .contact-card, .partner-card,
.impact-number, .auth-card, .auth-visual-card {
  box-shadow: var(--clay), var(--water-halo), var(--shore);
}
.stat-pill { box-shadow: var(--clay-sm), var(--water-halo-sm), var(--shore); }
.lesson-box {
  box-shadow:
    4px 4px 12px rgba(150, 98, 55, 0.14),
    -3px -3px 9px rgba(255, 255, 255, 0.8),
    inset 1px 1px 3px rgba(255, 255, 255, 0.7),
    var(--water-halo-sm), var(--shore);
}

/* ease the water-shadow in slowly on hover (the lift itself stays responsive) */
.visual-card, .card, .image-panel, .founder-card, .feature-card,
.metric-card, .story-card, .cta-card, .contact-card, .partner-card,
.impact-number, .auth-card, .auth-visual-card, .stat-pill, .lesson-box {
  transition: box-shadow 0.7s var(--ease-out), transform 0.4s var(--ease-out);
}

/* islands ride higher out of the water on hover, casting a deeper shadow */
.visual-card:hover, .card:hover, .feature-card:hover, .metric-card:hover,
.founder-card:hover, .partner-card:hover, .contact-card:hover, .cta-card:hover,
.impact-number:hover, .story-card:hover {
  box-shadow: var(--clay-lg), var(--water-halo-lg), var(--shore);
}
.stat-pill:hover {
  box-shadow: var(--clay), var(--water-halo), var(--shore);
}
/* lesson-box keeps its own 6-layer shadow shape in both states so the shadow
   can interpolate (a differing layer count would snap instantly) */
.lesson-box.soft-hover:hover {
  box-shadow:
    6px 7px 18px rgba(150, 98, 55, 0.20),
    -4px -4px 12px rgba(255, 255, 255, 0.85),
    inset 1px 1px 3px rgba(255, 255, 255, 0.7),
    var(--water-halo-sm),
    var(--shore);
}

/* --- the bob --- */
.visual-card, .card, .image-panel, .founder-card, .feature-card,
.metric-card, .story-card, .cta-card, .contact-card, .partner-card,
.impact-number, .stat-pill, .auth-card, .auth-visual-card {
  animation: island-bob 5.5s ease-in-out infinite;
}
/* desync neighbours so a row of islands never bobs in lockstep */
:is(.visual-card, .card, .image-panel, .founder-card, .feature-card,
    .metric-card, .story-card, .cta-card, .contact-card, .partner-card,
    .impact-number, .stat-pill):nth-child(3n + 2) {
  animation-name: island-bob-b; animation-duration: 8.4s; animation-delay: -2.2s;
}
:is(.visual-card, .card, .image-panel, .founder-card, .feature-card,
    .metric-card, .story-card, .cta-card, .contact-card, .partner-card,
    .impact-number, .stat-pill):nth-child(3n) {
  animation-name: island-drift; animation-duration: 7.6s; animation-delay: -4.1s;
}
:is(.visual-card, .card, .image-panel, .founder-card, .feature-card,
    .metric-card, .story-card, .cta-card, .contact-card, .partner-card,
    .impact-number, .stat-pill):nth-child(3n + 1) {
  animation-duration: 6.6s; animation-delay: -1s;
}

/* hero islands keep their fade-up entrance, then bob forever; the two-value
   delays run entrance-first, bob-second, and !important shields them from the
   generic desync rules above (which share the same selectors) */
.hero-stats .stat-pill,
.hero .visual-card {
  animation:
    fade-up 0.9s var(--ease-out) both,
    island-bob 5.5s ease-in-out infinite !important;
}
.hero .visual-card                  { animation-delay: 0.26s, -1.6s !important; }
.hero-stats .stat-pill:nth-child(1) { animation-delay: 0.48s, -0.4s !important; }
.hero-stats .stat-pill:nth-child(2) { animation-delay: 0.58s, -2.6s !important; }
.hero-stats .stat-pill:nth-child(3) { animation-delay: 0.68s, -4.3s !important; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  /* match the hero islands' specificity so their !important bob is cancelled */
  .hero-stats .stat-pill,
  .hero .visual-card { animation: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- account page ---------- */
/* The only place the palette turns red: destructive actions need to read as
   destructive, so they step outside the warm-clay green/gold system. */
:root {
  --danger: #b3402c;
  --danger-deep: #8d2f1f;
  --danger-soft: rgba(179, 64, 44, 0.12);
}

.account-wrap {
  display: grid;
  gap: 1.6rem;
  max-width: 760px;
}

.account-card h3,
.danger-zone h3 {
  font-size: 1.35rem;
  margin-bottom: 0.9rem;
}

.account-card > p { margin-bottom: 1.2rem; }
.account-card .auth-notice,
.account-card .auth-error { margin-bottom: 1.2rem; }

.account-details {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}
.account-details > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: baseline;
}
.account-details dt {
  min-width: 9rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.account-details dd {
  margin: 0;
  color: var(--heading);
  font-weight: 700;
}

.danger-zone {
  border: 2px solid var(--danger-soft);
}
.danger-zone h3 { color: var(--danger-deep); }

.danger-list {
  margin: 0.8rem 0 1.4rem;
  padding-left: 1.2rem;
  color: var(--text);
  font-weight: 600;
}
.danger-list li { margin-bottom: 0.35rem; }

.btn-danger {
  color: #fff;
  background: linear-gradient(145deg, #c8523c, var(--danger));
  box-shadow:
    7px 8px 18px rgba(140, 55, 38, 0.32),
    -5px -5px 13px rgba(255, 235, 225, 0.5),
    inset 2px 2px 5px rgba(255, 255, 255, 0.28),
    inset -5px -6px 13px rgba(120, 40, 25, 0.4);
}
.btn-danger:hover {
  box-shadow:
    10px 12px 24px rgba(140, 55, 38, 0.38),
    -6px -6px 15px rgba(255, 235, 225, 0.55),
    inset 2px 2px 6px rgba(255, 255, 255, 0.3),
    inset -5px -6px 14px rgba(120, 40, 25, 0.42);
}
.btn-danger:active {
  box-shadow:
    inset 5px 5px 12px rgba(120, 40, 25, 0.42),
    inset -4px -4px 10px rgba(255, 235, 225, 0.35);
}
.btn-danger:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.55;
  transform: none;
}
.btn-danger:disabled:hover { transform: none; }

.delete-confirm {
  margin-top: 1.3rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--danger-soft);
}
.delete-confirm .field { margin-bottom: 1.1rem; }

.delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

@media (max-width: 560px) {
  .account-details dt { min-width: 100%; }
  .delete-actions .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   Biology Lab — the Gemini tutor panel on ai.html
   Same clay vocabulary as the rest of the site: the conversation sits in a
   pressed-in well, the composer is a second well, and the only raised things
   are the ones you can press.
   ========================================================================== */

/* Screen-reader-only label (the composer's <textarea> carries a visible
   placeholder, but a placeholder is not an accessible name). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Section headings can carry the same shimmering accent as the hero h1. */
.section-header h2 .accent {
  background: linear-gradient(100deg,
    var(--leaf-deep) 0%, var(--marigold-deep) 42%, var(--teal) 68%, var(--leaf-deep) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  animation: accent-shimmer 7s linear infinite;
}

.bio-chat {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--clay);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- header row ---------- */

.bio-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 0.35rem;
}

.bio-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--leaf) 0%, var(--teal) 100%);
  box-shadow: var(--clay-sm);
}

.bio-avatar svg { width: 24px; height: 24px; }

.bio-head-text { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }

.bio-head-text strong {
  font-family: var(--font-display);
  font-size: 1.16rem;
  color: var(--heading);
}

.bio-head-text span {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.bio-clear {
  flex: none;
  font: 700 0.82rem/1 var(--font-body);
  color: var(--teal-deep);
  background: var(--surface-strong);
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.05rem;
  cursor: pointer;
  box-shadow: var(--clay-sm);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.bio-clear:hover { transform: translateY(-2px); box-shadow: var(--clay); }
.bio-clear:active { transform: translateY(0); box-shadow: var(--clay-inset); }

/* ---------- conversation ---------- */

.bio-log {
  background: var(--surface-inset);
  border-radius: var(--radius-sm);
  box-shadow: var(--clay-inset);
  padding: 1.25rem;
  height: clamp(320px, 52vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-behavior: smooth;
}

.bio-log::-webkit-scrollbar { width: 10px; }
.bio-log::-webkit-scrollbar-thumb {
  background: rgba(92, 158, 49, 0.35);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.bio-msg { display: flex; max-width: 100%; }
.bio-msg-user { justify-content: flex-end; }

.bio-bubble {
  max-width: 74%;
  padding: 0.8rem 1.05rem;
  border-radius: 20px;
  font-size: 0.97rem;
  line-height: 1.6;
  font-weight: 500;
  overflow-wrap: anywhere;
  animation: bio-pop 0.32s var(--ease-spring) both;
}

.bio-msg-user .bio-bubble {
  background: linear-gradient(150deg, var(--leaf) 0%, var(--leaf-deep) 100%);
  color: #fdfbf5;
  border-bottom-right-radius: 7px;
  box-shadow: 4px 5px 12px rgba(67, 120, 31, 0.3);
}

.bio-msg-model .bio-bubble {
  background: var(--surface-strong);
  color: var(--text);
  border-bottom-left-radius: 7px;
  box-shadow: var(--clay-sm);
}

@keyframes bio-pop {
  from { opacity: 0; transform: translateY(9px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* Markdown the tutor is allowed to emit. */
.bio-bubble p + p { margin-top: 0.62rem; }
.bio-bubble h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--heading);
  margin: 0.7rem 0 0.35rem;
}
.bio-bubble h4:first-child { margin-top: 0; }
.bio-bubble ul { margin: 0.5rem 0 0.15rem; padding-left: 1.15rem; }
.bio-bubble li { margin-bottom: 0.3rem; }
.bio-bubble strong { color: var(--heading); font-weight: 800; }
.bio-msg-user .bio-bubble strong { color: #fff; }
.bio-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(16, 128, 122, 0.1);
  padding: 0.1em 0.38em;
  border-radius: 6px;
}

/* ---------- empty state ---------- */

.bio-empty {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.05rem;
  padding: 0.5rem 0;
}

.bio-empty p {
  font-family: var(--font-display);
  font-size: 1.22rem;
  color: var(--heading);
}

.bio-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  max-width: 34rem;
}

.bio-chip {
  font: 600 0.86rem/1.35 var(--font-body);
  color: var(--teal-deep);
  background: var(--surface-strong);
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  cursor: pointer;
  box-shadow: var(--clay-sm);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s var(--ease-out), color 0.22s;
}

.bio-chip:hover { transform: translateY(-3px); box-shadow: var(--clay); color: var(--leaf-deep); }
.bio-chip:active { transform: translateY(-1px) scale(0.97); box-shadow: var(--clay-inset); }

/* ---------- thinking indicator ---------- */

.bio-dots { display: inline-flex; gap: 5px; padding: 0.2rem 0.1rem; }

.bio-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: bio-bounce 1.25s ease-in-out infinite;
}

.bio-dots i:nth-child(2) { animation-delay: 0.16s; }
.bio-dots i:nth-child(3) { animation-delay: 0.32s; }

@keyframes bio-bounce {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.4; }
  35%           { transform: translateY(-5px); opacity: 1; }
}

/* ---------- notice line ---------- */

.bio-notice {
  margin: 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.bio-notice-error {
  color: var(--danger-deep);
  background: var(--danger-soft);
  border-radius: 14px;
  padding: 0.7rem 1rem;
}

/* ---------- composer ---------- */

.bio-form {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  background: var(--surface-inset);
  border-radius: 26px;
  box-shadow: var(--clay-inset);
  padding: 0.5rem 0.5rem 0.5rem 1.15rem;
}

.bio-input {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font: 500 1rem/1.5 var(--font-body);
  color: var(--text);
  padding: 0.72rem 0;
  max-height: 140px;
}

.bio-input::placeholder { color: var(--muted); opacity: 0.85; }
.bio-input:disabled { opacity: 0.6; cursor: not-allowed; }

.bio-send {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #4a2f05;
  background: linear-gradient(150deg, var(--marigold) 0%, var(--marigold-deep) 100%);
  box-shadow: var(--clay-sm);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s var(--ease-out);
}

.bio-send svg { width: 21px; height: 21px; }
.bio-send:hover:not(:disabled) { transform: translateY(-2px) scale(1.05); box-shadow: var(--clay); }
.bio-send:active:not(:disabled) { transform: translateY(0) scale(0.96); box-shadow: var(--clay-inset); }

.bio-send:disabled { opacity: 0.5; cursor: not-allowed; }
.bio-send.is-busy svg { animation: bio-send-spin 1.1s linear infinite; }

@keyframes bio-send-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Keyboard focus has to stay obvious on both wells. */
.bio-form:focus-within { box-shadow: var(--clay-inset), 0 0 0 3px rgba(92, 158, 49, 0.35); }
.bio-chip:focus-visible,
.bio-clear:focus-visible,
.bio-send:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

@media (max-width: 620px) {
  .bio-chat { padding: 1rem; }
  .bio-log { padding: 0.9rem; }
  .bio-bubble { max-width: 88%; }
  .bio-head-text span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bio-bubble { animation: none; }
  .bio-dots i { animation-duration: 2.4s; }
  .bio-send.is-busy svg { animation: none; }
  .section-header h2 .accent { animation: none; }
  .bio-log { scroll-behavior: auto; }
}
