/* ==========================================================
   The Turing Laboratory : shared stylesheet
   Used across every page.
   ========================================================== */

:root {
  --paper: #FAF6EC;
  --paper-deep: #F2EBDB;
  --paper-warm: #EFE6D2;
  --ink: #16263F;
  --ink-soft: #4C5A72;
  --ink-mute: #8A9099;
  --terra: #B85C38;
  --terra-deep: #983F1F;
  --terra-soft: #E5BC8A;
  --moss: #3F6256;
  --rule: #DDCFB5;
  --rule-soft: #E8DFC8;
  --shadow: 0 1px 2px rgba(22,38,63,0.04), 0 8px 28px -12px rgba(22,38,63,0.10);
  --shadow-lg: 0 4px 8px rgba(22,38,63,0.06), 0 24px 48px -16px rgba(22,38,63,0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.serif { font-family: 'Fraunces', Georgia, serif; font-feature-settings: "ss01" 0; }

/* ----- Typography ----- */
h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
  font-feature-settings: "ss01" 0;
}
h1 { font-size: clamp(2.4rem, 5.8vw, 4.4rem); font-weight: 400; line-height: 1.05; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); }
p { color: var(--ink-soft); }

.eyebrow {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--terra);
}
.eyebrow.center {
  display: flex;
  justify-content: center;
}

/* ----- Layout ----- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px;}
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 28px; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-deep { background: var(--paper-deep); }
.section-ink { background: var(--ink); color: var(--paper); }
.section-ink h1, .section-ink h2, .section-ink h3 { color: var(--paper); }
.section-ink p { color: rgba(250,246,236,0.72); }
.section-ink .eyebrow { color: var(--terra-soft); }
.section-ink .eyebrow::before { background: var(--terra-soft); }

@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section-tight { padding: 48px 0; }
}

/* ----- Top bar ----- */
.topbar {
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 0;
  width: 100%;
  box-sizing: border-box;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar a {
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 160ms;
}
.topbar a:hover { color: var(--terra-soft); }
.topbar-left, .topbar-right { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.topbar-right { color: rgba(250,246,236,0.7); }

/* Language toggle in topbar (English <-> Chinese) */
.lang-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  color: var(--paper);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 180ms, color 180ms;
}
.lang-toggle:hover {
  color: var(--terra-soft);
  border-bottom-color: var(--terra-soft);
}
.lang-toggle svg { opacity: 0.85; }
.topbar-divider {
  width: 1px;
  height: 14px;
  background: rgba(250,246,236,0.18);
  display: inline-block;
}

@media (max-width: 720px) {
  .topbar { font-size: 12px; }
  /* Stack phone and email vertically so each takes full width — no gap on right */
  .topbar .container { flex-direction: column; align-items: flex-start; gap: 6px; }
  /* Hide the "Home tuition & online lessons" tagline on mobile — no room for it */
  .topbar-right { display: none; }
  .topbar-left { flex-direction: column; gap: 6px; align-items: flex-start; }
  .topbar-divider { display: none; }
}

/* ----- Header & Nav ----- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
  /* Prevent mobile browsers clipping the nav at the viewport edge */
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  gap: 16px;
}
@media (max-width: 1020px) {
  .nav .container { height: 64px; gap: 10px; padding: 0 20px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.brand-logo .logo-placeholder {
  font-family: 'Manrope', sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.1;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: 'Fraunces', serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
@media (max-width: 1020px) {
  /* Shrink brand name and hide tagline so Enquire Now button always fits */
  .brand-name { font-size: 16px; }
  .brand-tag  { display: none; }
  .brand-logo { width: 36px; height: 36px; }
}
@media (max-width: 480px) {
  /* On phones, hide brand text entirely — logo icon alone is enough,
     and this frees the space needed for Enquire Now + hamburger */
  .brand-text { display: none; }
}
.brand-tag {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 3px;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}
.nav-links > li { position: relative; }
.nav-links a, .nav-link-toggle {
  font-family: 'Manrope', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 200ms;
}
.nav-links a:hover, .nav-link-toggle:hover, .nav-links li.has-dropdown:hover .nav-link-toggle {
  color: var(--ink);
}
.nav-links a.active, .nav-links li.active > .nav-link-toggle { color: var(--ink); }
.nav-links a::after, .nav-link-toggle::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1.5px;
  background: var(--terra);
  transition: width 220ms ease;
}
.nav-links a:hover::after, .nav-link-toggle:hover::after,
.nav-links a.active::after, .nav-links li.active > .nav-link-toggle::after { width: 100%; }
.nav-link-toggle .chevron {
  width: 10px; height: 10px;
  transition: transform 200ms;
  margin-left: 2px;
}
.nav-links li.has-dropdown:hover .chevron { transform: rotate(180deg); }

/* Dropdown menu */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: -16px;
  min-width: 280px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 200ms, visibility 200ms, transform 200ms;
  z-index: 60;
}
.nav-links li.has-dropdown:hover .dropdown,
.nav-links li.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 12px 16px;
  border-radius: 5px;
  color: var(--ink) !important;
  font-size: 14.5px;
  font-weight: 600;
  transition: background 200ms;
}
.dropdown a::after { display: none; }
.dropdown a:hover { background: var(--paper-deep); }
.dropdown a.active { background: var(--ink); color: var(--paper) !important; }
.dropdown-desc {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-top: 2px;
  letter-spacing: 0;
  text-transform: none;
}
.dropdown a.active .dropdown-desc { color: rgba(250,246,236,0.65); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: transform 200ms ease, background 220ms, box-shadow 220ms, color 220ms, border-color 220ms;
  border: 1.5px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--terra);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -10px rgba(184, 92, 56, 0.5);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn-ghost {
  background: var(--paper-deep);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--paper-warm); }
