*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --surface: #141b24;
  --surface-2: #1a2332;
  --border: rgba(255,255,255,0.07);
  --text: #e8eaed;
  --text-muted: #7a8394;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.12);
  --accent-border: rgba(74, 222, 128, 0.25);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--accent);
  color: #0d1117 !important;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  transition: opacity 0.2s !important;
}

.nav-cta:hover { opacity: 0.85; }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 80px;
  padding: 120px 80px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 5px 12px;
  border-radius: 4px;
  margin-bottom: 28px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-block;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-ghost {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.hero-proof {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.proof-item { display: flex; flex-direction: column; }

.proof-number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1;
}

.proof-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.proof-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* Hero phone mockup */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.phone-wrap {
  position: relative;
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}

.phone-frame {
  width: 260px;
  border-radius: 36px;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  display: block;
  background: var(--surface);
  overflow: hidden;
}

.phone-frame img { width: 100%; display: block; }

.phone-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at center, rgba(74,222,128,0.08) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

/* ── TICKER ── */
.ticker {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  overflow: hidden;
  white-space: nowrap;
  background: var(--surface);
}

.ticker-inner {
  display: inline-flex;
  gap: 64px;
  animation: ticker 22s linear infinite;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
}

.ticker-item span {
  color: var(--accent);
  margin-right: 8px;
}

/* ── SECTIONS SHARED ── */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 40px;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.7;
  font-weight: 300;
}

/* ── DEMO SECTION ── */
#lessons { border-top: 1px solid var(--border); }

.lessons-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 56px;
}

.demo-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.demo-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.demo-tab {
  flex: 1;
  padding: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.02em;
}

.demo-tab:not(:last-child) { border-right: 1px solid var(--border); }
.demo-tab.active { color: var(--accent); background: var(--accent-dim); }

.demo-panel { padding: 40px; }

#tab-sentence,
#tab-speed {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#tab-sentence > *,
#tab-speed > * { width: 100%; max-width: 560px; }

#tab-compound {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.compound-rows,
.compound-bank,
.compound-bank-label,
#tab-compound .demo-instruction,
#tab-compound .demo-actions { width: 100%; max-width: 560px; }

.demo-panel.hidden { display: none !important; }

.demo-instruction {
  font-size: 1rem;
  color: var(--text);
  font-weight: 400;
  text-align: center;
  margin-bottom: 36px;
  line-height: 1.5;
}

/* Answer drop zone */
.demo-answer-area {
  min-height: 52px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

.demo-answer-area.has-tiles { border-color: var(--accent-border); }

.demo-answer-placeholder {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
}

.demo-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 24px;
}

/* Tiles */
.demo-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.tile {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s, opacity 0.15s, background 0.15s;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.tile:hover { background: var(--surface); transform: translateY(-2px); }
.tile.used { opacity: 0.25; pointer-events: none; }
.tile.wrong { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #f87171; }
.tile.correct-tile { background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent); }

.answer-tile {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  cursor: pointer;
  transition: opacity 0.15s;
}

.answer-tile:hover { opacity: 0.7; }

/* Actions */
.demo-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.demo-submit {
  background: var(--accent);
  color: #0d1117;
  border: none;
  padding: 11px 28px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.demo-submit:hover { opacity: 0.85; }

.demo-feedback {
  font-size: 0.85rem;
  font-weight: 400;
  transition: opacity 0.3s;
}

.demo-feedback.success { color: var(--accent); }
.demo-feedback.error { color: #f87171; }

/* ── COMPOUND DRAG TO SLOT ── */
.compound-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.compound-row {
  display: flex;
  align-items: center;
  height: 46px;
}

.compound-slot {
  width: 130px;
  height: 46px;
  border: 1.5px dashed var(--border);
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.compound-slot.drag-over { border-color: var(--accent); background: var(--accent-dim); }
.compound-slot.filled { border-color: var(--accent-border); background: var(--accent-dim); }
.compound-slot.correct { border-color: var(--accent); background: var(--accent-dim); }
.compound-slot.incorrect { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.08); }

.compound-slot-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

.compound-slot-placeholder {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.4;
  user-select: none;
}

.compound-join {
  width: 20px;
  height: 46px;
  background: var(--surface-2);
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.compound-join-line {
  width: 12px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}

.compound-fixed {
  height: 46px;
  min-width: 100px;
  padding: 0 18px;
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-left: none;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 400;
  user-select: none;
}

.compound-bank-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  opacity: 0.6;
}

.compound-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  min-height: 46px;
}

.compound-piece {
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s, border-color 0.15s, opacity 0.15s;
}

.compound-piece:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.compound-piece.dragging { opacity: 0.4; cursor: grabbing; }
.compound-piece.used { opacity: 0.2; pointer-events: none; }

.demo-reset {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.demo-reset:hover { border-color: var(--text-muted); color: var(--text); }

/* ── FEATURES ── */
#features { border-top: 1px solid var(--border); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 64px;
}

.feature-card {
  background: var(--surface);
  padding: 40px 32px;
  transition: background 0.2s;
}

.feature-card:hover { background: var(--surface-2); }

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  font-weight: 300;
}

/* ── TESTIMONIALS ── */
#testimonials { border-top: 1px solid var(--border); }

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 64px;
}

.testimonial {
  background: var(--surface);
  padding: 36px 30px;
}

.testimonial-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 24px;
  font-style: italic;
}

.testimonial-author {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.testimonial-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 3px;
}

.stars {
  display: flex;
  gap: 3px;
  margin-bottom: 18px;
}

.star {
  width: 10px;
  height: 10px;
  background: var(--accent);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* ── DOWNLOAD ── */
#download {
  border-top: 1px solid var(--border);
  text-align: center;
}

#download .section-title { max-width: 560px; margin: 0 auto 16px; }
#download .section-sub { max-width: 420px; margin: 0 auto 48px; text-align: center; }

.download-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.trust-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 20px;
  opacity: 0.7;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ── FADE IN ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── SPEED ROUND ── */
.speed-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.speed-score {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
  line-height: 1;
}

.speed-score span { color: var(--text-muted); font-size: 1rem; }

.speed-timer-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  margin: 0 20px;
  overflow: hidden;
}

.speed-timer-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.1s linear, background 0.3s;
}

.speed-timer-bar.urgent { background: #f87171; }

.speed-prompt {
  text-align: center;
  margin-bottom: 32px;
}

.speed-prompt-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.speed-prompt-word {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.speed-prompt-word em { font-style: italic; color: var(--accent); }

.speed-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.speed-choice {
  padding: 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-align: center;
}

.speed-choice:hover { background: var(--surface); border-color: var(--text-muted); transform: translateY(-1px); }
.speed-choice.correct { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); pointer-events: none; }
.speed-choice.wrong { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); color: #f87171; pointer-events: none; }
.speed-choice:disabled { pointer-events: none; }

.speed-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
}

.speed-start-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 4px;
}

.speed-start-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 300px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.speed-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 0;
  text-align: center;
}

.speed-end-score {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--accent);
  line-height: 1;
}

.speed-end-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 100px 32px 60px;
    gap: 60px;
    text-align: center;
  }

  .hero-sub { margin: 0 auto 40px; }
  .hero-actions { justify-content: center; }
  .hero-proof { justify-content: center; }
  .hero-visual { order: -1; }
  .lessons-header { grid-template-columns: 1fr; }
  .features-grid, .testimonials-grid { grid-template-columns: 1fr; }
  nav { padding: 0 24px; }
  section { padding: 72px 24px; }

  footer {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding: 32px 24px;
  }
}