/* ============================================================
   Glass Frog Academy
   Same brand as the Leapshot Challenge site (colours, fonts, chunky
   buttons) but its own layout: one page at a time, picked from the
   nav, on grid paper like the hand-drawn GFA trifold.
   ============================================================ */

:root {
  --bg: #f5f9ee;
  --surface: #ffffff;
  --surface-alt: #eaf2dd;
  --ink: #131512;
  --ink-soft: #5c6852;
  --border: #dbe4cd;
  --accent: #7cc73e;          /* frog green */
  --accent-soft: #eaf6df;
  --main: #b1e57f;            /* pastel lime, primary button fill */
  --sticker: #aadcf7;         /* pastel sky */
  --pond: #e6f4fb;
  --shadow-hard: 4px 4px 0 0 var(--ink);
  --radius: 16px;
  --header-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 106.25%; }   /* 17px base */

body {
  font-family: "Nunito", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-color: var(--bg);
  /* faint engineering-paper grid */
  background-image:
    linear-gradient(rgba(124, 199, 62, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 199, 62, 0.09) 1px, transparent 1px);
  background-size: 32px 32px;
}

img { max-width: 100%; }

:focus:not(:focus-visible) { outline: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Type ---------- */

h1, h2, h3, .brand, .btn, .stat-value, .contact-email, .next-page strong {
  font-family: "Baloo 2", "Nunito", sans-serif;
}

h1, h2, h3 { line-height: 1.08; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.7rem, 6vw, 4.3rem); font-weight: 800; margin-bottom: 18px; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 14px; }
h3 { font-size: 1.25rem; font-weight: 700; }

.eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 600px;
}

.accent { color: var(--accent); }

/* small uppercase green label above card titles */
.card-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* handwriting, like the trifold board */
.hand { font-family: "Caveat", cursive; font-weight: 700; }