.btn-light {
  background: var(--paper);
  color: var(--ink);
}
.btn-light:hover {
  background: var(--terra-soft);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  width: 44px; height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  content: ""; display: block;
  width: 16px; height: 1.5px; background: var(--ink);
  transition: transform 220ms;
}
.menu-toggle span::before { transform: translateY(-5px); }
.menu-toggle span::after { transform: translateY(3.5px); }

@media (max-width: 1020px) {
  .nav-links { display: none; }
  /* Keep Enquire Now always visible — it is the primary CTA */
  .btn-nav { display: inline-flex !important; padding: 10px 16px; font-size: 13px; }
  .menu-toggle { display: inline-flex; }
  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--paper);
    padding: 24px 28px 32px;
    border-bottom: 1px solid var(--rule-soft);
    gap: 4px;
    align-items: stretch;
    box-shadow: 0 12px 24px -12px rgba(22,38,63,0.15);
    /* Ensure dropdown is never clipped by viewport overflow */
    z-index: 49;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav.open .nav-links li { width: 100%; }
  .nav.open .nav-links a, .nav.open .nav-link-toggle {
    padding: 14px 0;
    width: 100%;
    border-bottom: 1px solid var(--rule-soft);
  }
  .nav.open .dropdown {
    position: static;
    background: var(--paper-deep);
    border: 0;
    box-shadow: none;
    padding: 8px;
    margin: 0 0 8px;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .nav.open .has-dropdown.expanded .dropdown { display: block; }
  .nav.open .has-dropdown .chevron { transition: transform 200ms; }
  .nav.open .has-dropdown.expanded .chevron { transform: rotate(180deg); }
  /* btn-nav is already in the sticky bar; hide the duplicate inside the drawer */
  .nav.open .btn-nav { display: none !important; }
}

/* ----- Hero patterns ----- */
.hero {
  position: relative;
  padding: 88px 0 72px;
  overflow: hidden;
}
.hero-blob {
  position: absolute;
  top: 60px; right: -120px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 92, 56, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }

