/* ═══════════════════════════════════════════════════════════════
   Pendulum — Front-page styles
   Aesthetic reference: Plaid.com (clean, spacious, card-based)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tokens ─── */
:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fb;
  --ink: #111827;
  --muted: #4b5563;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --accent: #0a8bd1;
  --accent-soft: rgba(10, 139, 209, 0.08);
  --accent-rgb: 10, 139, 209;
  --ink-rgb: 17, 24, 39;
  --btn-bg: #111827;
  --btn-text: #ffffff;
  --card-bg: #ffffff;
  --card-hover: 0 8px 30px rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.82);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0b0f;
  --bg-alt: #111318;
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --faint: #4b5563;
  --line: #1e2130;
  --accent: #3b9eff;
  --accent-soft: rgba(59, 158, 255, 0.1);
  --accent-rgb: 59, 158, 255;
  --ink-rgb: 243, 244, 246;
  --btn-bg: #f3f4f6;
  --btn-text: #0a0b0f;
  --card-bg: #15161d;
  --card-hover: 0 8px 30px rgba(0, 0, 0, 0.25);
  --nav-bg: rgba(10, 11, 15, 0.82);
  color-scheme: dark;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; font: 400 1rem/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
img { display: block; max-width: 100%; }
button { font-family: var(--font); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ─── Utilities ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }
.section { padding: clamp(72px, 12vh, 128px) 0; }
.bg-alt { background: var(--bg-alt); }
.accent { color: var(--accent); }

/* ─── Reveal animation ─── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* ─── Navigation ─── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; border-bottom: 1px solid transparent; transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s; }
.nav.scrolled { background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--line); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 18px clamp(20px, 5vw, 48px); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.25rem; letter-spacing: -0.03em; }
/* The mark is the lab's held frame (favicon.svg), a picture that scales with the text and does not move. */
.mark { display: block; width: 1.75rem; height: 1.75rem; }
.mark-footer { width: 1.25rem; height: 1.25rem; }
@media (max-width: 640px) { .mark { width: 1.375rem; height: 1.375rem; } .mark-footer { width: 1.125rem; height: 1.125rem; } }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links > a:not(.nav-cta) { font-size: 0.875rem; color: var(--muted); transition: color 0.2s; }
.nav-links > a:not(.nav-cta):hover { color: var(--ink); }
.nav-cta { white-space: nowrap; }

/* Hamburger */
.nav-toggle { display: none; width: 36px; height: 36px; background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; position: relative; padding: 0; }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--ink); position: absolute; left: 50%; transform: translateX(-50%); transition: all 0.25s; }
.nav-toggle span:nth-child(1) { top: 10px; }
.nav-toggle span:nth-child(2) { top: 17px; }
.nav-toggle span:nth-child(3) { top: 24px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 17px; transform: translateX(-50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 17px; transform: translateX(-50%) rotate(-45deg); }

/* Theme toggle */
.theme-toggle { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle svg { width: 16px; height: 16px; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ─── Buttons ─── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 14px 28px; border-radius: 12px; font-size: 0.9375rem; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; font-family: var(--font); }
.btn-sm { padding: 10px 20px; font-size: 0.8125rem; border-radius: 10px; }
.btn-lg { padding: 18px 36px; font-size: 1.0625rem; border-radius: 14px; }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-ghost { background: none; color: var(--muted); padding-left: 4px; padding-right: 4px; }
.btn-ghost:hover { color: var(--ink); }
.btn-outline { background: none; border: 1px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--muted); transform: translateY(-1px); }

/* ─── Section headers ─── */
.section-head { text-align: center; margin-bottom: clamp(40px, 6vh, 64px); }
.label { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.section-head h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; }
.section-sub { color: var(--muted); font-size: clamp(0.95rem, 1.2vw, 1.1rem); margin-top: 14px; max-width: 560px; margin-left: auto; margin-right: auto; }
.section-action { text-align: center; margin-top: 36px; }

/* ─── Badge ─── */
.badge { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); background: var(--accent-soft); margin-bottom: 24px; }

/* ─── Hero ─── */
.hero { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; padding-top: 80px; overflow: hidden; }
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: center; width: 100%; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.035em; }
.hero-sub { color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.65; margin-top: 22px; max-width: 480px; }
.hero-actions { display: flex; align-items: center; gap: 16px; margin-top: 36px; flex-wrap: wrap; }
.hero-visual { position: relative; aspect-ratio: 1; max-height: 520px; }
#hero-canvas { width: 100%; height: 100%; display: block; }

/* ─── Carousel ─── */
.carousel { max-width: 860px; margin: 0 auto; }
.carousel-viewport { overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--card-bg); }
.carousel-track { display: flex; transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1); }
.carousel-slide { flex: 0 0 100%; min-width: 0; }
.slide-visual { position: relative; background: var(--bg-alt); aspect-ratio: 16 / 9; }
.slide-visual img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; display: block; }
.slide-visual .slide-mount { position: absolute; inset: 0; display: none; }
.carousel-slide.live .slide-visual img { display: none; }
.carousel-slide.live .slide-visual .slide-mount { display: block; }
.slide-info { padding: 20px 28px 24px; }
.slide-info h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.slide-info p { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.carousel-arrow { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-bg); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: all 0.2s; }
.carousel-arrow:hover { border-color: var(--muted); background: var(--bg-alt); }
.carousel-dots { display: flex; gap: 8px; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); border: none; padding: 0; cursor: pointer; transition: background 0.25s, transform 0.25s; }
.carousel-dot:hover { background: var(--faint); }
.carousel-dot.active { background: var(--accent); transform: scale(1.25); }

/* ─── Features ─── */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-bg); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--card-hover); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 20px; }
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.875rem; line-height: 1.6; }

/* ─── Classroom ─── */
.classroom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.classroom-card { padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-bg); }
.classroom-number { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em; color: var(--accent); }
.classroom-card h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; margin: 14px 0 16px; }
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag-list li { font-size: 0.75rem; padding: 4px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.classroom-card p { color: var(--muted); font-size: 0.875rem; line-height: 1.6; }

/* ─── CTA ─── */
.cta-section { background: var(--bg); }
.cta-inner { text-align: center; padding: clamp(56px, 10vh, 96px) 0; border-top: 1px solid var(--line); }
.cta-inner h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.025em; }
.cta-inner p { color: var(--muted); margin: 14px 0 32px; font-size: 1.05rem; }

/* ─── Footer ─── */
.footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 28px clamp(20px, 5vw, 48px); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.02em; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 0.8125rem; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--ink); }
.footer-copy { font-size: 0.75rem; color: var(--faint); }

/* ─── Responsive ─── */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { max-height: 360px; margin: 0 auto; width: 80%; order: -1; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .classroom-grid { grid-template-columns: repeat(2, 1fr); }
  .classroom-grid .classroom-card:last-child { grid-column: 1 / -1; max-width: 50%; margin: 0 auto; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; padding: 20px clamp(20px, 5vw, 48px) 24px; gap: 16px; display: none; }
  .nav-links.open { display: flex; }
  .nav-links > a { font-size: 1rem; }
  .hero { min-height: auto; padding-top: 100px; padding-bottom: 48px; }
  .hero-visual { width: 100%; max-height: 260px; }
  .features-grid { grid-template-columns: 1fr; }
  .classroom-grid { grid-template-columns: 1fr; }
  .classroom-grid .classroom-card:last-child { max-width: 100%; }
  .slide-info { padding: 16px 20px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ─── Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ─── Transitions for theme ─── */
html { transition: background 0.3s; }
body { transition: background 0.3s, color 0.3s; }
