/* ==========================================================================
   SV Technologies — Cloud Infrastructure Training Institute
   Build-less static stylesheet. Hand-written modern CSS.
   ========================================================================== */

/* ----- Font imports ------------------------------------------------------- */
@import url("https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@400,500,700,800,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  /* Backgrounds (white + blue — light theme default) */
  --bg-base: #ffffff;
  --bg-surface: #ffffff;
  --bg-elevated: #f4f7fd;
  --bg-raised: #eaf1fc;

  /* Brand — blue */
  --primary: #0a66ff;
  --primary-bright: #2f80ff;
  --primary-hover: #0052d6;
  --primary-soft: rgba(10, 102, 255, 0.08);
  --primary-glow: rgba(10, 102, 255, 0.25);
  --accent-2: #0a66ff;

  /* Text */
  --text-primary: #0b1b33;
  --text-secondary: #41526e;
  --text-muted: #6b7a92;

  /* Borders */
  --border-default: #e2e8f2;
  --border-subtle: rgba(11, 27, 51, 0.08);
  --border-highlight: rgba(10, 102, 255, 0.4);

  /* Status */
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;

  /* Shape */
  --radius: 0.75rem;

  /* Derived */
  --header-height: 5rem;
  --container-max: 80rem;
  --shadow-soft: 0 12px 40px -16px rgba(10, 40, 90, 0.18);
  --shadow-glow: 0 10px 30px -10px var(--primary-glow);
}

/* ----- Dark theme override (opt-in via data-theme="dark") ----------------- */
[data-theme="dark"] {
  --bg-base: #05070e;
  --bg-surface: #0a0e1a;
  --bg-elevated: #10172a;
  --bg-raised: #161f38;

  --primary: #3d7dff;
  --primary-bright: #5c94ff;
  --primary-hover: #2f6bff;
  --primary-soft: rgba(61, 125, 255, 0.12);
  --primary-glow: rgba(61, 125, 255, 0.45);
  --accent-2: #22d3ee;

  --text-primary: #eef2fb;
  --text-secondary: #a7b2c9;
  --text-muted: #6b7690;

  --border-default: #1c2742;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-highlight: rgba(61, 125, 255, 0.55);

  --shadow-soft: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-bright);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.15;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
}

h2 {
  font-size: clamp(1.9rem, 3vw + 0.5rem, 3rem);
}

h3 {
  font-size: clamp(1.3rem, 1.5vw + 0.5rem, 1.75rem);
}

p {
  color: var(--text-secondary);
}

::selection {
  background: var(--primary-soft);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 2px;
}

/* ==========================================================================
   Typography utilities
   ========================================================================== */
