:root {
  --navy: #1a2f68;
  --navy-deep: #050810;
  --navy-light: #24397a;
  --red: #d8324c;
  --red-dark: #a51f34;
  --gold: #cfa565;
  --gold-light: #f0dab0;
  --white: #ffffff;

  --bg: #0a0e18;
  --bg-alt: #0e1526;
  --surface: #121a2e;
  --surface-alt: #161f38;

  --text: #f1f3f9;
  --text-muted: #97a0ba;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --header-bg: rgba(9, 12, 22, 0.72);
  --header-bg-scrolled: rgba(8, 11, 20, 0.94);

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.35);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 36px 84px rgba(0, 0, 0, 0.55);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: clip; }

/* Smooth fade between pages (native View Transitions API).
   Unsupported browsers just ignore this and navigate instantly - no fallback needed. */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: .35s;
    animation-timing-function: cubic-bezier(.22,.61,.36,1);
  }

  ::view-transition-old(root) { animation-name: page-out; }
  ::view-transition-new(root) { animation-name: page-in; }
}

@keyframes page-out {
  to { opacity: 0; transform: translateY(-8px); }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
}

body {
  font-family: 'Tajawal', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--gold);
  color: var(--navy-deep);
}

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

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 45%, var(--navy-light) 75%, var(--red-dark) 150%);
  transition: opacity .5s ease, visibility .5s ease;
}

.preloader-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  animation: preloaderPulse 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.14);
}

.preloader-ring {
  position: absolute;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: var(--gold);
  animation: preloaderSpin .9s linear infinite;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes preloaderSpin {
  to { transform: rotate(360deg); }
}

@keyframes preloaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.92); }
}

@media (prefers-reduced-motion: reduce) {
  .preloader-logo, .preloader-ring { animation: none; }
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 32px);
}

h1, h2, h3 { font-weight: 800; }

section { scroll-margin-top: 90px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
  transition: box-shadow .3s ease, background .3s ease, border-color .3s ease;
}

.site-header.scrolled {
  background: var(--header-bg-scrolled);
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
  border-bottom-color: var(--border-strong);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
  transition: box-shadow .25s;
}

.brand:hover .brand-logo {
  box-shadow: 0 0 0 3px rgba(207,165,101,0.5);
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: .5px;
}

.main-nav {
  display: flex;
  gap: 6px;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .96rem;
  transition: color .25s, background .25s;
  position: relative;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  inset-inline-start: 16px;
  inset-inline-end: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s var(--ease);
}

.main-nav a:hover { color: var(--text); background: var(--chip-bg); }

.main-nav a:hover::after,
.main-nav a.active::after { transform: scaleX(1); }

.main-nav a.active { color: var(--text); font-weight: 800; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lang-btn {
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .5px;
  cursor: pointer;
  transition: all .25s;
  font-family: inherit;
}

.lang-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all .25s;
}

.theme-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  transform: rotate(15deg);
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-btn span {
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* Hero */
.hero {
  background:
    radial-gradient(560px 420px at 12% -10%, rgba(207,165,101,0.3), transparent 60%),
    radial-gradient(520px 420px at 108% 10%, rgba(216,50,76,0.34), transparent 60%),
    linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 45%, var(--navy-light) 100%);
  color: var(--white);
  padding: clamp(72px, 11vw, 120px) 0 clamp(80px, 12vw, 130px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 160px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-logo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 8px rgba(255,255,255,0.08), var(--shadow-lg);
  margin-bottom: 26px;
}

.hero h1 {
  font-size: clamp(1.9rem, 3.4vw + 1rem, 3rem);
  margin-bottom: 14px;
  line-height: 1.3;
}

.tagline {
  font-size: clamp(1rem, .6vw + .9rem, 1.2rem);
  color: rgba(255,255,255,0.82);
  margin-bottom: 32px;
  font-weight: 500;
}

.hero-inner > * {
  opacity: 0;
  transform: translateY(22px);
  animation: heroIn .8s ease forwards;
}

.hero-inner > *:nth-child(1) { animation-delay: .05s; }
.hero-inner > *:nth-child(2) { animation-delay: .16s; }
.hero-inner > *:nth-child(3) { animation-delay: .27s; }
.hero-inner > *:nth-child(4) { animation-delay: .38s; }
.hero-inner > *:nth-child(5) { animation-delay: .49s; }

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 38px;
}

