/* Pre-Primary page: the site's own navy, royal blue, orange and light blue. */

.pp { background: var(--white); }
.pp--tint { background: var(--cream); }

.pp__head { max-width: 48rem; margin-bottom: clamp(1.75rem, 4vw, 2.5rem); }

.pp__split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2rem clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.pp__split--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }

.pp__lead { margin-top: 1.25rem; font-size: 1.125rem; line-height: 1.8; color: #44516b; }

.pp__photo,
.pp-band__photo {
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--indigo-100);
}

.pp__photo img,
.pp-band__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.pp__photo { aspect-ratio: 4 / 3; }

.pp__tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    padding: 0;
}

.pp-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-top: 4px solid var(--indigo-700);
    border-radius: 1rem;
    background: var(--white);
}

.pp-tile--alt { border-top-color: var(--orange-500); }

.pp-tile__icon,
.pp-grow__icon {
    display: grid;
    flex: none;
    place-items: center;
    border-radius: 50%;
    background: var(--indigo-100);
    color: var(--indigo-700);
}

.pp-tile__icon { width: 3.5rem; height: 3.5rem; }
.pp-tile--alt .pp-tile__icon,
.pp-grow--alt .pp-grow__icon { background: #ffe9d6; color: var(--orange-600); }

.pp-tile h3 { font-size: 1.1875rem; color: var(--navy-900); }

.pp__grow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 0;
}

.pp-grow {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--indigo-700);
    border-radius: 0.875rem;
    background: var(--cream);
    font-weight: 600;
    color: var(--navy-900);
}

.pp-grow--alt { border-left-color: var(--orange-500); }
.pp-grow__icon { width: 2.5rem; height: 2.5rem; }

.pp-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    overflow: hidden;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-800) 100%);
    color: rgba(255, 255, 255, 0.88);
}

.pp-band__photo { border: 0; border-radius: 0; min-height: 16rem; }

.pp-band__body { align-self: center; padding: clamp(1.75rem, 4vw, 3rem); }

.pp-band__label {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--saffron-400);
}

.pp-band h2 { margin-block: 0.5rem 0.75rem; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); color: var(--white); }
.pp-band__body p:last-child { font-size: 1.0625rem; line-height: 1.7; }

.pp-note {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 1.5rem;
    padding: 0.875rem 1.125rem;
    border-left: 4px solid var(--orange-500);
    border-radius: 0 0.5rem 0.5rem 0;
    background: #fff4e8;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #7c2d12;
}

.pp-note .icon { flex: none; margin-top: 0.15rem; color: var(--orange-600); }

@media (max-width: 1000px) {
    .pp__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .pp__split,
    .pp__split--flip,
    .pp-band { grid-template-columns: minmax(0, 1fr); }
    .pp__split--flip .pp__photo { order: -1; }
}

@media (max-width: 560px) {
    .pp__tiles,
    .pp__grow { grid-template-columns: minmax(0, 1fr); }
}

/* Single-column band used on the stage pages. */
.pp-band--text { grid-template-columns: minmax(0, 1fr); margin-top: 1.5rem; }

/* Stage pages (Primary, Middle, Secondary). */
.pp__tiles--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pp-tile--stack { flex-direction: column; align-items: flex-start; }

.stg-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    padding: 0;
}

.stg-step {
    padding: 1.75rem 1.5rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--indigo-700);
    border-radius: 1rem;
    background: var(--white);
}

.stg-step--alt { border-left-color: var(--orange-500); }

.stg-step__no {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--indigo-700);
}

.stg-step--alt .stg-step__no { color: var(--orange-600); }
.stg-step h3 { font-size: 1.1875rem; line-height: 1.35; color: var(--navy-900); }

@media (max-width: 1100px) {
    .pp__tiles--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .stg-steps { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .pp__tiles--four { grid-template-columns: minmax(0, 1fr); }
}

/* Gallery strip on the stage pages. */
.pp-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    padding: 0;
}

.pp-gallery__item {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--indigo-100);
}

.pp-gallery__item img { display: block; width: 100%; height: 100%; object-fit: cover; }

.pp-gallery__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.625rem 1.375rem;
    border: 1px solid var(--indigo-700);
    border-radius: 999px;
    font-weight: 700;
    color: var(--indigo-700);
    text-decoration: none;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.pp-gallery__btn:hover { background: var(--indigo-700); color: var(--white); }

@media (max-width: 1000px) {
    .pp-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .pp-gallery { grid-template-columns: minmax(0, 1fr); }
}

/* Clickable gallery: photo buttons and the full-size viewer. */
.pp-gallery__item { position: relative; }

.pp-gallery__open {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.pp-gallery__open img { transition: transform 0.4s var(--ease); }
.pp-gallery__open:hover img { transform: scale(1.04); }
.pp-gallery__open:focus-visible { outline: 3px solid var(--orange-500); outline-offset: -3px; }

.pp-lightbox {
    width: min(100vw, 70rem);
    max-width: 100vw;
    max-height: 100vh;
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--white);
    overflow: visible;
}

.pp-lightbox::backdrop { background: rgba(7, 20, 47, 0.9); }

.pp-lightbox[open] { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 1rem; }

.pp-lightbox figure { margin: 0; min-width: 0; text-align: center; }

.pp-lightbox img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    margin-inline: auto;
    border-radius: 0.75rem;
    object-fit: contain;
}

.pp-lightbox figcaption { margin-top: 0.75rem; font-size: 0.9375rem; color: rgba(255, 255, 255, 0.85); }

.pp-lightbox__close,
.pp-lightbox__nav {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    cursor: pointer;
}

.pp-lightbox__close:hover,
.pp-lightbox__nav:hover { background: var(--orange-500); border-color: var(--orange-500); }

.pp-lightbox__close { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 1; }
.pp-lightbox__nav--prev .icon { transform: rotate(180deg); }

