/* ==========================================================================
   Learning Path Site — Design tokens extracted from motion.zajno.com (Step 0)
   - bg dark:  rgb(12,11,11)   -> #0C0B0B
   - fg light: rgb(253,252,250)-> #FDFCFA
   - bg light (inner pages, sampled from the "Easing" lesson panel):
               rgb(200,207,232) -> #C8CFE8
   - pill radius: 34.6666px on a 61px-tall element (i.e. fully-rounded stadium)
   - circle badge: 53px diameter, border-radius 50%
   - hamburger bars: 19x4px, radius 2.667px
   - menu cards: 0px radius, full height, divided by 1px hairlines
   - easing: cubic-bezier(0.16, 1, 0.3, 1) (GSAP power3/4.out equivalent)
   ========================================================================== */

:root {
  --bg-dark: #0a0a0a;
  --bg-dark-2: #111111;
  --fg-light: #f5f5f5;
  --fg-light-2: #fdfcfa;
  --bg-light: #c8cfe8;
  --fg-dark: #0c0b0b;

  --line-dark: rgba(245, 245, 245, 0.22);
  --line-light: rgba(12, 11, 11, 0.18);

  --radius-pill: 999px;
  --radius-circle: 50%;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.4s;
  --dur-med: 0.6s;
  --dur-slow: 0.9s;

  --nav-h: 92px;
  --gutter: clamp(20px, 5vw, 64px);

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  background: var(--bg-dark);
  color: var(--fg-light);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Body variants for inner pages ---------- */
body.is-light {
  background: var(--bg-light);
  color: var(--fg-dark);
}

/* ==========================================================================
   Preloader — plays on first visit and on hard refresh only. Skipped when
   navigating between pages via internal links (decided synchronously by an
   inline head script, before first paint, to avoid any flash).
   ========================================================================== */

html.skip-loader .page-loader {
  display: none;
}

html.lock-scroll,
html.lock-scroll body {
  overflow: hidden;
  height: 100%;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.loader-ball {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-dark);
  transform: translateY(-100vh);
  will-change: transform;
}

body.is-light a {
  color: var(--fg-dark);
}

/* ==========================================================================
   Top Nav — pill logo + circular badges + pill menu button
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.55) 0%, rgba(10, 10, 10, 0) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.is-light .site-nav {
  background: linear-gradient(to bottom, rgba(200, 207, 232, 0.6) 0%, rgba(200, 207, 232, 0) 100%);
}

.site-nav .nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--fg-light-2);
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.is-light .nav-badge {
  border-color: var(--fg-dark);
  background: var(--bg-light);
}

.nav-badge svg {
  width: 18px;
  height: 18px;
}

.nav-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.nav-logo {
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--fg-light-2);
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  font-weight: 500;
  white-space: nowrap;
}

body.is-light .nav-logo {
  border-color: var(--fg-dark);
  background: var(--bg-light);
}

.nav-toggle {
  height: 52px;
  padding: 0 8px 0 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--fg-light-2);
  background: var(--bg-dark);
  color: var(--fg-light-2);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  font-weight: 500;
  min-width: 44px;
  min-height: 44px;
}

body.is-light .nav-toggle {
  border-color: var(--fg-dark);
  color: var(--fg-dark);
  background: var(--bg-light);
}

.nav-toggle .toggle-word {
  transition: opacity 0.2s var(--ease-out);
}

.nav-toggle-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--fg-light-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

body.is-light .nav-toggle-icon {
  background: var(--fg-dark);
}

.toggle-bar {
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--bg-dark);
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

body.is-light .toggle-bar {
  background: var(--bg-light);
}

.toggle-bar.bar-1 {
  transform: translateY(-4px);
}

.toggle-bar.bar-2 {
  transform: translateY(4px);
}

.nav-toggle.is-open .toggle-bar.bar-1 {
  transform: translateY(0) rotate(45deg);
}

.nav-toggle.is-open .toggle-bar.bar-2 {
  transform: translateY(0) rotate(-45deg);
}

@media (max-width: 640px) {
  .nav-toggle {
    padding: 0;
    width: 52px;
    justify-content: center;
  }
  .nav-toggle .toggle-word {
    display: none;
  }
  .nav-logo {
    font-size: 0.75rem;
    padding: 0 16px;
  }
}

/* ==========================================================================
   Landing Hero
   ========================================================================== */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) var(--gutter) 100px;
  position: relative;
}

