/* ==========================================================================
   Pre-Uni New College — Epping Branch
   Design language: exam paper. Ink navy, marking-red pen, ruled notebook
   lines and graph-paper grids — the material world of a tutoring college.
   ========================================================================== */

:root {
  --ink:       #16243D;   /* pen ink / uniform navy   */
  --ink-soft:  #4A5670;   /* secondary text           */
  --paper:     #FBFAF7;   /* answer-booklet white     */
  --white:     #FFFFFF;
  --rule:      #C9D8EE;   /* notebook rule blue       */
  --grid:      #E8EDF5;   /* graph-paper grid         */
  --red:       #C13A32;   /* teacher's marking pen    */
  --red-soft:  #F7E9E7;
  --navy-deep: #0F1A2E;

  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body:    "Schibsted Grotesk", "Segoe UI", sans-serif;
  --font-mono:    "Spline Sans Mono", Consolas, monospace;
  --font-hand:    "Caveat", "Segoe Script", cursive;   /* red-pen annotations */

  --container: 1120px;
  --radius: 10px;
  --shadow: 0 2px 6px rgba(22, 36, 61, 0.06), 0 12px 32px rgba(22, 36, 61, 0.08);
  --header-h: 76px;
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
  border-radius: 2px;
}

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- Type helpers ---------- */

/* The kicker above each heading is written like a teacher's margin note in
   red pen, not the usual tracked-out uppercase micro-label. */
.eyebrow {
  font-family: var(--font-hand);
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--red);
  display: block;
  width: fit-content;
  margin-bottom: 0.55rem;
  transform: rotate(-1.6deg);
  transform-origin: left bottom;
}

/* Lighter red so the note still reads on the navy panels. */
.contact-strip .eyebrow { color: #E89B95; }

.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 700;
  max-width: 22ch;
}

.section-lead {
  color: var(--ink-soft);
  max-width: 58ch;
  font-size: 1.05rem;
}

/* Red-pen underline — the marker's stroke under a key word */
.pen-word { position: relative; white-space: nowrap; }

.pen-word svg {
  position: absolute;
  left: -2%;
  bottom: -0.18em;
  width: 104%;
  height: 0.32em;
  overflow: visible;
}

.pen-word path {
  fill: none;
  stroke: var(--red);
  stroke-width: 7;
  stroke-linecap: round;
}

@media (prefers-reduced-motion: no-preference) {
  .pen-word path {
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: pen-draw 0.7s ease-out 0.45s forwards;
  }
  @keyframes pen-draw { to { stroke-dashoffset: 0; } }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.9em 1.5em;
  border-radius: 6px;
  border: 2px solid var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-solid { background: var(--ink); color: var(--white); }
.btn-solid:hover { background: var(--navy-deep); border-color: var(--navy-deep); }

.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }

.btn-red { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-red:hover { background: #A82F28; border-color: #A82F28; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--grid);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled { box-shadow: 0 4px 20px rgba(22, 36, 61, 0.08); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  margin-right: auto;
}

/* Wide lockup (~5.8:1) — set by height, so keep it short or it crowds the nav. */
.brand-logo {
  height: 46px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a:not(.nav-call) {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.5em 0.7em;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav a:not(.nav-call):hover { color: var(--ink); background: var(--grid); }

.site-nav a.active {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--red);
  border-radius: 6px 6px 0 0;
}

.nav-call { display: none; }
.header-call { padding: 0.75em 1.2em; font-size: 0.88rem; }

/* Keep the "Book a Tour" CTA looking like a button inside the nav,
   overriding the plain-link nav styling. */
.site-nav a.nav-tour {
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--red);
  padding: 0.6em 1.05em;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 6px;
  margin-left: 0.35rem;
}
.site-nav a.nav-tour:hover { background: #A82F28; border-color: #A82F28; color: var(--white); }
.site-nav a.nav-tour.active { box-shadow: none; }

/* ---------- Nav dropdowns ---------- */

.nav-group { position: relative; }

.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5em 0.7em;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-trigger:hover { color: var(--ink); background: var(--grid); }
.nav-caret { transition: transform 0.2s ease; }

.nav-trigger.active-parent {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--red);
  border-radius: 6px 6px 0 0;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--grid);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 120;
}