.font-display {
  font-family: "Cabinet Grotesk", "Outfit", sans-serif;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.font-mono {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.text-gradient {
  background: linear-gradient(100deg, var(--primary-bright), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.overline {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--primary-bright);
}

.overline::before {
  content: "";
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: var(--primary-bright);
  opacity: 0.8;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.lead {
  font-size: clamp(1.05rem, 1.2vw + 0.5rem, 1.35rem);
  color: var(--text-secondary);
  max-width: 42rem;
}

/* ==========================================================================
   Decorative backgrounds
   ========================================================================== */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(61, 125, 255, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(61, 125, 255, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 40%, transparent 85%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 40%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.glow-radial {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  background: radial-gradient(circle at center, var(--primary-glow), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.glow-radial.accent {
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.4), transparent 70%);
}

.noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg-base) 70%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border-subtle);
}

.glass-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Cabinet Grotesk", "Outfit", sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.brand .brand-logo {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: 0.4rem;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--primary-bright), var(--accent-2));
  transition: width 0.25s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hamburger toggle */
.nav-toggle {
  width: 2.75rem;
  height: 2.75rem;
  display: none;
  place-items: center;
  border-radius: 0.5rem;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--text-primary);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1.1rem;
  height: 2px;
  background: var(--text-primary);
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

/* Mobile nav drawer */
.nav-mobile {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem;
  background: color-mix(in srgb, var(--bg-surface) 96%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-default);
  transform: translateY(-120%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.nav-mobile.open,
.open .nav-mobile {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.nav-mobile a {
  padding: 0.85rem 0.5rem;
  font-size: 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-mobile a:last-of-type {
  border-bottom: none;
}

.nav-mobile .btn-primary,
.nav-mobile .btn-ghost {
  margin-top: 0.75rem;
  justify-content: center;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card-surface {
  position: relative;
  background: var(--bg-surface);
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.04), transparent 35%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-surface:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-soft);
}

.card-surface .card-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 0.65rem;
  background: var(--primary-soft);
  border: 1px solid var(--border-highlight);
  color: var(--primary-bright);
  margin-bottom: 1.25rem;
}

.card-surface h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* ── Session gallery marquee ──────────────────── */
.marquee {
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee__track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  padding: 0.5rem 1.25rem;
  animation: marquee-scroll 42s linear infinite;
}
.marquee:hover .marquee__track {
  animation-play-state: paused;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.session-slide {
  flex: 0 0 auto;
  width: 22rem;
  max-width: 80vw;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
}
.session-slide img {
  width: 100%;
  height: 13.5rem;
  object-fit: cover;
  display: block;
}
.session-slide figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
}
/* When JS finds no images loaded, hide the whole section */
#sessions.is-empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; overflow-x: auto; }
}

/* ── Logo/icon with graceful fallback ─────────── */
/* The emoji sits in the box; the <img> overlays it. If the image is missing,
   onerror hides the img and the emoji shows through. Nothing looks broken. */
.icon-img {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.65rem;
  background: var(--primary-soft);
  border: 1px solid var(--border-highlight);
  font-size: 1.5rem;        /* emoji fallback size */
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.icon-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  background: #fff;
}
.cert-issuer-wrap {
  display: inline-flex;
  align-items: center;
}
.cert-logo {
  height: 1.6rem;
  width: auto;
  max-width: 7rem;
  object-fit: contain;
}

/* Trust badge row */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  text-align: left;
}
.trust-badge {
  height: 3rem;
  width: auto;
  object-fit: contain;
}

/* ── Certification cards ──────────────────────── */
.cert-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.cert-card__top {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.cert-card__feats {
  padding: 1.25rem 1.5rem;
  flex: 1;
}
.cert-card__stack {
  padding: 0 1.5rem 1.5rem;
}
.cert-card--featured {
  border-color: var(--primary);
  box-shadow: 0 16px 48px -22px var(--primary-glow);
}
.cert-issuer {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.cert-exam {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 0.28rem 0.6rem;
}

/* Animated gradient border glow on hover */
.card-glow {
  position: relative;
  isolation: isolate;
}

.card-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(130deg, var(--primary-bright), var(--accent-2), transparent 70%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.card-glow:hover::after {
  opacity: 1;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.8rem 1.4rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease,
    border-color 0.25s ease, filter 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-bright), var(--primary));
  color: #ffffff;
  box-shadow: 0 6px 22px -6px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 30px -8px var(--primary-glow);
  color: #ffffff;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: color-mix(in srgb, var(--bg-elevated) 50%, transparent);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-ghost:hover {
  border-color: var(--border-highlight);
  background: var(--primary-soft);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 1.8rem;
  font-size: 1.05rem;
}

.btn-primary svg,
.btn-ghost svg {
  width: 1.1em;
  height: 1.1em;
}

/* ==========================================================================
   Badges & pills
   ========================================================================== */
.badge-mono {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--border-highlight);
  color: var(--primary-bright);
}

.badge-mono .dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent-2);
}

/* ==========================================================================
   Dividers
   ========================================================================== */
.section-divider {
  width: 100%;
  height: 1px;
  border: none;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-default) 20%,
    var(--border-highlight) 50%,
    var(--border-default) 80%,
    transparent
  );
}

/* ==========================================================================
   Forms
   ========================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-dark,
textarea.input-dark,
select.input-dark,
input.input-dark {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-dark::placeholder {
  color: var(--text-muted);
}

.input-dark:hover {
  border-color: var(--border-highlight);
}

.input-dark:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

textarea.input-dark {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.6;
}

select.input-dark {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c94ff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

select.input-dark option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.06);
  }
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(30px, -20px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes drift-slow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-40px, 25px) scale(1.08);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

.fade-up {
  animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pulse-glow {
  animation: pulse-glow 4s ease-in-out infinite;
}

.animate-drift {
  animation: drift 14s ease-in-out infinite;
}

.animate-drift-slow {
  animation: drift-slow 18s ease-in-out infinite;
}

/* Staggered fade-up helper */
.fade-up.delay-2 { animation-delay: 0.12s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Layout — container
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 2rem;
  }
}

/* ==========================================================================
   Layout — sections
   ========================================================================== */
.section {
  position: relative;
  padding-block: 5rem;
}

.section-sm {
  padding-block: 3rem;
}

