/* ═══════════════════════════════════════════════════════════════════════
   Integrity Keepers' School — public site, multi-page (Nov 2026)

   Layout follows the classic Ghanaian school-site pattern parents know
   (photo hero with a coloured card, welcome split, class cards, news,
   dark footer) but the identity is the school's own:
   · COBALT + YOLK from the uniform; the uniform print (.print) is the
     signature, used on bands and one banner per page at most.
   · INK is the crest's navy. Fraunces for display, system sans for text.
   Contrast: yolk is never text on a light surface.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/fraunces-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/fraunces-latin-italic.woff2') format('woff2');
}

:root {
  --ink: #11163a;
  --ink-2: #1a2150;
  --cobalt: #1c3ea8;
  --cobalt-deep: #142d7e;
  --yolk: #f2b81d;
  --yolk-soft: #fbe7ad;
  --sky: #3d9bd4;
  --paper: #ffffff;
  --paper-2: #eef3ff;
  --text: #171a33;
  --text-2: #50546e;
  --line: #d9e1f2;
  --on-dark-2: #c3c8e6;

  --display: 'Fraunces', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;

  --wrap: 1200px;
  --gut: clamp(20px, 5vw, 40px);
  --sec: clamp(64px, 8vw, 112px);
  --r: 6px;
  --r-lg: 14px;
  --header-h: 76px;

  --print: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Crect width='36' height='36' fill='%231c3ea8'/%3E%3Cpath d='M0 0L36 36M36 0L0 36' stroke='%23ffffff' stroke-opacity='.28' stroke-width='1.2'/%3E%3Cpath d='M18 9L23 18L18 27L13 18Z' fill='%23f2b81d'/%3E%3Cpath d='M0 -5L5 0L0 5L-5 0Z M36 -5L41 0L36 5L31 0Z M0 31L5 36L0 41L-5 36Z M36 31L41 36L36 41L31 36Z' fill='%23f2b81d'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 4vw, 3rem); color: var(--ink); }
.on-dark h2 { color: #fff; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--yolk); color: var(--ink); font-weight: 700;
}
.skip:focus { top: 12px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.print { background-image: var(--print); background-size: 36px 36px; }
.print-band { height: 18px; }
.section { padding: var(--sec) 0; }
.section.tint { background: var(--paper-2); }
.section.dark { background: var(--ink); color: #fff; }
.lede { font-size: 1.15rem; color: var(--text-2); max-width: 620px; margin-top: 16px; }
.dark .lede { color: var(--on-dark-2); }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }
.dot-accent { position: relative; }
.dot-accent::after {
  content: ''; position: absolute; width: 10px; height: 10px;
  background: var(--yolk); transform: rotate(45deg);
  top: -18px; right: -18px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 0.95rem/1.1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-yolk { background: var(--yolk); color: var(--ink); }
.btn-yolk:hover { background: #ffc93a; }
.btn-cobalt { background: var(--cobalt); color: #fff; }
.btn-cobalt:hover { background: var(--cobalt-deep); }
.btn-line { border-color: currentColor; color: inherit; background: transparent; }
.btn-line:hover { background: rgba(255, 255, 255, 0.1); }
.text-link { font-weight: 700; color: var(--cobalt); text-underline-offset: 4px; }
.more-link {
  display: inline-flex; gap: 6px; margin-top: 24px;
  font-weight: 700; color: var(--cobalt); text-decoration: none;
  border-bottom: 2px solid var(--yolk); padding-bottom: 2px;
}
.more-link:hover { color: var(--cobalt-deep); }
.dark .more-link { color: #fff; }

/* ── Admissions announcement (every page; year set once in build-pages) ── */
/* Yolk ground with ink text: yolk is never text on a light surface, but ink
   on yolk passes AA comfortably (≈10:1). */
.announce { background: var(--yolk); color: var(--ink); font-size: 0.95rem; }
.announce .wrap { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; position: relative; padding-right: 56px; }
.announce a { color: var(--ink); text-decoration: none; padding: 10px 0; text-align: center; line-height: 1.35; }
.announce a b { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; white-space: nowrap; }
.announce a:hover b { text-decoration-thickness: 3px; }
.announce-x {
  position: absolute; right: max(8px, calc(var(--gut) - 14px)); top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent;
  color: var(--ink); font: 400 1.6rem/1 var(--sans); cursor: pointer;
}
.announce-x:hover { background: rgba(17, 22, 58, 0.1); }
.announce-x:focus-visible { outline-color: var(--ink); }