.hero-tags span {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(207,165,101,0.3);
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.btn {
  display: inline-block;
  padding: 15px 38px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: .98rem;
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--white);
  box-shadow: 0 14px 30px rgba(216,50,76,0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(216,50,76,0.5);
}

/* About */
.about {
  padding: clamp(56px, 8vw, 84px) 0;
  text-align: center;
}

.about-hero-card {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 44px 30px 32px;
  margin-bottom: 36px;
  overflow: hidden;
}

.about-hero-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--navy-light), var(--gold), var(--red));
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-light);
  background: rgba(207,165,101,0.12);
  border: 1px solid rgba(207,165,101,0.22);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: .6px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.grid + .kicker { margin-top: 64px; }

.about h2 { color: var(--text); margin-bottom: 20px; font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem); }

.about p {
  max-width: 740px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.about .fact-pills {
  margin-top: 30px;
}

.about .course-section {
  margin-top: 26px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  text-align: right;
  transition: box-shadow .3s ease, border-color .3s ease;
}

.about .course-section:hover {
  box-shadow: var(--shadow);
  border-color: rgba(207,165,101,0.35);
}

.about .course-section > h3 {
  text-align: right;
  color: var(--text);
  margin-bottom: 18px;
  font-size: clamp(1.2rem, 1vw + 1rem, 1.5rem);
}

.about .course-section p {
  max-width: none;
  margin: 0 0 18px;
  text-align: right;
}

.gallery-heading {
  color: var(--text);
  font-size: 1.35rem;
  margin: 60px 0 26px;
  text-align: center;
}

/* Photo gallery + lightbox (used on About and Mental Arithmetic pages) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px;
}

.about .gallery-grid .gallery-item {
  border: 1px solid var(--border);
}

/* Media showcase: video as the centerpiece, two supporting photos stacked beside it */
.media-showcase {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 20px;
  max-width: 1000px;
  height: 460px;
  margin: 44px auto 0;
}

.media-primary {
  grid-row: 1 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.media-primary video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-secondary {
  display: contents;
}

.media-secondary .gallery-item {
  aspect-ratio: auto;
  height: 100%;
}

@media (max-width: 700px) {
  .media-showcase {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .media-primary video { aspect-ratio: 16 / 9; height: auto; }

  .media-secondary {
    display: flex;
    gap: 18px;
  }

  .media-secondary .gallery-item {
    aspect-ratio: 4 / 3;
    height: auto;
    flex: 1;
  }
}

.gallery-item {
  all: unset;
  cursor: pointer;
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  transition: box-shadow .3s ease, border-color .3s ease;
}

.gallery-item:hover { box-shadow: var(--shadow); border-color: rgba(207,165,101,0.4); }

.media-caption {
  position: absolute;
  inset-inline: 16px;
  bottom: 14px;
  z-index: 1;
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.gallery-item:has(.media-caption)::after { opacity: 1; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,8,16,0) 55%, rgba(5,8,16,.6));
  opacity: 0;
  transition: opacity .3s ease;
}

.gallery-item:hover img { transform: scale(1.06); }
.gallery-item:hover::after { opacity: 1; }

.gallery-item:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(3,5,10,.95);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 88vw;
  max-height: 84vh;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--white);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(207,165,101,.25);
}

.lightbox-close { top: 24px; inset-inline-end: 24px; }
.lightbox-prev { inset-inline-start: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { inset-inline-end: 20px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; }
}

/* Courses */
.courses {
  padding: clamp(56px, 8vw, 84px) 0;
  background: var(--bg-alt);
}

.courses h2 {
  color: var(--text);
  text-align: center;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem);
  margin-bottom: 34px;
}

.grid {
  display: grid;
  gap: 22px;
}

.lang-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.program-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}

.card::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-light), var(--gold), var(--red));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .45s var(--ease);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(207,165,101,0.35);
}

.card:hover::before {
  transform: scaleX(1);
}