.hero-simple {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--rule-soft);
}
.hero-simple .eyebrow { margin-bottom: 18px; }
.hero-simple h1 { max-width: 880px; margin-bottom: 22px; }
.hero-simple p.lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 620px;
  line-height: 1.55;
}

/* ----- Stat strip ----- */
.stats {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-deep);
  padding: 36px 0;
}
.stats .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-item {
  border-left: 1px solid var(--rule);
  padding-left: 22px;
}
.stat-item:first-child { border-left: 0; padding-left: 0; }
.stat-num {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-num em { font-style: italic; color: var(--terra); font-weight: 400; }
.stat-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  line-height: 1.4;
}
@media (max-width: 720px) {
  .stats .container { grid-template-columns: repeat(2, 1fr); gap: 28px 18px; }
  .stat-item { border-left: 0; padding-left: 0; }
}

/* Two-stat hero pills (inspired by qualifications poster) */
.stat-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 36px;
  max-width: 580px;
}
.stat-pill {
  background: var(--ink);
  color: var(--paper);
  padding: 28px 24px;
  border-radius: 12px;
  text-align: center;
}
.stat-pill .stat-num {
  color: var(--paper);
  font-size: clamp(2.4rem, 4vw, 3rem);
  margin-bottom: 8px;
}
.stat-pill .stat-num em { color: var(--terra-soft); }
.stat-pill .stat-label {
  color: rgba(250,246,236,0.75);
  font-size: 13px;
}

/* ----- Sections / cards ----- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 48px;
  gap: 32px;
  flex-wrap: wrap;
}
.section-header h2 { max-width: 580px; margin-top: 14px; }
.section-header p { max-width: 380px; }
.section-header.center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 56px;
}
.section-header.center h2 { margin-top: 14px; }

.divider-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--terra);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 18px;
}
.divider-mark::before, .divider-mark::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--rule);
}

/* ----- CTA strip (used at bottom of every page) ----- */
.cta-strip {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.cta-strip::before {
  content: "";
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 92, 56, 0.18), transparent 70%);
  pointer-events: none;
}
.cta-strip .container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.cta-strip h2 { color: var(--paper); margin-bottom: 14px; }
.cta-strip p { color: rgba(250,246,236,0.72); max-width: 520px; font-size: 17px; }
.cta-strip-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 820px) {
  .cta-strip .container { grid-template-columns: 1fr; gap: 28px; }
  .cta-strip-actions { justify-content: flex-start; }
}

/* ----- Footer ----- */
footer.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 60px 0 32px;
  font-size: 14px;
  border-top: 1px solid rgba(250,246,236,0.08);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand .brand-name { color: var(--paper); }
.footer-brand .brand-logo { border-color: rgba(250,246,236,0.4); background: transparent; }
.footer-brand .brand-logo .logo-placeholder { color: rgba(250,246,236,0.5); }
.footer-brand .brand-tag { color: rgba(250,246,236,0.5); }
.footer-brand p {
  color: rgba(250,246,236,0.55);
  font-size: 14px;
  max-width: 360px;
  margin-top: 18px;
  line-height: 1.55;
}
.footer-col h4 {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250,246,236,0.5);
  font-weight: 600;
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  color: rgba(250,246,236,0.85);
  font-size: 14px;
  transition: color 180ms;
}
.footer-col a:hover { color: var(--terra-soft); }
.footer-bottom {
  border-top: 1px solid rgba(250,246,236,0.12);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: rgba(250,246,236,0.5);
}
.footer-bottom a:hover { color: var(--paper); }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px 24px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ----- Page-specific helpers (loaded everywhere for simplicity) ----- */

