/* ================================================================
   Kenya Cubing Federation — Design System
   Clean, professional, multi-page site
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

:root {
  /* Deep forest palette */
  --black: #080e0b;
  --surface: #0d1711;
  --card: #111e16;
  --card-hover: #17271d;
  --border: #223329;
  --border-hover: #344a3b;
  --text: #f5f8f5;
  --text-muted: #a0afa4;
  --white: #ffffff;

  /* Accents */
  --primary: #ffffff;
  --primary-invert: #000000;
  --error: #ef4444;
  --green: #10b981;
  --red: #ef4444;
  --gold: #f59e0b;

  /* Typography: Strict System UI */
  --ff-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-heading: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Sharp System Radius */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Misc */
  --transition: 0.2s ease;
  --nav-h: 64px;
  --max-w: 1140px;
}

body {
  font-family: var(--ff-body);
  background: var(--black);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ── Layout ───────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-lg); }

.section {
  padding: var(--space-3xl) 0;
}
.section--alt { background: var(--surface); }

/* ── Typography ───────────────────────────────────────────────── */
.section__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: var(--space-md);
}
.section__title {
  font-family: var(--ff-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}
.section__subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: var(--space-xl);
}
.text-gradient {
  background: linear-gradient(135deg, var(--red), var(--gold));
  text-shadow: 0 0 30px rgba(196,30,58,0.5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.88rem; }

/* ── Navigation ───────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(8,14,11,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo {
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.site-logo {
  display: block;
  width: 148px;
  height: auto;
  max-height: 54px;
  padding: 3px;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}
.site-logo--footer {
  width: 220px;
  max-height: 78px;
}
.nav__logo-icon {
  color: var(--green);
  font-size: 1.1rem;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.nav__link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}
.nav__link:hover,
.nav__link.active {
  color: var(--white);
}
.nav__link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}
.nav__cta {
  font-size: 0.85rem; font-weight: 600; padding: 10px 24px;
  background: linear-gradient(135deg, var(--green), #20a35c);
  color: #ffffff; border-radius: var(--radius-pill);
  box-shadow: 0 4px 15px rgba(27,138,78,0.3); transition: var(--transition);
}
.nav__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(27,138,78,0.5);
  color: #ffffff;
}

/* Hamburger — ALWAYS in DOM, hidden on desktop, visible on mobile */
.nav__hamburger {
  display: none;       /* hidden on desktop */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px;
  z-index: 1001;
}
.nav__hamburger span {
  display: block;
  width: 100%; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}
.nav__hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__hamburger.active span:nth-child(2) { opacity: 0; }
.nav__hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav__overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.24);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.nav__overlay.active { opacity: 1; visibility: visible; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn--primary {
  background: linear-gradient(135deg, var(--red), #e62345);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 20px rgba(196,30,58,0.4);
}
.btn--primary:hover {
  background: linear-gradient(135deg, #e62345, var(--red));
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(196,30,58,0.6);
}
.btn--outline {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border-hover);
}
.btn--outline:hover { border-color: var(--white); }
.btn--sm { padding: 8px 18px; font-size: 0.82rem; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: var(--transition);
}
.card--hover:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

/* ── Grid ─────────────────────────────────────────────────────── */
.grid { display: grid; gap: var(--space-lg); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.badge--red { background: rgba(196,30,58,0.15); color: var(--red); }
.badge--green { background: rgba(27,138,78,0.15); color: var(--green); }
.badge--gold { background: rgba(212,168,67,0.15); color: var(--text-muted); }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th {
  text-align: left;
  padding: 14px 20px;
  font-family: var(--ff-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ── Forms ────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: var(--space-lg); }
.form__group { position: relative; }
.form__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.form__input, .form__select, .form__textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.form__select { cursor: pointer; appearance: none; }
.form__select option { background: var(--card); }
.form__textarea { resize: vertical; min-height: 120px; }
.form__input:focus, .form__select:focus, .form__textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(27,138,78,0.25);
  background: var(--card);
}
.form__input.error, .form__select.error, .form__textarea.error { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.form__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.form__checkbox input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--green);
}
.form__success {
  display: none;
  align-items: center;
  gap: 10px;
  padding: var(--space-md);
  background: rgba(27,138,78,0.1);
  border: 1px solid rgba(27,138,78,0.25);
  border-radius: var(--radius);
  color: var(--green);
  font-weight: 600;
}
.form__success.show { display: flex; }
.form__error:not([hidden]) {
  margin: 0;
  color: var(--error, #dc2626);
  font-size: 0.9rem;
  font-weight: 600;
}
.form-confirmation {
  width: min(440px, calc(100% - 32px));
  margin: auto;
  padding: clamp(28px, 6vw, 40px);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.form-confirmation::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(5px);
}
.form-confirmation__icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto var(--space-md);
  place-items: center;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.14);
  color: var(--green);
  font-size: 1.4rem;
}
.form-confirmation h2 {
  margin-bottom: var(--space-sm);
  font-family: var(--ff-heading);
  font-size: clamp(1.45rem, 5vw, 1.8rem);
}
.form-confirmation p {
  margin-bottom: var(--space-lg);
  color: var(--text-muted);
  line-height: 1.65;
}
.form-confirmation form { margin: 0; }
.form-confirmation .btn { min-width: 120px; }
.form .btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* ── Page Header (non-home pages) ─────────────────────────────── */
.page-header {
  padding: calc(var(--nav-h) + var(--space-3xl)) 0 var(--space-2xl);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.page-header__title {
  font-family: var(--ff-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.page-header__subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 520px;
}

/* ── Hero (home only) ─────────────────────────────────────────── */

/* ── Hero Video ─────────────────────────────────────────────── */
.hero__video {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.9;
}
.hero__overlay {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    linear-gradient(90deg, rgba(5,12,8,0.42) 0%, rgba(5,12,8,0.2) 48%, rgba(5,12,8,0.06) 100%),
    linear-gradient(0deg, rgba(5,12,8,0.16), transparent 30%, rgba(5,12,8,0.08));
  z-index: 1;
  pointer-events: none;
}
[data-theme='light'] .hero__video { opacity: 0.9; }
[data-theme='light'] .hero__overlay {
  background:
    linear-gradient(90deg, rgba(8,18,12,0.42) 0%, rgba(8,18,12,0.2) 48%, rgba(8,18,12,0.06) 100%),
    linear-gradient(0deg, rgba(8,18,12,0.16), transparent 30%, rgba(8,18,12,0.08));
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + var(--space-xl)) 0 var(--space-2xl);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.hero__layout {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.hero__content {
  display: grid;
  grid-template-columns: minmax(0, 620px);
  gap: 0;
  align-items: center;
}
.hero__copy {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: min(620px, 52vw);
  margin: 0;
  padding: clamp(28px, 4vw, 48px) clamp(28px, 5vw, 72px);
  border: 1px solid rgba(220,255,231,0.22);
  border-left: 3px solid var(--green);
  border-left: 0;
  border-radius: 0 24px 24px 0;
  background: linear-gradient(135deg, rgba(7,15,10,0.86), rgba(7,15,10,0.72));
  box-shadow: 0 28px 80px rgba(0,0,0,0.34), 0 0 42px rgba(27,138,78,0.1);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}
.hero__copy::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -90px;
  right: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27,138,78,0.2), transparent 70%);
  pointer-events: none;
}
[data-theme='light'] .hero__copy {
  background: linear-gradient(135deg, rgba(7,15,10,0.88), rgba(7,15,10,0.72));
}
.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(27,138,78,0.3);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(27,138,78,0.08);
}
.hero__title {
  font-family: var(--ff-heading);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  color: #fff;
}
.hero__subtitle {
  font-size: 1.4rem;
  color: #ffd166;
  font-weight: 500;
  margin-bottom: var(--space-md);
  min-height: 2.2rem;
}
.hero__desc {
  color: rgba(255,255,255,0.88);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: var(--space-xl);
  line-height: 1.75;
}
.hero__actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }
.hero__actions .btn--outline { color: #fff; border-color: rgba(255,255,255,0.72); }
.hero__actions .btn--outline:hover { background: rgba(255,255,255,0.12); border-color: #fff; }

/* 3D Cube */
.hero__cube {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,0.34));
}
.stage {
  width: 280px; height: 280px;
  perspective: 900px;
  position: relative;
}
.spin {
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: spin 35s linear infinite;
}
@keyframes spin {
  from { transform: rotateX(-25deg) rotateY(0deg); }
  to   { transform: rotateX(-25deg) rotateY(360deg); }
}
.cubie {
  position: absolute;
  width: 64px; height: 64px;
  left: 50%; top: 50%;
  margin: -32px 0 0 -32px;
  transform-style: preserve-3d;
}
.f {
  position: absolute;
  width: 64px; height: 64px;
  background: #181818;
  border-radius: 5px;
}
.f.s {
  box-sizing: border-box;
  border: 4px solid #181818;
  border-radius: 12px;
}
.cube-status {
  position: absolute;
  bottom: -36px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--ff-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Learning cube showcase ───────────────────────────────────── */
.learn-cube {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  overflow: hidden;
  padding: clamp(24px, 5vw, 56px);
  background:
    radial-gradient(ellipse at 82% 50%, rgba(27,138,78,0.16), transparent 48%),
    var(--card);
}
.learn-cube__copy { max-width: 560px; }
.learn-cube__copy .section__title { margin-bottom: 12px; }
.learn-cube__copy p { max-width: 500px; margin-bottom: 20px; }
.learn-cube__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: radial-gradient(circle, rgba(255,255,255,0.07), rgba(255,255,255,0.015) 60%);
}
.learn-cube__visual .stage { flex: 0 0 280px; }
.learn-cube__visual .cube-status { color: var(--text); }

