:root {
  --bg: #060608;
  --bg-alt: #0a0a0d;
  --card: #111116;
  --border: #24242b;
  --red: #ff0000;
  --red-rgb: 255, 0, 0;
  --blue: #17b2ff;
  --blue-rgb: 23, 178, 255;
  --text: #fff;
  --text-dim: #a1a1aa;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Tajawal', Arial, sans-serif;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

a { text-decoration: none; color: inherit; }

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

.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.skip-link {
  position: absolute;
  right: 10px;
  top: -60px;
  background-color: var(--red);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-link:focus { top: 10px; }

.section-title {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
}
.section-eyebrow {
  display: block;
  text-align: center;
  color: var(--blue);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

section[id] { scroll-margin-top: 90px; }

/* Technical HUD corner accents */
.tech-corners { position: relative; }
.tech-corners::before,
.tech-corners::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--blue);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.3s, border-color 0.3s;
}
.tech-corners::before { top: 0; inset-inline-start: 0; border-inline-end: none; border-bottom: none; }
.tech-corners::after { bottom: 0; inset-inline-end: 0; border-inline-start: none; border-top: none; }
.tech-corners:hover::before,
.tech-corners:hover::after { border-color: var(--red); opacity: 0.9; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background-color: rgba(6,6,8,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  position: relative;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1px;
}
/* SM ACADEMY mark. Sized by height so the wordmark keeps its aspect ratio;
   the width/height attributes on the tag reserve the box before it loads. */
.logo-mark {
  display: block;
  height: 40px;
  width: auto;
}
.logo span { color: var(--red); }
/* Text fallback: if the mark fails to load, the img removes itself and the
   header shows the "SM" wordmark instead of a broken image. */
.logo-text { display: none; color: var(--text); }
.logo--nomark .logo-text { display: inline; }

nav a {
  margin-inline-start: 25px;
  font-weight: 500;
  transition: color 0.2s;
}
nav a:hover { color: var(--blue); }
.nav-cta {
  background-color: var(--red);
  padding: 8px 18px;
  border-radius: 8px;
  color: #fff !important;
}
.nav-cta:hover { color: #fff !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  padding: 110px 0 90px;
  text-align: center;
  background: radial-gradient(circle at 50% 20%, #1a0000 0%, var(--bg) 65%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -50% -20%;
  background: linear-gradient(120deg, transparent 30%, rgba(var(--blue-rgb),0.10) 45%, rgba(var(--red-rgb),0.10) 55%, transparent 70%);
  background-size: 200% 200%;
  animation: sweep 12s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sweep {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}
.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap-reverse;
}
/* min-width:0 lets these shrink below their flex-basis instead of being
   pinned to it — keeps the hero safe on very narrow screens. */
.hero-content { flex: 1 1 420px; min-width: 0; }
.hero-visual { flex: 1 1 400px; min-width: 0; max-width: min(440px, 100%); }

/* keyframe kept: also used by the course card's hover icon */
@keyframes spin-turbo {
  to { transform: rotate(360deg); }
}

.turbo-photo {
  margin: 0;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.turbo-photo img {
  display: block;
  width: 100%;
  height: clamp(320px, 42vw, 440px);
  object-fit: cover;
  object-position: 50% 62%;
  filter: contrast(1.08) saturate(0.9);
}
.turbo-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,0,0,0.16) 0%, transparent 45%, rgba(6,6,8,0.75) 100%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 25px;
}
.hero h1 {
  font-size: clamp(30px, 5.5vw, 46px);
  font-weight: 900;
  margin-bottom: 20px;
  line-height: 1.4;
}
.highlight { color: var(--red); }
.hero p {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 35px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: 50px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-value {
  font-family: 'Space Mono', monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--blue);
}
.hero-stat-label {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--red);
  color: #fff;
  padding: 14px 40px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 17px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(var(--red-rgb),0.6);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: var(--text);
  padding: 13px 36px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 17px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, color 0.2s;
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-3px);
}

/* About */
.about { padding: 70px 0; background-color: var(--bg-alt); }
.about-inner {
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
}
.about-inner p {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.9;
}

/* Courses */
.courses { padding: 80px 0; }
.course-panel {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: 15px;
  padding: 40px;
  overflow: hidden;
  transition: transform 0.35s, box-shadow 0.35s;
}
.course-panel:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 40px rgba(var(--red-rgb),0.3);
}
.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.05) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.9s ease;
  pointer-events: none;
}
.course-panel:hover .card-shine { transform: translateX(120%); }

.course-panel-icon svg { transition: transform 0.3s; }
.course-panel:hover .course-panel-icon svg { animation: spin-turbo 1.4s linear infinite; }

.course-panel-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 30px;
}
.course-panel-icon { width: 56px; height: 56px; color: var(--blue); }
.course-panel-icon .icon { width: 100%; height: 100%; stroke-width: 1.3; }
.course-panel-name { font-size: 24px; font-weight: 900; }
.course-panel-meta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.course-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 20px;
  padding: 5px 14px;
}

.program-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 35px;
}
.program-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.course-panel.visible .program-item {
  opacity: 1;
  transform: translateY(0);
}
.course-panel.visible .program-item:nth-child(1) { transition-delay: 0.05s; }
.course-panel.visible .program-item:nth-child(2) { transition-delay: 0.15s; }
.course-panel.visible .program-item:nth-child(3) { transition-delay: 0.25s; }
.course-panel.visible .program-item:nth-child(4) { transition-delay: 0.35s; }
.course-panel.visible .program-item:nth-child(5) { transition-delay: 0.45s; }
@media (prefers-reduced-motion: reduce) {
  .program-item { opacity: 1; transform: none; transition: none; }
}
.program-item-icon { width: 22px; height: 22px; color: var(--blue); margin-top: 2px; }
.program-item p { margin: 0; font-size: 14px; line-height: 1.6; }

