/* ============================================================
   Zero To Hero Academy — Design System
   main.css: tokens · reset · typography · layout · utilities
   ============================================================ */

/* ── Google Fonts ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #0d0d14;
  --bg2:         #13131f;
  --bg3:         #1a1a2e;

  /* Brand colours */
  --purple:      #7c3aed;
  --purple-light: #a855f7;
  --yellow:      #f5c842;
  --teal:        #2dd4bf;

  /* Text */
  --white:       #f1f0f8;
  --muted:       #a0a0c0; /* adjusted from ebook #7b7a99 — meets 7:1 on --bg */

  /* Surfaces */
  --border:      rgba(255,255,255,0.07);
  --border-hover: rgba(168,85,247,0.4);

  /* Gradients */
  --grad-purple-teal:  linear-gradient(135deg, var(--purple-light), var(--teal));
  --grad-yellow-teal:  linear-gradient(135deg, var(--yellow), var(--teal));
  --grad-purple-yellow: linear-gradient(135deg, var(--purple-light), var(--yellow));

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Type scale */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;
  --text-6xl:   3.75rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container-max: 1100px;
  --container-pad: 1.5rem;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-full: 100px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

/* ── CSS Reset ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--white);
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

ul, ol {
  list-style: none;
}

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

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--white);
}

p {
  color: var(--white);
}

/* ── WCAG: Skip Navigation ───────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-6);
  background: var(--yellow);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}

.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid var(--bg);
  outline-offset: 2px;
}

/* ── WCAG: Focus Styles ──────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Remove default outline only when focus-visible is supported */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Typography ──────────────────────────────────────────── */
.display-1 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl));
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.display-2 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 4.5vw, var(--text-5xl));
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.heading-1 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
  font-weight: 700;
  line-height: 1.15;
}

.heading-2 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  font-weight: 700;
}

.heading-3 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-lg), 2vw, var(--text-2xl));
  font-weight: 600;
}

.body-lg {
  font-size: var(--text-lg);
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted);
}

.body-md {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--muted);
}

/* ── Gradient Text ───────────────────────────────────────── */
.text-gradient-purple-teal {
  background: var(--grad-purple-teal);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-yellow-teal {
  background: var(--grad-yellow-teal);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple-yellow {
  background: var(--grad-purple-yellow);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--wide {
  max-width: 1280px;
}

.container--narrow {
  max-width: 760px;
}

.section {
  padding-block: var(--space-24);
}

.section--sm {
  padding-block: var(--space-16);
}

.section--lg {
  padding-block: var(--space-32);
}

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--space-6);
}

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

.flex {
  display: flex;
  gap: var(--space-4);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left;   }

/* Colour utilities */
.text-white  { color: var(--white); }
.text-muted  { color: var(--muted); }
.text-yellow { color: var(--yellow); }
.text-purple { color: var(--purple-light); }
.text-teal   { color: var(--teal); }

/* Spacing utilities */
.mt-auto { margin-top: auto; }
.mb-4    { margin-bottom: var(--space-4); }
.mb-6    { margin-bottom: var(--space-6); }
.mb-8    { margin-bottom: var(--space-8); }
.mb-12   { margin-bottom: var(--space-12); }
.gap-2   { gap: var(--space-2); }
.gap-4   { gap: var(--space-4); }
.gap-6   { gap: var(--space-6); }
.gap-8   { gap: var(--space-8); }

/* ── Decorative Glow Orbs ────────────────────────────────── */
.orb-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}

.orb--purple {
  background: var(--purple);
  width: 400px;
  height: 400px;
}

.orb--teal {
  background: var(--teal);
  width: 300px;
  height: 300px;
}

.orb--yellow {
  background: var(--yellow);
  width: 250px;
  height: 250px;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin-block: 0;
}

/* ── Screen-reader only ──────────────────────────────────── */
.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;
}

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

  .orb {
    display: none;
  }
}

/* ── Responsive Breakpoints ──────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --container-pad: 1.25rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .section { padding-block: var(--space-16); }
  .section--lg { padding-block: var(--space-20); }
}

@media (max-width: 480px) {
  :root {
    --container-pad: 1rem;
  }
}

/* ── Scroll Reveal Animation ─────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