/* ── Stats ────────────────────────────────────────────────────── */
.stats { padding: var(--space-2xl) 0; border-bottom: 1px solid var(--border); }
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  text-align: center;
}
.stats__number {
  font-family: var(--ff-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}
.stats__label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Reveal Animation ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Skeleton Loading ─────────────────────────────────────────── */
.skeleton {
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-3xl) 0 var(--space-xl);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}
.footer__brand p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: var(--space-md) 0 var(--space-lg);
  max-width: 300px;
  line-height: 1.7;
}
.footer__socials { display: flex; gap: 10px; }
.footer__socials a {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer__socials a:hover { background: var(--green); color: var(--white); border-color: var(--green); }
.footer__col h4 {
  font-family: var(--ff-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: var(--space-lg);
}
.footer__col ul { display: flex; flex-direction: column; gap: 10px; }
.footer__col a {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer__col a:hover { color: var(--white); }
.footer__col li { font-size: 0.88rem; color: var(--text-muted); }
.footer__bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── Shake animation (form errors) ────────────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .hero { padding-top: calc(var(--nav-h) + var(--space-2xl)); }
  .hero__content { grid-template-columns: minmax(0, min(620px, 68vw)); }
  .hero__title { font-size: clamp(2.4rem, 6vw, 3.4rem); }
  .learn-cube { grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding: var(--space-2xl) 0; }
  .hero { min-height: 0; padding: calc(var(--nav-h) + var(--space-md)) 0 var(--space-lg); }
  .hero__content { grid-template-columns: minmax(0, 1fr); }
  .hero__copy { max-width: min(620px, calc(100vw - 16px)); padding: 22px 20px 22px 24px; }
  .hero__overlay {
    background: linear-gradient(180deg, rgba(5,12,8,0.3), rgba(5,12,8,0.16) 62%, rgba(5,12,8,0.34));
  }

  [data-theme='light'] .hero__overlay {
    background: linear-gradient(180deg, rgba(8,18,12,0.3), rgba(8,18,12,0.16) 62%, rgba(8,18,12,0.34));
  }
  .hero__content { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .hero__copy { margin: 0; padding: clamp(18px, 4vw, 30px); }
  .hero__desc { margin-left: 0; margin-right: 0; }
  .hero__actions { justify-content: flex-start; }
  .learn-cube { grid-template-columns: 1fr; gap: 12px; }
  .learn-cube__visual { min-height: 240px; }
  .learn-cube__visual .stage { flex-basis: 220px; }

  /* Compact mobile dropdown */
  .nav__links {
    position: fixed;
    top: calc(var(--nav-h) + 10px);
    right: 16px;
    left: auto;
    width: min(320px, calc(100vw - 32px));
    max-height: calc(100dvh - var(--nav-h) - 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 1001;
    padding: 10px;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 48px rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  [data-theme="light"] .nav__links { background: rgba(255,255,255,0.98); }

  .nav__links.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav__link {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
  }
  .nav__link:hover,
  .nav__link.active {
    background: rgba(27,138,78,0.12);
    color: var(--green);
  }
  .nav__link.active::after { display: none; }
  .nav__links li { width: 100%; }

  .nav__overlay {
    background: rgba(0,0,0,0.12);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  
  .nav__cta { display: none; }
  .nav__hamburger { display: flex; z-index: 1002; }   /* ← VISIBLE on mobile */

  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .stage { width: 200px; height: 200px; }
}

@media (max-width: 600px) {
  .hero__content { grid-template-columns: 1fr; gap: 0; }
  .hero__copy { margin: 0; padding: 16px 16px 16px 20px; }
  .hero__tag { margin-bottom: 12px; }
  .hero__title { margin-bottom: 12px; }
  .hero__subtitle { font-size: 1.2rem; min-height: 1.8rem; margin-bottom: 8px; }
  .hero__desc { font-size: 0.92rem; line-height: 1.45; margin-bottom: 16px; }
  .learn-cube { padding: 20px; }
  .learn-cube__visual { min-height: 210px; }
  .learn-cube__visual .stage { flex-basis: 200px; }
}

@media (max-width: 480px) {
  .stats__grid { grid-template-columns: 1fr; }
  .hero__copy { padding: 16px; }
  .hero__title { font-size: clamp(2.1rem, 10vw, 2.5rem); }
  .hero__actions { flex-direction: row; align-items: stretch; width: 100%; gap: 8px; }
  .hero__actions .btn { flex: 1; width: auto; justify-content: center; padding: 10px 8px; font-size: 0.8rem; }
  .hero__tag { font-size: 0.68rem; letter-spacing: 1px; }
}


/* ── 3D Logo Cube ─────────────────────────────────────────────── */
.logo-cube {
  width: 28px; height: 28px;
  transform-style: preserve-3d;
  animation: logo-spin 6s linear infinite;
  position: relative;
  flex-shrink: 0;
}
.logo-cube .face {
  position: absolute;
  width: 28px; height: 28px;
  border-radius: 3px;
}
.logo-cube .face--front  { background: #C41E3A; transform: translateZ(14px); }
.logo-cube .face--back   { background: #FF8A1F; transform: rotateY(180deg) translateZ(14px); }
.logo-cube .face--right  { background: #2563EB; transform: rotateY(90deg) translateZ(14px); }
.logo-cube .face--left   { background: #1B8A4E; transform: rotateY(-90deg) translateZ(14px); }
.logo-cube .face--top    { background: #FFD21F; transform: rotateX(90deg) translateZ(14px); }
.logo-cube .face--bottom { background: #F4F6FF; transform: rotateX(-90deg) translateZ(14px); }

@keyframes logo-spin {
  from { transform: rotateX(-15deg) rotateY(0deg); }
  to   { transform: rotateX(-15deg) rotateY(360deg); }
}

.nav__logo {
  perspective: 200px;
}


/* Light Theme Variables */
[data-theme="light"] {
  --black: #ffffff;
  --surface: #f4f4f5;
  --card: #ffffff;
  --card-hover: #fafafa;
  --border: #e4e4e7;
  --border-hover: #d4d4d8;
  --text: #09090b;
  --text-muted: #71717a;
  --white: #000000;
  --primary: #09090b;
  --primary-invert: #ffffff;
}

/* ── Competition gallery ──────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 20px;
}
.gallery-card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}
.gallery-card:focus-visible,
.gallery-lightbox__close:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.gallery-card:hover img,
.gallery-card:focus-visible img {
  transform: scale(1.045);
}
.gallery-card__caption {
  position: absolute;
  inset: auto 0 0;
  padding: 38px 16px 15px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  color: #fff;
  font-size: 0.96rem;
  font-weight: 600;
}
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 24px;
  background: rgba(0, 0, 0, 0.92);
}
.gallery-lightbox.is-open { display: flex; }
.gallery-lightbox-open { overflow: hidden; }
.gallery-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.gallery-lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(100%, 1100px);
  max-height: 100%;
}
.gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 12px;
}
.gallery-lightbox__caption {
  margin-top: 14px;
  color: #fff;
  font-size: 1rem;
  text-align: center;
}
@media (max-width: 600px) {
  .site-logo { width: 122px; max-height: 46px; }
  .site-logo--footer { width: min(220px, 100%); max-height: none; }
  .gallery-grid { gap: 14px; }
  .gallery-lightbox { padding: 64px 14px 20px; }
  .gallery-lightbox__image { max-height: calc(100vh - 130px); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-card img { transition: none; }
}

[data-theme="light"] .nav {
  background: rgba(255,255,255,0.85);
}
[data-theme="light"] .nav__hamburger span {
  background: var(--text);
}
[data-theme="light"] .card {
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}
[data-theme="light"] .card--hover:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}
[data-theme="light"] .btn--primary {
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  transition: var(--transition);
}
.theme-toggle:hover { color: var(--text); }

/* Ambient Glowing Background */
body::before {
  content: ''; position: fixed; top: -20%; left: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(196,30,58,0.12) 0%, transparent 60%);
  z-index: -1; pointer-events: none;
}
body::after {
  content: ''; position: fixed; bottom: -20%; right: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(27,138,78,0.12) 0%, transparent 60%);
  z-index: -1; pointer-events: none;
}
[data-theme="light"] body::before { background: radial-gradient(circle, rgba(196,30,58,0.06) 0%, transparent 60%); }
[data-theme="light"] body::after { background: radial-gradient(circle, rgba(27,138,78,0.06) 0%, transparent 60%); }


/* ── Form Readability Fix ────────────────────────────────────── */
.form__input::placeholder, .form__select::placeholder, .form__textarea::placeholder {
  color: var(--text-muted) !important;
  opacity: 1 !important;
}
.form__input, .form__textarea, .form__select {
  color: var(--text) !important;
  background-color: var(--surface) !important;
  caret-color: var(--text);
  color-scheme: dark;
}
.form__input:focus, .form__textarea:focus, .form__select:focus {
  background-color: var(--surface) !important;
}
.form__input:-webkit-autofill,
.form__input:-webkit-autofill:hover,
.form__input:-webkit-autofill:focus,
.form__input:-webkit-autofill:active,
.form__textarea:-webkit-autofill,
.form__textarea:-webkit-autofill:hover,
.form__textarea:-webkit-autofill:focus,
.form__select:-webkit-autofill,
.form__select:-webkit-autofill:hover,
.form__select:-webkit-autofill:focus,
.form__input:autofill,
.form__textarea:autofill,
.form__select:autofill {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text) !important;
  background-color: var(--surface) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important;
  box-shadow: 0 0 0 1000px var(--surface) inset !important;
}
[data-theme="light"] .form__input,
[data-theme="light"] .form__textarea,
[data-theme="light"] .form__select {
  color-scheme: light;
}
.form__input:-webkit-autofill:focus,
.form__textarea:-webkit-autofill:focus,
.form__select:-webkit-autofill:focus,
.form__input:autofill:focus,
.form__textarea:autofill:focus,
.form__select:autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset, 0 0 0 4px rgba(27,138,78,0.25) !important;
  box-shadow: 0 0 0 1000px var(--surface) inset, 0 0 0 4px rgba(27,138,78,0.25) !important;
}