.hero-graphic {
  width: min(90vw, 900px);
  margin-bottom: clamp(40px, 8vw, 88px);
  position: relative;
}

.hero-graphic svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hg-line {
  stroke: var(--fg-light);
  stroke-width: 1;
  opacity: 0.5;
}

.hg-ring {
  fill: none;
  stroke: var(--fg-light-2);
  stroke-width: 1.4;
}

.hg-dot {
  fill: var(--fg-light-2);
}

.hero-heading {
  font-size: clamp(2rem, 6.2vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 18ch;
  margin: 0 auto;
}

.hero-sub {
  margin-top: clamp(18px, 3vw, 28px);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 400;
  color: rgba(245, 245, 245, 0.65);
}

.hero-credit {
  margin-top: 10px;
  font-size: clamp(0.75rem, 1.1vw, 0.9rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(245, 245, 245, 0.4);
}

/* ==========================================================================
   Menu Overlay
   ========================================================================== */

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg-dark);
  visibility: hidden;
  opacity: 0;
  display: flex;
  flex-direction: column;
  padding-top: var(--nav-h);
}

.menu-overlay.is-active {
  visibility: visible;
  opacity: 1;
}

.menu-track {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 24px var(--gutter);
}

.menu-track::-webkit-scrollbar {
  display: none;
}

.menu-card {
  scroll-snap-align: start;
  flex: 0 0 min(66vw, 360px);
  height: calc(100% - 8px);
  max-height: 640px;
  border: 1px solid var(--line-dark);
  border-radius: 28px;
  position: relative;
  padding: 32px clamp(22px, 3.5vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  background: rgba(245, 245, 245, 0.02);
  transition: background var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}

.menu-card:hover {
  background: rgba(245, 245, 245, 0.05);
  border-color: rgba(245, 245, 245, 0.4);
}

.menu-card:hover .menu-card-art {
  opacity: 0.32;
  transform: scale(1.04) rotate(1deg);
}

.menu-card-index {
  position: absolute;
  top: 32px;
  right: clamp(22px, 3.5vw, 36px);
  font-size: 0.8rem;
  color: rgba(245, 245, 245, 0.45);
}

.menu-card-title {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  max-width: 13ch;
  position: relative;
  z-index: 2;
}

.menu-card-art {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out);
  pointer-events: none;
}

.menu-card-art svg {
  width: 100%;
  height: 100%;
}

.menu-card-art * {
  stroke: var(--fg-light);
  fill: none;
}

.menu-footer {
  padding: 6px var(--gutter) 26px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.4);
  display: flex;
  justify-content: space-between;
}

@media (max-width: 640px) {
  .menu-card {
    flex-basis: 74vw;
  }
}

/* ==========================================================================
   Inner pages (Paths / Articles) — light lavender theme
   ========================================================================== */

.inner-main {
  position: relative;
  padding-top: var(--nav-h);
  min-height: 100vh;
  overflow: hidden;
}

.bg-deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-deco svg {
  position: absolute;
}

.bg-deco .deco-shape {
  stroke: var(--fg-dark);
  opacity: 0.16;
  fill: none;
}

.page-header {
  position: relative;
  z-index: 1;
  padding: clamp(56px, 9vw, 110px) var(--gutter) clamp(40px, 6vw, 64px);
  max-width: 1400px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(12, 11, 11, 0.55);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg-dark);
  display: inline-block;
}

.page-title {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 20ch;
}

.page-sub {
  margin-top: 20px;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  max-width: 62ch;
  color: rgba(12, 11, 11, 0.7);
}