/* Programme card grid (Home + Programmes overview) */
.programme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.programme-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 220ms, border-color 220ms, box-shadow 220ms;
  position: relative;
}
.programme-card:hover {
  transform: translateY(-4px);
  border-color: var(--terra);
  box-shadow: var(--shadow);
}
.programme-card-glyph {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 32px;
  color: var(--terra);
  line-height: 1;
}
.programme-card h3 { font-size: 24px; }
.programme-card p { font-size: 15px; flex: 1; }
.programme-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.programme-card-meta .arrow {
  color: var(--terra);
  font-weight: 600;
  transition: transform 200ms;
}
.programme-card:hover .programme-card-meta .arrow { transform: translateX(4px); }

@media (max-width: 720px) {
  .programme-grid { grid-template-columns: 1fr; }
}

/* Photo placeholder (used for Allen's portrait) */
.photo-frame {
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  font-size: 13px;
  text-align: center;
  padding: 24px;
  font-weight: 500;
}
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  pointer-events: none;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

/* Subject chips */
.subject-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.subject-chip {
  font-size: 13.5px;
  background: var(--paper-deep);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 500;
}

/* Location tags */
.location-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.location-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.location-tag::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--terra);
}

/* One subtle entrance for hero only. No scroll-triggered fades */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.entrance, .entrance > * { animation: none; }
.entrance > *:nth-child(1) { animation: hero-rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.entrance > *:nth-child(2) { animation: hero-rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 80ms; }
.entrance > *:nth-child(3) { animation: hero-rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 160ms; }
.entrance > *:nth-child(4) { animation: hero-rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 240ms; }

/* ============================================================
   School logo marquee strip
   ============================================================ */
.schools-strip {
  padding: 56px 0;
  background: var(--paper-deep);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  overflow: hidden;
}
.schools-strip-label {
  text-align: center;
  margin-bottom: 32px;
}
.schools-strip-label span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}

/* The track wrapper clips the overflowing marquee */
.schools-strip-track-wrap {
  position: relative;
  /* Fade edges so logos dissolve in/out naturally */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

/* Two identical lists side-by-side; JS-free infinite scroll via CSS */
.schools-marquee {
  display: flex;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}
.schools-marquee:hover { animation-play-state: paused; }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* One list of logos */
.schools-logo-list {
  display: flex;
  align-items: center;
  gap: 56px;
  padding: 0 28px;
  list-style: none;
  margin: 0;
}

.schools-logo-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schools-logo-item img {
  height: 128px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  /* Blends white logo backgrounds into the beige page — no more white boxes */
  mix-blend-mode: multiply;
  transition: transform 0.25s ease;
}
.schools-logo-item img:hover {
  transform: scale(1.08);
}

/* Fallback pill shown when image file is missing */
.school-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--rule);
  border-radius: 22px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  white-space: nowrap;
  background: var(--paper);
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .schools-logo-item img  { height: 50px; max-width: 150px; }
  .school-placeholder     { font-size: 11px; height: 34px; }
  .schools-logo-list      { gap: 40px; }
  .schools-marquee        { animation-duration: 30s; }
}
/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .schools-marquee { animation: none; }
  .schools-strip-track-wrap {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Language toggle — nav variant (sticky bar, light background) */
.lang-toggle-nav {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  transition: background 180ms, border-color 180ms, color 180ms;
  flex-shrink: 0;
  /* Ensure it isn't hidden alongside .nav-links on mobile */
  display: inline-flex;
}
.lang-toggle-nav:hover {
  background: var(--paper-deep);
  border-color: var(--ink-mute);
  color: var(--ink);
}
.lang-toggle-nav svg {
  opacity: 0.7;
  flex-shrink: 0;
}

/* On mobile the lang toggle lives inside the drawer (injected by app.js).
   Hide it from the sticky bar at mobile widths to avoid crowding. */
@media (max-width: 1020px) {
  .lang-toggle-nav { display: none !important; }
  /* The in-drawer version uses a different class */
  .lang-toggle-drawer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule-soft);
    width: 100%;
    transition: color 180ms;
  }
  .lang-toggle-drawer:hover { color: var(--ink); }
  .lang-toggle-drawer svg { opacity: 0.7; flex-shrink: 0; }
}
