:root {
  --bg: #0b1020;
  --bg-elev: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);

  --radius: 14px;
  --radius-sm: 12px;
  --container: 100%;

  --header-offset: 88px;

  --font: Inter, "Noto Sans Sinhala", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --primary: #0b5d3b;
  --primary-2: #16a34a;
  --danger: #c30010;

  --gallery-slot-w: 520px;
  --gallery-slot-h: 700px;
  --gallery-slot-w-wide: 720px;
  --gallery-gap: 14px;
  --gallery-slot-w-row1: calc((var(--gallery-slot-w) + var(--gallery-slot-w-wide)) / 2);
  --gallery-slot-w-row3-first: calc(var(--gallery-slot-w-wide) + var(--gallery-slot-w) + var(--gallery-gap));
  --gallery-slot-w-row4-first: calc(var(--gallery-slot-w-row3-first) - var(--gallery-gap) - var(--gallery-slot-w));
}

:root[data-theme='light'] {
  --bg: #f8fafc;
  --bg-elev: rgba(12, 18, 33, 0.06);
  --text: rgba(12, 18, 33, 0.92);
  --muted: rgba(12, 18, 33, 0.68);
  --border: rgba(12, 18, 33, 0.12);
  --shadow: 0 20px 40px rgba(12, 18, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-y: auto;
  padding-top: var(--header-offset);
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(124, 92, 255, 0.25), transparent 60%),
    radial-gradient(900px 500px at 85% 0%, rgba(33, 212, 253, 0.18), transparent 55%),
    var(--bg);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
  z-index: 50;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 28, 0.85);
  border-bottom: 1px solid var(--border);
}

:root[data-theme='light'] .site-header {
  background: rgba(247, 248, 251, 0.75);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: var(--shadow);
}

.brand-text {
  font-size: clamp(22px, 4.4vw, 48px);
  color: var(--primary);
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}

.nav-toggle-icon {
  display: inline-block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--muted);
}

.nav-link:hover {
  background: var(--bg-elev);
  color: var(--text);
}

.nav-link.is-active {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: inline-block;
  margin-right: 8px;
}

.hero {
  padding: 34px 0 62px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
  min-height: 0;
}

.hero-copy {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.hero-copy-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
}

.hero-card {
  margin-top: auto;
}