.icon-badge {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(207,165,101,0.14), rgba(216,50,76,0.12));
  box-shadow: inset 0 0 0 1px var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 1.85rem;
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 6px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.icon-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  background: var(--white);
}

.card:hover .icon-badge {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: inset 0 0 0 1px rgba(207,165,101,0.5), 0 8px 20px rgba(0,0,0,0.35);
}

.card h3 {
  color: var(--text);
  font-size: 1.12rem;
  position: relative;
  z-index: 1;
  transition: color .3s;
}

.card:hover h3 {
  color: var(--gold-light);
}

.program-card p {
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

/* Scroll reveal (uses animation, not transition, so it never fights .card's hover transition) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
}

.reveal.visible {
  animation: revealIn .7s var(--ease) forwards;
}

@keyframes revealIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .hero-inner > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Mental Arithmetic - UCMAS */
.mental-math {
  padding: clamp(56px, 8vw, 84px) 0;
  text-align: center;
  background: var(--bg-alt);
}

.mental-math h2 {
  color: var(--text);
  font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem);
  margin-bottom: 20px;
}

.mental-math p {
  max-width: 740px;
  margin: 0 auto 30px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  padding: 16px 30px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  box-shadow: var(--shadow);
  max-width: 90%;
  border: 1px solid rgba(207,165,101,0.4);
}

.achievement-badge .badge-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Contact */
.contact {
  padding: clamp(56px, 8vw, 84px) 0;
  text-align: center;
}

.contact h2 {
  color: var(--text);
  font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem);
  margin-bottom: 16px;
}

.address {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 38px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

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

.social-btn.whatsapp { background: #25D366; }
.social-btn.telegram { background: #229ED9; }
.social-btn.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-btn.facebook { background: #1877F2; }

/* Email card */
.email-card {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 520px;
  margin: 40px auto 0;
  padding: 28px 32px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 55%, var(--red-dark) 160%);
  box-shadow: var(--shadow);
  text-align: start;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(207,165,101,0.25);
}

.email-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(207,165,101,0.2), transparent 55%);
  pointer-events: none;
}

.email-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--white);
  stroke-width: 1.8;
}

.email-info { flex: 1; min-width: 0; }

.email-label {
  display: block;
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.email-address {
  display: inline-block;
  color: var(--white);
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  word-break: break-all;
  letter-spacing: .3px;
}

.email-address:hover { text-decoration: underline; }

.email-copy {
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.email-copy:hover { background: rgba(255,255,255,0.28); }

.email-copy.copied {
  background: var(--gold);
  color: var(--navy-deep);
  border-color: var(--gold);
}

@media (max-width: 560px) {
  .email-card { flex-wrap: wrap; text-align: center; justify-content: center; }
  .email-info { flex-basis: 100%; }
}

/* Map */
.map-wrap {
  max-width: 820px;
  margin: 46px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 10px;
}

.map-wrap iframe {
  display: block;
  border-radius: var(--radius-sm);
}

.map-link {
  display: block;
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 15px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  transition: background .2s;
}

.map-link:hover { background: var(--navy-light); }

/* Footer */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 42px 0 30px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--white);
}

.footer-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-links a {
  color: rgba(255,255,255,0.68);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color .2s;
}

.footer-links a:hover { color: var(--gold-light); }

.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social a {
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  transition: color .2s, transform .2s, background .2s;
}

.footer-social a:hover {
  color: var(--navy-deep);
  background: var(--gold);
  transform: translateY(-2px);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 0;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
}

@media (max-width: 600px) {
  .footer-inner { justify-content: center; text-align: center; }
}

/* 404 error page */
.error-page {
  padding: 110px 0;
  text-align: center;
}

.error-code {
  font-size: clamp(4.5rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--gold), var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page h2 {
  color: var(--text);
  margin: 18px 0 12px;
  font-size: 1.6rem;
}

.error-page p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 32px;
}

/* FAQ */
.faq {
  padding: clamp(56px, 8vw, 84px) 0;
}

.faq .container { max-width: 820px; }

.faq .kicker { display: block; text-align: center; width: fit-content; margin-inline: auto; }

