/* ============================================================
   SDM School — Campus / Ecosystem
   Figma: SDM School Website Final / CAMPUS CULTURE DESIGN (1440 × 15804)
   Shared tokens, header, pills, arrows, CTA and footer live in styles.css.

   --u is one design pixel: 1px on the 1440 frame, scaling down with the
   screen. Positions and the big vertical gaps use it so the layout keeps
   the frame's proportions; text sizes use clamp() so copy stays legible.
   ============================================================ */

.page-campus {
  --nav-ink: #3934c9;                       /* the Campus frame sets its menu in blue */
  --u: calc(min(100vw, 1440px) / 1440);
  --c-grey: #606060;
  --c-red: #e34c39;
  --c-violet: #3934c9;
}

/* Clouds, photos and line art run past the frame on purpose. */
.page-campus main { overflow-x: clip; }

.c-lede {
  margin: 10px auto 0;
  font-size: var(--fs-lede);
  color: var(--c-grey);
  text-align: center;
}
.c-lede--narrow { max-width: 485px; }
.c-lede--wins { max-width: 578px; }

/* Photos in the Beyond / Cabinet blocks: soft corners and a lift. */
.c-photo {
  display: block;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.35);
}

/* Faint line art that sweeps behind several sections. */
.c-lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.c-line {
  position: absolute;
  left: calc(50% + (var(--x) - 720) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  max-width: none;
  height: auto;
  transform: rotate(var(--r, 0deg));
}

/* ============================================================
   Hero — the atrium, headline across its middle floor
   ============================================================ */
.c-hero {
  position: relative;
  padding-top: var(--hero-gap);   /* clears the header bar */
}
.c-hero-img {
  width: 100%;
  aspect-ratio: 1440 / 1067;
  object-fit: cover;
}
.c-hero-title {
  position: absolute;
  left: 0;
  right: 0;
  /* 299px down the full-width 1440 × 1067 photo, below the header gap */
  top: calc(var(--hero-gap) + 100vw * 299 / 1440);
  transform: translateY(-50%);
  padding-inline: 20px;
  font-size: var(--fs-title);
  line-height: 1.15;
  color: var(--c-red);
  text-align: center;
}

/* ============================================================
   More than a place to learn — pale blue band, wave below
   ============================================================ */
.c-values {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(208, 223, 246, 0.8);
  padding: calc(115 * var(--u)) 0 max(96px, calc(278 * var(--u)));
  text-align: center;
}
.c-values-inner { position: relative; z-index: 1; }

.c-value-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1280px;
  margin: max(16px, calc(65 * var(--u))) auto 0;
  padding-inline: 20px;
  column-gap: 24px;
}
.c-value-list h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--blue);
}
.c-value-list p {
  max-width: 205px;
  margin: 9px auto 0;
  font-size: var(--fs-caption);
  color: var(--c-grey);
}

.c-pill-orange {
  margin-top: max(16px, calc(74 * var(--u)));
  min-width: min(257px, 100%);
  min-height: 58px;
  padding: 12px 28px;
  font-size: var(--fs-body-sm);
  background: var(--tangerine);
}
.c-pill-orange:hover { background: #d95f20; }

/* The white wave that closes the band (Figma: rotated 174.33°, flipped). */
.c-values-wave {
  position: absolute;
  left: -25.83%;
  bottom: calc(-726.6 * var(--u));
  width: 136.88%;
  max-width: none;
  height: auto;
  z-index: 0;
  rotate: 174.33deg;
  scale: 1 -1;
  pointer-events: none;
}

.c-confetti {
  position: absolute;
  z-index: 1;
  height: auto;
  pointer-events: none;
}
.c-confetti--1 { left: calc(45 * var(--u)); top: calc(124 * var(--u)); width: calc(37 * var(--u)); opacity: 0.31; transform: rotate(26.24deg); }
.c-confetti--2 { left: calc(1367 * var(--u)); top: calc(285 * var(--u)); width: calc(49 * var(--u)); opacity: 0.51; transform: rotate(-97.56deg); }
.c-confetti--3 { left: calc(315 * var(--u)); bottom: calc(205 * var(--u)); width: calc(33 * var(--u)); opacity: 0.41; transform: rotate(17.9deg); }

/* ============================================================
   Moments that matter — four daily rituals
   ============================================================ */
.c-moments { padding: calc(11 * var(--u)) 0 calc(31 * var(--u)); }

.c-moment-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1160px;
  margin: max(16px, calc(72 * var(--u))) auto 0;
  padding-inline: 20px;
  text-align: center;
}
.c-moment-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.c-moment-list img {
  height: clamp(80px, 8.4vw, 121px);
  width: auto;
  margin-bottom: clamp(16px, 2.36vw, 34px);
  transition: transform 0.6s var(--ease-out);
}
.c-moment-list li:hover img { transform: translateY(-6px); }
.c-moment-list h3 {
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: 1.22;
  color: var(--c-grey);
}
.c-moment-list p {
  margin-top: 8px;
  font-size: var(--fs-caption);
  color: var(--c-grey);
}