/* ── Utility bar + header ─────────────────────────────────────────────── */
.util { background: var(--ink); color: var(--on-dark-2); font-size: 0.8125rem; }
.util .wrap { display: flex; justify-content: space-between; gap: 16px; min-height: 36px; align-items: center; }
.util .links { display: flex; gap: 22px; }
.util a { text-decoration: none; color: #fff; }
.util a:hover { text-decoration: underline; }

header.site {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  transition: box-shadow 0.2s;
}
header.site.scrolled { box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(17, 22, 58, 0.09); }
.nav-bar { display: flex; align-items: center; gap: 26px; min-height: var(--header-h); transition: min-height 0.2s; }
/* Once the page scrolls, the desktop header slims down (76 → 64px) and the
   crest with it. Desktop only: the phone bar is already slim, and the drawer
   is positioned from --header-h. */
@media (min-width: 1101px) {
  header.site.scrolled .nav-bar { min-height: 64px; }
  header.site.scrolled .brand .crest { width: 42px; height: 42px; }
}
.brand .crest { transition: width 0.2s, height 0.2s; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand .crest { width: 50px; height: 50px; border-radius: 50%; }
.brand b { display: block; font: 700 1.15rem/1.05 var(--display); color: var(--ink); }
.brand small {
  display: block; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cobalt); font-weight: 700; margin-top: 3px;
}
nav.links { display: flex; align-items: center; gap: 24px; }
nav.links > a {
  text-decoration: none; font-weight: 600; font-size: 0.95rem; color: var(--ink);
  padding: 6px 0; border-bottom: 2px solid transparent;
}
nav.links > a:hover { color: var(--cobalt); }
nav.links > a[aria-current='page'] { color: var(--cobalt); border-color: var(--yolk); }
nav.links > a.drawer-only { display: none; }
.drawer-actions { display: none; }
.menu-btn {
  display: none; gap: 10px; min-height: 44px; padding: 10px 16px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink); font: 700 0.9rem/1 var(--sans); cursor: pointer;
}
/* three-line icon that turns into a cross while the drawer is open */
.burger { position: relative; width: 18px; height: 2px; background: currentColor; transition: background 0.15s; }
.burger::before, .burger::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; transition: transform 0.2s;
}
.burger::before { top: -6px; }
.burger::after { top: 6px; }
header.site.nav-open .burger { background: transparent; }
header.site.nav-open .burger::before { transform: translateY(6px) rotate(45deg); }
header.site.nav-open .burger::after { transform: translateY(-6px) rotate(-45deg); }
.drawer-portal { justify-self: center; margin-top: 6px; font-weight: 700; color: var(--cobalt); text-underline-offset: 4px; }

@media (max-width: 1100px) {
  .menu-btn { display: inline-flex; align-items: center; position: relative; }
  .nav-cta { display: none; }
  nav.links { display: none; }
  header.site.nav-open nav.links {
    display: flex; position: fixed; inset: var(--header-h) 0 0 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gut) 32px; background: var(--paper); overflow-y: auto;
  }
  header.site.nav-open nav.links > a,
  header.site.nav-open nav.links > a.drawer-only {
    display: block; font: 600 1.5rem/1.2 var(--display);
    padding: 14px 0; border-bottom: 1px solid var(--line);
  }
  header.site.nav-open nav.links > a[aria-current='page'] { color: var(--cobalt); border-bottom-color: var(--line); }
  header.site.nav-open nav.links > a[aria-current='page']::before { content: '◆ '; color: var(--yolk); font-size: 0.8em; }
  header.site.nav-open .drawer-actions { display: grid; gap: 10px; margin-top: 24px; }
  header.site.nav-open .drawer-actions .btn-line { color: var(--ink); }
  .util .loc { display: none; }
  .util .wrap { justify-content: center; }
}

/* Phones: one slim bar, like a native app. The utility row goes (the bottom
   action bar already has Call and WhatsApp; the drawer has the portal) and the
   name sits on one line, so content starts ~80px sooner. */
@media (max-width: 860px) {
  :root { --header-h: 62px; }
  .util { display: none; }
  .brand { gap: 10px; min-width: 0; }
  .brand .crest { width: 40px; height: 40px; }
  .brand b { font-size: 1.02rem; white-space: nowrap; }
  .brand small { font-size: 0.62rem; margin-top: 2px; }
  .nav-bar { gap: 12px; }
  /* icon-only menu button; the word stays for screen readers */
  .menu-btn { width: 44px; height: 44px; padding: 0; justify-content: center; flex: none; border-width: 1.5px; }
  .menu-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
@media (max-width: 360px) { .brand small { display: none; } }

/* ── Home hero: coloured panel + photograph, side by side ─────────────── */
.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  min-height: min(84vh, 720px); color: #fff; overflow: hidden; isolation: isolate;
  /* depth: a soft sky glow behind the headline over an ink → cobalt sweep */
  background:
    radial-gradient(ellipse 70% 80% at 30% 38%, rgba(61, 155, 212, 0.22), transparent 70%),
    linear-gradient(90deg, var(--ink-2) 0%, var(--cobalt-deep) 22%, var(--cobalt) 55%),
    var(--cobalt);
}
.hero::after {
  /* bottom shade on the whole hero, so it never starts at the photo's edge */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(17, 22, 58, 0.35) 0%, rgba(17, 22, 58, 0) 30%);
}
.hero-media { order: 2; position: relative; z-index: 0; display: block; min-height: 100%; margin-left: -7vw; }
.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  /* a mask, not an overlay: the photo dissolves into whatever gradient is behind it */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 6%, rgba(0, 0, 0, 0.3) 18%, rgba(0, 0, 0, 0.8) 32%, #000 44%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 6%, rgba(0, 0, 0, 0.3) 18%, rgba(0, 0, 0, 0.8) 32%, #000 44%);
}
.hero-inner {
  order: 1; position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end;
  padding: clamp(40px, 6vw, 80px) clamp(28px, 4vw, 56px) clamp(40px, 6vw, 80px) var(--gut);
}
.hero-card { width: 100%; max-width: 560px; container-type: inline-size; }
/* "Admissions open · 2026/2027", above the motto. A link, so 44px tall. */
.hero-chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 18px 8px 14px;
  margin-bottom: 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 700; font-size: 0.92rem;
  text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.hero-chip:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.5); }