/* Invisible bridge so the pointer can cross the gap without closing. */
.nav-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu,
.nav-group.open .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-group:hover .nav-caret,
.nav-group:focus-within .nav-caret,
.nav-group.open .nav-caret { transform: rotate(180deg); }

.nav-menu a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.55em 0.7em;
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-menu a:hover { color: var(--ink); background: var(--grid); }

.nav-menu a.active {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 2px 0 0 var(--red);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 1px solid var(--grid);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  background-position: top left, top left;
  background-repeat: repeat, repeat;
  background-color: var(--paper);
  border-bottom: 1px solid var(--grid);
  overflow: hidden;
}

.hero::after {
  /* fade the grid out toward the bottom so content sections start clean */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(transparent, var(--paper));
  pointer-events: none;
}

/* ============================================================
   Timetable coverflow — 3D spherical carousel in the hero
   ============================================================ */
.hero--timetable {
  padding-top: clamp(2.25rem, 5vw, 3.75rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

/* Override the default two-column hero layout for the carousel. */
.hero--timetable .container {
  display: block;
  position: relative;
  z-index: 1;
}

/* The page's opening statement, above the poster carousel. */
.hero-intro {
  max-width: 46rem;
  margin: 0 auto clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
}

.hero-intro h1 { margin-bottom: 0.5em; }

.hero-pitch {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 54ch;
  margin-inline: auto;
}

.hero-intro .eyebrow { margin-inline: auto; }
.hero-intro .hero-actions { justify-content: center; }

.coverflow {
  --cf-w: clamp(340px, 58vw, 860px);      /* width of the centre 16:9 card */
  position: relative;
  outline: none;
}


.cf-stage {
  position: relative;
  height: calc(var(--cf-w) * 3 / 4 + 5rem);
  perspective: 1600px;
  transform-style: preserve-3d;
}

.cf-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cf-w);
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 24px 55px -22px rgba(20, 24, 40, 0.45);
  cursor: pointer;
  will-change: transform, opacity;
  transition: transform 0.55s cubic-bezier(.22,.61,.36,1),
              opacity 0.45s ease,
              box-shadow 0.45s ease;
  /* base transform is set inline by JS; this is the pre-JS fallback */
  transform: translate(-50%, -50%);
}

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

.cf-item.is-active {
  cursor: zoom-in;   /* a tap on the centre card opens it full size */
  box-shadow: 0 34px 70px -20px rgba(20, 24, 40, 0.55);
}

.cf-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.cf-nav:hover { background: var(--red); color: #fff; border-color: var(--red); }
.cf-nav:active { transform: translateY(-50%) scale(0.94); }
.cf-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cf-nav--prev { left: clamp(0.25rem, 2vw, 1.5rem); }
.cf-nav--next { right: clamp(0.25rem, 2vw, 1.5rem); }

.cf-caption {
  margin-top: 1.25rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .cf-item { transition: none; }
}

/* ---------- Poster lightbox (opened from the coverflow) ---------- */

body.lb-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  padding: clamp(3.5rem, 8vw, 4.5rem) clamp(0.75rem, 3vw, 2rem);
  background: rgba(9, 15, 27, 0.97);
  overscroll-behavior: contain;
}

.lightbox[hidden] { display: none; }

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  max-height: 100%;
  min-width: 0;
}

.lb-figure img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.8);
}

.lb-caption {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #C9D8EE;
  text-align: center;
}

.lb-close,
.lb-nav {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lb-close:hover,
.lb-nav:hover { background: var(--red); border-color: var(--red); }

.lb-close svg,
.lb-nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-close {
  position: absolute;
  top: clamp(0.75rem, 3vw, 1.5rem);
  right: clamp(0.75rem, 3vw, 1.5rem);
}

/* On a phone the arrows sit under the poster, clear of the image itself. */
@media (max-width: 640px) {
  .lightbox { flex-wrap: wrap; align-content: center; }
  .lb-figure { order: -1; flex: 1 0 100%; }
  .lb-figure img { max-height: calc(100vh - 13rem); }
  .lb-close, .lb-nav { width: 42px; height: 42px; }
}

.hero:not(.hero--timetable) .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.35rem, 5.4vw, 3.9rem);
  font-weight: 800;
  margin-bottom: 0.4em;
}

