/* ============================================================
   SkillTree — Stylesheet
   Design language: circular "node" shapes and connecting lines
   nod to the skill-tree graph itself, paired with a clean, modern
   product-page type system — distinct from the Scratch course site.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color */
  --ink: #1E2620;
  --ink-soft: #55655C;
  --paper: #F5FAF7;
  --card: #FFFFFF;
  --line: #DCE8E1;

  --orange: #1F9D6B;
  --orange-dark: #167A54;
  --orange-tint: #E4F5EC;

  --blue: #6C5CE7;
  --blue-deep: #4B3FBF;
  --blue-tint: #EDEBFC;

  --yellow: #F0B429;
  --yellow-dark: #8A6512;
  --yellow-tint: #FDF3DC;

  --shadow-sm: 0 1px 2px rgba(30, 42, 58, 0.06);
  --shadow-md: 0 8px 24px rgba(30, 42, 58, 0.08);
  --shadow-lg: 0 16px 40px rgba(30, 42, 58, 0.14);

  --radius: 18px;
  --radius-sm: 10px;

  --font-display: 'Sora', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --footer-bg: #16221A;
  --footer-text: #C4D6CB;
  --footer-text-strong: #FFFFFF;
  --footer-line: rgba(255,255,255,0.12);

  --header-bg: rgba(245, 250, 247, 0.86);

  color-scheme: light;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  color-scheme: dark;

  --ink: #EAF2EC;
  --ink-soft: #9FB3A8;
  --paper: #101A14;
  --card: #16221A;
  --line: #24352A;

  --orange: #34C98A;
  --orange-dark: #7FE0B3;
  --orange-tint: rgba(52, 201, 138, 0.14);

  --blue: #8F82F0;
  --blue-deep: #B7AEFA;
  --blue-tint: rgba(143, 130, 240, 0.14);

  --yellow: #F0B429;
  --yellow-dark: #F0B429;
  --yellow-tint: rgba(240, 180, 41, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

  --footer-bg: #0B120D;
  --footer-line: rgba(255,255,255,0.08);

  --header-bg: rgba(16, 26, 20, 0.86);
}

body,
.site-header,
.card,
.module-details,
.stat,
.button-secondary,
.toc a,
.site-nav a,
.video-placeholder,
.card-icon,
.module-number,
.module-meta span {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

a {
  color: var(--blue-deep);
  text-decoration: none;
}

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

.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;
}

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

main { display: block; }

section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 24px;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.button:not(.button-secondary) {
  background: var(--orange);
  color: #ffffff;
  box-shadow: 0 6px 0 var(--orange-dark);
}
.button:not(.button-secondary):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--orange-dark);
}
.button:not(.button-secondary):active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--orange-dark);
}

.button-secondary {
  background: transparent;
  color: var(--blue-deep);
  border-color: var(--blue);
}
.button-secondary:hover {
  background: var(--blue-tint);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-title::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 5px 5px 5px 0;
  background: var(--orange);
  display: inline-block;
  transform: rotate(45deg);
}

.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--orange-tint);
  color: var(--orange-dark);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-cta {
  gap: 5px;
  padding: 8px 14px;
  font-size: 0.85rem;
  box-shadow: 0 3px 0 var(--orange-dark);
}