.hero-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yolk); box-shadow: 0 0 0 4px rgba(242, 184, 29, 0.25); }
.hero .hero-chip + .motto { display: flex; width: max-content; }
.hero .motto {
  display: inline-flex; align-items: center; gap: 10px;
  font: italic 600 1rem/1 var(--display); color: var(--yolk); margin-bottom: 18px;
}
.hero .motto::before { content: ''; width: 26px; height: 2px; background: var(--yolk); }
.hero h1 {
  /* Sized from the card's own width: "Seven BECE classes." measures ~9.3em in
     Fraunces at these sizes (its optical-size axis widens small text), so
     10.5cqi keeps it on one line wherever the 2.3rem floor allows — every
     desktop width from 1100px up (it wrapped as "Seven BECE / classes." at
     1100–1850px). The vw value is the fallback without container units. */
  font-size: clamp(2.3rem, 4.4vw, 3.6rem);
  font-size: clamp(2.3rem, 10.5cqi, 3.6rem);
  line-height: 1.03; text-shadow: 0 2px 18px rgba(17, 22, 58, 0.25);
}
.hero h1 em { font-style: normal; color: var(--yolk); display: block; }
.hero-lead { margin-top: 20px; font-size: 1.1rem; color: #e4e9fb; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero .track { display: inline-block; margin-top: 18px; color: #fff; font-weight: 600; font-size: 0.95rem; text-underline-offset: 4px; }

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr; min-height: 0;
    background:
      radial-gradient(ellipse 90% 60% at 30% 70%, rgba(61, 155, 212, 0.18), transparent 70%),
      linear-gradient(180deg, var(--cobalt) 0%, var(--cobalt-deep) 100%);
  }
  .hero::after { display: none; }
  .hero-media { order: 1; aspect-ratio: 5 / 4; margin-left: 0; }
  .hero-photo {
    object-position: 50% 8%; /* heads sit high in the frame; 30% cropped them */
    -webkit-mask-image: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, 0.5) 80%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, 0.5) 80%, transparent 100%);
  }
  .hero-inner { order: 2; padding: 12px var(--gut) 44px; justify-content: flex-start; }
}
/* Phones: main actions become full-width bars, easy to hit with a thumb */
@media (max-width: 520px) {
  .hero-actions, .cta-banner .acts { flex-direction: column; }
  .hero-actions .btn, .cta-banner .acts .btn { width: 100%; }
}