.faq h2 {
  color: var(--text);
  text-align: center;
  margin-bottom: 42px;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem);
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 6px 26px;
  margin-bottom: 14px;
  transition: box-shadow .25s ease, border-color .25s ease;
}

.faq-item:hover { box-shadow: var(--shadow); border-color: rgba(207,165,101,0.3); }

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 0;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--navy-deep);
  background: var(--gold);
  border-radius: 50%;
  transition: transform .3s var(--ease), background .3s;
}

.faq-item[open] summary::after { transform: rotate(135deg); background: var(--red); color: var(--white); }

.faq-item p {
  color: var(--text-muted);
  padding-bottom: 22px;
  line-height: 1.9;
}

/* Floating WhatsApp button */
.whatsapp-float {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(37,211,102,0.45);
  z-index: 150;
  transition: transform .25s ease, box-shadow .25s ease;
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 36px rgba(37,211,102,0.55);
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  animation: whatsappPulse 2.4s ease-out infinite;
}

@keyframes whatsappPulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-float::before { animation: none; }
}

@media (max-width: 600px) {
  .whatsapp-float {
    width: 52px;
    height: 52px;
    bottom: 18px;
    right: 18px;
  }
  .whatsapp-float svg { width: 26px; height: 26px; }
}

/* Legal pages (Privacy Policy, Terms of Service) */
.legal {
  padding: clamp(56px, 8vw, 84px) 0;
}

.legal .container {
  max-width: 820px;
}

.legal .kicker { display: block; text-align: center; width: fit-content; margin-inline: auto; }

.legal h2 {
  color: var(--text);
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem);
  text-align: center;
}

.legal .updated-at {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 42px;
}

.legal h3 {
  color: var(--text);
  font-size: 1.2rem;
  margin: 38px 0 12px;
}

.legal p,
.legal li {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.9;
}

.legal ul {
  margin: 0 0 16px;
  padding-inline-start: 22px;
  display: grid;
  gap: 8px;
}

.legal a { color: var(--gold-light); }

/* Mobile */
@media (max-width: 820px) {
  .main-nav {
    position: absolute;
    top: 80px;
    inset-inline: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 0 8px;
    transition: max-height .35s ease, padding .35s ease;
  }

  .main-nav.open { max-height: 320px; padding: 8px; }

  .main-nav a {
    padding: 14px 16px;
    width: 100%;
    text-align: center;
    border-radius: var(--radius-sm);
  }

  .main-nav a::after { display: none; }

  .menu-btn { display: flex; }

  .hero h1 { font-size: 1.9rem; }
}

/* Course card link (courses.html -> course detail pages) */
.course-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.course-link p {
  color: var(--gold-light);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s, transform .25s;
}

.course-link:hover p,
.course-link:focus-visible p {
  opacity: 1;
  transform: translateY(0);
}

/* Course detail pages */
.course-page { padding: clamp(56px, 8vw, 84px) 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 34px;
  padding: 8px 4px;
  transition: color .2s, gap .2s;
}

.back-link:hover { color: var(--gold-light); gap: 10px; }

.course-hero { text-align: center; margin-bottom: 56px; }

.course-hero .icon-badge {
  width: 86px;
  height: 86px;
  font-size: 2.3rem;
  margin: 0 auto 20px;
}

.course-hero h2 { color: var(--text); font-size: clamp(1.7rem, 2.4vw + 1rem, 2.2rem); margin-bottom: 16px; }

.course-hero p {
  max-width: 740px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.fact-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}

.fact-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(207,165,101,0.35);
}

.fact-pill .pill-icon { font-size: 1.15rem; }

.course-section { margin-top: 68px; }

.course-section > h3 {
  text-align: center;
  color: var(--text);
  font-size: clamp(1.25rem, 1.4vw + 1rem, 1.55rem);
  margin-bottom: 36px;
}

.showcase-intro {
  max-width: 640px;
  margin: -14px auto 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Featured photo showcase (e.g. SamLab workshop-in-action gallery) - a bolder,
   larger sibling of the standard .gallery-grid used for simple photo grids. */
.feature-showcase.gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(6, auto);
  grid-auto-flow: row;
  gap: 16px 20px;
  max-width: 820px;
  margin: 0 auto;
  direction: ltr;
  padding: 10px;
}