/* ============================================================
   Houses → clubs → cabinet share one sweep of line art
   ============================================================ */
.c-mid { position: relative; isolation: isolate; }

/* Five houses, one HEART */
.c-houses {
  padding-top: calc(69 * var(--u));
  text-align: center;
}
.c-houses-character {
  width: clamp(130px, 13.4vw, 193px);
  height: auto;
  margin-inline: auto;
  transform: scaleX(-1);       /* Figma flips the character to face right */
}
.c-houses-title {
  position: relative;
  margin-top: calc(-40 * var(--u));
  font-size: var(--fs-title);
  font-weight: 700;
  line-height: 1.22;
  color: var(--navy);
}
.c-heart { font-size: 1.067em; font-weight: 400; }

.h-h { color: var(--pink); }
.h-e { color: var(--tangerine); }
.h-a { color: var(--navy); }
.h-a2 { color: var(--c-violet); }
.h-r { color: var(--c-red); }
.h-t { color: var(--blue); }

.c-house-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  row-gap: calc(40 * var(--u));
  width: calc(840 * var(--u));
  min-width: min(560px, 100%);
  margin: calc(69 * var(--u)) auto 0;
  font-size: clamp(24px, 2.57vw, 37px);
  color: var(--c-grey);
}
.c-house-list li { grid-column: span 2; }
.c-house-list li:nth-child(4) { grid-column: 2 / span 2; }
.c-house-list li:nth-child(5) { grid-column: 4 / span 2; }

/* Four clubs, countless ideas */
.c-clubs { padding-top: calc(311 * var(--u)); }

.c-club-list {
  display: grid;
  grid-template-columns: calc(608 * var(--u)) minmax(0, 1fr);
  row-gap: max(8px, calc(18 * var(--u)));
  margin-top: max(16px, calc(89 * var(--u)));
  padding: 0 20px 0 calc(147 * var(--u));
}
.c-club-list li {
  display: grid;
  grid-template-columns: max(72px, calc(122 * var(--u))) minmax(0, 1fr);
  align-items: start;
}
.c-club-list img {
  width: clamp(56px, 6.2vw, 90px);
  height: auto;
}
.c-club-list h3 {
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--pink);
}
.c-club-list p {
  max-width: 474px;
  margin-top: 6px;
  font-size: var(--fs-lede);
  color: var(--c-grey);
}
.c-club-list li:nth-child(odd) p { max-width: 387px; }

/* One cabinet, one collective */
.c-cabinet { padding-top: max(24px, calc(170 * var(--u))); }
.c-cabinet-inner {
  display: grid;
  grid-template-columns: calc(590 * var(--u)) calc(509 * var(--u));
  align-items: center;
  padding-left: calc(168 * var(--u));
}
.c-cabinet-copy { padding-right: 24px; }
.c-cabinet-copy h2 {
  font-size: var(--fs-title);
  line-height: 1.15;
  color: var(--pink);
}
.c-cabinet-copy p {
  max-width: 430px;
  margin-top: 22px;
  font-size: var(--fs-lede);
  color: var(--c-grey);
}
.c-cabinet-img { width: 100%; aspect-ratio: 1; }

/* ============================================================
   Beyond the classroom — photo on a cloud, title beside it
   ============================================================ */