/* ── Inner-page banner ────────────────────────────────────────────────── */
.page-head { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.page-head .wrap { position: relative; padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(40px, 6vw, 72px); }
.page-head::after {
  /* a column of the uniform print on the right edge */
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: min(22vw, 260px);
  background-image: var(--print); background-size: 36px 36px; opacity: 0.9;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
  mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.crumbs { font-size: 0.88rem; color: var(--on-dark-2); margin-bottom: 14px; }
.crumbs a { color: #fff; text-underline-offset: 3px; }
.page-head h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); max-width: 760px; position: relative; z-index: 1; }
.page-head h1 em { font-style: normal; color: var(--yolk); }
.page-head p.sub { margin-top: 14px; max-width: 600px; color: var(--on-dark-2); font-size: 1.1rem; position: relative; z-index: 1; }
@media (max-width: 700px) { .page-head::after { width: 70px; } }

/* ── Welcome split (home + about) ─────────────────────────────────────── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 7vw, 96px); align-items: center; }
.split.flip > :first-child { order: 2; }
.photo-frame { position: relative; margin: 0; }
.photo-frame img {
  width: 100%; border-radius: var(--r-lg); object-fit: cover; aspect-ratio: 4 / 3;
  box-shadow: 0 20px 50px rgba(17, 22, 58, 0.14);
}
.photo-frame::before {
  content: ''; position: absolute; z-index: -1; left: -18px; bottom: -18px; width: 45%; height: 55%;
  background-image: var(--print); background-size: 36px 36px; border-radius: var(--r-lg);
}
.photo-frame figcaption { margin-top: 12px; font-size: 0.88rem; color: var(--text-2); }
.prose p + p { margin-top: 16px; }
.prose { color: var(--text-2); font-size: 1.08rem; margin-top: 22px; }
.prose strong { color: var(--text); }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split.flip > :first-child { order: 0; }
  .photo-frame::before { left: -10px; bottom: -10px; }
}

/* ── Proof band (home) ────────────────────────────────────────────────── */
.proof { background: var(--ink); color: #fff; }
.proof .wrap { display: grid; grid-template-columns: 1fr auto; gap: 0; align-items: stretch; }
.proof-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.proof-item { padding: 40px 28px 40px 0; }
.proof-item + .proof-item { padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.proof-item b { display: block; font: 600 clamp(2.2rem, 4vw, 3.2rem)/1 var(--display); color: var(--yolk); }
.proof-item span { display: block; margin-top: 10px; color: var(--on-dark-2); font-size: 0.98rem; max-width: 260px; }
.proof .go { display: flex; align-items: center; padding-left: 28px; }
@media (max-width: 900px) {
  /* Three stats in a swipeable row (the next one peeks in), the honours-board
     button full width underneath. Text stays 16px; nothing shrinks to fit. */
  .proof .wrap { grid-template-columns: 1fr; padding-top: 28px; }
  .proof-stats {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%; gap: 12px;
    margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut) 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut);
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  }
  .proof-item, .proof-item + .proof-item {
    scroll-snap-align: start; padding: 20px; border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.04);
  }
  .proof-item b { font-size: 2.3rem; }
  .proof-item span { font-size: 1rem; max-width: none; }
  .proof .go { padding: 16px 0 30px; }
  .proof .go .btn { width: 100%; }
}

/* ── Class cards (home + academics) ───────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 370px; padding: 150px 28px 28px; border-radius: var(--r-lg); overflow: hidden;
  text-decoration: none; color: #fff; isolation: isolate;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(17, 22, 58, 0.2); }
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 130px; z-index: -1;
  background-image: var(--print); background-size: 36px 36px;
}
.card::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent 50px, var(--card-bg) 130px);
}
.card.k { --card-bg: var(--cobalt); background: var(--cobalt); }
.card.p { --card-bg: var(--ink-2); background: var(--ink-2); }
.card.j { --card-bg: var(--ink); background: var(--ink); }
.card .grad { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yolk); }
.card h3 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); margin: 8px 0 10px; }
.card p { color: #dfe4fa; font-size: 1rem; }
.card .arrow { margin-top: 18px; font-weight: 700; display: inline-block; transition: transform 0.2s; }
.card:hover .arrow, .card:focus-visible .arrow { transform: translateX(4px); }
.card:focus-visible { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(17, 22, 58, 0.2); }

/* With a photo: the picture fills the card and an ink scrim rises from the
   bottom, so the white text sits on ≥85% ink (well past AA). Without one, the
   print-pattern design above stays as it is. */
.card.has-photo { min-height: 420px; padding-top: 28px; }
.card.has-photo::before { display: none; }
.card.has-photo::after {
  background: linear-gradient(0deg, rgba(17, 22, 58, 0.94) 0%, rgba(17, 22, 58, 0.86) 48%, rgba(17, 22, 58, 0.3) 72%, rgba(17, 22, 58, 0) 88%);
}
.card-media { position: absolute; inset: 0; z-index: -2; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform 0.4s ease; }
.card.has-photo:hover .card-media img, .card.has-photo:focus-visible .card-media img { transform: scale(1.04); }
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }
  .card.has-photo { min-height: 360px; padding: 28px 22px 24px; }
  /* on a phone the print is a strip, not half the card: the words come first */
  .card { min-height: 0; padding: 78px 22px 24px; }
  .card::before { height: 58px; }
  .card::after { background: linear-gradient(180deg, transparent 20px, var(--card-bg) 58px); }
}

/* Section heading row: title on the left, "see more" on the right */
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 40px; }
.sec-head .more-link { margin-top: 0; }
.sec-head.small h3 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); color: var(--ink); }

/* ── Life tiles (home) ────────────────────────────────────────────────── */
/* Each tile is a link to the year on /school-life/: photo on top (4:3), then
   the month, title and line. A tile without a photo shows the print under a
   cobalt-to-ink gradient in the same frame, so the row stays even. */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 40px; }