.section-block {
  position: relative;
  z-index: 1;
  padding: 0 var(--gutter) clamp(60px, 8vw, 100px);
  max-width: 1400px;
  margin: 0 auto;
}

/* ---------- Pill / link controls on light bg ---------- */

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--fg-dark);
  background: transparent;
  color: var(--fg-dark);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  min-height: 44px;
}

.pill-link:hover {
  background: var(--fg-dark);
  color: var(--bg-light);
}

.pill-link svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Timeline (Paths page)
   ========================================================================== */

.path-group {
  margin-bottom: clamp(56px, 8vw, 96px);
}

.path-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--line-light);
  padding-bottom: 20px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.path-group-head h2 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 700;
}

.path-group-head .path-time {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(12, 11, 11, 0.6);
}

.timeline-step {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: clamp(16px, 3vw, 32px);
  padding: clamp(24px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--line-light);
  position: relative;
}

.timeline-step:last-child {
  border-bottom: none;
}

.step-number {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  color: rgba(12, 11, 11, 0.85);
  font-variant-numeric: tabular-nums;
}

.step-body h3 {
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.step-body p {
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(12, 11, 11, 0.78);
  max-width: 70ch;
}

.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  align-items: center;
}

.step-tag {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-light);
  color: rgba(12, 11, 11, 0.7);
}

.step-link {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  margin: -12px -4px;
  min-height: 44px;
}

.step-link svg {
  width: 13px;
  height: 13px;
}

@media (max-width: 640px) {
  .timeline-step {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .step-number {
    font-size: 1.8rem;
  }
}

/* ==========================================================================
   Comparison table
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--line-light);
  background: rgba(253, 252, 250, 0.35);
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-light);
  vertical-align: top;
}

.compare-table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(12, 11, 11, 0.55);
  font-weight: 500;
  border-bottom: 1px solid rgba(12, 11, 11, 0.35);
}

.compare-table tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}

.compare-table tbody tr:hover {
  background: rgba(12, 11, 11, 0.06);
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table td.is-primary {
  font-weight: 500;
}

.compare-table td.is-alt {
  color: rgba(12, 11, 11, 0.85);
}

.compare-table td.is-diff {
  color: rgba(12, 11, 11, 0.75);
  max-width: 34ch;
}

/* ==========================================================================
   Article pages
   ========================================================================== */

.article-download {
  margin-top: 26px;
}

.article-body {
  max-width: 74ch;
}

.article-body p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: rgba(12, 11, 11, 0.82);
  margin-bottom: 22px;
}

.article-body h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 700;
  margin-top: clamp(40px, 5vw, 64px);
  margin-bottom: 18px;
  letter-spacing: -0.005em;
}

.article-body strong {
  font-weight: 700;
  color: var(--fg-dark);
}

.article-body ul {
  margin: 0 0 26px;
  padding-left: 1.3em;
  list-style: disc;
}

.article-body li {
  font-size: 1.02rem;
  line-height: 1.75;
  color: rgba(12, 11, 11, 0.82);
  margin-bottom: 10px;
}

.article-body li::marker {
  color: rgba(12, 11, 11, 0.45);
}

.article-body pre {
  background: rgba(12, 11, 11, 0.05);
  border: 1px solid var(--line-light);
  border-radius: 14px;
  padding: 22px 26px;
  margin: 0 0 26px;
  overflow-x: auto;
}

.article-body pre code {
  font-family: "Space Grotesk", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--fg-dark);
  white-space: pre;
}

/* ==========================================================================
   Footer (inner pages)
   ========================================================================== */

.site-footer {
  position: relative;
  z-index: 1;
  padding: 40px var(--gutter) 60px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.78rem;
  color: rgba(12, 11, 11, 0.55);
  border-top: 1px solid var(--line-light);
  max-width: 1400px;
  margin: 0 auto;
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Reveal / animation helper classes (JS toggles these via GSAP, base state
   below acts as a no-JS fallback so content is not hidden if scripts fail)
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
}

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

/* Utility */
.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;
}
