:root {
  --lemon: #f7dd63;
  --lemon-soft: #fff6cd;
  --ink: #2d2d2d;
  --orange: #f59f00;
  --card: #ffffff;
  --aid: #eb3728;
  --nav: #f3c302;
  --mint: #e5f5e6;
  --navy: #143b6d;
  --font-hand: "Patrick Hand", "Segoe Print", "Comic Sans MS", cursive;
}

* {
  box-sizing: border-box;
}

/* CSS-level fallback so scrolling still animates if script.js fails to load
   or someone arrives on a #section deep link directly */
html {
  scroll-behavior: smooth;
}

/* links and buttons carry cursor:pointer from the UA stylesheet, so they need
   the lemon set explicitly or they fall back to the system hand */
a,
button,
summary,
[role="button"] {
  cursor: url("images/cursor-lemon.png") 6 6, pointer;
}

/* text stays selectable-looking where it is actually selectable */
input,
textarea {
  cursor: url("images/cursor-lemon.png") 6 6, text;
}

body {
  /* lemon cursor; the trailing keyword is the required fallback */
  cursor: url("images/cursor-lemon.png") 6 6, auto;
  margin: 0;
  font-family: var(--font-hand);
  color: var(--ink);
  background: #fffdf2;
  /* Patrick Hand runs small for its size, so nudge the base up. */
  font-size: 1.08rem;
  line-height: 1.6;
}

/* Yellow nav band: floats above the page, hides on scroll up. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--nav);
  padding: 1.1rem clamp(1rem, 4vw, 3.2rem);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.topbar.is-stuck {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.16);
}

.topbar.is-hidden {
  transform: translateY(-100%);
}

/* Anchor targets clear the floating bar instead of hiding under it. */
.section,
.footer,
.hero {
  scroll-margin-top: 4.5rem;
}

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

  .topbar,
  .founders,
  .story-image,
  .hero-mascot,
  .join-mascot,
  .card-mascot,
  .footer-mascot,
  .team-sticker,
  .brand,
  .nav-links a,
  .join-card a,
  .footer a,
  .event-map iframe,
  .face,
  .btn-partners,
  .work-photo-shadow {
    transition: none;
  }

  .founders:hover,
  .story-image:hover,
  .hero-mascot:hover,
  .join-mascot:hover,
  .card-mascot:hover,
  .footer-mascot:hover,
  .brand:hover,
  .nav-links a:hover,
  .join-card a:hover,
  .footer a:hover,
  .event-map iframe:hover,
  .face:hover,
  .btn-partners:hover,
  .work-photo-shadow:hover {
    transform: none;
  }

  /* keep the sticker straddling the photo edge; only drop the scale */
  .team-sticker:hover {
    transform: translateY(var(--lift));
  }
}

/* Photo hero: the images carry the section, no yellow over them. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 72vh;
  background: #1c1c1c;
  color: #fff;
  padding: clamp(3rem, 12vw, 8rem) clamp(1rem, 4vw, 3.2rem) clamp(2.5rem, 7vw, 4.5rem);
}

/* Rotating photo backdrop: four slides crossfading on a 5s beat. */
.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: hero-fade 20s infinite;
}

.hero-slide:nth-child(1) {
  animation-delay: 0s;
}
.hero-slide:nth-child(2) {
  animation-delay: 5s;
}
.hero-slide:nth-child(3) {
  animation-delay: 10s;
}
.hero-slide:nth-child(4) {
  animation-delay: 15s;
}

@keyframes hero-fade {
  0% {
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  25% {
    opacity: 1;
  }
  29% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* Just enough shading under the text to keep it readable on any photo. */
.hero-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0.12) 100%
  );
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    animation: none;
  }

  .hero-slide:nth-child(1) {
    opacity: 1;
  }
}

.brand {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: #4b4b4b;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--ink);
}

/* Same lift as the images, adapted for text: box-shadow would draw a rectangle
   around the words, so the glyphs get a text-shadow instead. */
.brand,
.nav-links a,
.join-card a,
.footer a {
  display: inline-block;
  transition: transform 0.25s ease, text-shadow 0.25s ease;
}