.tile {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  --tile-c: var(--cobalt);
}
.tile:nth-child(2) { --tile-c: var(--yolk); }
.tile:nth-child(3) { --tile-c: var(--sky); }
.tile:nth-child(4) { --tile-c: var(--ink); }
.tile:hover, .tile:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(17, 22, 58, 0.14); }
.tile-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 4px solid var(--tile-c); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.tile:hover .tile-media img, .tile:focus-visible .tile-media img { transform: scale(1.04); }
.tile-media.fallback {
  background: linear-gradient(165deg, rgba(28, 62, 168, 0.15) 0%, rgba(20, 45, 126, 0.7) 45%, rgba(17, 22, 58, 0.96) 100%), var(--print);
  background-size: auto, 36px 36px;
}
.tile-body { display: block; padding: 20px 22px 24px; }
.tile .m { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cobalt); }
.tile h3 { font-size: 1.35rem; margin: 8px 0; color: var(--ink); }
.tile:hover h3 { color: var(--cobalt); }
.tile p { color: var(--text-2); font-size: 1rem; }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
/* Phones: a swipeable row, each tile ~80% of the screen so the next one peeks
   in as the cue to swipe, with a thin visible scrollbar as a second cue. */
@media (max-width: 520px) {
  .tiles {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%;
    gap: 14px; margin: 28px calc(-1 * var(--gut)) 0; padding: 4px var(--gut) 14px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut);
    scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  }
  .tile { scroll-snap-align: start; }
  .tile:hover, .tile:focus-visible { transform: none; }
}

/* Latest from the school (home, filled by site.js): picture on top, then the
   title as the link, in a three-up grid that reads the same with 1, 2 or 3 items */
.latest-wrap { margin-top: clamp(48px, 6vw, 72px); padding-top: clamp(32px, 4vw, 44px); border-top: 1px solid var(--line); }
.latest { margin-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.latest-item { display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.latest-item img {
  width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px;
  background: var(--paper-2); transition: opacity 0.15s;
}
.latest-item.no-photo { padding: 20px; border: 1px solid var(--line); border-top: 4px solid var(--cobalt); border-radius: 10px; }
.latest-item .kind { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cobalt); }
.latest-item h3 { font-size: 1.3rem; margin: 6px 0; color: var(--ink); }
.latest-item p {
  color: var(--text-2); font-size: 1rem;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
/* site.js sets data-count. One item becomes a wide featured card (picture
   left ~55%, words right) so there is no empty space; two sit side by side. */
.latest[data-count='2'] { grid-template-columns: repeat(2, 1fr); }
.latest[data-count='1'] { grid-template-columns: 1fr; }
.latest[data-count='1'] .latest-item:not(.no-photo) {
  display: grid; grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); gap: clamp(20px, 3vw, 40px); align-items: center;
}
.latest[data-count='1'] .latest-item h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.latest[data-count='1'] .latest-item p { -webkit-line-clamp: 3; line-clamp: 3; }
.latest-item:hover h3 { color: var(--cobalt); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.latest-item:hover img { opacity: 0.9; }
@media (max-width: 860px) {
  .latest, .latest[data-count] { grid-template-columns: 1fr; gap: 28px; }
  .latest[data-count='1'] .latest-item:not(.no-photo) { grid-template-columns: 1fr; gap: 14px; }
}

/* ── Parent voices (home; hidden until the school sends real quotes) ───── */
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.voice { margin: 0; padding: 28px; background: #fff; border-radius: var(--r-lg); border-top: 4px solid var(--cobalt); display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.voice blockquote { margin: 0; }
.voice blockquote p { font: italic 500 1.2rem/1.45 var(--display); color: var(--ink); }
.voice figcaption b { display: block; color: var(--ink); }
.voice figcaption span { color: var(--text-2); font-size: 1rem; }
@media (max-width: 860px) { .voice-grid { grid-template-columns: 1fr; } }

/* ── CTA banner ───────────────────────────────────────────────────────── */
/* after a white section the two paddings stacked into a ~220px hole */
.section:not(.tint):not(.dark) + .cta-section,
.section:not(.tint):not(.dark) + .voices[hidden] + .cta-section { padding-top: 0; }
.cta-banner {
  position: relative; border-radius: var(--r-lg); overflow: hidden; color: #fff;
  padding: clamp(36px, 6vw, 64px); display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 52%, rgba(17, 22, 58, 0.55) 100%), var(--print);
  background-size: auto, 36px 36px;
}
.cta-banner p.big { font: italic 600 clamp(1.6rem, 3.4vw, 2.5rem)/1.15 var(--display); max-width: 640px; }
.cta-banner p.small { margin-top: 10px; color: var(--on-dark-2); }
.cta-banner .acts { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) {
  .cta-banner { grid-template-columns: 1fr; background: var(--ink); }
}

/* ── Results: the honours board ───────────────────────────────────────── */
.board {
  margin-top: 8px; border: 1px solid rgba(242, 184, 29, 0.5);
  padding: clamp(20px, 4vw, 44px); position: relative; border-radius: 4px;
}
.board::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(242, 184, 29, 0.22); pointer-events: none; }
.board-title {
  text-align: center; font: 600 0.8rem/1 var(--sans); letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--yolk); margin-bottom: 26px;
}
.board table { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
.board th {
  font: 600 0.75rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--on-dark-2); text-align: left; padding: 0 0 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.board td { padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font: 600 clamp(1.15rem, 2.4vw, 1.6rem)/1.2 var(--display); }
.board tr:last-child td { border-bottom: 0; }
.board td.yr { color: var(--yolk); width: 22%; }
.board td small { display: block; font: 400 0.82rem/1.4 var(--sans); color: var(--on-dark-2); margin-top: 2px; }
.board .first { color: var(--yolk); }
.results-intro { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.results-intro p { color: var(--on-dark-2); font-size: 1.08rem; }
.results-intro h2 em { font-style: normal; color: var(--yolk); }
.results-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 72px); }
.results-split h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 8px; color: var(--ink); }
.results-split .sub { color: var(--text-2); font-size: 0.95rem; margin-bottom: 26px; }
.dist li { display: grid; grid-template-columns: 112px 1fr 44px; gap: 14px; align-items: center; padding: 8px 0; }
.dist .a { font-size: 0.9rem; color: var(--text-2); }
.dist .bar { height: 14px; background: var(--paper-2); position: relative; border-radius: 99px; overflow: hidden; }
.dist .bar span { position: absolute; inset: 0 auto 0 0; background: var(--cobalt); border-radius: 99px; }
.dist .best .bar span { background: var(--yolk); }
.dist .best .a { color: var(--ink); font-weight: 700; }
.dist .c { font: 600 1.25rem/1 var(--display); text-align: right; color: var(--ink); }
.dist-note, .destinations-foot { margin-top: 18px; font-size: 0.92rem; color: var(--text-2); }
.destinations li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.destinations li:first-child { border-top: 2px solid var(--ink); }
.destinations b { font: 600 1.15rem/1.2 var(--display); color: var(--ink); }
.destinations i { display: block; font-style: normal; font-size: 0.82rem; color: var(--cobalt); letter-spacing: 0.04em; }
.destinations .n { font: 600 1.4rem/1 var(--display); color: var(--ink); min-width: 2ch; text-align: right; }
.standout {
  display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center;
  padding: clamp(28px, 4vw, 44px); border-radius: var(--r-lg); background: var(--yolk-soft);
}
.standout .big { font: 600 clamp(3.2rem, 8vw, 5.5rem)/0.9 var(--display); color: var(--cobalt); }
.standout p { font-size: 1.125rem; max-width: 620px; color: var(--ink); }
.standout p span { display: block; margin-top: 6px; font-style: italic; color: var(--text-2); }
@media (max-width: 860px) {
  .results-intro, .results-split, .standout { grid-template-columns: 1fr; }
  .standout { gap: 12px; }
  .dist li { grid-template-columns: 96px 1fr 36px; }
}