.hero-copy p {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero-note {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.hero-note a { color: var(--red); font-weight: 500; }

/* ============================================================
   First round offers — school logo ticker under the hero.
   One row of chips, cloned by JS and slid right-to-left so the
   loop never shows a seam.
   ============================================================ */
.offers {
  --offers-bg: var(--white);
  background: var(--offers-bg);
  border-bottom: 1px solid var(--grid);
  padding: clamp(2rem, 4.5vw, 3rem) 0 clamp(2.25rem, 5vw, 3.25rem);
  overflow: hidden;
}

.offers-head {
  text-align: center;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.offers-head .eyebrow { margin-inline: auto; }

.offers-title {
  font-size: clamp(1.4rem, 2.8vw, 1.95rem);
  font-weight: 700;
  margin-bottom: 0.35em;
}

.offers-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* The viewport the track slides through, with the edges faded out. */
.offers-marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.offers-track { display: flex; width: max-content; }

.offers-row {
  --offer-logo: clamp(88px, 9vw, 124px);
  display: flex;
  align-items: flex-start;
  gap: clamp(1.75rem, 3.5vw, 3.25rem);
  margin: 0;
  padding: 0 clamp(0.9rem, 1.75vw, 1.6rem);
  list-style: none;
}

.offer-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.offer-chip img {
  width: var(--offer-logo);
  height: var(--offer-logo);
  object-fit: contain;
}

.offer-count {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

/* Animation only runs once JS has cloned the row — otherwise a -50%
   slide would drag the single row off the screen. */
@media (prefers-reduced-motion: no-preference) {
  .offers-marquee.is-live .offers-track {
    animation: offers-scroll var(--offers-duration, 45s) linear infinite;
  }

  .offers-marquee.is-live:hover .offers-track,
  .offers-marquee.is-live:focus-within .offers-track { animation-play-state: paused; }

  @keyframes offers-scroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
  }
}

/* No animation: let the row be swiped instead of stranding logos off-screen. */
@media (prefers-reduced-motion: reduce) {
  .offers-marquee { overflow-x: auto; scrollbar-width: thin; }
  .offers-marquee .offers-row + .offers-row { display: none; }
}

/* Exam cover-sheet card — the page's signature artifact */
.exam-slip {
  position: relative;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.75rem 1.75rem 3rem;
  transform: rotate(1.2deg);
}

.exam-slip::before {
  /* the red margin line of an answer booklet */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2.1rem;
  width: 1.5px;
  background: var(--red);
  opacity: 0.55;
}

.exam-slip-head {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 0.35rem;
}

.exam-slip dl { margin: 0; }

.exam-slip .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.78rem 0;
  border-bottom: 1px solid var(--rule);
}

.exam-slip .row:last-of-type { border-bottom: none; }

.exam-slip dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.exam-slip dd {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: right;
}

.exam-stamp {
  position: absolute;
  right: -14px;
  top: -16px;
  width: 74px;
  height: 74px;
  border: 2.5px solid var(--red);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--white);
  transform: rotate(9deg);
  line-height: 1.3;
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(3.25rem, 7vw, 5.5rem); }
.section-alt { background: var(--white); border-block: 1px solid var(--grid); }

.section-head { margin-bottom: clamp(1.75rem, 4vw, 3rem); }

/* A closing button under a section's content. */
.section-cta { margin-top: clamp(1.75rem, 4vw, 2.5rem); }

/* YouTube facade — loads the iframe only when clicked */
.yt-facade {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy-deep);
  box-shadow: var(--shadow);
  border: 1px solid var(--grid);
  cursor: pointer;
}

.yt-facade .yt-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.yt-facade:hover .yt-poster { transform: scale(1.03); }

.yt-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 84px;
  height: 60px;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.yt-play svg { width: 84px; height: 60px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35)); }
.yt-play .yt-play-bg { fill: #1f1f1f; fill-opacity: 0.85; transition: fill 0.2s ease; }
.yt-facade:hover .yt-play-bg,
.yt-play:focus-visible .yt-play-bg { fill: var(--red); fill-opacity: 1; }

.yt-facade figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1.2rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 26, 46, 0.85));
}

.yt-facade iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Rail (side-scrolling shelf, used for clips and campus shots) ----
   --rail-card sets how much of the track one card takes, so a rail shows two
   big items or several small ones just by changing that one number. */

.rail { position: relative; --rail-card: 46%; }

.rail-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  /* Room for the card shadow to breathe, plus space under the scrollbar. */
  padding: 0.4rem 0.4rem 1.1rem;
  margin-inline: -0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.rail-track.is-dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
  user-select: none;
}