.c-beyond {
  position: relative;
  isolation: isolate;
  padding-top: max(64px, calc(278 * var(--u)));
}

/* Each programme is laid out on its own slice of the 1440 frame:
   --h is the slice's height, and every child is placed in --u. */
.c-prog {
  position: relative;
  height: calc(var(--h) * var(--u));
}
.c-prog > * { position: absolute; }
.c-cloud {
  z-index: -1;
  max-width: none;
  height: auto;
  pointer-events: none;
  /* campus.js sets --cloud-s from the programme's scroll position: the
     bubble grows as it nears the middle of the screen. Hover adds a bit. */
  scale: var(--cloud-s, 1);
  transition: scale 0.7s var(--ease-out);
}
@media (hover: hover) {
  .c-prog:hover .c-cloud { scale: calc(var(--cloud-s, 1) * 1.08); }
}
.c-prog-img {
  width: calc(615 * var(--u));
  aspect-ratio: 1;
}
.c-prog-copy { width: calc(575 * var(--u)); }
.c-prog-copy h3 {
  font-size: var(--fs-title-xl);
  line-height: 1.06;
  color: var(--c-red);
}
.c-prog-copy p {
  max-width: 438px;
  margin-top: calc(10 * var(--u));
  font-size: var(--fs-lede);
  color: var(--c-grey);
}
/* Blue rows (Edusports, Accolades): cloud left, copy right-aligned. */
.c-prog--flip .c-prog-copy { text-align: right; }
.c-prog--flip .c-prog-copy h3 { line-height: 1.18; color: var(--navy); }
.c-prog--flip .c-prog-copy p { margin-left: auto; color: var(--navy); }

.c-prog--spark { --h: 857; margin-top: calc(-11 * var(--u)); }
.c-prog--spark .c-cloud   { left: calc(514 * var(--u)); top: 0; width: calc(860.3 * var(--u)); }
.c-prog--spark .c-prog-img { left: calc(168 * var(--u)); top: calc(147 * var(--u)); }
.c-prog--spark .c-prog-copy { left: calc(824 * var(--u)); top: calc(344 * var(--u)); }
.c-prog--spark .c-prog-copy p { max-width: 387px; }

.c-prog--sports { --h: 662; margin-top: calc(190 * var(--u)); }
.c-prog--sports .c-cloud   { left: calc(64 * var(--u)); top: 0; width: calc(760.3 * var(--u)); }
.c-prog--sports .c-prog-img { left: calc(599 * var(--u)); top: calc(47 * var(--u)); }
.c-prog--sports .c-prog-copy { right: calc(882 * var(--u)); top: calc(279 * var(--u)); }
.c-prog--sports .c-prog-copy p { max-width: 387px; }