/* ── About ────────────────────────────────────────────────────────────── */
.quote { margin: 0; padding: 28px 0 0; border-top: 3px solid var(--cobalt); }
.quote p { font: italic 500 clamp(1.5rem, 2.8vw, 2.1rem)/1.25 var(--display); color: var(--ink); }
.quote footer { margin-top: 12px; font-size: 0.9rem; color: var(--text-2); }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 48px; border-top: 2px solid var(--ink); }
.values > div { padding: 26px 26px 10px 0; }
.values > div + div { padding-left: 26px; border-left: 1px solid var(--line); }
.values h3 { font-size: 1.5rem; color: var(--ink); margin-bottom: 8px; }
.values p { color: var(--text-2); }
.cover-photo { margin: 36px 0 0; }
.cover-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-lg); opacity: 0; transition: opacity 0.4s; }
.cover-photo img.loaded { opacity: 1; }
@media (max-width: 860px) {
  .values { grid-template-columns: 1fr; }
  .values > div, .values > div + div { padding: 22px 0; border-left: 0; border-bottom: 1px solid var(--line); }
}

/* ── Academics ────────────────────────────────────────────────────────── */
.stage-row { display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 5vw, 64px); padding: 44px 0; border-top: 1px solid var(--line); }
.stage-row:first-child { border-top: 2px solid var(--ink); }
.stage-row .grad { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cobalt); }
.stage-row h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-top: 8px; }
.stage-row .prose { margin-top: 0; }
.stage-row ul.ticks { margin-top: 18px; display: grid; gap: 8px; }
.stage-row ul.ticks li { padding-left: 24px; position: relative; color: var(--text); }
.stage-row ul.ticks li::before {
  content: ''; position: absolute; left: 2px; top: 9px; width: 9px; height: 9px; background: var(--yolk); transform: rotate(45deg);
}
@media (max-width: 860px) { .stage-row { grid-template-columns: 1fr; gap: 14px; } }