.rail-track.is-dragging .rail-card { cursor: grabbing; }

.rail-track::-webkit-scrollbar { height: 8px; }
.rail-track::-webkit-scrollbar-track { background: var(--grid); border-radius: 99px; }
.rail-track::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 99px; }
.rail-track::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); }

.rail-card {
  flex: 0 0 var(--rail-card);
  scroll-snap-align: start;
}

/* The play badge is a shared <use> sprite, so colour it through `fill`,
   which inherits into the symbol (the arrow keeps its own white fill). */
.rail-card .yt-play { width: 76px; height: 54px; }
.rail-card .yt-play svg {
  width: 76px;
  height: 54px;
  fill: rgba(31, 31, 31, 0.85);
  transition: fill 0.2s ease;
}
.rail-card:hover .yt-play svg,
.rail-card .yt-play:focus-visible svg { fill: var(--red); }

.rail-card figcaption {
  padding: 2.6rem 1.3rem 1rem;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}

/* Campus shots sit smaller and wider — several on screen at once. */
.rail--campus { --rail-card: 30%; }

.rail--campus .rail-card {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--grid);
}

.rail--campus .rail-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.rail--campus .rail-card:hover img { transform: scale(1.04); }

.rail--campus figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem 1.1rem 0.85rem;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 26, 46, 0.88));
}

/* Fades that hint at more cards off each edge; JS drops them at the ends. */
.rail::before,
.rail::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 1.1rem;
  width: 3.5rem;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
  z-index: 2;
}

/* Rails on an unbanded section sit on paper, not white — match the fade. */
.section:not(.section-alt) { --rail-fade: var(--paper); }

.rail::before { left: -0.4rem; background: linear-gradient(90deg, var(--rail-fade, var(--white)), transparent); }
.rail::after { right: -0.4rem; background: linear-gradient(270deg, var(--rail-fade, var(--white)), transparent); }
.rail.at-start::before { opacity: 0; }
.rail.at-end::after { opacity: 0; }

.rail-nav {
  position: absolute;
  top: calc(50% - 0.55rem);
  transform: translateY(-50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--grid);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.25s ease;
}

.rail-nav:hover { background: var(--red); color: #fff; border-color: var(--red); }
.rail-nav:active { transform: translateY(-50%) scale(0.94); }
.rail-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rail-nav--prev { left: -0.9rem; }
.rail-nav--next { right: -0.9rem; }

.rail-nav[disabled] { opacity: 0; pointer-events: none; }

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

/* ---------- Cyberschool band ---------- */

.cyber-band {
  background: var(--navy-deep);
  color: var(--white);
  --rail-fade: var(--navy-deep);
}

.cyber-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.cyber-band .eyebrow { color: #E89B95; }
.cyber-band .section-title { color: var(--white); }
.cyber-band .section-lead { color: var(--rule); }

.cyber-points {
  list-style: none;
  margin: 1.5rem 0 2rem;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.cyber-points li {
  position: relative;
  padding-left: 1.9rem;
  color: var(--rule);
  font-size: 1.02rem;
}

.cyber-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(232, 155, 149, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E89B95' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 13.5 9.5 19 20 5.5'/%3E%3C/svg%3E") center / 0.8rem no-repeat;
}

.cyber-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Outline button that works on the dark band. */
.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(201, 216, 238, 0.5);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--white); }

.cyber-window {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(201, 216, 238, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  background: #182742;
}

.cyber-chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  background: #101d33;
  border-bottom: 1px solid rgba(201, 216, 238, 0.16);
}

.cyber-chrome > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(201, 216, 238, 0.3);
}

.cyber-url {
  margin: 0 0 0 0.7rem;
  flex: 1;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  background: rgba(201, 216, 238, 0.12);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--rule);
}

.cyber-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(rgba(201, 216, 238, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 216, 238, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
}

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

/* ---------- Course cards ---------- */

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

.course-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.course-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 4px;
  padding: 0.35em 0.7em;
  align-self: flex-start;
  margin-bottom: 1.1rem;
}

.course-card h3 { font-size: 1.28rem; font-weight: 700; }

/* Pointer to the trial test courses, under the Years 1–6 card grid. */
.course-aside {
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.course-aside a { color: var(--red); font-weight: 500; }

.course-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex-grow: 1;
}