.nav-cta:hover { box-shadow: 0 5px 0 var(--orange-dark); }
.nav-cta:active { box-shadow: 0 1px 0 var(--orange-dark); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  transform: rotate(-12deg) scale(1.06);
  border-color: var(--orange);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle:hover { background: var(--blue-tint); }

/* ---------- Motion: entrance + scroll reveal ---------- */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow, .hero h1, .hero p, .hero-actions { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero-decor span { animation: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: visible;
  padding-top: 72px;
  padding-bottom: 56px;
  text-align: center;
  max-width: 780px;
}

.hero-decor {
  position: absolute;
  inset: -40px -20% auto -20%;
  height: 480px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-decor span {
  position: absolute;
  display: block;
  border-radius: 50%;
  animation: drift 16s ease-in-out infinite;
}

.hero-decor .edge {
  position: absolute;
  height: 2px;
  background: var(--line);
  opacity: 0.6;
  transform-origin: left center;
}

.hero-decor .edge:nth-of-type(1) { top: 24%; left: 12%; width: 130px; transform: rotate(18deg); }
.hero-decor .edge:nth-of-type(2) { top: 66%; left: 20%; width: 110px; transform: rotate(-14deg); }
.hero-decor .edge:nth-of-type(3) { top: 20%; right: 14%; width: 150px; transform: rotate(-20deg); }
.hero-decor .edge:nth-of-type(4) { top: 60%; right: 10%; width: 120px; transform: rotate(16deg); }

.hero-decor span:nth-child(1) {
  top: 12%; left: 8%;
  width: 46px; height: 46px;
  background: var(--orange-tint);
  border: 2px solid var(--orange);
  opacity: 0.55;
  animation-duration: 14s;
}
.hero-decor span:nth-child(2) {
  top: 62%; left: 16%;
  width: 26px; height: 26px;
  background: var(--yellow-tint);
  border: 2px solid var(--yellow);
  opacity: 0.6;
  animation-duration: 11s;
  animation-delay: -3s;
}
.hero-decor span:nth-child(3) {
  top: 8%; right: 10%;
  width: 34px; height: 34px;
  background: var(--blue-tint);
  border: 2px solid var(--blue);
  opacity: 0.5;
  animation-duration: 13s;
  animation-delay: -6s;
}
.hero-decor span:nth-child(4) {
  top: 58%; right: 6%;
  width: 54px; height: 54px;
  background: var(--orange-tint);
  border: 2px solid var(--orange);
  opacity: 0.4;
  animation-duration: 18s;
  animation-delay: -9s;
}
.hero-decor span:nth-child(5) {
  top: 34%; left: 46%;
  width: 18px; height: 18px;
  background: var(--blue-tint);
  border: 2px solid var(--blue);
  opacity: 0.5;
  animation-duration: 9s;
  animation-delay: -2s;
}

@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(10px, -18px) rotate(8deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.hero-eyebrow, .hero h1, .hero p, .hero-actions {
  position: relative;
  z-index: 1;
  animation: hero-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-eyebrow  { animation-delay: 0.02s; }
.hero h1       { animation-delay: 0.12s; }
.hero p        { animation-delay: 0.22s; }
.hero-actions  { animation-delay: 0.32s; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--blue-deep);
  background: var(--blue-tint);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero p {
  font-size: 1.1rem;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-top: 0;
  padding-bottom: 56px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  color: var(--blue-deep);
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ---------- Section headings ---------- */
.section-head {
  max-width: 640px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.section-head p { margin-bottom: 0; }

.why-skilltree {
  position: relative;
  background: var(--card);
  overflow: hidden;
}

.why-skilltree::before {
  content: "";
  position: absolute;
  top: -60px;
  left: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--blue-tint) 0%, transparent 70%);
  z-index: 0;
}

.why-skilltree::after {
  content: "";
  position: absolute;
  bottom: -90px;
  right: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orange-tint) 0%, transparent 70%);
  z-index: 0;
}

.why-skilltree .section-head,
.why-skilltree .card-grid {
  position: relative;
  z-index: 1;
}

/* ---------- Card grid (node-styled cards) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* the small node dot — a nod to the skill-tree graph itself */
.card::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 30px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--orange);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #D8DEEC;
}

.card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 50%;
  background: var(--orange-tint);
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.94rem;
  margin-bottom: 14px;
}

.card > a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--blue-deep);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card > a::after {
  content: "→";
  transition: transform 0.15s ease;
}

.card > a:hover::after { transform: translateX(3px); }

/* alternate icon tint by nth-child for visual rhythm */
.educator-resources,
.product-videos {
  position: relative;
  overflow: hidden;
}

.educator-resources::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--yellow-tint) 0%, transparent 70%);
  z-index: 0;
}

.product-videos::before {
  content: "";
  position: absolute;
  bottom: -70px;
  left: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--blue-tint) 0%, transparent 70%);
  z-index: 0;
}

.educator-resources .section-head,
.educator-resources .card-grid,
.product-videos .section-head,
.product-videos .card-grid {
  position: relative;
  z-index: 1;
}

.educator-resources .card:nth-child(2) .card-icon,
.product-videos .card:nth-child(2) .card-icon,
.why-skilltree .card:nth-child(2) .card-icon { background: var(--blue-tint); }

.educator-resources .card:nth-child(3) .card-icon,
.product-videos .card:nth-child(3) .card-icon,
.why-skilltree .card:nth-child(3) .card-icon { background: var(--yellow-tint); }

.educator-resources .card:nth-child(4) .card-icon,
.why-skilltree .card:nth-child(4) .card-icon { background: var(--blue-tint); }

