/* Home (index.html) page styles (assets/css/home.css). Scoped with body.page-home.
   Colours come from the main.css tokens only. Sections, in page order:
     1  Hero (split: text + framed ICT photo + crest; trust facts use .page-hero__meta)
     2  At a glance (impact stats card over the hero edge)
     3  Our story (text + collage: assembly video loop, nursery photo, motto badge)
     4  Needs / 5 Tiers (extras only)
     6  Break time (3D campus scene)
     7  How to give (steps, pay cards, promise)
     8  Sponsor band (extras only)
   (The old photo strip was removed: every photo already appears higher on the page, and the
   story links point to the full gallery on student-life.html.) */

/* ==========================================================================
   1  Hero
   ========================================================================== */
.page-home .home-hero {
  padding-top: calc(var(--utility-h) + var(--header-h) + clamp(2.25rem, 5vw, 4.25rem));
  padding-bottom: calc(clamp(72px, 8vw, 112px) + 72px);   /* room for the stats card that overlaps by 72px */
}

.page-home .home-hero__inner {
  display: grid;
  gap: clamp(3.25rem, 8vw, 4.5rem);
  align-items: center;
}

@media (min-width: 960px) {
  .page-home .home-hero__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(3rem, 6vw, 6.5rem);
  }
}

.page-home .home-hero__title {
  max-width: 15ch;
  font-size: clamp(2.6rem, 1.45rem + 4.3vw, 5.1rem);
  line-height: 1.02;
}

.page-home .home-hero__lede {
  max-width: 50ch;
  margin-top: 1.6rem;
}

.page-home .home-hero .btn-group {
  margin-top: 2.4rem;
}

/* trust facts under the buttons: the shared .page-hero__meta component (as on Our Needs) */
.page-home .home-hero__meta {
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

/* the photo composition */
.page-home .home-hero__visual {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}

@media (min-width: 960px) {
  .page-home .home-hero__visual {
    justify-self: end;
    margin-inline: 0;
  }
  /* a fold of the uniform check tucked behind the photo */
  .page-home .home-hero__visual::before {
    content: "";
    position: absolute;
    top: -30px;
    left: -34px;
    z-index: 0;
    width: 48%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    background-color: rgba(255, 255, 255, .05);
    background-image:
      linear-gradient(90deg, rgba(227, 218, 164, .26) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .12) 50%, transparent 50%),
      linear-gradient(0deg, rgba(255, 255, 255, .12) 50%, transparent 50%);
    background-size: 56px 14px, 14px 14px, 14px 14px;
    pointer-events: none;
  }
}

.page-home .home-hero__photo {
  position: relative;
  z-index: 1;
}

.page-home .home-hero__photo .photo-frame__media {
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .55);
}

.page-home .home-hero__photo > figcaption {
  color: rgba(250, 247, 240, .74);
}

.page-home .home-hero__crest {
  position: absolute;
  top: -30px;
  right: -22px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(84px, 8vw, 112px);
  aspect-ratio: 1;
  padding: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px var(--gold-500), 0 18px 36px -14px rgba(0, 0, 0, .6);
}

.page-home .home-hero__crest picture,
.page-home .home-story__motto-crest picture {
  display: block;
  width: 100%;
  height: 100%;
}

.page-home .home-hero__crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* very narrow phones: keep the place line on one row */
@media (max-width: 374.98px) {
  .page-home .home-hero .eyebrow {
    gap: .6rem;
    letter-spacing: .12em;
  }
  .page-home .home-hero .eyebrow::before {
    width: 18px;
  }
}

/* tablets and phones: a wider, shorter crop so the ask stays near the fold */
@media (max-width: 959.98px) {
  .page-home .home-hero__visual {
    max-width: none;
    margin-inline: 0;
  }
  .page-home .home-hero__photo .photo-frame__media {
    aspect-ratio: 16 / 10;
  }
  .page-home .home-hero__photo .photo-frame__media img {
    object-position: 50% 68%;
  }
  .page-home .home-hero__crest {
    top: -22px;
    right: -6px;
    width: 76px;
    padding: 5px;
  }
}

@media (max-width: 559.98px) {
  .page-home .home-hero__photo .photo-frame__media {
    aspect-ratio: 4 / 3;
  }
  .page-home .home-hero .btn-group > .btn {
    flex: 1 1 100%;
  }
  /* the three trust facts sit in one row (as on Our Needs) */
  .page-home .home-hero__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    font-size: .75rem;
    line-height: 1.4;
  }
  .page-home .home-hero__meta strong {
    margin-bottom: .2rem;
    font-size: 1.0625rem;
    line-height: 1.2;
  }
  .page-home .home-hero__crest {
    width: 64px;
    top: -18px;
  }
}


/* ==========================================================================
   2  At a glance
   ========================================================================== */
.page-home .home-glance {
  padding-bottom: 0;
}

/* four-column band: "Creche to JHS" stays on one line and sits on the same line as the numbers */
@media (min-width: 900px) {
  .page-home .home-glance .impact-stat__num--text {
    font-size: clamp(1.75rem, 3.6vw - 3px, 2.8rem);
    white-space: nowrap;
    min-height: clamp(2.6rem, 1.7rem + 3vw, 4.5rem);
    align-items: flex-end;
  }
}