.course-more {
  margin-top: 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--red);
}

/* ---------- Downloads (ruled answer-sheet list) ---------- */

.download-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.download-group {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.download-group h3 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 1.5rem;
  background: var(--ink);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
}

.download-group h3 small {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rule);
}

.download-list { position: relative; padding-left: 1.1rem; }

.download-list::before {
  /* answer-booklet red margin */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.1rem;
  width: 1px;
  background: var(--red);
  opacity: 0.4;
}

.download-list a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  font-size: 0.93rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.download-list a:last-child { border-bottom: none; }
.download-list a:hover { background: var(--paper); }
.download-list a:hover .dl-name { color: var(--red); }

.dl-name { flex-grow: 1; }

.dl-type {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.25em 0.55em;
  flex: none;
}

.featured-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.featured-download .fd-text { flex: 1 1 280px; }

.featured-download h3 { color: var(--white); font-size: 1.2rem; margin-bottom: 0.2em; }

.featured-download p {
  color: var(--rule);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Feature list (why us) ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}

.feature-tick {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--red-soft);
  color: var(--red);
  border-radius: 50%;
  margin-top: 0.15rem;
}

.feature-tick svg { width: 15px; height: 15px; }

.feature h3 { font-size: 1.05rem; margin-bottom: 0.25em; }
.feature p { color: var(--ink-soft); font-size: 0.93rem; }

/* ---------- Contact strip / info cards ---------- */

.contact-strip {
  background: var(--navy-deep);
  color: var(--white);
}

.contact-strip .section-title { color: var(--white); }
.contact-strip .section-lead { color: var(--rule); }

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.contact-card {
  border: 1px solid rgba(201, 216, 238, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.contact-card h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rule);
  margin-bottom: 0.75rem;
}

.contact-card a, .contact-card p {
  color: var(--white);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  font-family: var(--font-display);
}

.contact-card a:hover { color: #E89B95; }

.contact-card small {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--rule);
}

/* ---------- Page hero (subpages) ---------- */

.page-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  border-bottom: 1px solid var(--grid);
}

.page-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 800;
  max-width: 20ch;
}

.page-hero .section-lead { font-size: 1.08rem; }

/* ---------- Prose blocks ---------- */

.prose { max-width: 68ch; }
.prose h2 { font-size: 1.6rem; margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--ink); }

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

/* Fact sheet (about page sidebar) */
.fact-sheet {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.fact-sheet h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.fact-sheet .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.92rem;
}

.fact-sheet .row:last-child { border-bottom: none; }
.fact-sheet .row span { color: var(--ink-soft); }
.fact-sheet .row strong { text-align: right; }

/* ---------- Course detail blocks ---------- */

.course-detail {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 1.5rem;
}

.course-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.course-detail-head h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); }

/* Heading for the second group of courses, ruled off from the one above. */
.course-group-head {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--rule);
}

.course-detail > p { color: var(--ink-soft); max-width: 62ch; }

.course-sub {
  font-size: 1.05rem;
  margin-top: 1.6rem;
  margin-bottom: 0.2rem;
}

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

.subject {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  background: var(--paper);
}

.subject h3 { font-size: 1rem; margin-bottom: 0.3em; }
.subject p { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }

.check-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.6rem;
}

.check-list li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

.check-list li::before {
  content: "✓";
  color: var(--red);
  font-weight: 700;
  flex: none;
  line-height: 1.5;
}

/* ---------- Steps (new students) ---------- */

.steps { counter-reset: step; display: grid; gap: 1.25rem; }

.step {
  counter-increment: step;
  display: flex;
  gap: 1.5rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem 1.75rem;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--red);
  flex: none;
  line-height: 1.2;
}

.step h3 { font-size: 1.15rem; margin-bottom: 0.3em; }
.step p { color: var(--ink-soft); font-size: 0.95rem; }
.step .btn { margin-top: 0.9rem; }

/* ---------- Hours tables ---------- */

.hours-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.hours-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.hours-card h3 {
  margin: 0;
  padding: 1rem 1.5rem;
  background: var(--ink);
  color: var(--white);
  font-size: 1rem;
}

.hours-card.holiday h3 { background: var(--red); }