/* ── The IKS year (static calendar) ───────────────────────────────────── */
.months { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.months > .month { padding: 18px 18px 26px 0; border-bottom: 1px solid var(--line); }
.months > .month:not(:nth-child(4n + 1)) { padding-left: 18px; border-left: 1px solid var(--line); }
.months > .month h3 { font: 700 0.8rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cobalt); margin-bottom: 12px; }
.months > .month li { font-size: 0.98rem; line-height: 1.4; padding: 3px 0; }
.months > .month li q { quotes: '“' '”'; color: var(--text-2); font-style: italic; }
.months > .month.big { background: var(--yolk-soft); }
.months > .month.big li:first-child { font: 600 1.2rem/1.25 var(--display); }
.months > .month.office { background: var(--ink); color: #fff; padding: 18px; border-left: 0; }
.months > .month.office h3 { color: var(--yolk); }
.months > .month.office a { color: var(--yolk); font-weight: 700; }
@media (max-width: 900px) {
  .months { grid-template-columns: repeat(2, 1fr); }
  .months > .month, .months > .month:not(:nth-child(4n + 1)) { padding: 16px 14px 22px 0; border-left: 0; }
  .months > .month:nth-child(2n) { padding-left: 14px; border-left: 1px solid var(--line); }
  .months > .month.big, .months > .month.office { padding-left: 14px; }
}
@media (max-width: 480px) {
  .months { grid-template-columns: 1fr; }
  .months > .month:nth-child(2n) { border-left: 0; padding-left: 0; }
}

/* ── School life (dynamic galleries + upcoming) ───────────────────────── */
.activities-grid { margin-top: 40px; display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
.galleries-only .activities-grid, .upcoming-only .activities-grid { grid-template-columns: 1fr; }
.activity + .activity { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
.activity .when { font-size: 0.85rem; font-weight: 700; color: var(--cobalt); }
.activity h3 { font-size: 1.6rem; margin: 6px 0 8px; color: var(--ink); }
.activity .desc { color: var(--text-2); max-width: 640px; }
.thumb-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.thumb-grid button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; }
.thumb-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform 0.25s; }
.thumb-grid button:hover img { transform: scale(1.04); }
.more-note { margin-top: 10px; font-size: 0.9rem; color: var(--text-2); }
#upcoming { background: var(--ink); color: #fff; padding: 24px; border-radius: var(--r-lg); }
.upcoming-head { font: 600 1.3rem/1 var(--display); margin-bottom: 14px; }
.upcoming-list li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.date-badge { display: grid; place-items: center; min-width: 52px; padding: 6px; background: var(--yolk); color: var(--ink); line-height: 1; border-radius: 6px; }
.date-badge .day { font: 700 1.3rem/1 var(--display); }
.date-badge .month { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.upcoming-list .note { display: block; font-size: 0.88rem; color: var(--on-dark-2); }
@media (max-width: 860px) { .activities-grid { grid-template-columns: 1fr; } }

/* "IKS in pictures": a uniform square grid; each photo opens the lightbox. */
.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; }
.pics button { display: block; width: 100%; padding: 0; border: 0; background: var(--paper-2); border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.pics img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform 0.4s ease; }
.pics button:hover img, .pics button:focus-visible img { transform: scale(1.04); }
/* The first photo is a 2×2 feature, so 7 photos fill three rows exactly. */
.pics li:first-child { grid-column: span 2; grid-row: span 2; }
.pics li:first-child button, .pics li:first-child picture, .pics li:first-child img { height: 100%; }
@media (max-width: 600px) { .pics { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

/* ── News ─────────────────────────────────────────────────────────────── */
.news-lead { max-width: 760px; }
.news-lead h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--ink); }
.news-when { margin: 8px 0 16px; font-size: 0.88rem; font-weight: 700; color: var(--cobalt); }
.news-body p + p { margin-top: 14px; }
.news-older { margin-top: 36px; max-width: 760px; border-top: 1px solid var(--line); }
.news-older:empty { display: none; }
.news-older details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.news-older summary { cursor: pointer; font-weight: 700; }
.news-older .news-body { margin-top: 12px; color: var(--text-2); }
.empty-note {
  max-width: 640px; padding: 28px; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--text-2);
}
.empty-note b { display: block; color: var(--ink); font: 600 1.3rem/1.2 var(--display); margin-bottom: 8px; }