@media (max-width: 560px) {
    .pp-lightbox[open] { flex-wrap: wrap; justify-content: center; }
    .pp-lightbox figure { order: -1; width: 100%; }
}

/* Stage pages (Pre-Primary, Primary, Middle): open editorial layout with few boxes. */
.sp { background: var(--white); }
.sp--tint { background: var(--cream); }
.sp--navy { background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 60%, var(--navy-800) 100%); color: rgba(255, 255, 255, 0.88); }
.sp--navy .section-heading__title { color: var(--white); }
.sp--navy .section-heading__title em { color: var(--saffron-400); }

.sp-lead { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); line-height: 1.8; color: #2c3a57; }
.sp-intro__text > p { margin-top: 1.25rem; line-height: 1.8; color: #44516b; }
.sp-intro__text > .sp-lead { margin-top: 1.5rem; }

.sp-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 2.5rem clamp(2rem, 6vw, 5rem);
    align-items: center;
}

.sp-photo { position: relative; margin: 0; }
.sp-photo::before {
    content: "";
    position: absolute;
    inset: 1.25rem -1.25rem -1.25rem 1.25rem;
    border: 2px solid var(--orange-500);
    border-radius: 1.5rem;
    opacity: 0.6;
    transition: transform 0.4s var(--ease);
}
.sp-photo:hover::before { transform: translate(0.375rem, 0.375rem); }
.sp-photo img { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 1.5rem; }

/* Learning list: rows split by hairlines, no cards. */
.sp-list { display: grid; padding: 0; }

.sp-item {
    display: grid;
    grid-template-columns: 3rem 3.5rem minmax(0, 1fr);
    align-items: start;
    gap: 1rem 1.25rem;
    padding-block: 1.5rem;
    border-top: 1px solid var(--line);
    transition: transform 0.3s var(--ease);
}

.sp-item:hover { transform: translateX(0.375rem); }

.sp-item__no { font-size: 1.75rem; font-weight: 700; line-height: 1; color: #c4d2ec; transition: color 0.3s var(--ease); }
.sp-item:hover .sp-item__no { color: var(--orange-500); }

.sp-item__icon {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--indigo-100);
    color: var(--indigo-700);
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.sp-item:nth-child(even) .sp-item__icon { background: #ffe9d6; color: var(--orange-600); }
.sp-item:hover .sp-item__icon { background: var(--indigo-700); color: var(--white); }
.sp-item:nth-child(even):hover .sp-item__icon { background: var(--orange-500); }

.sp-item__body h3 { font-size: 1.1875rem; line-height: 1.3; color: var(--navy-900); }
.sp-item__body p { margin-top: 0.5rem; line-height: 1.7; color: #44516b; }

/* Variant: grid (two columns of rows) */
.sp-learn--grid .sp-learn__head { margin-bottom: 1.5rem; }
.sp-learn--grid .sp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 4rem); }

/* Variant: line (one column on a vertical rule) */
.sp-learn--line .sp-learn__head { margin-bottom: 2rem; }
.sp-learn--line .sp-list { position: relative; max-width: 52rem; }
.sp-learn--line .sp-list::before { content: ""; position: absolute; left: 1.625rem; top: 1.5rem; bottom: 1.5rem; width: 2px; background: var(--line); }
.sp-learn--line .sp-item { grid-template-columns: 3.25rem minmax(0, 1fr); border-top: 0; }
.sp-learn--line .sp-item__no { display: none; }
.sp-learn--line .sp-item__icon { position: relative; border: 4px solid var(--cream); box-sizing: content-box; width: 3.25rem; height: 3.25rem; margin: -4px; }

/* Variant: split (sticky heading beside the list) */
.sp-learn--split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); gap: 2rem clamp(2rem, 6vw, 5rem); align-items: start; }
.sp-learn--split .sp-learn__head { position: sticky; top: 7rem; }
.sp-learn--split .sp-item:first-child { border-top: 0; padding-top: 0; }

/* Beyond the classroom */
.sp-beyond { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 6vw, 5rem); align-items: center; }
.sp-beyond__text > .sp-lead { margin-top: 1.25rem; }

.sp-note {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--orange-600);
}

.sp-note .icon { flex: none; margin-top: 0.15rem; }

.sp-events { display: grid; padding: 0; }

.sp-event {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-block: 1.125rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.1875rem;
    font-weight: 600;
    color: var(--navy-900);
    transition: transform 0.3s var(--ease);
}

.sp-event:first-child { border-top: 1px solid var(--line); }
.sp-event:hover { transform: translateX(0.375rem); }

.sp-event__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: #ffe9d6;
    color: var(--orange-600);
}

/* What we aim to nurture */
/* Call to action */
.sp-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.sp-cta h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); color: var(--navy-900); }
.sp-cta p { max-width: 40rem; margin-top: 0.75rem; line-height: 1.75; color: #44516b; }
.sp-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.sp-cta__link { display: inline-flex; align-items: center; gap: 0.5rem; padding-bottom: 0.25rem; border-bottom: 2px solid var(--orange-500); font-weight: 700; color: var(--navy-900); text-decoration: none; }
.sp-cta__link:hover { color: var(--indigo-700); }

@media (max-width: 1000px) {
    .sp-intro,
    .sp-beyond,
    .sp-learn--split { grid-template-columns: minmax(0, 1fr); }
    .sp-learn--split .sp-learn__head { position: static; }
    .sp-learn--grid .sp-list { grid-template-columns: minmax(0, 1fr); }
    .sp-photo::before { inset: 0.75rem -0.5rem -0.75rem 0.5rem; }
}

@media (max-width: 560px) {
    .sp-item { grid-template-columns: 3.25rem minmax(0, 1fr); }
    .sp-item__no { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-item,
    .sp-event,
    .sp-photo::before { transition: none; }
    .sp-item:hover,
    .sp-event:hover { transform: none; }
}

/* Admission call to action: soft light band with a faint campus photograph. */
.sp-admit {
    position: relative;
    overflow: hidden;
    padding-block: clamp(3rem, 7vw, 5.5rem);
    background: linear-gradient(180deg, var(--white) 0%, var(--cream) 100%);
}

.sp-admit::before {
    content: "";
    position: absolute;
    left: -6rem;
    bottom: -6rem;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    background: var(--navy-900);
}

.sp-admit::after {
    content: "";
    position: absolute;
    left: 5rem;
    bottom: -9rem;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    background: var(--indigo-100);
    opacity: 0.8;
}

.sp-admit__bg {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(46%, 36rem);
    height: 70%;
    border-top-left-radius: 100% 60%;
    overflow: hidden;
    opacity: 0.14;
    pointer-events: none;
}

.sp-admit__bg img { display: block; width: 100%; height: 100%; object-fit: cover; }

.sp-admit__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 2rem clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.sp-admit__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--indigo-700);
}