.hours-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.hours-card td {
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.hours-card tr:last-child td { border-bottom: none; }

.hours-card td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.hours-card .closed td:last-child { color: var(--red); }

.map-embed {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 2rem;
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: 380px;
  border: 0;
}

/* ---------- Enquiry form + map ---------- */

.enquiry-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
}

.enquiry-form {
  background: var(--paper);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.35rem, 3vw, 2rem);
}

.enquiry-solo { max-width: 640px; }

.enquiry-submit { width: 100%; margin-top: 0.35rem; }

.enquiry-fineprint {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.enquiry-fineprint a { color: var(--red); font-weight: 500; }

.enquiry-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  font-size: 0.92rem;
}

.enquiry-aside .map-embed { margin-top: 0; }
.enquiry-aside .map-embed iframe { height: 280px; }

.visit-facts {
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.9rem;
}

.visit-facts > div { margin: 0; }

.visit-facts dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.visit-facts dd {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.6;
}

.visit-facts dd a { color: var(--red); font-weight: 500; }

/* ---------- Notice box ---------- */

.notice {
  display: flex;
  gap: 0.9rem;
  background: var(--red-soft);
  border: 1px solid #E5C4C0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: var(--ink);
  font-size: 0.95rem;
}

.notice strong { color: var(--red); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-deep);
  color: var(--rule);
  padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem;
  margin-top: auto;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(201, 216, 238, 0.2);
}

.footer-logo {
  display: block;
  margin-bottom: 0.9rem;
}

/* Same lockup as the header, wordmark reversed out for the navy ground.
   Sized by width so the 5.8:1 strip can never outgrow its grid column. */
.footer-logo img {
  width: min(300px, 100%);
  height: auto;
}

.footer-brand p { font-size: 0.9rem; max-width: 34ch; }

.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8FA3C4;
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  color: var(--rule);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.22rem 0;
}

.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-col p { font-size: 0.92rem; margin-top: 0.5rem; }
.footer-hours { line-height: 1.9; }

.footer-bottom {
  padding-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #8FA3C4;
}

/* ---------- Reveal on scroll ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }
  .reveal.in { opacity: 1; transform: none; }
}

/* ==========================================================================
   Teacher profiles
   ========================================================================== */

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

.teacher-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.teacher-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.teacher-avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--grid);
  border: 2px solid var(--rule);
}

/* Alternate the ring accent so the grid reads as a set, not a block. */
.teacher-card:nth-child(3n+2) .teacher-avatar { border-color: var(--red); }
.teacher-card:nth-child(3n+3) .teacher-avatar { border-color: var(--ink); }

.teacher-head h3 { font-size: 1.2rem; font-weight: 700; margin: 0; }

.teacher-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0.2rem 0 0;
}

.teacher-bio {
  color: var(--ink-soft);
  font-size: 0.93rem;
  flex-grow: 1;
  margin-bottom: 1.1rem;
}

.teacher-subjects {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
  padding: 0;
}

.teacher-subjects li {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--grid);
  border-radius: 4px;
  padding: 0.3em 0.65em;
}

.teacher-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--grid);
}

.teacher-meta div { margin: 0; }

.teacher-meta dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.teacher-meta dd {
  margin: 0.15rem 0 0;
  font-weight: 700;
  font-size: 0.92rem;
}

/* ==========================================================================
   Book a tour
   ========================================================================== */

.booking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.booking-col {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.35rem, 3vw, 2rem);
}

.booking-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
}

.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7em;
  height: 1.7em;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
}

/* ---------- Calendar ---------- */