.brand:hover,
.nav-links a:hover,
.join-card a:hover,
.footer a:hover {
  transform: scale(1.04);
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* left-anchored links keep their left edge put while scaling */
.brand,
.join-card a,
.footer a {
  transform-origin: left center;
}

/* Sits inline at the end of the headline, standing on the text baseline. */
.hero-mascot {
  height: 1.3em;
  width: auto;
  /* drops it slightly below the baseline so it sits into the line */
  vertical-align: -0.16em;
  margin-left: 0.12em;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.hero-mascot:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
}

.hero-content {
  /* flex items default to min-width:auto, which stops the headline wrapping */
  min-width: 0;
  /* wide enough for the headline plus the inline mascot */
  max-width: 940px;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.hero-content p {
  /* the prose keeps its own comfortable measure */
  max-width: 760px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

/* keeps the mascot from ever being orphaned from "Project" */
.nowrap {
  white-space: nowrap;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

h1,
h2,
h3 {
  font-family: var(--font-hand);
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 8vw, 5.2rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.7rem, 5vw, 3rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

.section {
  padding: clamp(2rem, 8vw, 5rem) clamp(1rem, 4vw, 3.2rem);
}

.section-alt {
  background: var(--lemon-soft);
}

/* Our Story: illustration on the left, centered against the text beside it. */
#story {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3.5rem);
}

.story-image {
  flex: none;
  width: clamp(195px, 26vw, 400px);
  height: auto;
  /* transparent PNG, so the shadow traces the artwork instead of a box */
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.story-image:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.38));
}

.story-body {
  flex: 1;
  min-width: 0;
}

/* Our Story runs right-aligned: heading centered over the text block below it. */
#story h2 {
  max-width: 980px;
  margin-left: auto;
  text-align: center;
}

.text-columns {
  /* the block sits against the right edge of the section */
  max-width: 980px;
  margin-left: auto;
  columns: 2 300px;
  column-gap: 2rem;
}

.text-columns p {
  margin-top: 0;
}

.aid {
  color: var(--aid);
}

/* Patrick Hand has one weight, so faux-bold barely reads — give strong a tint. */
strong {
  color: #8a5a00;
}

/* Sign-off: the signature with the founders portrait beside it. */
.signoff {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.4vw, 1.1rem);
  break-inside: avoid;
}

.signoff .signature {
  margin: 0;
}

/* Founders portrait, circular, inline next to the signature. */
.founders {
  --size: clamp(115px, 12vw, 170px);
  flex: none;
  display: block;
  margin: 0;
  /* width and height both set, so the circle can never go oval */
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 4px solid var(--card);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.founders:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

.signature {
  font-style: italic;
  font-weight: 500;
}

.names {
  display: inline-block;
  font-family: "Dancing Script", "Snell Roundhand", cursive;
  font-style: normal;
  font-weight: 600;
  font-size: 1.55em;
  line-height: 1.25;
}

/* heading centered over the event card below it */
#events h2 {
  max-width: 760px;
  text-align: center;
}

.event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 6vw, 5rem);
  /* map sits centered against the heading-plus-card block beside it */
  align-items: center;
}

/* map runs out to the right edge of the section */
.event-map {
  justify-self: end;
  width: 100%;
}

.event-map iframe {
  display: block;
  width: 100%;
  height: clamp(240px, 26vw, 320px);
  border: 4px solid var(--orange);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.event-map iframe:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
}

/* chai lemon perched on the card's bottom-right corner */
.card-mascot {
  position: absolute;
  right: clamp(-30px, -2vw, -10px);
  bottom: -14px;
  width: clamp(76px, 8.5vw, 110px);
  height: auto;
  /* transparent PNG, so the shadow traces the artwork instead of a box */
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.card-mascot:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.38));
}

.event-card {
  position: relative;
  max-width: 760px;
  background: var(--card);
  border-left: 10px solid var(--orange);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.event-card ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.lead {
  max-width: 900px;
}

/* holds the clipPath definition only; never rendered */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
}

.work-layout {
  display: grid;
  /* photo on the left, heading and card on the right */
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  /* the whole group sits centered in the section */
  max-width: 1180px;
  margin-inline: auto;
}

/* A clip-path cuts away border and box-shadow, and it is applied AFTER filter --
   so the shadow has to live on an unclipped parent or it gets clipped away too.
   The white rim comes from the clipped frame's background showing through its
   padding, since a real border would be clipped off as well. */
.work-photo-col {
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: clamp(210px, 27vw, 380px);
}

.work-caption {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #4b4b4b;
}

.work-photo-shadow {
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.work-photo-shadow:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.38));
}

.work-photo-frame {
  /* square box so the scalloped clip stays regular rather than stretching */
  width: clamp(210px, 26vw, 360px);
  height: clamp(210px, 26vw, 360px);
  padding: 6px;
  background: var(--card);
  clip-path: url(#petal-clip);
}

.work-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: url(#petal-clip);
}



/* heading centered over the card below it */
#work h2 {
  max-width: 900px;
  text-align: center;
}

.work-card {
  max-width: 900px;
  background: var(--mint);
  border-radius: 16px;
  padding: clamp(1.1rem, 2.6vw, 1.9rem) clamp(1.2rem, 3vw, 2.2rem);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.work-card .lead {
  max-width: none;
}

.work-card p:last-child {
  margin-bottom: 0;
}

.btn-partners {
  /* sits below the card, centered under it; max-content keeps the border
     hugging the label now that this is a link rather than a button */
  display: block;
  width: max-content;
  text-decoration: none;
  margin: 1.6rem auto 0;
  padding: 0.6rem 1.5rem;
  font: inherit;
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: url("images/cursor-lemon.png") 6 6, pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-partners:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.stats article {
  /* content sits centered in the card, both axes */
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: var(--card);
  border-radius: 16px;
  padding: 1.4rem 1.1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

/* zero every paragraph margin so the only spacing is the number's own,
   giving an identical gap above and below it */
.stats article p {
  margin: 0;
}

.stat-number {
  margin: 0.55rem 0;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-family: var(--font-hand);
  color: #b67d00;
}

/* heading centered over the cards below it */
#join h2 {
  text-align: center;
}

.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  /* cards line up along the bottom so the mascot can perch above the first */
  align-items: end;
}

.join-col {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.join-mascot {
  align-self: center;
  width: clamp(96px, 11vw, 140px);
  height: auto;
  /* transparent PNG, so the shadow traces the artwork instead of a box */
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.join-mascot:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.38));
}