.c-prog--beaford { --h: 947; margin-top: calc(146 * var(--u)); }
.c-prog--beaford .c-cloud   { left: calc(514 * var(--u)); top: 0; width: calc(955.7 * var(--u)); }
.c-prog--beaford .c-prog-img { left: calc(166 * var(--u)); top: calc(206 * var(--u)); width: calc(617 * var(--u)); }
.c-prog--beaford .c-prog-copy { left: calc(824 * var(--u)); top: calc(412 * var(--u)); }
.c-prog--beaford .c-prog-copy p { color: #e24c38; }

.c-prog--accolades { --h: 662; margin-top: calc(146 * var(--u)); }
.c-prog--accolades .c-cloud   { left: calc(93 * var(--u)); top: 0; width: calc(760.3 * var(--u)); }
.c-prog--accolades .c-prog-img { left: calc(628 * var(--u)); top: calc(47 * var(--u)); }
.c-prog--accolades .c-prog-copy { right: calc(853 * var(--u)); top: calc(279 * var(--u)); }
.c-prog--accolades .c-prog-copy p { max-width: 245px; margin-top: 0; }

/* ============================================================
   A space for every possibility — zig-zag of rooms
   ============================================================ */
.c-spaces { padding-top: max(24px, calc(318 * var(--u))); }

.c-spaces-title {
  padding-left: calc(149 * var(--u));
  padding-right: 20px;
  font-size: var(--fs-title);
  line-height: 1.15;
  color: var(--blue);
}

.c-space-list { margin-top: max(12px, calc(101 * var(--u))); }
.c-space {
  display: flex;
  align-items: flex-end;
  gap: calc(var(--gap) * var(--u));
  padding-left: calc(var(--x) * var(--u));
}
.c-space + .c-space { margin-top: calc(var(--above) * var(--u)); }
.c-space img {
  flex: none;
  width: calc(449 * var(--u));
  aspect-ratio: 449 / 343;
  object-fit: cover;
  border-radius: calc(32 * var(--u));
  transition: transform 0.6s var(--ease-out);
}
.c-space:hover img { transform: translateY(-6px) rotate(-1deg); }

.c-space-name {
  margin-bottom: calc(var(--lift, 0) * var(--u));
  font-size: clamp(24px, 3.82vw, 55px);
  font-weight: 600;
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.c-space-name--lg { font-size: clamp(28px, 4.44vw, 64px); }
.c-space-name--pink { color: var(--pink); }
.c-space-name--red  { color: #e24c38; }
.c-space-name--blue { color: var(--navy); }

.c-space--amphi { --x: 149; --gap: 31; --lift: -8; }
.c-space--music { --x: 544; --gap: 40; --lift: 25; --above: 284; }
.c-space--gym   { --x: 0;   --gap: 87; --above: 250; }
.c-space--innov { --x: 572; --gap: 40; --above: 304; }
.c-space--art   { --x: 96;  --gap: 60; --lift: -9; --above: 206; }

/* Gymkhana sits on the right with its name to the left. */
.c-space--flip {
  flex-direction: row-reverse;
  justify-content: flex-start;
  padding-right: calc(51 * var(--u));
}

/* ============================================================
   Pivot · Peak · Play — the whole school, full bleed
   ============================================================ */
.c-ppp {
  display: block;
  width: 100%;
  height: auto;
  margin-top: max(24px, calc(292 * var(--u)));
  aspect-ratio: 1440 / 877;
  object-fit: cover;
  /* The Figma frame's curved bottom edge: its mask shape sits 323px left
     of the frame and runs 1891px wide, full height. Inlined (from
     assets/figma/campus/ppp-mask.svg): browsers refuse an external SVG
     mask from another origin, including file://. */
  --ppp-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1891.16 876.635' preserveAspectRatio='none'><path d='M1866 0H172.16C42.2439 352.8 -139.638 1016.78 172.16 850.321C561.907 642.243 798.635 610.198 1136.16 645C1441.66 676.5 1632.16 847 1891.16 741L1866 0Z'/></svg>");
  -webkit-mask: var(--ppp-mask) -22.43vw 0 / 131.33% 100% no-repeat;
          mask: var(--ppp-mask) -22.43vw 0 / 131.33% 100% no-repeat;
}

/* ============================================================
   Celebrating everyday wins — three photo carousels
   ============================================================ */
.c-wins { padding-bottom: calc(235 * var(--u)); }

.c-win {
  position: relative;
  width: calc(878 * var(--u));
  margin-left: calc(375 * var(--u));
}
.c-win--play  { margin-top: max(16px, calc(184 * var(--u))); }
.c-win--peak  { margin-top: max(16px, calc(229 * var(--u))); }
.c-win--pivot { margin-top: max(16px, calc(176 * var(--u))); }

.c-win-label {
  position: absolute;
  left: calc(-226 * var(--u));
  top: calc(var(--label-y) * var(--u));
  transform: translateY(-50%);
  font-size: clamp(48px, 6.67vw, 96px);
  line-height: 1;
}
.c-win--play  .c-win-label { --label-y: 104; color: var(--c-red); }
.c-win--peak  .c-win-label { --label-y: -1;  color: var(--c-violet); }
.c-win--pivot .c-win-label { --label-y: -14; color: var(--pink); }

.c-win-stage { position: relative; }
.c-win-slides {
  position: relative;
  aspect-ratio: 878 / 470;
  overflow: hidden;
  border-radius: calc(32 * var(--u) + 4px);
  background: #fdfcfd;
}
.c-win-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.c-win-slides img.is-active { opacity: 1; }

.c-win-stage .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.c-win-stage .arrow:hover { transform: translateY(-50%) scale(1.08); }
.c-win-stage .arrow--prev { left: calc(-80 * var(--u) - 6px); }
.c-win-stage .arrow--next { right: calc(-61 * var(--u) - 6px); }

/* ============================================================
   Discover more — the shared CTA, on the About wave
   ============================================================ */
.join--campus {
  margin-top: 0;
  padding: 145px 20px 106px;
}
.join--campus::before {
  left: -33.3%;
  width: 172.8%;
  --join-wave: url('../assets/figma/about/cta-wave.svg');
}
.join--campus .join-copyright { top: 120px; }

.join-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 92px;
  margin-top: 33px;
}
.join-btn {
  min-width: 160px;
  min-height: 53px;
  padding: 12px 22px;
  font-size: var(--fs-ui);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px) {
  /* Carousels: name above the photo, arrows over its edges. */
  .c-win { width: auto; margin-inline: 20px; }
  .c-win-label {
    position: static;
    transform: none;
    margin-bottom: 14px;
  }
  .c-win-stage .arrow--prev { left: 10px; }
  .c-win-stage .arrow--next { right: 10px; }

  .join-actions { column-gap: 20px; }

  /* The CTA wave scales with the width here (styles.css); start the
     copy on its solid fill. */
  .join--campus { padding-top: calc(var(--join-fill) + 24px); }
}

@media (max-width: 760px) {
  .c-lines,
  .c-confetti,
  .c-cloud { display: none; }

  .c-br { display: none; }

  /* Hero: on phones the title sits above the photo; over the atrium's
     busy railings it was hard to read. */
  .c-hero { display: flex; flex-direction: column; padding-top: var(--hero-gap-phone); }
  .c-hero-title {
    position: static;
    order: -1;
    transform: none;
    padding: 4px 20px 18px;
  }

  .c-value-list,
  .c-moment-list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }

  .c-house-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 28px;
    width: auto;
    min-width: 0;
    padding-inline: 20px;
  }

  .c-clubs { padding-top: 96px; }
  .c-club-list {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 28px;
    max-width: 480px;
    margin-inline: auto;
    padding: 0 20px;
  }
  .c-club-list li { grid-template-columns: 72px minmax(0, 1fr); }

  .c-cabinet { padding-top: 72px; }
  .c-cabinet-inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 28px;
    max-width: 480px;
    margin-inline: auto;
    padding: 0 20px;
    text-align: center;
  }
  .c-cabinet-copy { padding-right: 0; }
  .c-cabinet-copy p { margin-inline: auto; }

  /* Programmes stack: photo, then its title and line, centred. */
  .c-beyond { padding-top: 96px; }
  .c-prog,
  .c-prog--spark, .c-prog--sports, .c-prog--beaford, .c-prog--accolades {
    height: auto;
    max-width: 480px;
    margin: 56px auto 0;
    padding-inline: 20px;
  }
  .c-prog > * { position: static; }
  .c-prog .c-prog-img { width: 100%; }
  .c-prog .c-prog-copy,
  .c-prog--flip .c-prog-copy {
    width: auto;
    margin-top: 20px;
    text-align: center;
  }
  .c-prog .c-prog-copy p { max-width: none; margin: 8px auto 0; }

  /* Rooms stack: photo with its name beneath. */
  .c-spaces { padding-top: 96px; }
  .c-spaces-title { padding-left: 20px; text-align: center; }
  .c-space-list { max-width: 480px; margin: 32px auto 0; padding-inline: 20px; }
  .c-space,
  .c-space--flip {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0;
  }
  .c-space + .c-space { margin-top: 40px; }
  .c-space img { width: 100%; border-radius: 20px; }
  .c-space-name { margin-bottom: 0; }
  .c-space-name br { display: none; }

  .c-ppp { margin-top: 96px; }
  .c-win--play, .c-win--peak, .c-win--pivot { margin-top: 56px; }
  .c-wins { padding-bottom: 72px; }
}

@media (max-width: 420px) {
  .c-value-list { column-gap: 12px; }
  .c-moment-list { column-gap: 8px; }
}