.hero-media {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.hero-media-footer {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(246, 192, 33, 0.35);
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  font-weight: 900;
  text-align: center;
  font-size: clamp(24px, 3.8vw, 52px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  animation: heroFooterBlink 1.1s ease-in-out infinite;
}

@keyframes heroFooterBlink {
  0%,
  100% {
    opacity: 1;
    filter: saturate(1.05);
    text-shadow:
      0 2px 10px rgba(0, 0, 0, 0.18),
      0 0 0 rgba(246, 192, 33, 0);
  }
  50% {
    opacity: 0.2;
    filter: saturate(1.25);
    text-shadow:
      0 2px 10px rgba(0, 0, 0, 0.18),
      0 0 18px rgba(246, 192, 33, 0.75);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media-footer {
    animation: none;
  }
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mosaic-item {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
  aspect-ratio: 4 / 3;
}

:root[data-theme='light'] .mosaic-item {
  background: rgba(0, 0, 0, 0.04);
}

.mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-copy h1 {
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.1;
  margin: 8px 0;
  letter-spacing: -0.03em;
}

.sinhala-slogan {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.35;
  color: var(--text);
  font-weight: 600;
}

.slogan-split {
  display: grid;
  grid-template-columns: 1fr 8px 1fr;
  align-items: start;
  gap: 18px;
  margin: 4px 0 6px;
}

.slogan-split-col {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.slogan-split-left {
  align-items: center;
  text-align: center;
}

.slogan-split-right {
  align-items: flex-start;
  text-align: left;
}

/* Right-side slogan colors */
.slogan-split-right [data-slogan-right-1] {
  color: #f6c021;
}

.slogan-split-right [data-slogan-right-2] {
  color: var(--primary);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.65);
}

.slogan-split-divider {
  width: 6px;
  height: 100%;
  min-height: 96px;
  align-self: stretch;
  border-radius: 999px;
  background: #f6c021;
}

.slogan-split-line {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 34px);
  line-height: 1.75;
  font-weight: 700;
  color: var(--text);
}

.slogan-split-word {
  margin: 0;
  font-size: clamp(32px, 2.8vw, 48px);
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  max-width: 60ch;
}

/* Homepage hero: move ONLY the lead line (no layout shift) */
.hero-copy .lead {
  margin-inline: auto;
  text-align: center;
  transform: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--bg-elev);
  font-size: 13px;
  font-weight: 700;
}

/* Bigger badge for the homepage hero */
.hero-copy .badge {
  margin: -6px 0 10px;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: 800;
}

.badge--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.badge--success {
  border-color: var(--primary-2);
  background: var(--primary-2);
  color: #ffffff;
}

.nav-cta {
  text-decoration: none;
  white-space: nowrap;
}

.nav-actions .badge {
  border-radius: 12px;
  font-size: clamp(16px, 1.6vw, 22px);
  padding: 10px 14px;
  font-weight: 900;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.stat {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 14px;
  padding: 12px;
}

.stat-num {
  font-size: 18px;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 26px 0;
}

.section-alt {
  padding: 26px 0;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

section[id] {
  scroll-margin-top: var(--header-offset);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.our-classes-title {
  font-size: 35px;
  font-weight: 900;
  color: var(--danger);
}

.section-divider {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  margin: 6px auto 18px;
  width: min(720px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.dot-divider {
  width: min(860px, 100%);
  margin: 0 auto 14px;
  height: 12px;
  background:
    radial-gradient(circle, rgba(29, 78, 216, 0.9) 4px, transparent 4.6px)
    0 50% / 18px 12px repeat-x;
  opacity: 0.8;
  animation: dot-divider-blink 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(29, 78, 216, 0.35));
}

@keyframes dot-divider-blink {
  0%, 100% {
    opacity: 0.35;
    filter: drop-shadow(0 0 0 rgba(29, 78, 216, 0));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(29, 78, 216, 0.45));
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot-divider {
    animation: none;
  }
}

.success-head {
  margin: 0 auto;
  width: min(860px, 100%);
  text-align: center;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: #000;
}


.success-slider-frame {
  width: min(1320px, 100%);
  margin: 14px auto 0;
  position: relative;
  border-radius: 36px;
  background: #ffffff;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.16);
}

.success-slider {
  width: 100%;
  margin: 0;
  overflow: hidden;
  position: relative;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  padding: 24px clamp(16px, 2.4vw, 44px) 16px;
}

.success-slider-frame::before {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 10;
  --gold: #f4b400;
  --gold-w: 7px;
  --corner-size: 140px;
  inset: calc(var(--gold-w) / -2);
  border-radius: calc(36px + (var(--gold-w) / 2));
  border: var(--gold-w) solid var(--gold);
  box-shadow: 0 16px 40px rgba(244, 180, 0, 0.08);

  /* Show only the corner portions of the border (matches screenshot). */
  -webkit-mask:
    linear-gradient(#000 0 0) 0 0 / var(--corner-size) var(--corner-size) no-repeat,
    linear-gradient(#000 0 0) 100% 0 / var(--corner-size) var(--corner-size) no-repeat,
    linear-gradient(#000 0 0) 0 100% / var(--corner-size) var(--corner-size) no-repeat,
    linear-gradient(#000 0 0) 100% 100% / var(--corner-size) var(--corner-size) no-repeat;
  mask:
    linear-gradient(#000 0 0) 0 0 / var(--corner-size) var(--corner-size) no-repeat,
    linear-gradient(#000 0 0) 100% 0 / var(--corner-size) var(--corner-size) no-repeat,
    linear-gradient(#000 0 0) 0 100% / var(--corner-size) var(--corner-size) no-repeat,
    linear-gradient(#000 0 0) 100% 100% / var(--corner-size) var(--corner-size) no-repeat;
}

.success-slider-track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  position: relative;
  z-index: 1;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  animation: success-track-move 480s linear infinite;
}

.success-student {
  flex: 0 0 auto;
  position: relative;
  isolation: isolate;
  --success-face-col: 220px;
  --success-pad-x: 46px;
  --success-face-size: 168px;
  --success-badge-size: 46px;
  --success-badge-gap: 14px;
  --success-num-size: 46px;
  --success-num-gap: 14px;
  display: grid;
  grid-template-columns: var(--success-face-col) minmax(0, 54ch);
  align-items: center;
  gap: 28px;
  width: max-content;
  height: 440px;
  padding: 32px 42px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: rgba(12, 18, 33, 0.92);
  box-shadow: none;
}

.success-student + .success-student {
  border-left: 0;
  margin-left: -1px;
}

.success-student::before {
  content: 'A';
  position: absolute;
  left: calc(var(--success-pad-x) + (var(--success-face-col) / 2));
  top: calc(50% - (var(--success-face-size) / 2) - (var(--success-badge-size) / 2) - var(--success-badge-gap));
  transform: translateX(-50%);
  width: var(--success-badge-size);
  height: var(--success-badge-size);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  z-index: 3;
}

.success-student::after {
  content: attr(data-num);
  position: absolute;
  left: calc(var(--success-pad-x) + (var(--success-face-col) / 2));
  top: calc(50% + (var(--success-face-size) / 2) - (var(--success-num-size) / 2) + var(--success-num-gap));
  transform: translateX(-50%);
  width: var(--success-num-size);
  height: var(--success-num-size);
  border-radius: 999px;
  background: var(--primary-2);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  z-index: 3;
}

.success-student:not([data-num])::after {
  content: none;
}

.success-face {
  width: var(--success-face-size);
  height: var(--success-face-size);
  box-sizing: border-box;
  border-radius: 999px;
  border: 10px solid rgba(29, 78, 216, 0.95);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  z-index: 2;
}

.success-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 999px;
  display: block;
}

.success-student--photo-01 .success-face img {
  object-position: 50% 25%;
}

.success-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 54ch;
}

.success-name {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: rgba(12, 18, 33, 0.92);
}

.success-comment {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.55;
  color: rgba(12, 18, 33, 0.9);
  max-width: 52ch;
  text-align: justify;
  text-justify: inter-word;
}

@media (max-width: 900px) {
  .success-slider {
    padding-inline: 16px;
  }

  .success-student {
    grid-template-columns: 1fr;
    height: auto;
    padding: 26px 18px;
    text-align: center;
    justify-items: center;
    --success-pad-x: 18px;
  }

  .success-student::before {
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
  }

  .success-student::after {
    left: 50%;
    top: calc(12px + var(--success-face-size) + 26px);
    transform: translateX(-50%);
  }

  .success-name {
    font-size: 26px;
  }

  .success-comment {
    font-size: 18px;
    text-align: center;
  }
}

@keyframes success-track-move {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .success-slider-track {
    animation: none;
  }
}

.classes-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 44px;
  flex-wrap: nowrap;
  overflow-x: auto;
  width: 100%;
  max-width: 2200px;
  margin: 0 auto;
  min-height: 560px;
  /* Extra bottom space so speech-bubble tails/frames don't touch the divider */
  padding: 96px 16px 96px;
}

.class-tile {
  --tile-accent: var(--primary);
  width: auto;
  max-width: 260px;
  min-width: 220px;
  flex: 1 1 0;
  height: 460px;
  position: relative;
  border-radius: 6px;
  border: 3px solid var(--tile-accent);
  background: rgba(255, 255, 255, 0.96);
  color: rgba(12, 18, 33, 0.92);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 10px 34px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  outline: 0;
}

/* colored "speech bubble" tail */
.class-tile::after {
  content: '';
  position: absolute;
  left: 14px;
  bottom: -28px;
  width: 70px;
  height: 40px;
  background: var(--tile-accent);
  clip-path: polygon(0 0, 100% 0, 72% 100%, 0 70%);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.12));
}

/* colored frame behind the card */
.class-tile::before {
  content: '';
  position: absolute;
  inset: -12px -12px -52px -12px;
  border-radius: 10px;
  background: var(--tile-accent);
  z-index: -1;
}

.class-avatar {
  position: absolute;
  top: -22px;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.65), transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.18));
  border: 5px solid var(--tile-accent);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

/* Golden "A" inside the top circle for Register cards */
.class-tile--register .class-avatar {
  width: 64px;
  height: 64px;
  top: -26px;
  display: grid;
  place-items: center;
}

.class-tile--register .class-avatar::after {
  content: 'A';
  font-weight: 900;
  font-size: 66px;
  line-height: 1;
  color: #f6c021;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.28),
    0 0 16px rgba(246, 192, 33, 0.35);
  pointer-events: none;
}

.class-title {
  font-weight: 900;
  font-size: 24px;
  color: var(--tile-accent);
  text-align: center;
  letter-spacing: -0.01em;
}

.class-tag {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(12, 18, 33, 0.6);
  margin-bottom: -4px;
}

/* Highlight the Grade 06 "Register for" + "Science" text */

/* Allow class tiles to be anchors without link styling */
a.class-tile {
  color: inherit;
  text-decoration: none;
}

a.class-tile:focus-visible {
  outline: 3px solid rgba(255, 215, 0, 0.95);
  outline-offset: 4px;
}
.class-tile--register .class-tag {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--danger);
  animation: register-tag-blink 1.35s ease-in-out infinite;
}

.class-tile--register .class-title {
  font-size: 38px;
  line-height: 1.05;
}

@keyframes register-tag-blink {
  0%, 100% {
    opacity: 0.65;
    text-shadow: 0 0 0 rgba(220, 38, 38, 0);
  }
  50% {
    opacity: 1;
    text-shadow:
      0 2px 0 rgba(0, 0, 0, 0.14),
      0 0 14px rgba(220, 38, 38, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .class-tile--register .class-tag {
    animation: none;
  }
}

.class-tile--register .class-sub {
  font-size: 20px;
  font-weight: 900;
  color: #1d4ed8;
}

/* Long copy needs a smaller, wrapped title so it fits the fixed 250×350 tile */
.class-tile--samples .class-title {
  font-size: 26px;
  line-height: 1.2;
  max-width: 20ch;
  text-wrap: balance;
  font-weight: 900;
  color: rgba(12, 18, 33, 0.95);
  letter-spacing: -0.005em;
}

.class-sub {
  font-size: 19px;
  color: rgba(12, 18, 33, 0.7);
  text-align: center;
  max-width: 24ch;
}

.class-stars {
  position: absolute;
  bottom: 12px;
  font-size: 22px;
  letter-spacing: 2px;
  font-weight: 900;
  color: #f6c021;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.35),
    0 6px 14px rgba(246, 192, 33, 0.25);
}

.class-tile--red {
  --tile-accent: var(--danger);
}

.class-tile--green {
  --tile-accent: var(--primary);
}

.muted {
  color: var(--muted);
  margin: 8px 0 0;
}

.grid {
  display: grid;
  gap: 14px;
}

.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

:root[data-theme='light'] .card {
  background: rgba(255, 255, 255, 0.7);
}

.card-header {
  padding: 16px 16px 0;
}

.card-title {
  margin: 0;
  font-size: 18px;
}

.card-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.card-body {
  padding: 16px;
}

.card-link {
  transition: transform 140ms ease, border-color 140ms ease;
}

.card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 92, 255, 0.55);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.table th,
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gallery-gap);
  overflow-x: auto;
  padding-bottom: 6px;
}

.gallery-row {
  display: flex;
  gap: var(--gallery-gap);
  flex-wrap: nowrap;
}

#gallery .section-head {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.gallery-heading {
  margin: 0;
  line-height: 1.05;
}

.gallery-heading-kicker {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gallery-heading-main {
  display: block;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.gallery-item {
  width: var(--gallery-slot-w);
  height: var(--gallery-slot-h);
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.gallery-item--wide {
  width: var(--gallery-slot-w-wide);
}

.gallery-item--row1-grow {
  width: var(--gallery-slot-w-row1);
}

.gallery-item--row3-first-wide {
  width: var(--gallery-slot-w-row3-first);
}

.gallery-item--row4-first-wide {
  width: var(--gallery-slot-w-row4-first);
}

.gallery-item--row5-first-wide {
  width: var(--gallery-slot-w-wide);
}

.gallery-media {
  position: relative;
  width: 100%;
  height: 100%;
  background: #3f6fb3;
}

.gallery-media img,
.gallery-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 1320px) {
  :root {
    --gallery-slot-w: 400px;
    --gallery-slot-w-wide: 600px;
    --gallery-slot-h: 600px;
  }

  .gallery-row {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 860px) {
  :root {
    --gallery-slot-w: 92vw;
    --gallery-slot-w-wide: 92vw;
    --gallery-slot-h: min(70vh, 640px);
  }

  .gallery {
    overflow-x: visible;
  }

  .gallery-row {
    flex-direction: column;
    align-items: center;
  }

  .gallery-item,
  .gallery-item--wide,
  .gallery-item--row1-grow,
  .gallery-item--row3-first-wide,
  .gallery-item--row4-first-wide,
  .gallery-item--row5-first-wide {
    width: min(var(--gallery-slot-w), 100%);
  }
}

@media (max-width: 520px) {
  :root {
    --gallery-slot-h: min(62vh, 520px);
  }

  .hero-media-footer {
    font-size: clamp(20px, 5.4vw, 44px);
  }

  .classes-grid {
    padding-top: 56px;
    padding-bottom: 86px;
    padding-left: 12px;
    padding-right: 12px;
    gap: 22px;
  }

  .class-tile {
    width: 280px;
    height: 420px;
    padding: 44px 14px 40px;
  }

  .class-avatar {
    width: 76px;
    height: 76px;
    top: -26px;
  }

  .class-tile--register .class-avatar {
    width: 88px;
    height: 88px;
    top: -34px;
  }

  .class-tile--register .class-avatar::after {
    font-size: 64px;
  }

  .class-tile--register .class-tag {
    font-size: 22px;
  }

  .class-tile--register .class-title {
    font-size: 38px;
  }

  .class-tile--register .class-sub {
    font-size: 22px;
  }

  .class-tile--samples .class-title {
    font-size: 24px;
    max-width: 20ch;
  }
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.list li {
  margin: 8px 0;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-left: 6px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  gap: 8px;
}

.btn:hover {
  border-color: rgba(124, 92, 255, 0.55);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.03);
}

.btn-outline {
  background: transparent;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
  font-weight: 800;
}

.btn-danger:hover {
  filter: brightness(1.02);
}

.btn-ghost {
  background: var(--bg-elev);
}

.inline-search {
  display: flex;
  gap: 10px;
  align-items: center;
}

input,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font);
}

:root[data-theme='light'] input,
:root[data-theme='light'] textarea {
  background: rgba(255, 255, 255, 0.8);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.chip.is-active {
  border-color: rgba(124, 92, 255, 0.55);
}

.page-hero {
  padding: 26px 0 6px;
}

.page-hero h1 {
  margin: 10px 0 0;
  font-size: clamp(28px, 3.2vw, 40px);
  letter-spacing: -0.03em;
}

.details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  margin-top: 10px;
}

.callout {
  margin-top: 16px;
  border: 1px solid rgba(33, 212, 253, 0.35);
  background: rgba(33, 212, 253, 0.08);
  padding: 12px 14px;
  border-radius: 14px;
}

.quiz {
  border: 0;
  padding: 0;
  margin: 0;
}

.quiz-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.radio {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  margin: 8px 0;
}

.quiz-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.quiz-result {
  margin: 10px 0 0;
  font-weight: 600;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.site-footer {
  padding: 18px 0;
  border-top: 1px solid var(--border);
  margin-top: 18px;
}

.site-footer .meta {
  font-size: clamp(14px, 1.8vw, 26px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
  align-items: start;
  padding-top: 10px;
  padding-bottom: 10px;
}

.footer-col {
  min-width: 220px;
}

.footer-brand {
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: clamp(18px, 2.4vw, 36px);
}

.footer-title {
  margin: 0 0 10px;
  font-size: clamp(14px, 2vw, 28px);
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-address {
  font-style: normal;
  color: var(--muted);
  font-size: clamp(14px, 1.8vw, 26px);
  line-height: 1.55;
}

.footer-sep {
  height: 10px;
}

.footer-nav {
  display: grid;
  gap: 8px;
}

.footer-link {
  color: var(--muted);
  font-weight: 650;
  font-size: clamp(14px, 1.8vw, 26px);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.link {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 600;
}

.hero-card .card {
  height: clamp(260px, 36vh, 440px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.hero-promo-img {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}



.hero-card .card .card-body {
  overflow: auto;
}

@media (max-width: 1024px) {
  .hero {
    padding: 26px 0 46px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .classes-grid {
    justify-content: flex-start;
    gap: 28px;
    overflow-x: auto;
    min-height: 540px;
    padding: 92px 16px 92px;
  }

  .mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slogan-split {
    grid-template-columns: 1fr;
  }

  .slogan-split-divider {
    width: 100%;
    height: 6px;
    min-height: 0;
  }

  .slogan-split-right {
    align-items: center;
    text-align: center;
  }

  .cards-3 {
    grid-template-columns: 1fr;
  }

  .cards-2 {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-card .card {
    position: static;
    max-height: none;
    height: clamp(240px, 38vh, 380px);
  }

  .hero-card {
    margin-top: 0;
    flex: 0 0 auto;
    display: block;
  }

  .hero-card {
    margin-top: 10px;
  }
}

@media (max-width: 900px) and (min-width: 721px) {
  .nav-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-actions .badge {
    font-size: 16px;
    padding: 8px 12px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-offset: 74px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    right: 16px;
    top: calc(var(--header-offset) - 18px);
    width: min(340px, calc(100vw - 32px));
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(10, 14, 28, 0.92);
    box-shadow: var(--shadow);
  }

  :root[data-theme='light'] .nav-menu {
    background: rgba(247, 248, 251, 0.96);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-actions {
    margin-left: 0;
    width: 100%;
  }

  .nav-actions .badge {
    width: 100%;
    justify-content: center;
  }

  .nav-actions .btn {
    width: 100%;
  }
}
