/* ============================================================
   Lau Lab Education — Matches homepage style
   Slate + Sky, Inter + Space Grotesk, calm glass cards.
   ============================================================ */

:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --secondary: #4f46e5;
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --light: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --max-w: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

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

/* ── Navigation ── */
.education-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.8);
}

.hero-shell,
.section-shell,
.footer-shell {
  width: min(var(--max-w), calc(100% - 2rem));
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.nav-row {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-scroller {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-scroller::-webkit-scrollbar { display: none; }

.nav-pill,
.lang-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.15s;
}

.nav-pill:hover {
  color: var(--ink);
  background: var(--line);
}

.nav-pill-active {
  color: var(--primary);
  background: #e0f2fe;
  font-weight: 600;
}

.lang-pill {
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  margin-left: 0.25rem;
  border-radius: 999px;
}
.lang-pill:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

/* ── Layout ── */
.page-top {
  padding-top: 4rem;
  padding-bottom: 2.5rem;
}

/* Give the first hero section in sub-pages a white background so it doesn't look empty */
.page-top > .hero-shell:first-child {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem;
}

.hero-grid,
.feature-grid,
.curated-grid,
.subtle-grid,
.media-card,
.editorial-split,
.stack-panel {
  display: grid;
  gap: 1.25rem;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.7fr);
  align-items: start;
}

.feature-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.curated-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.subtle-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-card   { grid-template-columns: minmax(0, 1.18fr) minmax(16rem, 0.82fr); }
.editorial-split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }

.span-4  { grid-column: span 4; }
.span-5  { grid-column: span 5; }
.span-6  { grid-column: span 6; }
.span-7  { grid-column: span 7; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.col-4   { grid-column: span 4; }
.col-5   { grid-column: span 5; }
.col-6   { grid-column: span 6; }
.col-7   { grid-column: span 7; }
.col-8   { grid-column: span 8; }
.col-12  { grid-column: span 12; }

/* ── Cards ── */
.hero-panel,
.floating-card,
.content-card,
.info-strip {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.hero-panel {
  padding: 1.5rem 1.5rem 1rem;
  border: none;
  background: transparent;
  box-shadow: none;
}

.floating-card,
.content-card,
.info-strip {
  padding: 1.25rem;
}

.content-card:hover,
.floating-card:hover,
.info-strip:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.link-card:hover { border-color: var(--line-strong); }

.content-card.featured {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #f0f9ff, #ffffff);
}
.content-card.muted { background: var(--bg); }

/* ── Topic icons ── */
.topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  line-height: 1;
}

.topic-icon.small {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.icon-note {
  position: relative;
  padding-left: 3rem;
}
.icon-note .topic-icon {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  margin: 0;
}

/* ── Comic elements ── */
.comic-preview {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.comic-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
}

.comic-frame img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.comic-frame:hover img { transform: scale(1.02); }

.comic-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(15,23,42,0.35));
}

.comic-caption {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.comic-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Visual steps ── */
.visual-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.visual-step {
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
}

.visual-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  background: #e0f2fe;
  font-size: 0.8rem;
  font-weight: 700;
}

.visual-step strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.visual-step span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ── Card thumb ── */
.card-thumb {
  overflow: hidden;
  border-radius: var(--radius);
  margin: -0.5rem -0.5rem 1rem;
  border: 1px solid var(--line);
  background: var(--bg);
}

.card-thumb img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.link-card:hover .card-thumb img { transform: scale(1.02); }

/* ── Comic mosaic ── */
.comic-mosaic {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
.comic-mosaic img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
@media (max-width: 700px) {
  .comic-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Kickers ── */
.hero-kicker,
.section-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

/* ── Hero typography ── */
.hero-title {
  margin-top: 0.25rem;
  max-width: 24ch;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  line-height: 1.1;
  font-weight: 700;
  text-wrap: balance;
}

.hero-lead {
  margin-top: 1rem;
  max-width: 48rem;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-button-primary,
.hero-button-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}

.hero-button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(2,132,199,0.2);
}
.hero-button-primary:hover {
  background: var(--primary-dark);
}

.hero-button-secondary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.hero-button-secondary:hover {
  border-color: var(--muted);
  background: var(--bg);
}

/* Hide chip rows */
.hero-chip-row { display: none; }

/* ── Section heads ── */
.section-shell { margin-top: 2rem; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin-top: 0.35rem;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.2;
  font-weight: 700;
}

.section-head p,
.content-copy,
.body-copy {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

/* ── Card typography ── */
.card-title {
  margin-top: 0.4rem;
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

/* ── Lists ── */
.card-list,
.body-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.card-list li,
.body-list li {
  position: relative;
  padding-left: 1.25rem;
}

.card-list li::before,
.body-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--light);
}

/* ── Notes ── */
.mini-note,
.soft-note {
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
}

.mini-note strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 600;
}

.soft-note { margin-top: 0.75rem; }

/* ── Link arrows ── */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}

.link-arrow::after {
  content: "→";
  transition: transform 0.15s ease;
}
.link-card:hover .link-arrow::after {
  transform: translateX(3px);
}

/* ── Timeline ── */
.timeline { display: grid; gap: 0.9rem; }

.timeline-step {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.timeline-step .time {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--light);
}

.timeline-step .mini-note { margin: 0; }

/* ── Chapter directory ── */
.chapter-directory {
  max-height: min(68vh, 52rem);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.soft-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.soft-scroll::-webkit-scrollbar { width: 6px; }
.soft-scroll::-webkit-scrollbar-track { background: transparent; }
.soft-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.chapter-card {
  transition: border-color 0.15s ease, background-color 0.15s ease;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.chapter-card:hover { border-color: var(--line-strong); }

.chapter-card-active {
  border-color: var(--primary) !important;
  background: #f0f9ff !important;
  box-shadow: var(--shadow);
}

/* ── Reader frame ── */
.reader-frame {
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
}

/* ── Video thumb ── */
.video-thumb {
  position: relative;
  display: block;
  min-height: 16rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--line);
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.05), rgba(15,23,42,0.25));
}

.play-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--line);
}

/* ── Spotlight panel ── */
.spotlight-panel {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: var(--ink);
}
.spotlight-panel .eyebrow,
.spotlight-panel .card-title,
.spotlight-panel .content-copy,
.spotlight-panel .body-copy,
.spotlight-panel .link-arrow,
.spotlight-panel a {
  color: var(--ink) !important;
}
.spotlight-panel .eyebrow {
  color: var(--primary) !important;
}
.spotlight-panel .reader-frame {
  background: #ffffff;
  border-color: var(--line);
}

/* ── Footer ── */
.footer-shell {
  margin-top: 2.5rem;
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--light);
  font-size: 0.875rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-grid,
  .editorial-split,
  .timeline-step,
  .media-card {
    grid-template-columns: 1fr;
  }
  .feature-grid,
  .curated-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .span-4, .span-5, .span-6, .span-7, .span-8, .span-12,
  .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .hero-shell,
  .section-shell,
  .footer-shell {
    width: min(100% - 1.25rem, var(--max-w));
    padding-left: 0.625rem;
    padding-right: 0.625rem;
  }
  .page-top { padding-top: 5rem; }
  .hero-panel,
  .floating-card,
  .content-card,
  .info-strip {
    padding: 1.25rem;
    border-radius: var(--radius);
  }
  .feature-grid,
  .curated-grid,
  .subtle-grid {
    grid-template-columns: 1fr;
  }
  .visual-steps { grid-template-columns: 1fr; }
  .section-head {
    flex-direction: column;
    align-items: start;
  }
  .hero-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }
}