.section-head {
  max-width: 44rem;
  margin-bottom: 3rem;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 10vw, 8rem);
}

/* Two-column feature layouts that collapse cleanly on tablet/mobile */
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 3.5rem;
}

.instructor-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.3fr;
  align-items: start;
  gap: 2.5rem;
}

@media (max-width: 900px) {
  .hero-grid,
  .instructor-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .instructor-grid > div:first-child {
    max-width: 24rem;
    margin-inline: auto;
  }
}

/* Focus-areas pipeline: 5 cols -> 3 -> 2 as width shrinks */
#focusGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
@media (max-width: 1024px) {
  #focusGrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  #focusGrid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Layout — grid helpers
   ========================================================================== */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Collapse to 2 columns under 1024px */
@media (max-width: 1024px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Collapse to 1 column under 640px */
@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Layout — flex helpers
   ========================================================================== */
.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-1 {
  flex: 1 1 0%;
}

/* Spacing utilities */
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* ==========================================================================
   Stats / metric blocks
   ========================================================================== */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
}
.stats-band__item {
  background: var(--bg-surface);
  padding: 1.75rem 1.25rem;
  text-align: center;
}
.stats-band__item .stat-value {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
}
.stats-band__item .stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
@media (max-width: 768px) {
  .stats-band { grid-template-columns: repeat(2, 1fr); }
}

.stat-value {
  font-family: "Cabinet Grotesk", "Outfit", sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Toasts (plain CSS replacement for sonner)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--primary);
  border-radius: 0.6rem;
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  font-size: 0.9rem;
  animation: fade-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.hide {
  animation: fade-up 0.3s ease reverse forwards;
}

/* ==========================================================================
   Admin table
   ========================================================================== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 42rem;
}

.admin-table thead th {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
  padding: 0.9rem 1.1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 0.9rem 1.1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background 0.18s ease;
}

.admin-table tbody tr:hover {
  background: var(--bg-elevated);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* Tech-stack chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding-block: 3.5rem 2rem;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
}

.site-footer h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
}

.site-footer ul li {
  margin-bottom: 0.6rem;
}

.site-footer ul li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer ul li a:hover {
  color: var(--text-primary);
}

.site-footer .footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .site-footer .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .site-footer .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Visibility helpers & responsive nav breakpoints
   ========================================================================== */
.hidden {
  display: none !important;
}

/* Desktop-only items hide under the 1024px nav breakpoint */
.desktop-only {
  display: initial;
}

@media (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }
}

/* ==========================================================================
   Custom scrollbar
   ========================================================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 999px;
  border: 2px solid var(--bg-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   Misc utilities
   ========================================================================== */
.relative { position: relative; }
.z-10 { z-index: 10; }
.w-full { width: 100%; }

/* ── Floating "Listen to this page" narration button ─────────────── */
.page-narrate {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem 0.7rem 0.8rem;
  border: 1px solid var(--border-highlight, rgba(255, 255, 255, 0.18));
  border-radius: 999px;
  background: var(--primary, #0a66ff);
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(10, 102, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.page-narrate:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(10, 102, 255, 0.45);
}
.page-narrate:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.page-narrate .narrate-icon {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.page-narrate .icon-stop { display: none; }
.page-narrate.is-playing .icon-play { display: none; }
.page-narrate.is-playing .icon-stop { display: block; }
.page-narrate.is-playing {
  background: var(--accent, #7c3aed);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
}
@media (max-width: 560px) {
  .page-narrate .narrate-label { display: none; }
  .page-narrate { padding: 0.65rem; }
  .page-narrate .narrate-icon { width: 2rem; height: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .page-narrate { transition: none; }
  .page-narrate:hover { transform: none; }
}

/* ── Toolkit tool screenshots (LMS preview) ──────────────────────── */
.toolkit-previews {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}
.toolkit-shot {
  display: block;
  position: relative;
  border-radius: var(--radius, 14px);
  overflow: hidden;
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.1));
  background: var(--bg-surface, #0f1830);
  box-shadow: var(--shadow-soft, 0 8px 24px rgba(0, 0, 0, 0.25));
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.toolkit-shot:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight, rgba(10, 102, 255, 0.5));
  box-shadow: 0 14px 34px rgba(10, 102, 255, 0.28);
}
.toolkit-shot img {
  display: block;
  width: 100%;
  height: auto;
}
.toolkit-shot__cap {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(8, 15, 35, 0.82);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}
@media (max-width: 640px) {
  .toolkit-previews { grid-template-columns: 1fr; }
}