.sp-admit__eyebrow::before { content: ""; width: 2.5rem; height: 2px; background: var(--orange-500); }

.sp-admit h2 {
    margin-top: 0.875rem;
    font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
    line-height: 1.1;
    color: var(--navy-900);
}

.sp-admit h2 em { font-style: normal; color: var(--indigo-700); }
.sp-admit__text > p:not([class]) { max-width: 40rem; margin-top: 1.25rem; font-size: 1.0625rem; line-height: 1.75; color: #44516b; }

.sp-admit__facts { display: flex; flex-wrap: wrap; margin-top: 2rem; padding: 0; }

.sp-admit__facts li {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    flex: 1 1 13rem;
    padding: 0.25rem 1.25rem;
    font-size: 0.9063rem;
    line-height: 1.55;
    color: #526079;
}

.sp-admit__facts li:first-child { padding-left: 0; }
.sp-admit__facts li + li { border-left: 1px solid var(--line); }
.sp-admit__facts strong { display: block; margin-bottom: 0.125rem; font-size: 1rem; color: var(--navy-900); }

.sp-admit__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--indigo-100);
    color: var(--indigo-700);
}

.sp-admit__facts li.is-alt .sp-admit__icon { background: #ffe9d6; color: var(--orange-600); }

.sp-admit__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 1rem 1.5rem; }

.sp-admit__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    border-radius: 999px;
    background: var(--navy-900);
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(7, 20, 47, 0.18);
    transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.sp-admit__btn:hover { background: var(--indigo-700); transform: translateY(-2px); }

.sp-admit__link {
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
    font-weight: 700;
    color: var(--indigo-700);
    text-decoration: none;
}

.sp-admit__circle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1.5px solid var(--indigo-700);
    border-radius: 50%;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.sp-admit__link:hover .sp-admit__circle { background: var(--indigo-700); color: var(--white); }

@media (max-width: 1000px) {
    .sp-admit__inner { grid-template-columns: minmax(0, 1fr); }
    .sp-admit__actions { justify-content: flex-start; }
    .sp-admit__bg { width: 70%; opacity: 0.1; }
}

@media (max-width: 640px) {
    .sp-admit__facts { display: grid; gap: 1.25rem; }
    .sp-admit__facts li,
    .sp-admit__facts li + li { padding: 0; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-admit__btn { transition: none; }
    .sp-admit__btn:hover { transform: none; }
}

/* Admission call to action, second design: white "Admissions Open" card over the campus photograph. */
.sp-admit__bg {
    width: min(58%, 48rem);
    height: 100%;
    border-radius: 0;
    opacity: 0.55;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 55%);
    mask-image: linear-gradient(to right, transparent 0%, #000 55%);
}

.sp-admit__inner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr); }

.sp-admit__card {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 40px rgba(7, 20, 47, 0.1);
}

.sp-admit__card-head { display: flex; align-items: center; gap: 1.25rem; }

.sp-admit__cap {
    display: grid;
    flex: none;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: var(--indigo-100);
    color: var(--navy-900);
}

.sp-admit__card h3 { font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem); color: var(--navy-900); }
.sp-admit__card-head p { margin-top: 0.25rem; line-height: 1.55; color: #526079; }

.sp-admit__btn {
    justify-content: space-between;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
    background: var(--navy-900);
}

.sp-admit__go {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--indigo-600);
}

.sp-admit__or {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: #526079;
}

.sp-admit__or::before,
.sp-admit__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.sp-admit__card .sp-admit__link { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.sp-admit__card .sp-admit__link:hover { color: var(--navy-900); }

@media (max-width: 1000px) {
    .sp-admit__inner { grid-template-columns: minmax(0, 1fr); }
    .sp-admit__bg { width: 100%; opacity: 0.1; -webkit-mask-image: none; mask-image: none; }
}

/* Growing together: glass-outline tiles with a round icon, a divider and a short colour bar. */
.sp--navy .eyebrow { color: rgba(255, 255, 255, 0.9); }
.sp-nurture__lead { max-width: 44rem; margin-top: 1.25rem; font-size: 1.125rem; line-height: 1.7; color: rgba(255, 255, 255, 0.82); }

.sp-aims {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.sp-aim {
    --tone: var(--indigo-600);
    grid-column: span 3;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.sp-aim:nth-child(n + 5) { grid-column: span 4; }
.sp-aim--1 { --tone: var(--cyan-400); }
.sp-aim--2 { --tone: var(--saffron-400); }
.sp-aim--3 { --tone: var(--orange-500); }

.sp-aim:hover { transform: translateY(-4px); border-color: var(--tone); background: rgba(255, 255, 255, 0.09); }

.sp-aim__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    border: 1px solid var(--tone);
    border-radius: 50%;
    background: color-mix(in srgb, var(--tone) 22%, transparent);
    color: var(--white);
}

.sp-aim__text {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    padding-left: 1.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--white);
}

.sp-aim__text i { display: block; width: 2rem; height: 3px; border-radius: 2px; background: var(--tone); }

@media (max-width: 1100px) {
    .sp-aim,
    .sp-aim:nth-child(n + 5) { grid-column: span 6; }
    .sp-aim:last-child { grid-column: 4 / span 6; }
}

@media (max-width: 640px) {
    .sp-aim,
    .sp-aim:nth-child(n + 5),
    .sp-aim:last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-aim { transition: none; }
    .sp-aim:hover { transform: none; }
}

/* Overview paragraphs on the stage pages share one size and colour. */
.sp-intro__text > p,
.sp-intro__text > .sp-lead {
    font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
    line-height: 1.8;
    color: #2c3a57;
}

/* ==========================================================================
   Pre-Primary: a playful theme. Applied through the .sp-play class, so the
   Primary and Middle School pages (which share these sections) are unchanged.
   Colours stay within the site's palette: royal blue, saffron, orange, sky.
   ========================================================================== */
.sp-play {
    --pl-blue: var(--indigo-600);
    --pl-sun: var(--saffron-400);
    --pl-coral: var(--orange-500);
    --pl-sky: var(--cyan-400);
    --pl-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pl-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-0.75rem) rotate(6deg); } }