.calendar {
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--paper);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.cal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.cal-nav:hover:not(:disabled) { background: var(--ink); color: var(--white); }
.cal-nav:disabled { opacity: 0.3; cursor: not-allowed; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.cal-weekdays span {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.25rem 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.cal-cell:hover:not(:disabled):not(.cal-blank) {
  border-color: var(--ink);
  background: var(--grid);
}

.cal-cell.is-selected {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  font-weight: 700;
}

.cal-cell.is-off {
  color: var(--rule);
  background: transparent;
  border-color: transparent;
  cursor: not-allowed;
}

.cal-blank { border: none; background: none; cursor: default; }

.cal-note {
  margin: 0.9rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* ---------- Time slots ---------- */

.timeslots { margin-top: 1.5rem; }

.timeslots-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.75rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.6rem;
}

.slot {
  padding: 0.7em 0.5em;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.slot:hover { border-color: var(--ink); background: var(--grid); }

.slot.is-selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  font-weight: 700;
}

/* ---------- Form fields ---------- */

.field { margin-bottom: 1.15rem; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.field .optional { color: var(--ink-soft); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.7em 0.85em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea { resize: vertical; min-height: 80px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 36, 61, 0.08);
}

.field input::placeholder,
.field textarea::placeholder { color: #9AA6BC; }

/* ---------- Summary + submit ---------- */

.booking-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  margin: 0.5rem 0 1.25rem;
  background: var(--red-soft);
  border: 1px dashed var(--red);
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--ink);
}

.summary-icon { color: var(--red); flex-shrink: 0; display: inline-flex; }

.booking-submit { width: 100%; }

.booking-fineprint {
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ---------- Confirmation ---------- */

.booking-done {
  position: relative;
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3rem);
  box-shadow: var(--shadow);
}

.booking-done h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.booking-done p { color: var(--ink-soft); margin-bottom: 1.5rem; }

.done-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 6px;
  padding: 0.3em 0.7em;
  margin-bottom: 1.25rem;
  transform: rotate(-4deg);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero {
    background-image:
      linear-gradient(var(--grid) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 32px 32px, 32px 32px;
    background-position: top left, top left;
    background-repeat: repeat, repeat;
  }
  .exam-slip { max-width: 460px; transform: rotate(0.8deg); }
  .card-grid, .contact-cards, .teacher-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .fact-sheet { position: static; }
  .header-call { display: none; }
  .booking-grid { grid-template-columns: 1fr; }
  .cyber-layout,
  .enquiry-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--grid);
    box-shadow: 0 16px 32px rgba(22, 36, 61, 0.12);
    padding: 0.5rem 1.25rem 1.25rem;
    display: none;
  }

  .site-nav.open { display: flex; }

  .site-nav a:not(.nav-call) {
    padding: 0.9em 0.5em;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--grid);
    border-radius: 0;
  }

  .site-nav a.active { box-shadow: inset 3px 0 0 var(--red); padding-left: 1em; }

  .nav-call {
    display: inline-flex;
    margin-top: 1rem;
  }

  .site-nav a.nav-tour {
    margin: 1rem 0 0;
    padding: 0.85em 1.05em;
    font-size: 1rem;
    text-align: center;
    justify-content: center;
  }

  /* Dropdowns become inline accordions inside the mobile menu. */
  .nav-group { position: static; }

  .nav-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 0.9em 0.5em;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--grid);
    border-radius: 0;
  }

  .nav-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
  }

  .nav-menu::before { display: none; }

  /* On touch, only an explicit toggle opens the submenu — not hover/focus. */
  .nav-group:hover .nav-menu,
  .nav-group:focus-within .nav-menu { display: none; }
  .nav-group.open .nav-menu { display: flex; }

  .nav-menu a {
    padding: 0.85em 0.5em 0.85em 1.5em;
    font-size: 1rem;
    border-bottom: 1px solid var(--grid);
    border-radius: 0;
    white-space: normal;
  }

  /* Swiping is the natural gesture here — drop the arrows. */
  .rail-nav { display: none; }
  .rail::before,
  .rail::after { width: 1.75rem; }
  .rail { --rail-card: 84%; }
  .rail--campus { --rail-card: 62%; }
  .rail-card .yt-play,
  .rail-card .yt-play svg { width: 64px; height: 46px; }
}

@media (max-width: 640px) {
  :root { --header-h: 66px; }

  .brand-logo { height: 36px; }

  .card-grid,
  .contact-cards,
  .download-groups,
  .feature-grid,
  .hours-grid,
  .subject-grid,
  .teacher-grid { grid-template-columns: 1fr; }

  .field-row { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }

  .hero-actions .btn { flex: 1 1 100%; }

  /* Narrower centre card so the neighbouring timetables peek in more. */
  .coverflow { --cf-w: clamp(210px, 64vw, 360px); }

  .offers-row { --offer-logo: 76px; gap: 1.4rem; }

  .step { flex-direction: column; gap: 0.6rem; padding: 1.35rem; }

  .exam-slip { padding: 1.4rem 1.25rem 1.4rem 2.4rem; }
  .exam-slip::before { left: 1.7rem; }
  .exam-stamp { right: -8px; top: -14px; width: 64px; height: 64px; }

  .map-embed iframe { height: 300px; }
}