@media (max-width: 559.98px) {
  .page-home .home-glance .impact-stat {
    padding: 1.25rem 1rem 1.3rem;
  }
  .page-home .home-glance .impact-stat__num {
    font-size: 2.5rem;
  }
  .page-home .home-glance .impact-stat__num--text {
    font-size: 1.45rem;
    white-space: nowrap;
    min-height: 2.5rem;
    align-items: flex-end;
  }
  .page-home .home-glance .impact-stat__label {
    font-size: .6875rem;
    letter-spacing: .1em;
  }
  .page-home .home-glance .impact-stat__note {
    font-size: .8125rem;
  }
}


/* ==========================================================================
   3  Our story
   ========================================================================== */
.page-home .home-story {
  padding-top: clamp(80px, 10vw, 150px);
}

.page-home .home-story__body {
  margin-top: 1.6rem;
  max-width: 54ch;
}

.page-home .home-story__body > * + * {
  margin-top: 1em;
}

.page-home .home-story__body .lede {
  color: var(--c-heading);
}

.page-home .home-story__mission {
  position: relative;
  max-width: 34ch;
  margin-top: 2rem;
  padding: .2rem 0 .2rem 1.35rem;
  border-left: 2px solid var(--gold-500);
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.08rem + .5vw, 1.45rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--purple-800);
}

.page-home .home-story__mission span {
  display: block;
  margin-bottom: .4rem;
  font-family: var(--font-sans);
  font-size: .6875rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.page-home .home-story__links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2rem;
  margin-top: 2rem;
}

.page-home .home-story__collage {
  padding-bottom: 20%;
}

.page-home .home-story__collage .collage__main {
  width: 78%;
}

.page-home .home-story__collage .collage__inset {
  width: 46%;
}

/* the main frame holds the muted assembly loop (main.css section 52), cropped to the
   same 4:3 frame the photo had so the collage keeps its balance */
.page-home .home-story__video .video-ambient {
  --va-ratio: 4 / 3;
}

/* the inset covers the lower right corner and the motto badge the upper right,
   so the Pause/Play button sits bottom left */
.page-home .home-story__video .video-ambient__toggle {
  right: auto;
  left: .75rem;
}

.page-home .home-story__video-caption {
  display: grid;
  justify-items: start;
  gap: .15rem;
}

.page-home .home-story__video-caption .link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 24px;
  font-weight: 600;
}

.page-home .home-story__video-caption .link i {
  font-size: .85em;
  color: var(--c-accent-icon);
}

/* motto badge: crest + "With God We Are Blessed" */
.page-home .home-story__motto {
  top: 4%;
  right: 0;
  width: min(210px, 30%);
  justify-items: center;
  gap: .35rem;
  padding: 1.1rem .9rem 1.2rem;
  text-align: center;
}

.page-home .home-story__motto-crest {
  display: grid;
  place-items: center;
  width: 64px;
  aspect-ratio: 1;
  margin-bottom: .35rem;
  padding: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--gold-500);
}

.page-home .home-story__motto-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-home .home-story__motto-label {
  font-size: .625rem;
  letter-spacing: .18em;
  color: rgba(250, 247, 240, .74);
}

.page-home .home-story__motto strong {
  font-family: var(--font-serif);
  font-size: clamp(1rem, .9rem + .35vw, 1.2rem);
  font-style: italic;
  line-height: 1.3;
  color: var(--gold-300);
}

@media (max-width: 559.98px) {
  /* the inset overlaps the lower right of the main photo; the caption sits beside it */
  .page-home .home-story__collage {
    min-height: calc((100vw - 2 * var(--gutter)) * .86);
    padding-bottom: 0;
  }
  .page-home .home-story__collage .collage__main {
    width: 86%;
  }
  .page-home .home-story__collage .collage__inset {
    top: calc((100vw - 2 * var(--gutter)) * .5);
    bottom: auto;
    width: 46%;
  }
  .page-home .home-story__motto {
    width: 34%;
    padding: .8rem .5rem .9rem;
  }
  .page-home .home-story__motto-crest {
    width: 44px;
  }
  .page-home .home-story__motto strong {
    font-size: .875rem;
  }
  .page-home .home-story__collage .collage__main > figcaption {
    padding-right: 44%;
  }
}


/* ==========================================================================
   4  Needs (the need cards come from main.css)
   ========================================================================== */
.page-home .home-needs .section-head {
  margin-bottom: clamp(40px, 5vw, 72px);
}


/* ==========================================================================
   5  Tiers: "any amount" row and the school fees note
   ========================================================================== */
.page-home .home-tiers__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .9rem 1.5rem;
  margin-top: clamp(2.25rem, 4vw, 3rem);
  padding: 1.25rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--c-muted);
}

.page-home .home-tiers__more strong {
  color: var(--c-heading);
}