@keyframes pl-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pl-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg) scale(1.12); } 75% { transform: rotate(9deg) scale(1.12); } }

/* Soft wavy edges between sections. */
#overview.sp-play,
#learning.sp-play { position: relative; padding-bottom: clamp(4rem, 8vw, 6rem); }

#overview.sp-play::after,
#learning.sp-play::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: clamp(1.75rem, 4vw, 3rem);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: bottom;
    pointer-events: none;
}

#overview.sp-play::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 22 Q12.5 2 25 22 T50 22 T75 22 T100 22 V40 H0Z' fill='%23f4f8ff'/%3E%3C/svg%3E"); }
#learning.sp-play::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 22 Q12.5 42 25 22 T50 22 T75 22 T100 22 V40 H0Z' fill='%23ffffff'/%3E%3C/svg%3E"); }

/* ---- Overview: blob-shaped photo, floating shapes, marker-pen highlight ---- */
#overview.sp-play { overflow: hidden; }

.sp-play .sp-intro { position: relative; }

.sp-play .sp-intro::before,
.sp-play .sp-intro::after {
    content: "";
    position: absolute;
    z-index: 0;
    pointer-events: none;
    animation: pl-float 7s ease-in-out infinite;
}

.sp-play .sp-intro::before { top: -1.5rem; right: 2%; width: 4.5rem; height: 4.5rem; border-radius: 50%; background: var(--pl-sky); opacity: 0.55; }
.sp-play .sp-intro::after { bottom: -1rem; right: 44%; width: 3.25rem; height: 3.25rem; border: 6px solid var(--pl-coral); border-radius: 50%; opacity: 0.55; animation-delay: -2.5s; }

.sp-play .sp-intro__text { position: relative; z-index: 1; }
.sp-play .section-heading__title { font-weight: 800; letter-spacing: -0.02em; }

.sp-play .section-heading__title em {
    font-style: normal;
    padding: 0 0.15em;
    background: linear-gradient(transparent 58%, rgba(251, 191, 36, 0.6) 58%, rgba(251, 191, 36, 0.6) 90%, transparent 90%);
    color: var(--pl-blue);
}

.sp-play.sp--navy .section-heading__title em { background: none; color: var(--saffron-400); }

.sp-play .sp-photo { z-index: 1; }
.sp-play .sp-photo::before {
    inset: 1.25rem -1rem -1.25rem 1rem;
    border: 0;
    border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%;
    background: var(--pl-sun);
    opacity: 0.85;
    transform: rotate(-4deg);
}

.sp-play .sp-photo:hover::before { transform: rotate(3deg) scale(1.03); }
.sp-play .sp-photo img { aspect-ratio: 1 / 1; border-radius: 52% 48% 46% 54% / 50% 44% 56% 50%; border: 6px solid var(--white); transition: border-radius 0.8s var(--ease); }
.sp-play .sp-photo:hover img { border-radius: 46% 54% 52% 48% / 54% 50% 50% 46%; }