.course-panel-cta { text-align: center; }

/* Why us */
.why-us { padding: 80px 0; background-color: var(--bg-alt); }
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  text-align: center;
}
.why-item {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 30px 15px;
  transition: border-color 0.3s, transform 0.3s;
}
.why-item:hover { border-color: var(--blue); transform: translateY(-6px); }
.why-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--red);
}
.why-icon .icon { width: 100%; height: 100%; }
.why-item p { font-weight: 500; }

/* FAQ */
.faq { padding: 80px 0; }
.faq-list { max-width: 750px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: start;
  padding: 20px;
  cursor: pointer;
}
.faq-question .icon {
  width: 20px;
  height: 20px;
  color: var(--blue);
  transition: transform 0.25s;
  flex-shrink: 0;
}
.faq-item[data-open="true"] .faq-question .icon { transform: rotate(180deg); }
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease-out;
}
.faq-item[data-open="true"] .faq-answer { grid-template-rows: 1fr; }
.faq-answer-inner {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.8;
}
.faq-item[data-open="true"] .faq-answer-inner { padding: 0 20px 20px; }

/* Signup */
.signup { padding: 80px 0; }
.signup-form {
  max-width: 550px;
  margin: 0 auto;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 35px;
}
.form-row { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-weight: 500; font-size: 14px; }
.form-row input,
.form-row select,
.form-row textarea {
  background-color: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  min-height: 44px;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--blue);
}
.form-row input.invalid,
.form-row select.invalid {
  border-color: var(--red);
}
.field-error {
  color: var(--red);
  font-size: 13px;
  min-height: 16px;
}
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-radius: 10px;
  transition: box-shadow 0.2s;
}
.choice-group.invalid { box-shadow: 0 0 0 1px var(--red); padding: 4px; }
.choice-btn {
  background-color: #000;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 44px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.choice-btn:hover { border-color: var(--blue); }
.choice-btn.selected {
  background-color: var(--blue);
  border-color: var(--blue);
  color: #000;
  font-weight: 700;
}
.signup-form .btn-primary { width: 100%; justify-content: center; }
.form-message {
  text-align: center;
  margin-top: 15px;
  font-weight: 500;
  min-height: 20px;
}
.form-message.success { color: #2ecc71; }
.form-message.error { color: var(--red); }

/* Footer */
.site-footer {
  padding: 40px 0 25px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { font-size: 14px; transition: color 0.2s; }
.footer-nav a:hover { color: var(--blue); }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 25px;
  left: 25px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top .icon { width: 20px; height: 20px; }
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .back-to-top { transition: none; }
  .hero::before { animation: none; }
  .course-panel:hover .course-panel-icon svg { animation: none; }
  .card-shine { display: none; }
}

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  nav#siteNav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background-color: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 20px;
    display: none;
  }
  nav#siteNav.open { display: flex; }
  nav#siteNav a {
    margin-inline-start: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  nav#siteNav .nav-cta {
    margin-top: 10px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .logo-mark { height: 32px; }
  .hero { padding: 70px 0 60px; }
  .hero-stats { gap: 28px; margin-top: 36px; }
  .hero-inner { gap: 34px; }
  .course-panel { padding: 28px 20px; }
  .signup-form { padding: 26px 20px; }
}

/* ==========================================================================
   Shared components: course hub (index.html) + reused across course pages
   ========================================================================== */

/* Centered hero variant — used by the hub page, which has no side visual */
.hero--centered .hero-inner { justify-content: center; text-align: center; }
.hero--centered .hero-content { flex: 0 1 720px; }

/* Course selection cards (data-driven, rendered from assets/courses.js) */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.course-card {
  --accent-rgb: var(--red-rgb);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid rgb(var(--accent-rgb));
  border-radius: 16px;
  padding: 32px 28px;
  overflow: hidden;
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
}
.course-card:hover,
.course-card:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.3);
}
.course-card:hover .card-shine { transform: translateX(120%); }
.course-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: -32px -28px 0;
  overflow: hidden;
}
.course-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.08) saturate(0.92);
}
.course-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, var(--card) 100%);
  pointer-events: none;
}
.course-card-media-icon {
  position: absolute;
  bottom: 14px;
  inset-inline-start: 16px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--accent-rgb));
}
.course-card-media-icon .icon { width: 20px; height: 20px; }
.course-card-body { display: flex; flex-direction: column; gap: 18px; flex: 1; }
.course-card-name { font-size: 24px; font-weight: 900; margin: 0; }
.course-card-desc { color: var(--text-dim); font-size: 15px; line-height: 1.8; margin: 0; flex: 1; }
.course-card-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.course-card-meta .course-meta-pill { color: rgb(var(--accent-rgb)); border-color: rgb(var(--accent-rgb)); }
.course-card-cta { justify-content: center; background-color: rgb(var(--accent-rgb)); }
.course-card-badge {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
}

/* "What you'll learn" module grid — reused on any course page */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.module-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px;
  transition: border-color 0.3s, transform 0.3s;
}
.module-card:hover { border-color: var(--blue); transform: translateY(-4px); }
.module-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.module-card-number {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.module-card-icon { width: 24px; height: 24px; color: var(--blue); flex-shrink: 0; }
.module-card-title { font-size: 16px; font-weight: 700; margin: 0; }
.module-card-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin: 0; }

/* Lists inside a reused accordion answer (e.g. curriculum lessons) */
.faq-answer-inner ul { margin: 0; padding-inline-start: 20px; }
.faq-answer-inner li { margin-bottom: 6px; }
.faq-answer-inner li:last-child { margin-bottom: 0; }