.join-card {
  background: #fff;
  border: 2px solid #ffe07d;
  border-radius: 14px;
  padding: 1rem;
}

.join-card a {
  color: #875700;
  font-weight: 700;
}

/* --- Board of Directors page --- */
.page-team {
  background: var(--navy);
  color: #fffdf2;
}

.team-main {
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 3.2rem)
    clamp(3rem, 8vw, 5rem);
  text-align: center;
}

.team-title,
.page-title {
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  font-size: clamp(2rem, 6vw, 3.6rem);
}

.team-title {
  color: #fffdf2;
}

/* --- Current Partners page --- */
.page-partners {
  background: linear-gradient(90deg, #ffe3a2 0%, #ffd7af 100%);
  min-height: 100vh;
  color: var(--ink);
}

.partners-main {
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 3.2rem)
    clamp(3rem, 8vw, 5rem);
  text-align: center;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
  /* pulled in from the section edges; cards scale down to fit */
  max-width: 880px;
  margin: 0 auto;
}

.partner-card {
  margin: 0;
}

.partner-card img {
  display: block;
  width: 100%;
  /* the height attribute is a presentation hint; aspect-ratio only wins
     once height is auto */
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.partner-card img:hover {
  transform: scale(1.03);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

.partner-name {
  margin: 1rem 0 0.35rem;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}

/* pin sits on the text baseline next to the place name */
.partner-place {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
}

.pin {
  flex: none;
  color: var(--aid);
}

@media (max-width: 620px) {
  .partner-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

.team-photo-wrap {
  position: relative;
  width: min(100%, 940px);
  /* room for the stickers that hang below the photo */
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}

.team-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Straddle the photo's bottom edge; --lift sets how far each sticker hangs
   below it, and is reused by the hover and reduced-motion rules. */
.team-sticker {
  --lift: 8%;
  position: absolute;
  bottom: 0;
  height: auto;
  transform: translateY(var(--lift));
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
  transition: transform 0.25s ease, filter 0.25s ease;
}

/* The two source images have different proportions (207x260 vs 239x230), so
   the widths differ to make the lemons render at the same height. */
.sticker-wave {
  width: clamp(80px, 11vw, 140px);
  right: clamp(52px, 8.5vw, 112px);
}

.sticker-kit {
  width: clamp(104px, 14.3vw, 183px);
  /* hangs past the photo's right edge; the -4vw term keeps the overhang small
     on narrow screens so it never pushes past the viewport */
  right: clamp(-70px, -4vw, -10px);
}

.team-sticker:hover {
  transform: translateY(var(--lift)) scale(1.06);
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.55));
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 620px;
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
}

.team-member {
  margin: 0;
  text-align: center;
}

/* Small square window; the portrait is scaled up inside it and offset so the
   face lands in the middle. --w/--x/--y are set per person in the markup. */
.face {
  position: relative;
  width: clamp(140px, 19vw, 200px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.face img {
  position: absolute;
  display: block;
  width: var(--w, 190%);
  /* never let the background show through if an offset is mistuned */
  min-width: 100%;
  min-height: 100%;
  left: var(--x, -45%);
  top: var(--y, -10%);
}

.face:hover {
  transform: scale(1.03);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.member-name {
  margin: 0.9rem 0 0.15rem;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.member-role {
  margin: 0;
  color: #b9cbe4;
}

@media (max-width: 620px) {
  .team-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
  }
}

/* lemon sits beside the two contact lines, centred against just those */
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 2vw, 1.4rem);
  flex-wrap: wrap;
}

.footer-text p {
  margin: 0.35rem 0;
}

.footer-mascot {
  flex: none;
  width: clamp(78px, 9vw, 118px);
  height: auto;
  /* transparent PNG, so the shadow traces the artwork instead of a box */
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.footer-mascot:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.38));
}

.footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  background: #fff1aa;
}

.footer a {
  color: #5b4300;
  /* inline-flex so the icon and text share a baseline and a gap */
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* icons inherit the link colour, so they follow it on hover too */
.icon {
  flex: none;
}

@media (max-width: 760px) {
  .hero {
    min-height: 62vh;
  }

  .text-columns {
    columns: 1;
  }

  .event-layout,
  .work-layout {
    grid-template-columns: 1fr;
  }

  .work-photo-col {
    justify-self: center;
  }

  #story {
    flex-direction: column;
    align-items: center;
  }

  .story-image {
    width: min(260px, 72%);
  }
}