/* ---- Learning list: coloured blob icons that wiggle ---- */
.sp-play .sp-item { border-top: 2px dashed #c9d8f3; transition: transform 0.35s var(--pl-bounce); }
.sp-play .sp-item:hover { transform: translateX(0.5rem) scale(1.01); }

.sp-play .sp-item__icon {
    --ic: var(--indigo-100);
    --ic-fg: var(--indigo-700);
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%;
    background: var(--ic);
    color: var(--ic-fg);
}

.sp-play .sp-item:nth-child(4n + 2) .sp-item__icon { --ic: #fff1c2; --ic-fg: #b57d00; }
.sp-play .sp-item:nth-child(4n + 3) .sp-item__icon { --ic: #d4f3fa; --ic-fg: #0a7f95; }
.sp-play .sp-item:nth-child(4n + 4) .sp-item__icon { --ic: #ffe0c7; --ic-fg: var(--orange-600); }

.sp-play .sp-item:nth-child(n) .sp-item__icon { background: var(--ic); color: var(--ic-fg); }
.sp-play .sp-item:hover .sp-item__icon,
.sp-play .sp-item:nth-child(even):hover .sp-item__icon { background: var(--ic-fg); color: var(--white); animation: pl-wiggle 0.6s ease; }

.sp-play .sp-item__no { color: var(--ic-fg, #c4d2ec); opacity: 0.55; }
.sp-play .sp-item:nth-child(4n + 1) .sp-item__no { color: var(--indigo-700); }
.sp-play .sp-item:nth-child(4n + 2) .sp-item__no { color: #b57d00; }
.sp-play .sp-item:nth-child(4n + 3) .sp-item__no { color: #0a7f95; }
.sp-play .sp-item:nth-child(4n + 4) .sp-item__no { color: var(--orange-600); }
.sp-play .sp-item__body h3 { font-weight: 800; }

/* ---- Growing together: floating bubbles and bobbing icons on the navy field ---- */
#nurture.sp-play { position: relative; overflow: hidden; }

#nurture.sp-play::before,
#nurture.sp-play::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: pl-float 9s ease-in-out infinite;
}

#nurture.sp-play::before { top: -3rem; right: 6%; width: 10rem; height: 10rem; background: rgba(251, 191, 36, 0.14); }
#nurture.sp-play::after { bottom: -2.5rem; left: 4%; width: 8rem; height: 8rem; background: rgba(56, 189, 248, 0.16); animation-delay: -3s; }

.sp-play .sp-aims { position: relative; z-index: 1; }
.sp-play .sp-aim { border-radius: 2rem; transition: transform 0.35s var(--pl-bounce), border-color 0.3s var(--ease), background-color 0.3s var(--ease); }
.sp-play .sp-aim:hover { transform: translateY(-6px) rotate(-1deg); }
.sp-play .sp-aim__icon { animation: pl-bob 3.4s ease-in-out infinite; }
.sp-play .sp-aim:nth-child(2n) .sp-aim__icon { animation-delay: -1.2s; }
.sp-play .sp-aim:nth-child(3n) .sp-aim__icon { animation-delay: -2.2s; }
.sp-play .sp-aim:hover .sp-aim__icon { animation: pl-wiggle 0.6s ease; }

/* ---- Gallery: tilted snapshots that straighten on hover ---- */
.sp-play .pp-gallery__item {
    border: 6px solid var(--white);
    border-radius: 1.25rem;
    box-shadow: 0 10px 22px -12px rgba(7, 20, 47, 0.35);
    transition: transform 0.4s var(--pl-bounce), box-shadow 0.3s var(--ease);
}

.sp-play .pp-gallery__item:nth-child(odd) { transform: rotate(-2.5deg); }
.sp-play .pp-gallery__item:nth-child(even) { transform: rotate(2deg) translateY(0.5rem); }
.sp-play .pp-gallery__item:hover { transform: rotate(0) scale(1.04); box-shadow: 0 16px 28px -14px rgba(7, 20, 47, 0.45); z-index: 1; }

/* ---- Admission call to action: a friendly bouncing button ---- */
.sp-play .sp-admit__btn { transition: transform 0.3s var(--pl-bounce), background-color 0.2s var(--ease); }
.sp-play .sp-admit__btn:hover { transform: translateY(-3px) scale(1.03); }
.sp-play .sp-admit__cap { animation: pl-bob 3s ease-in-out infinite; }

@media (max-width: 1000px) {
    .sp-play .sp-photo img { aspect-ratio: 4 / 3; }
    .sp-play .sp-intro::after { right: 12%; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-play .sp-intro::before,
    .sp-play .sp-intro::after,
    #nurture.sp-play::before,
    #nurture.sp-play::after,
    .sp-play .sp-aim__icon,
    .sp-play .sp-admit__cap { animation: none; }
    .sp-play .sp-item:hover .sp-item__icon,
    .sp-play .sp-aim:hover .sp-aim__icon { animation: none; }
    .sp-play .pp-gallery__item:nth-child(n),
    .sp-play .pp-gallery__item:hover { transform: none; }
    .sp-play .sp-item,
    .sp-play .sp-aim,
    .sp-play .pp-gallery__item,
    .sp-play .sp-admit__btn { transition: none; }
}

.sp-play .sp-photo img { aspect-ratio: 5 / 4; object-position: center 20%; }

/* ---- Extra section: a dotted trail of simple ideas, one stop after another ---- */
.sp-trail__head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.sp-trail__head .sp-lead { margin-top: 1.25rem; }

.sp-trail {
    --stop-0: var(--indigo-700);
    --tint-0: var(--indigo-100);
    --stop-1: #b57d00;
    --tint-1: #fff1c2;
    --stop-2: #0a7f95;
    --tint-2: #d4f3fa;
    --stop-3: var(--orange-600);
    --tint-3: #ffe0c7;
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2rem 1.25rem;
    padding: 0;
}

/* The dotted path that joins the stops. */
.sp-trail::before {
    content: "";
    position: absolute;
    top: 2.75rem;
    left: 10%;
    right: 10%;
    border-top: 3px dotted #b9c9ea;
}

.sp-trail__stop {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.625rem;
    text-align: center;
}

.sp-trail__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 5.5rem;
    height: 5.5rem;
    margin-bottom: 0.5rem;
    border: 6px solid var(--white);
    border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%;
    background: var(--tint);
    color: var(--stop);
    box-shadow: 0 8px 18px -10px rgba(7, 20, 47, 0.4);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.sp-trail__stop--0 { --stop: var(--stop-0); --tint: var(--tint-0); }
.sp-trail__stop--1 { --stop: var(--stop-1); --tint: var(--tint-1); }
.sp-trail__stop--2 { --stop: var(--stop-2); --tint: var(--tint-2); }
.sp-trail__stop--3 { --stop: var(--stop-3); --tint: var(--tint-3); }

.sp-trail__stop:hover .sp-trail__icon { transform: translateY(-6px) rotate(-6deg) scale(1.08); background: var(--stop); color: var(--white); }

.sp-trail__stop h3 { font-size: 1.1875rem; line-height: 1.25; color: var(--navy-900); }
.sp-trail__stop p { max-width: 15rem; font-size: 0.9688rem; line-height: 1.65; color: #44516b; }

.sp-trail__note { margin-top: 2.5rem; text-align: center; font-size: 0.9375rem; color: #526079; }

@media (max-width: 1100px) {
    .sp-trail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sp-trail::before { display: none; }
}

@media (max-width: 640px) {
    .sp-trail { grid-template-columns: minmax(0, 1fr); gap: 0; padding-left: 0; }
    .sp-trail::before { display: block; top: 1rem; bottom: 1rem; left: 2.75rem; right: auto; border-top: 0; border-left: 3px dotted #b9c9ea; }
    .sp-trail__stop { grid-template-columns: 5.5rem minmax(0, 1fr); justify-items: start; text-align: left; column-gap: 1.25rem; padding-block: 0.875rem; }
    .sp-trail__icon { grid-row: span 2; margin-bottom: 0; }
    .sp-trail__stop p { max-width: none; }
    .sp-trail__note { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-trail__icon { transition: none; }
    .sp-trail__stop:hover .sp-trail__icon { transform: none; }
}

/* ---- Pre-Primary "What we aim to nurture": a cloud of colourful bubbles instead of outlined tiles ---- */
#nurture.sp-play .sp-aims {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.125rem 1rem;
    margin-top: 2.5rem;
}

#nurture.sp-play .sp-aim,
#nurture.sp-play .sp-aim:nth-child(n + 5) {
    --bub: var(--saffron-400);
    --bub-fg: var(--navy-950);
    grid-column: auto;
    gap: 0.875rem;
    padding: 0.75rem 1.5rem 0.75rem 0.75rem;
    border: 0;
    border-radius: 999px;
    background: var(--bub);
    color: var(--bub-fg);
    box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.6);
}

#nurture.sp-play .sp-aim--1 { --bub: var(--cyan-400); }
#nurture.sp-play .sp-aim--2 { --bub: var(--orange-500); }
#nurture.sp-play .sp-aim--3 { --bub: var(--indigo-600); --bub-fg: var(--white); }

#nurture.sp-play .sp-aim:nth-child(odd) { transform: rotate(-2deg); }
#nurture.sp-play .sp-aim:nth-child(even) { transform: rotate(2deg) translateY(0.375rem); }
#nurture.sp-play .sp-aim:hover { transform: rotate(0) translateY(-6px) scale(1.06); background: var(--bub); }

#nurture.sp-play .sp-aim__icon {
    width: 3rem;
    height: 3rem;
    border: 0;
    background: var(--white);
    color: var(--bub-fg);
}

#nurture.sp-play .sp-aim--0 .sp-aim__icon { color: #b57d00; }
#nurture.sp-play .sp-aim--1 .sp-aim__icon { color: #0a7f95; }
#nurture.sp-play .sp-aim--2 .sp-aim__icon { color: var(--orange-600); }
#nurture.sp-play .sp-aim--3 .sp-aim__icon { color: var(--indigo-700); }

#nurture.sp-play .sp-aim__text {
    padding-left: 0;
    border-left: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bub-fg);
}

#nurture.sp-play .sp-aim__text i { display: none; }

@media (max-width: 640px) {
    #nurture.sp-play .sp-aims { justify-content: flex-start; }
    #nurture.sp-play .sp-aim,
    #nurture.sp-play .sp-aim:nth-child(n + 5) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    #nurture.sp-play .sp-aim:nth-child(n),
    #nurture.sp-play .sp-aim:hover { transform: none; }
}

/* ---- Pre-Primary admission section: a friendly sticker-style card with bouncing details ---- */
#enquire.sp-play { background: linear-gradient(180deg, var(--white) 0%, #fff8e6 100%); }

#enquire.sp-play::before {
    left: auto;
    right: 38%;
    bottom: -4rem;
    width: 9rem;
    height: 9rem;
    background: rgba(0, 200, 230, 0.22);
    animation: pl-float 9s ease-in-out infinite;
}

#enquire.sp-play::after {
    left: auto;
    right: 4%;
    bottom: auto;
    top: 2.5rem;
    width: 4.5rem;
    height: 4.5rem;
    background: rgba(251, 191, 36, 0.55);
    animation: pl-float 7s ease-in-out infinite -2s;
}

#enquire.sp-play h2 em { background: linear-gradient(transparent 58%, rgba(251, 191, 36, 0.6) 58%, rgba(251, 191, 36, 0.6) 90%, transparent 90%); padding: 0 0.15em; }

#enquire.sp-play .sp-admit__card {
    border: 3px solid var(--navy-900);
    border-radius: 2rem;
    background: var(--white);
    box-shadow: 8px 8px 0 var(--saffron-400);
    transform: rotate(1.5deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s var(--ease);
}

#enquire.sp-play .sp-admit__card:hover { transform: rotate(0) translateY(-4px); box-shadow: 12px 12px 0 var(--saffron-400); }

#enquire.sp-play .sp-admit__cap {
    border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%;
    background: #fff1c2;
    color: var(--navy-900);
}

#enquire.sp-play .sp-admit__btn { background: var(--orange-500); color: var(--navy-950); box-shadow: 0 4px 0 var(--orange-600); }
#enquire.sp-play .sp-admit__btn:hover { background: var(--orange-500); transform: translateY(-3px) scale(1.03); box-shadow: 0 7px 0 var(--orange-600); }
#enquire.sp-play .sp-admit__go { background: var(--navy-900); color: var(--white); }
#enquire.sp-play .sp-admit__card .sp-admit__link { color: var(--indigo-700); }

@media (max-width: 1000px) {
    #enquire.sp-play .sp-admit__card { transform: none; box-shadow: 6px 6px 0 var(--saffron-400); }
}

@media (prefers-reduced-motion: reduce) {
    #enquire.sp-play::before,
    #enquire.sp-play::after { animation: none; }
    #enquire.sp-play .sp-admit__card,
    #enquire.sp-play .sp-admit__card:hover { transform: none; transition: none; }
}

/* ==========================================================================
   Primary School: richer overview, motto band, filterable learning areas.
   Optional pieces of the shared stage page, switched on by the page's data.
   ========================================================================== */

/* Photographs: the main photo with a smaller one tucked over its corner. */
.sp-photos { position: relative; }
.sp-photo--second {
    position: absolute;
    left: -2rem;
    bottom: -2rem;
    z-index: 2;
    width: 44%;
}

.sp-photo--second::before { display: none; }
.sp-photo--second img { aspect-ratio: 1; border: 6px solid var(--white); border-radius: 1.25rem; box-shadow: 0 16px 28px -14px rgba(7, 20, 47, 0.5); transform: rotate(-4deg); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.sp-photos:hover .sp-photo--second img { transform: rotate(0) scale(1.04); }

/* Motto band: three big words and what each one means. */
.sp-motto { padding-block: clamp(2.5rem, 5vw, 4rem); background: var(--white); border-block: 1px solid var(--line); }
.sp-motto__inner { display: grid; gap: 1.5rem; }
.sp-motto__label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange-600); }
.sp-motto__words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }

.sp-motto__word {
    display: grid;
    gap: 0.5rem;
    padding: 0.25rem clamp(1rem, 3vw, 2.5rem);
    border-left: 1px solid var(--line);
    transition: transform 0.3s var(--ease);
}

.sp-motto__word:first-child { padding-left: 0; border-left: 0; }
.sp-motto__word strong { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.75rem); font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--indigo-700); }
.sp-motto__word--1 strong { color: var(--orange-600); }
.sp-motto__word--2 strong { color: #b57d00; }
.sp-motto__word span { max-width: 16rem; line-height: 1.5; color: #44516b; }
.sp-motto__word:hover { transform: translateY(-4px); }

/* Learning areas: filter chips and a gentle pop when a row appears. */
.sp-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }

.sp-filters__btn {
    padding: 0.5rem 1.25rem;
    border: 1.5px solid var(--indigo-700);
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-weight: 700;
    color: var(--indigo-700);
    cursor: pointer;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.sp-filters__btn:hover { transform: translateY(-2px); }
.sp-filters__btn.is-on { background: var(--indigo-700); color: var(--white); }
.sp-filters__btn:focus-visible { outline: 3px solid var(--orange-500); outline-offset: 2px; }

.sp-item[hidden] { display: none; }

@keyframes sp-pop { from { opacity: 0; transform: translateY(0.75rem) scale(0.98); } to { opacity: 1; transform: none; } }
.sp-item.sp-pop { animation: sp-pop 0.45s var(--ease) both; }

/* Primary theme: warmer backgrounds and editorial numerals. */
.sp-prime#overview { background: linear-gradient(180deg, var(--white) 0%, #f7faff 100%); overflow: visible; }
.sp-prime#learning { background: linear-gradient(180deg, #f4f8ff 0%, #eaf3fd 100%); }
.sp-prime .section-heading__title { font-weight: 800; letter-spacing: -0.02em; }

.sp-prime .sp-item__no {
    font-size: 2.25rem;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--indigo-700);
    opacity: 0.55;
    transition: opacity 0.3s var(--ease), -webkit-text-stroke-color 0.3s var(--ease);
}

.sp-prime .sp-item:nth-child(even) .sp-item__no { -webkit-text-stroke-color: var(--orange-600); }
.sp-prime .sp-item:hover .sp-item__no { opacity: 1; color: transparent; -webkit-text-stroke-color: var(--orange-500); }
.sp-prime .sp-item__body h3 { font-size: 1.25rem; }

@media (max-width: 1000px) {
    .sp-photo--second { left: auto; right: 0.5rem; bottom: -1.25rem; width: 38%; }
}

@media (max-width: 640px) {
    .sp-motto__words { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .sp-motto__word,
    .sp-motto__word:first-child { padding: 1rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
    .sp-motto__word:first-child { border-top: 0; padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-photo--second img,
    .sp-motto__word,
    .sp-filters__btn { transition: none; }
    .sp-photos:hover .sp-photo--second img,
    .sp-motto__word:hover,
    .sp-filters__btn:hover { transform: none; }
    .sp-item.sp-pop { animation: none; }
}

/* ---- Middle School: same building blocks as Primary, with a few differences of its own ---- */
.sp-teen .sp-photo--second { left: auto; right: -1.5rem; bottom: -2.25rem; width: 40%; }
.sp-teen .sp-photo--second img { aspect-ratio: 4 / 3; transform: rotate(3deg); }
.sp-teen .sp-photos:hover .sp-photo--second img { transform: rotate(0) scale(1.04); }

.sp-teen.sp-motto { background: var(--cream); }
.sp-teen .sp-motto__word strong { letter-spacing: -0.03em; }

.sp-teen#overview { background: linear-gradient(180deg, var(--white) 0%, #eef4ff 100%); }
.sp-teen#learning { background: linear-gradient(180deg, #eaf3fd 0%, var(--white) 100%); }

.sp-teen .sp-filters__btn { border-color: var(--orange-600); color: var(--orange-600); }
.sp-teen .sp-filters__btn.is-on { background: var(--orange-600); color: var(--white); }
.sp-teen .sp-item__no { -webkit-text-stroke-color: var(--orange-600); }
.sp-teen .sp-item:nth-child(even) .sp-item__no { -webkit-text-stroke-color: var(--indigo-700); }

@media (max-width: 1000px) {
    .sp-teen .sp-photo--second { right: 0.5rem; bottom: -1.25rem; width: 38%; }
}

/* Primary and Middle School: learning areas without numbers. */
.sp-prime .sp-item { grid-template-columns: 3.5rem minmax(0, 1fr); }
.sp-prime .sp-item__no { display: none; }

@media (max-width: 560px) {
    .sp-prime .sp-item { grid-template-columns: 3.25rem minmax(0, 1fr); }
}

/* ---- Motto band, redesigned: a heading and three soft panels with a coloured icon, numeral and edge arc ---- */
.sp-motto {
    position: relative;
    overflow: hidden;
    padding-block: clamp(3rem, 6vw, 5rem);
    background: linear-gradient(180deg, #f7faff 0%, var(--white) 100%);
    border-block: 0;
}

.sp-motto__inner { display: block; }

.sp-motto__label {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--navy-800);
}

.sp-motto__label::before { content: ""; width: 2.25rem; height: 2px; background: var(--indigo-700); }

.sp-motto__title { margin-top: 0.75rem; font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; color: var(--navy-800); }
.sp-motto__title strong { font-weight: 800; color: var(--navy-900); }

.sp-motto__rule {
    display: block;
    width: 4rem;
    height: 5px;
    margin-top: 1.25rem;
    border-radius: 999px;
    background: var(--indigo-600);
}

.sp-motto__words {
    counter-reset: motto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 2rem);
    margin-top: clamp(1.75rem, 4vw, 2.75rem);
    padding: 0;
}

.sp-motto__word,
.sp-motto__word:first-child {
    --tone: var(--indigo-700);
    --tint: #eef4ff;
    --arc: #9db8f2;
    counter-increment: motto;
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 0.75rem;
    padding: clamp(1.5rem, 3vw, 2rem) clamp(1.5rem, 3vw, 2rem) clamp(1.5rem, 3vw, 2rem) clamp(2rem, 4vw, 3rem);
    border: 0;
    border-radius: 1.5rem;
    background: var(--tint);
    transition: transform 0.35s var(--ease), box-shadow 0.3s var(--ease);
}

.sp-motto__word--1 { --tone: var(--orange-600); --tint: #fff4e8; --arc: #f5a77a; }
.sp-motto__word--2 { --tone: #0a7f95; --tint: #e6f6f9; --arc: #86d0dd; }

/* Coloured arc on the left edge, and a faint numeral at the top right. */
.sp-motto__word::before {
    content: "";
    position: absolute;
    left: -2.5rem;
    top: 18%;
    width: 4.5rem;
    height: 64%;
    border-radius: 50%;
    background: var(--arc);
    opacity: 0.8;
}

.sp-motto__word::after {
    content: counter(motto, decimal-leading-zero);
    position: absolute;
    top: 0.75rem;
    right: 1.25rem;
    font-size: clamp(3rem, 2rem + 3vw, 4.5rem);
    font-weight: 800;
    line-height: 1;
    color: var(--tone);
    opacity: 0.1;
}

.sp-motto__icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    background: var(--tone);
    color: var(--white);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sp-motto__word strong,
.sp-motto__word--1 strong,
.sp-motto__word--2 strong {
    position: relative;
    z-index: 1;
    margin-top: 0.5rem;
    font-size: clamp(2rem, 1.5rem + 1.8vw, 3rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--tone);
}

.sp-motto__bar { display: block; width: 3.25rem; height: 3px; border-radius: 2px; background: var(--tone); }
.sp-motto__word > span:last-child { position: relative; z-index: 1; max-width: 18rem; font-size: 1.0625rem; line-height: 1.5; color: #44516b; }

.sp-motto__word:hover { transform: translateY(-6px); box-shadow: 0 18px 30px -22px rgba(7, 20, 47, 0.45); }
.sp-motto__word:hover .sp-motto__icon { transform: rotate(-8deg) scale(1.1); }

@media (max-width: 900px) {
    .sp-motto__words { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .sp-motto__word,
    .sp-motto__icon { transition: none; }
    .sp-motto__word:hover,
    .sp-motto__word:hover .sp-motto__icon { transform: none; }
}

.sp-motto__word .sp-motto__icon { max-width: none; color: var(--white); }

/* Primary and Middle School: one body-text size in every section. */
.sp-prime .sp-lead,
.sp-prime .sp-intro__text > p,
.sp-prime .sp-intro__text > .sp-lead,
.sp-prime .sp-item__body p,
.sp-prime .sp-motto__word > span:last-child,
.sp-prime .sp-trail__stop p,
.sp-prime .sp-trail__head .sp-lead,
.sp-prime .sp-nurture__lead,
.sp-prime .pp__lead,
.sp-prime .sp-admit__text > p:not([class]),
.sp-prime .sp-admit__card-head p:not([class]) {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.sp-prime .sp-aim__text,
.sp-prime .sp-trail__note { font-size: 1.0625rem; }


/* Achievements photograph wall: white background. */
.pp--wall { background: var(--white); }

/* Achievements photograph wall: four per row; every photograph fills a tile of exactly the same size. Click opens it whole. */
.pp-gallery--wall {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.pp-gallery--wall .pp-gallery__item {
    width: auto;
    margin: 0;
    aspect-ratio: 3 / 4;
    background: var(--indigo-100);
}

.pp-gallery--wall .pp-gallery__open { width: 100%; height: 100%; padding: 0; }

.pp-gallery--wall .pp-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* Four per row on every screen from 560px up; two on small phones only. */
@media (max-width: 559px) {
    .pp-gallery--wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
}

.pp-wall-empty { margin: 0 0 1rem; padding: 2rem 1.5rem; border: 1px dashed var(--line); border-radius: 1rem; text-align: center; color: #44516b; line-height: 1.65; }

/* Achievements: a hint on hover / focus that the photograph opens at its real proportions. */
.pp-gallery--wall .pp-gallery__open::after {
    content: "View photo";
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.5rem 0.75rem 0.75rem;
    background: linear-gradient(transparent, rgba(7, 20, 47, 0.75));
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

.pp-gallery--wall .pp-gallery__open:hover::after,
.pp-gallery--wall .pp-gallery__open:focus-visible::after { opacity: 1; }