/* phones: compact tier cards (icon beside the amount) so four gifts fit in two screens */
@media (max-width: 559.98px) {
  .page-home .home-tiers .tier-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 1rem;
    align-items: start;
    padding: calc(6px + 1.3rem) 1.25rem 1.25rem;
  }
  .page-home .home-tiers .tier-card__icon {
    grid-row: 1 / span 3;
    width: 2.75rem;
    height: 2.75rem;
    margin: .2rem 0 0;
    font-size: 1rem;
  }
  .page-home .home-tiers .tier-card__amount {
    font-size: 2.2rem;
  }
  .page-home .home-tiers .tier-card__title {
    margin-top: .45rem;
    font-size: 1.15rem;
  }
  .page-home .home-tiers .tier-card__text {
    font-size: .875rem;
  }
  .page-home .home-tiers .tier-card__action {
    grid-column: 1 / -1;
    padding-top: 1.1rem;
  }
}

.page-home .home-tiers__fees {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.25rem;
  font-size: .875rem;
  line-height: 1.55;
  text-align: center;
  color: var(--c-muted);
}

@media (max-width: 559.98px) {
  .page-home .home-tiers__fees {
    justify-content: flex-start;
    text-align: left;
  }
}

.page-home .home-tiers__fees i {
  margin-top: .22rem;
  color: var(--c-accent-icon);
}

.page-home .home-tiers__fees a {
  color: var(--c-link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--c-rule);
  text-underline-offset: .2em;
}


/* ==========================================================================
   6  Break time: the 3D campus scene, framed like a window on purple
   ========================================================================== */
.page-home .home-scene > .gingham--corner {
  top: auto;
  bottom: 0;
  -webkit-mask-image: linear-gradient(45deg, #000 0%, rgba(0, 0, 0, .5) 35%, transparent 70%);
  mask-image: linear-gradient(45deg, #000 0%, rgba(0, 0, 0, .5) 35%, transparent 70%);
}

.page-home .home-scene__figure {
  position: relative;
}

@media (max-width: 767.98px) {
  .page-home .home-scene > .gingham--corner {
    display: none;
  }
}

.page-home .home-scene .campus-scene {
  height: clamp(460px, 72vh, 760px);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 0 1px rgba(224, 181, 64, .45), 0 40px 90px -30px rgba(0, 0, 0, .7);
}

@media (max-width: 640px) {
  .page-home .home-scene .campus-scene {
    height: auto;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
  }
}

/* poster: a real photo of the compound until the model is ready (or if WebGL is missing) */
.page-home .home-scene .campus-scene__poster {
  overflow: hidden;
  background: var(--purple-800);
}

.page-home .home-scene .campus-scene__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}

.page-home .home-scene .campus-scene__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 18, 41, 0) 55%, rgba(31, 18, 41, .45) 100%);
}

.page-home .home-scene__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 1.5rem;
}

.page-home .home-scene__note {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  max-width: 62ch;
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--c-text);
}

.page-home .home-scene__note i {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-top: -.2rem;
  border-radius: 50%;
  background: rgba(224, 181, 64, .16);
  color: var(--gold-300);
  font-size: .85rem;
}

.page-home .home-scene__note a {
  color: var(--gold-300);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(224, 181, 64, .6);
  text-underline-offset: .2em;
  white-space: nowrap;
}

.page-home .home-scene__note a:hover {
  text-decoration-color: var(--gold-300);
}

.page-home .home-scene__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.5rem;
}

.page-home .home-scene .campus-toggle__opt {
  color: rgba(250, 247, 240, .78);
}


/* ==========================================================================
   7  How to give
   ========================================================================== */
.page-home .home-give .steps {
  margin-bottom: clamp(2.75rem, 5vw, 4.5rem);
}

.page-home .home-give__promise {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}


/* ==========================================================================
   8  Sponsor band extras
   ========================================================================== */
.page-home .home-sponsor .sponsor-band__text a {
  color: var(--gold-300);
  text-decoration: underline;
  text-decoration-color: rgba(224, 181, 64, .55);
  text-underline-offset: .2em;
  white-space: nowrap;
}

.page-home .home-sponsor .sponsor-band__text a:hover {
  text-decoration-color: var(--gold-300);
}

.page-home .home-sponsor .icon-list strong {
  display: inline;
  margin-right: .35rem;
  color: #fff;
}

.page-home .home-sponsor .photo-frame > figcaption {
  color: rgba(250, 247, 240, .72);
}

.page-home .home-sponsor .sponsor-band__inner > * {
  min-width: 0;
}

.page-home .home-sponsor .photo-frame__media img {
  object-position: 50% 58%;
}

/* tablets and phones: a landscape crop so the photo does not fill a whole screen */
@media (max-width: 959.98px) {
  .page-home .home-sponsor .sponsor-band__media {
    max-width: 620px;
  }
  .page-home .home-sponsor .photo-frame {
    --pf-ratio: 4 / 3;
  }
  .page-home .home-sponsor .photo-frame__media img {
    object-position: 50% 64%;
  }
}

@media (max-width: 559.98px) {
  .page-home .home-sponsor .btn--lg {
    padding-inline: 1rem;
    letter-spacing: .12em;
    white-space: normal;
  }
}