/* highlighter swipe behind a word; it sweeps in when its page opens */
.mark {
  background-image: linear-gradient(transparent 58%, var(--main) 58%, var(--main) 90%, transparent 90%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0 0.1em;
  margin: 0 -0.1em;
}
.page.is-active .mark { animation: mark-sweep 0.7s 0.25s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
@keyframes mark-sweep { from { background-size: 0% 100%; } }

/* ---------- Buttons (neobrutalism, ported from the shadcn button) ---------- */

.btn {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* hover = the button presses into the page, sliding into its shadow's spot */
.btn:hover { transform: translate(4px, 4px); box-shadow: 0 0 0 0 var(--ink); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.btn-primary { background: var(--main); }
.btn-ghost { background: var(--surface); }
.btn-large { padding: 13px 30px; font-size: 1.05rem; }
.btn-nav {
  padding: 8px 20px;
  font-size: 0.95rem;
  box-shadow: 3px 3px 0 0 var(--ink);
}
.btn-nav:hover { transform: translate(3px, 3px); }

/* ---------- Header / Nav ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(245, 249, 238, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-logo { height: 40px; width: auto; display: block; }

.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a:not(.btn) {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.nav-links a:not(.btn):hover,
.nav-links a[aria-current="page"] { color: var(--ink); }

/* the little frog that hops to whichever page you're on */
.nav-frog {
  position: absolute;
  left: 0;
  top: calc(50% + 12px);
  width: 24px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
}
.nav-frog svg { display: block; width: 100%; height: 100%; overflow: visible; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Pages: one visible at a time (without JS they all show) ---------- */

.js .page { display: none; }
.js .page.is-active { display: block; animation: page-in 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }

.page-inner { padding: calc(var(--header-h) + 56px) 0 88px; }

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}

/* a framed window onto each page's frog scene */
.scene-card {
  position: relative;
  background: var(--pond);
  border: 2px solid var(--ink);
  border-radius: 26px;
  box-shadow: 6px 6px 0 0 var(--ink);
  overflow: hidden;
}
.scene-card.is-lime { background: #eef7e2; }
.scene-card.is-warm { background: #fdf5e4; }
.scene-card svg { display: block; width: 100%; height: auto; }

/* faint background sparkles in the scenes */
.tw { animation: twinkle 2.6s ease-in-out infinite; }
.tw:nth-of-type(2n) { animation-delay: 1.1s; }
.tw:nth-of-type(3n) { animation-delay: 1.8s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

.block { margin-top: 80px; }

/* inked photo frame to match the drawings */
.photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--surface-alt);
}

/* "Up next" link that ends every page */
.next-page {
  display: flex;
  justify-content: flex-end;
  margin-top: 88px;
}
.next-page a {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  text-decoration: none;
  color: var(--ink);
}
.next-page span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.next-page strong {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  border-bottom: 3px solid var(--accent);
  transition: border-color 0.15s ease;
}
.next-page a:hover strong { border-color: var(--ink); }

/* ---------- Spotlight glow on cards
   (ported from the spotlight-card React component; --x/--y/--xp are set
   on :root by a pointermove listener in app.js) ---------- */

[data-glow] {
  position: relative;
  z-index: 0;
  --glow-hue: calc(95 + var(--xp, 0.5) * 50);
}

[data-glow]::before,
[data-glow]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

[data-glow]::before {
  z-index: -1;
  background-image: radial-gradient(
    240px 240px at calc(var(--x, -9999) * 1px) calc(var(--y, -9999) * 1px),
    hsl(var(--glow-hue) 65% 45% / 0.1),
    transparent 70%
  );
  background-attachment: fixed;
}

[data-glow]::after {
  inset: -1.5px;
  border: 1.5px solid transparent;
  background-image: radial-gradient(
    180px 180px at calc(var(--x, -9999) * 1px) calc(var(--y, -9999) * 1px),
    hsl(var(--glow-hue) 70% 40% / 0.9),
    transparent 100%
  );
  background-origin: border-box;
  background-attachment: fixed;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

/* ---------- Home ---------- */

.home-hero { padding: calc(var(--header-h) + 64px) 0 72px; }

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.home-title { font-size: clamp(2.6rem, 5.6vw, 4.2rem); margin-bottom: 22px; }

/* special delivery: an airmail envelope with a mail-carrier frog */
.mail-drop {
  display: block;
  margin-top: 64px;
  padding: 9px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: repeating-linear-gradient(-45deg,
    #e25555 0 12px, #fdf5e4 12px 20px, #5f9fc9 20px 32px, #fdf5e4 32px 40px);
  box-shadow: var(--shadow-hard);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mail-drop:hover { transform: translate(4px, 4px); box-shadow: 0 0 0 0 var(--ink); }
.mail-drop:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.mail-inner {
  position: relative;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 10px 40px 10px 14px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.mail-scene svg { display: block; width: 100%; height: auto; }
.mail-copy .mail-kicker { font-size: 1.6rem; line-height: 1; color: #e25555; }
.mail-copy h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin: 6px 0 8px; }
.mail-copy p { color: var(--ink-soft); }
.mail-cta { white-space: nowrap; }
/* the CTA is just a label: the whole envelope is the link */
.mail-drop:hover .mail-cta { transform: none; }

/* a GFA postage stamp in the corner */
.mail-stamp {
  position: absolute;
  top: -14px;
  right: -12px;
  width: 54px;
  height: 62px;
  display: grid;
  place-items: center;
  background: #fdf5e4;
  border: 2px dashed var(--ink);
  outline: 4px solid #fdf5e4;
  border-radius: 3px;
  transform: rotate(7deg);
}
.mail-stamp img { width: 38px; height: auto; display: block; }

.home-lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 520px;
  margin-bottom: 30px;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
  list-style: none;
}
.hero-stats li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.hero-stats strong {
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-size: 1.05rem;
  color: var(--ink);
  margin-right: 3px;
}

.where { padding-bottom: 96px; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.tile {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-hard);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover { transform: translate(4px, 4px); box-shadow: 0 0 0 0 var(--ink); }
.tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 2px solid var(--ink);
}
.tile-body { padding: 14px 18px 18px; }
.tile-body h3 { display: flex; justify-content: space-between; gap: 8px; }
.tile-body p { margin-top: 4px; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- About ---------- */

.mission {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

/* two photos pinned up like stickers */
.mission-photos { position: relative; aspect-ratio: 6 / 5; }
.mission-photos .photo { position: absolute; box-shadow: var(--shadow-hard); }
.mission-photos .photo-main { top: 0; left: 0; width: 66%; height: 90%; transform: rotate(-2deg); }
.mission-photos .photo-side { right: 0; bottom: 0; width: 46%; height: 62%; transform: rotate(3deg); }

.mission-copy p { color: var(--ink-soft); font-size: 1.05rem; }
.mission-copy p + p { margin-top: 12px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value { font-size: 2.6rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.stat-label { color: var(--ink-soft); }

/* ---------- Programs ---------- */

.program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.program-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.program-card h3 { margin-bottom: 8px; }
.program-card p { color: var(--ink-soft); font-size: 0.95rem; }

.feature {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.feature-media .photo { height: auto; aspect-ratio: 39 / 17; box-shadow: var(--shadow-hard); }
.feature h2 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); }
.feature p { color: var(--ink-soft); }

/* the flagship program, inverted */
.leapshot-card {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: #fff;
  padding: 32px;
}
.leapshot-card h3 { font-size: 2rem; margin-bottom: 8px; }
.leapshot-card p { color: rgba(255, 255, 255, 0.72); max-width: 620px; }
.leapshot-card .btn { flex: 0 0 auto; box-shadow: 4px 4px 0 0 var(--accent); }

/* ---------- Events ---------- */

.event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

/* one tall photo beside two stacked ones; minmax(0, ...) keeps the
   photos' natural size from stretching the tracks */
.event-photos {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  height: 270px;
}
.event-photos .photo:first-child { grid-row: span 2; }

.event-photos.is-pair {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.event-photos.is-pair .photo:first-child { grid-row: auto; }

.event-photos.is-wide {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 3fr) minmax(0, 2fr);
}
.event-photos.is-wide .photo:first-child { grid-row: auto; grid-column: 1 / -1; }

.event-body { padding: 18px 10px 8px; }
.event-body h2 { font-size: 1.65rem; margin-bottom: 8px; }
.event-body p { color: var(--ink-soft); font-size: 0.95rem; }

.text-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
}
.text-link:hover { border-color: var(--ink); }

/* ---------- Team ---------- */

.polaroids {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
}
.polaroid {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 10px 10px 2px;
  box-shadow: var(--shadow-hard);
  transform: rotate(-2.5deg);
  transition: transform 0.2s ease;
}
.polaroid:nth-child(2) { transform: rotate(2deg); }
.polaroid:nth-child(3) { transform: rotate(-1deg); }
.polaroid:nth-child(4) { transform: rotate(2.5deg); }
.polaroid:hover { transform: rotate(0) scale(1.03); }
.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
}
.polaroid figcaption { padding: 4px 0; font-size: 1.4rem; line-height: 1.2; text-align: center; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.member {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.member-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.member-avatar {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  overflow: hidden;
  background: var(--accent-soft);
}
.member-avatar img,
.member-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.member-name { font-size: 1.25rem; margin-bottom: 2px; }
.member-role {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--accent);
}
.member-school { font-size: 0.85rem; color: var(--ink-soft); }
.member-quote { font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- Support ---------- */

.support-actions { margin-top: 30px; }

/* partner logos as a sheet of stickers, each on its own brand colour */
.logo-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}
.logo-tile {
  flex: 0 1 300px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: var(--tile, #fff);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-hard);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.2s ease;
}
.logo-tile:hover { transform: rotate(0) scale(1.03); }
.logo-tile img,
.logo-tile svg { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-tile.is-bleed { padding: 0; overflow: hidden; }
.logo-tile.is-bleed img { width: 100%; height: 100%; max-height: none; object-fit: cover; }

.sponsor-cta { margin-top: 40px; text-align: center; color: var(--ink-soft); }

/* ---------- Contact ---------- */

.contact-email {
  display: inline-block;
  margin: 8px 0 28px;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 22px; list-style: none; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--ink-soft); font-size: 0.88rem; }
.footer-links a:hover { color: var(--ink); }
.footer-legal { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Notebook sides (wide screens only)
   The grid paper is a page in a GFA notebook: spiral binding and a red
   margin line down the left, colour-coded section tabs down the right.
   The tabs repeat the main nav, so they're kept out of the tab order. ---------- */

.binding, .tabs { display: none; }

@media (min-width: 1240px) and (min-height: 660px) {
  .binding {
    display: block;
    position: fixed;
    left: 0;
    top: var(--header-h);
    bottom: 0;
    width: 46px;
    z-index: 50;
    pointer-events: none;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='34' viewBox='0 0 46 34'%3E%3Ccircle cx='33' cy='18' r='4.4' fill='%23e3ead8' stroke='%23131512' stroke-width='1.6'/%3E%3Cpath d='M32 17 C 24 4, 7 4, -2 14' fill='none' stroke='%23131512' stroke-width='5.2' stroke-linecap='round'/%3E%3Cpath d='M32 17 C 24 4, 7 4, -2 14' fill='none' stroke='%23c9cfc2' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") 0 10px / 46px 34px repeat-y,
      linear-gradient(90deg, rgba(19, 21, 18, 0.07), transparent 85%);
  }
  /* the red margin line */
  .binding::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 64px;
    width: 2px;
    background: rgba(226, 85, 85, 0.42);
  }

  .tabs {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    position: fixed;
    right: 0;
    top: calc(var(--header-h) + (100vh - var(--header-h)) / 2);
    transform: translateY(-50%);
    z-index: 50;
  }
  .tabs a {
    writing-mode: vertical-rl;
    padding: 14px 7px 14px 9px;
    background: var(--tab, #fff);
    border: 2px solid var(--ink);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    color: var(--ink);
    font-family: "Baloo 2", "Nunito", sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    transform: translateX(9px);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), padding 0.25s ease, box-shadow 0.25s ease;
  }
  .tabs a:hover { transform: translateX(3px); }
  .tabs a.is-current {
    transform: translateX(0);
    padding-left: 16px;
    font-weight: 800;
    box-shadow: -3px 3px 0 0 var(--ink);
  }
}

/* ---------- Margin doodles (doodles.js): ballpoint-pen doodles and notes
   in the notebook margins on very wide screens ---------- */

.page { position: relative; }
.margin-doodles { display: none; }

@media (min-width: 1360px) and (min-height: 660px) {
  .margin-doodles {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    pointer-events: none;
    color: #3a5cad;   /* blue ballpoint */
  }
  /* between the margin line and the content, and between the content and the tabs */
  .margin-doodles.is-left { left: 80px; width: calc((100% - 1100px) / 2 + 10px - 80px); }
  .margin-doodles.is-right { right: 62px; width: calc((100% - 1100px) / 2 + 10px - 62px); }

  .mdoodle {
    position: absolute;
    width: min(100%, var(--size));
    left: calc(var(--fx) * (100% - min(100%, var(--size))));
    transform: rotate(var(--rot));
    opacity: 0.85;
  }
  .mdoodle svg { display: block; width: 100%; height: auto; overflow: visible; }
  .mdoodle .ink {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mdoodle .dot { fill: currentColor; }
  .mdoodle .hl { fill: #f9e27d; opacity: 0.75; }
  .is-red { color: #d64545; }

  /* the first visit: the pen traces each stroke, then colours in */
  .mdoodle.is-drawing .ink {
    stroke-dasharray: 1 1;
    stroke-dashoffset: 1;
    animation: pen-stroke 0.9s ease-in-out var(--dd) forwards;
  }
  .mdoodle.is-drawing .dot,
  .mdoodle.is-drawing .hl {
    opacity: 0;
    animation: pen-fill 0.3s ease calc(var(--dd) + 0.7s) forwards;
  }
  .mdoodle.is-drawing .hl { --fill-to: 0.75; }
}

@keyframes pen-stroke { to { stroke-dashoffset: 0; } }
@keyframes pen-fill { to { opacity: var(--fill-to, 1); } }

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 24px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 12px 0; }
  .nav-links .btn-nav { text-align: center; margin-top: 8px; }
  .nav-links a[aria-current="page"]::before { content: "\2022  "; color: var(--accent); }
  .nav-links .nav-frog { display: none; }

  .page-inner { padding: calc(var(--header-h) + 36px) 0 64px; }
  .home-hero { padding: calc(var(--header-h) + 32px) 0 56px; }
  .mail-drop { margin-top: 48px; }
  .mail-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    justify-items: center;
    text-align: center;
    padding: 14px 18px 22px;
  }
  .mail-scene { width: 100%; max-width: 220px; }
  .mail-stamp { width: 44px; height: 50px; top: -12px; right: -10px; }
  .mail-stamp img { width: 30px; }

  .page-head,
  .home-grid,
  .mission,
  .feature { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .page-head .scene-card,
  .home-grid .scene-card { width: 100%; max-width: 440px; margin: 0 auto; }
  .mission-photos { width: 100%; max-width: 480px; margin: 0 auto; }

  .block { margin-top: 64px; }

  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid,
  .program-grid,
  .event-grid { grid-template-columns: minmax(0, 1fr); }
  .leapshot-card { flex-direction: column; align-items: flex-start; }
  .polaroids { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .logo-wall { gap: 14px; }
  .logo-tile { flex-basis: calc(50% - 7px); height: 96px; padding: 14px 18px; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  .stat-value { font-size: 2.2rem; }
  .event-photos { height: 230px; }
  .team-grid { grid-template-columns: minmax(0, 1fr); }
  .feature { padding: 18px; }
  .leapshot-card { padding: 26px 22px; }
}

@media (max-width: 480px) {
  .tile-grid { grid-template-columns: minmax(0, 1fr); }
  .tile img { aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  .js .page.is-active { animation: none; }
  .page.is-active .mark { animation: none; }
  .btn, .tile, .mail-drop, .polaroid, .logo-tile, .tabs a { transition: none; }
  .tw { animation: none; }
}