.feature-showcase .feature-item {
  direction: rtl;
  min-width: 0;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(4, 8, 18, 0.18);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.feature-showcase .people-photo {
  grid-column: 2;
}

.feature-showcase .robot-photo {
  grid-column: 1;
}

.feature-showcase .robot-photo:nth-child(1),
.feature-showcase .people-photo:nth-child(5) {
  grid-row: 1;
}

.feature-showcase .robot-photo:nth-child(2),
.feature-showcase .people-photo:nth-child(6) {
  grid-row: 2;
}

.feature-showcase .robot-photo:nth-child(3),
.feature-showcase .people-photo:nth-child(7) {
  grid-row: 3;
}

.feature-showcase .robot-photo:nth-child(4),
.feature-showcase .people-photo:nth-child(8) {
  grid-row: 4;
}

.feature-showcase .people-photo:nth-child(9),
.feature-showcase .people-photo:nth-child(10) {
  grid-row: 5;
}

.feature-showcase .people-photo:nth-child(9) {
  grid-column: 1;
}

.feature-showcase .people-photo:nth-child(10) {
  grid-column: 2;
}

@media (max-width: 640px) {
  .feature-showcase.gallery-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 8px;
  }

  .feature-showcase .people-photo,
  .feature-showcase .robot-photo {
    grid-column: 1;
    grid-row: auto;
  }
}

.feature-item {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.feature-item::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-light), var(--gold), var(--red));
  z-index: 2;
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(4, 8, 18, 0.28);
  border-color: rgba(207, 165, 101, 0.45);
}

.feature-item:hover img {
  transform: scale(1.1);
}

.feature-item .media-caption {
  font-size: 0.92rem;
  font-weight: 800;
  inset-inline: 18px;
  bottom: 16px;
  line-height: 1.45;
}

/* Student achievement spotlight (photo + story side by side) */
.spotlight-card {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  max-width: 860px;
  margin: 0 auto 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transition: box-shadow .3s ease, border-color .3s ease;
}

.spotlight-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(207, 165, 101, 0.35);
}

.spotlight-card::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-light), var(--gold), var(--red));
  z-index: 2;
}

.spotlight-media {
  all: unset;
  cursor: pointer;
  flex: 1 1 300px;
  min-height: 280px;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.spotlight-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease);
}

.spotlight-media:hover img {
  transform: scale(1.04);
}

.spotlight-body {
  flex: 1.3 1 340px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 11px;
}

.spotlight-body h4 {
  color: var(--gold-light);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.5;
}

.spotlight-body p {
  color: var(--text-muted);
  line-height: 1.9;
  margin: 0;
}

.spotlight-tags {
  margin: 2px 0;
}

@media (max-width: 640px) {
  .spotlight-media {
    min-height: 260px;
  }

  .spotlight-body {
    padding: 26px;
  }
}

.steps {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.step-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}

.step-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(207,165,101,0.35);
}

.step-number {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--navy));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

.step-item h4 { color: var(--text); font-size: 1.05rem; margin-bottom: 8px; }
.step-item p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

.level-card .icon-badge { font-size: 1.6rem; }

.cta-banner {
  margin-top: 68px;
  text-align: center;
  background:
    radial-gradient(420px 300px at 15% 0%, rgba(207,165,101,0.25), transparent 60%),
    radial-gradient(420px 300px at 100% 100%, rgba(216,50,76,0.32), transparent 60%),
    linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-light) 100%);
  color: var(--white);
  padding: 54px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(207,165,101,0.2);
}

.cta-banner h3 { font-size: clamp(1.3rem, 1.6vw + 1rem, 1.6rem); margin-bottom: 14px; }

.cta-banner p {
  color: rgba(255,255,255,0.85);
  margin: 0 auto 28px;
  max-width: 560px;
}

.cta-banner .btn-primary { background: var(--gold-light); color: var(--navy-deep); box-shadow: var(--shadow); }
.cta-banner .btn-primary:hover { background: var(--white); }

@media (max-width: 600px) {
  .course-hero h2 { font-size: 1.6rem; }
  .fact-pill { font-size: 0.85rem; padding: 12px 18px; }
}