/* ---------- Video cards ---------- */
.video-placeholder {
  height: 140px;
  border-radius: var(--radius-sm);
  background: var(--blue-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.product-videos .card-grid { grid-template-columns: repeat(3, 1fr); }

/* ---------- Skill-tree preview demo ---------- */
.skilltree-demo {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}

.skilltree-svg {
  flex: 1 1 380px;
  max-width: 620px;
  width: 100%;
  height: auto;
}

.edge-line {
  stroke: var(--line);
  stroke-width: 2;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.edge-line.optional { stroke-dasharray: 6 6; }

.edge-line.is-active {
  stroke: var(--orange);
  stroke-width: 3;
}

.node circle {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 2;
  cursor: pointer;
  transition: stroke 0.2s ease, fill 0.2s ease, stroke-width 0.2s ease, transform 0.2s ease;
  transform-origin: center;
  transform-box: fill-box;
}

.node text {
  font-size: 19px;
  pointer-events: none;
  user-select: none;
}

.node[data-status="mastered"] circle { fill: var(--orange-tint); stroke: var(--orange); }
.node[data-status="progress"] circle { fill: var(--yellow-tint); stroke: var(--yellow); }
.node[data-status="locked"]   circle { fill: var(--card); stroke: var(--line); }

.node:hover circle,
.node:focus circle {
  stroke-width: 3;
  transform: scale(1.06);
}

.node:focus { outline: none; }

.node.is-active circle {
  stroke-width: 4;
  transform: scale(1.1);
}

.skilltree-panel {
  flex: 1 1 240px;
  min-width: 220px;
}

.skilltree-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.skilltree-status[data-status="mastered"] { background: var(--orange-tint); color: var(--orange-dark); }
.skilltree-status[data-status="progress"] { background: var(--yellow-tint); color: var(--yellow-dark); }
.skilltree-status[data-status="locked"]   { background: var(--line); color: var(--ink-soft); }

.skilltree-panel h3 { font-size: 1.2rem; margin-bottom: 8px; }
.skilltree-panel p  { font-size: 0.95rem; margin-bottom: 12px; }

.skilltree-replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--blue-deep);
  background: var(--blue-tint);
  border: none;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.skilltree-replay:hover { background: var(--blue-tint); opacity: 0.8; }
.skilltree-replay:disabled { opacity: 0.5; cursor: default; }

.skilltree-hint {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  margin: -8px 0 0;
}

@media (max-width: 640px) {
  .skilltree-demo { padding: 22px; gap: 24px; }
}

/* ---------- Modules page: intro ---------- */
.page-intro {
  position: relative;
  max-width: 720px;
  padding-top: 64px;
  padding-bottom: 8px;
}

.page-intro::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orange-tint) 0%, transparent 70%);
  z-index: -1;
}

.page-intro h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
}

.page-intro p {
  font-size: 1.05rem;
  max-width: 620px;
}

/* ---------- Modules layout (sticky TOC + module list) ---------- */
.modules-layout {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 96px;
}

.toc {
  position: sticky;
  top: 88px;
  flex: 0 0 240px;
  align-self: flex-start;
}

.toc h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  border-left: 2px solid var(--line);
}

.toc a {
  position: relative;
  display: block;
  padding: 9px 0 9px 20px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a:hover { color: var(--ink); }

.toc a.is-active {
  color: var(--orange-dark);
  border-left-color: var(--orange);
  font-weight: 700;
}

.modules-content {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 20px;
}

.modules-content::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 43px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line) 0, var(--line) 6px,
    transparent 6px, transparent 13px
  );
  z-index: 0;
}

/* ---------- Module cards ---------- */
.module { scroll-margin-top: 88px; position: relative; z-index: 1; }

.module-details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 6px 26px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease, background-color 0.25s ease;
}

.module-details:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #D8DEEC;
}

.module-details[open] {
  box-shadow: var(--shadow-md);
  border-color: #D8DEEC;
}

.module-details summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.module-details summary::-webkit-details-marker { display: none; }

.module-icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  opacity: 0.9;
}

.module-details summary h2 {
  margin: 0;
  font-size: 1.2rem;
  flex: 1;
}

.module-details summary::after {
  content: "";
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 4px;
}

.module-details[open] summary::after { transform: rotate(-135deg); }

.module-number {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px 10px 10px 3px;
  background: var(--orange-tint);
  color: var(--orange-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-details .module-body {
  padding-bottom: 24px;
}

.module-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.module-meta span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-deep);
  background: var(--blue-tint);
  padding: 6px 14px;
  border-radius: 999px;
}

/* ---------- Responsive: modules layout ---------- */
@media (max-width: 880px) {
  .modules-layout { flex-direction: column; gap: 24px; }

  .toc {
    position: static;
    width: 100%;
    flex: none;
  }

  .toc ol {
    display: flex;
    overflow-x: auto;
    border-left: none;
    gap: 8px;
    padding-bottom: 6px;
  }

  .toc a {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
  }

  .toc a.is-active {
    border-color: var(--orange);
    background: var(--orange-tint);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 56px 24px 28px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--footer-text-strong);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px 4px 4px 0;
  background: var(--orange);
  transform: rotate(45deg);
}

.footer-col h4 {
  font-family: var(--font-display);
  color: var(--footer-text-strong);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-col a {
  color: var(--footer-text);
  font-size: 0.94rem;
}

.footer-col a:hover { color: var(--footer-text-strong); }

.footer-bottom {
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--footer-line);
  padding-top: 20px;
  font-size: 0.85rem;
  color: #8C99B3;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card-grid,
  .product-videos .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  section { padding: 56px 20px; }

  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px;
    gap: 4px;
    display: none;
  }

  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 14px; }

  .stats { grid-template-columns: 1fr 1fr; }
  .card-grid,
  .product-videos .card-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Cross-subdomain link ---------- */
.site-nav a.external-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