/* ── Admissions ───────────────────────────────────────────────────────── */
.adm-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
.path { margin-top: 36px; position: relative; padding-left: 30px; }
.path::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.path li { position: relative; padding-bottom: 22px; }
.path li::before {
  content: ''; position: absolute; left: -28px; top: 7px; width: 12px; height: 12px; background: var(--cobalt); transform: rotate(45deg);
}
.path li:last-child::before { background: var(--yolk); }
.path h3 { font-size: 1.3rem; color: var(--ink); }
.path p { margin-top: 4px; color: var(--text-2); }
.adm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.adm-actions .btn-line { color: var(--ink); }
.adm-actions .btn-line:hover { background: var(--paper-2); }
.portal-note { margin-top: 18px; font-size: 0.98rem; }
.assure { color: #fff; padding: 10px; border-radius: var(--r-lg); }
.assure .pull-fact, .assure .slot-photo { margin: 0; background: var(--ink); padding: clamp(26px, 4vw, 40px); border-radius: 8px; }
.assure .slot-photo { padding: 0; overflow: hidden; }
.assure .slot-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.assure blockquote { margin: 0; }
.assure blockquote p { font: italic 500 clamp(1.5rem, 2.6vw, 2rem)/1.25 var(--display); }
.assure blockquote footer { margin-top: 14px; color: var(--on-dark-2); font-size: 0.9rem; }
.assure .hours { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 0.95rem; color: var(--on-dark-2); }
.assure .hours b { display: block; color: var(--yolk); font-size: 1.05rem; }
.faq { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq details:first-child { padding-top: 0; }
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 400 1.4rem/1 var(--display); color: var(--cobalt); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin-top: 10px; color: var(--text-2); max-width: 640px; }
@media (max-width: 860px) { .adm-grid, .faq { grid-template-columns: 1fr; } .faq { gap: 16px; } }

/* ── Contact ──────────────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(36px, 6vw, 80px); }
.directions { font: 500 clamp(1.25rem, 2.2vw, 1.6rem)/1.4 var(--display); color: var(--ink); }
.directions em { font-style: normal; background: var(--yolk-soft); padding: 0 4px; }
.contact-meta { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; font-size: 0.98rem; color: var(--text-2); }
.contact-meta dt { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.reach li a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 1.08rem;
}
.reach li:first-child a { border-top: 2px solid var(--ink); }
.reach li a:hover { color: var(--cobalt); }
.reach small { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); font-weight: 700; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .contact-meta { grid-template-columns: 1fr; } }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer.site { background: var(--ink); color: var(--on-dark-2); font-size: 1rem; }
footer.site .print-band { height: 12px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding: 56px 0 40px; }
.footer-id img { border-radius: 50%; margin-bottom: 14px; }
.footer-id strong { display: block; font: 600 1.25rem/1.2 var(--display); color: #fff; }
.footer-id .motto { display: block; color: var(--yolk); font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase; margin: 4px 0 14px; }
.footer-id p + p { margin-top: 8px; }
footer.site h3 { font: 700 0.78rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: #fff; margin-bottom: 16px; }
footer.site li { padding: 4px 0; }
footer.site a { text-decoration: none; }
footer.site a:hover { color: #fff; text-decoration: underline; }
.footer-sign { font: italic 500 1.15rem/1.4 var(--display); color: #fff; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  padding: 20px 0 28px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.85rem;
}
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  /* room for the fixed action bar (57px) plus the phone's home-indicator inset */
  footer.site { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
/* Phones: the identity block spans the top, the link lists sit two-up, so the
   footer is about half as long as a single stacked column */
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; padding: 40px 0 28px; }
  .footer-id { grid-column: 1 / -1; display: grid; grid-template-columns: 56px 1fr; gap: 0 14px; align-items: center; }
  .footer-id img { width: 56px; height: 56px; margin: 0; grid-row: span 2; }
  .footer-id .motto { margin: 4px 0 0; }
  .footer-id p { grid-column: 1 / -1; margin-top: 14px; }
  .footer-id p + p { margin-top: 4px; }
  footer.site li { padding: 6px 0; }
}

/* ── Mobile action bar ────────────────────────────────────────────────── */
.action-bar { display: none; }
@media (max-width: 860px) {
  .action-bar {
    display: grid; grid-template-columns: repeat(3, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--ink); border-top: 3px solid var(--yolk); transition: transform 0.2s;
  }
  .action-bar.tucked { transform: translateY(110%); }
  .action-bar { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .action-bar a { min-height: 54px; display: grid; place-items: center; color: #fff; font-weight: 700; text-decoration: none; }
  .action-bar a + a { border-left: 1px solid rgba(255, 255, 255, 0.14); }
  .action-bar a:last-child { background: var(--yolk); color: var(--ink); }
}

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  /* no slide: the bar simply appears and disappears */
  .action-bar { transition: none; }
  .action-bar.tucked { transform: none; visibility: hidden; }
}

/* ── Motion: reveal on scroll ─────────────────────────────────────────── */
/* site.js adds .js to <html> and .reveal only to things BELOW the fold when
   the page loads, so nothing on screen ever blinks out, and with scripts off
   or reduced motion nothing is hidden at all. Cards in a grid stagger by
   70ms through --d. */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ── Lightbox ─────────────────────────────────────────────────────────── */
#lightbox { border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); max-height: 94vh; }
#lightbox::backdrop { background: rgba(10, 12, 32, 0.92); }
#lightbox figure { margin: 0; }
#lightbox img { max-height: 78vh; width: auto; margin: 0 auto; }
#lightbox figcaption { color: #fff; text-align: center; margin-top: 10px; }
.lb-controls { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.lb-controls button {
  min-height: 44px; padding: 11px 20px; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: #fff; font: 600 0.875rem/1 var(--sans); cursor: pointer;
}
.lb-controls button:hover { background: rgba(255, 255, 255, 0.2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .card:hover, .card:focus-visible, .tile:hover, .tile:focus-visible { transform: none; }
  .card-media img, .tile-media img, .pics img { transform: none !important; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