/* Level ladder (e.g. UCMAS 10 levels) */
.level-accordion {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin: 22px 0 0;
}

.level-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s ease;
}

.level-item::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-light), var(--gold), var(--red));
}

.level-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(207,165,101,0.35);
}

.level-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 20px 16px;
}

.level-item summary::-webkit-details-marker { display: none; }

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.summary-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.level-title {
  color: var(--text);
  font-weight: 800;
  line-height: 1.5;
}

.summary-subtitle {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 0.75rem;
}

.level-number {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.level-item p {
  margin: 0 20px 20px;
  padding: 15px 18px;
  color: var(--text-muted);
  line-height: 1.8;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.level-item[open] summary {
  background: linear-gradient(180deg, rgba(207,165,101,0.08), rgba(207,165,101,0.02));
}

.level-item[open] .summary-badge {
  background: var(--gold);
  color: var(--navy-deep);
}

.level-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .level-accordion {
    grid-template-columns: 1fr;
  }

  .summary-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-badge {
    align-self: flex-end;
  }
}

/* ==========================================================================
   Light theme - the previous (pre-"dark luxury") look, kept as a toggle.
   Overrides the dark-theme tokens above, plus the handful of component
   rules where the accent role itself swaps (gold-led vs red/navy-led)
   rather than just its shade.
   ========================================================================== */
html[data-theme="light"] {
  --navy: #0a1638;
  --navy-deep: #060d24;
  --navy-light: #16295f;
  --red: #c8102e;
  --red-dark: #9d0c24;
  --gold: #c9a24d;
  --gold-light: #e6cd8d;

  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f8f9ff;

  --text: #131a2c;
  --text-muted: #5b6178;
  --border: rgba(10, 22, 56, 0.09);
  --border-strong: rgba(10, 22, 56, 0.16);
  --chip-bg: rgba(10, 22, 56, 0.06);
  --header-bg: rgba(255, 255, 255, 0.82);
  --header-bg-scrolled: rgba(255, 255, 255, 0.96);

  --shadow-sm: 0 6px 18px rgba(9, 20, 51, 0.07);
  --shadow: 0 16px 40px rgba(9, 20, 51, 0.11);
  --shadow-lg: 0 30px 70px rgba(9, 20, 51, 0.18);
}

html[data-theme="light"] ::selection { background: var(--navy); color: var(--white); }

html[data-theme="light"] .kicker {
  color: var(--red-dark);
  background: rgba(200, 16, 46, 0.08);
  border-color: rgba(200, 16, 46, 0.12);
}

html[data-theme="light"] .kicker::before { background: var(--gold); }

html[data-theme="light"] .main-nav a::after { background: var(--red); }

html[data-theme="light"] .lang-btn:hover,
html[data-theme="light"] .theme-btn:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

html[data-theme="light"] .card:hover h3 { color: var(--red-dark); }

html[data-theme="light"] .course-link p { color: var(--red-dark); }

html[data-theme="light"] .back-link { color: var(--navy); }
html[data-theme="light"] .back-link:hover { color: var(--red-dark); }

html[data-theme="light"] .faq-item summary::after { color: var(--white); background: var(--red); }
html[data-theme="light"] .faq-item[open] summary::after { background: var(--navy); }

html[data-theme="light"] .legal a { color: var(--red-dark); }

html[data-theme="light"] .cta-banner .btn-primary { background: var(--white); color: var(--navy); }
html[data-theme="light"] .cta-banner .btn-primary:hover { background: var(--gold-light); }

html[data-theme="light"] .summary-badge { color: var(--navy-light); }
html[data-theme="light"] .level-item[open] summary {
  background: linear-gradient(180deg, rgba(10, 36, 99, 0.05), rgba(10, 36, 99, 0.02));
}
html[data-theme="light"] .level-item[open] .summary-badge {
  background: rgba(201, 162, 77, 0.2);
  color: var(--red-dark);
}

html[data-theme="light"] .error-code { background: linear-gradient(135deg, var(--navy), var(--red)); }

html[data-theme="light"] .email-copy.copied {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
