/* ============================================================
   Voce English Coaching — American Accent Training
   ============================================================ */

:root {
  --ink: #221c18;
  --ink-soft: #57504a;
  --ink-faint: #8a8178;
  --cream: #faf6f0;
  --paper: #ffffff;
  --sand: #f1e9de;
  --line: #e6ddd1;
  --accent: #c2542e;
  --accent-dark: #9c3f1f;
  --accent-soft: #fbe9e0;
  --teal: #0f6e63;
  --teal-soft: #e2f0ed;
  --gold: #b98a2e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(34, 28, 24, .05), 0 8px 28px rgba(34, 28, 24, .07);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
}

.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.header-nav { display: flex; gap: 22px; align-items: center; font-size: 14.5px; font-weight: 500; }
.header-nav a { color: var(--ink-soft); }
.header-nav a:hover { color: var(--accent-dark); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 84px 0 64px;
  background:
    radial-gradient(900px 420px at 85% -10%, var(--accent-soft), transparent 65%),
    radial-gradient(700px 380px at -5% 20%, var(--teal-soft), transparent 60%);
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #f0cdbc;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 62px);
  max-width: 15ch;
  margin-bottom: 18px;
}

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

.hero p.lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 32px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15.5px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(194, 84, 46, .3);
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink-faint); }

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 52px;
  flex-wrap: wrap;
}

.stat .num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
}
.stat .lbl { font-size: 13.5px; color: var(--ink-faint); font-weight: 500; }

/* ---------- Pillars ---------- */
.pillars { padding: 64px 0 8px; }

.section-head { margin-bottom: 36px; }
.section-head .kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}
.section-head h2 { font-size: clamp(28px, 4vw, 38px); }
.section-head p { color: var(--ink-soft); max-width: 62ch; margin: 6px 0 0; }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.pillar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.pillar .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 21px;
  margin-bottom: 16px;
  background: var(--teal-soft);
}
.pillar:nth-child(2) .icon { background: var(--accent-soft); }
.pillar:nth-child(3) .icon { background: #f5ecd8; }

.pillar h3 { font-size: 20px; margin-bottom: 8px; }
.pillar p { font-size: 14.5px; color: var(--ink-soft); margin: 0; }

/* ---------- Curriculum ---------- */
.curriculum { padding: 72px 0 80px; }

.progress-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.progress-banner .bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--sand);
  overflow: hidden;
}
.progress-banner .bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  transition: width .4s ease;
}
.progress-banner .pct { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.progress-banner .reset {
  font-size: 12.5px; color: var(--ink-faint);
  background: none; border: none; cursor: pointer; padding: 0;
}
.progress-banner .reset:hover { color: var(--accent-dark); text-decoration: underline; }

.module { margin-bottom: 52px; }

.module-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 6px;
}

.module-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .06em;
}

.module-head h3 { font-size: 26px; margin: 0; }
.module-blurb { color: var(--ink-soft); font-size: 15px; margin: 0 0 22px; max-width: 68ch; }

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.lesson-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .14s ease;
}
.lesson-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: #d9b8a5;
}

.lesson-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lesson-index {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: .1em;
}

.ipa-badge {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.lesson-card h4 { font-size: 19px; margin: 0; }
.lesson-card .tag { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

.lesson-card .done-flag {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: none;
  place-items: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(15,110,99,.4);
}
.lesson-card.is-done .done-flag { display: grid; }
.lesson-card.is-done { border-color: #bcd9d3; }

/* ---------- Method strip ---------- */
.method {
  background: var(--ink);
  color: #f5efe7;
  padding: 72px 0;
}
.method .section-head .kicker { color: var(--gold); }
.method .section-head h2 { color: #fff; }
.method .section-head p { color: #c9c0b6; }

.method-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 22px;
  counter-reset: mstep;
}

.method-step { counter-increment: mstep; }
.method-step::before {
  content: "0" counter(mstep);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--gold);
  display: block;
  margin-bottom: 8px;
}
.method-step h4 { color: #fff; font-size: 17.5px; margin-bottom: 6px; }
.method-step p { font-size: 14px; color: #c9c0b6; margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 44px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-faint);
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   Lesson page
   ============================================================ */

.lesson-shell { padding: 40px 0 90px; }

.crumbs {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.crumbs .sep { opacity: .5; }

.lesson-hero {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 38px;
  margin-bottom: 34px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.lesson-hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 320px; height: 320px;
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 68%);
  pointer-events: none;
}

.lesson-hero .module-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

.lesson-hero h1 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 10px; }
.lesson-hero .tagline { color: var(--ink-soft); font-size: 16.5px; max-width: 64ch; margin: 0 0 18px; }

.lesson-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: relative; z-index: 1; }

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--sand);
  border-radius: 999px;
  padding: 6px 14px;
}
.meta-chip .ipa { font-family: var(--font-display); color: var(--accent-dark); font-size: 15px; }

.lesson-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.toolbar-note { font-size: 13px; color: var(--ink-faint); }

.speed-toggle {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper);
}
.speed-toggle button {
  border: none;
  background: none;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  cursor: pointer;
}
.speed-toggle button.active { background: var(--ink); color: #fff; }

/* ---------- Sections ---------- */
.lesson-body { display: grid; gap: 26px; }

.sec {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow);
}

.sec > h2 {
  font-size: 22px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec > h2::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.sec p { color: var(--ink-soft); }
.sec p:first-of-type { margin-top: 0; }
.sec p:last-child { margin-bottom: 0; }

.sec ul.plain {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  display: grid;
  gap: 8px;
}

.lead-note {
  border-left: 4px solid var(--gold);
  background: #fbf5e8;
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  font-size: 14.5px;
  color: #6d5a2e;
}
.lead-note strong { color: #55461f; }

/* steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  counter-reset: step;
}
.step-card {
  counter-increment: step;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  font-size: 14.5px;
  font-weight: 500;
}
.step-card::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* drill */
.drill-row { margin-bottom: 14px; }
.drill-row:last-child { margin-bottom: 0; }
.drill-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.drill-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.drill-chip {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 10px;
  padding: 8px 14px;
  text-align: center;
}
.drill-chip .ipa { font-family: var(--font-display); font-size: 16px; font-weight: 600; display: block; }
.drill-chip .hint { font-size: 11.5px; color: var(--ink-faint); }

/* word chips */
.word-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.word-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.word-chip:hover { border-color: var(--teal); background: var(--teal-soft); }
.word-chip .hint { font-size: 12px; color: var(--ink-faint); }
.word-chip .spk { font-size: 11px; color: var(--teal); }

/* sentence lists */
.sent-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: sent; }
.sent-item {
  counter-increment: sent;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background .12s;
}
.sent-item:hover { background: var(--cream); }
.sent-item::before {
  content: counter(sent);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.sent-item .txt { flex: 1; }
.sent-item .hint-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 6px;
  padding: 1px 8px;
  margin-left: 8px;
  white-space: nowrap;
}
.sent-item .phon {
  display: block;
  font-size: 13px;
  color: var(--ink-faint);
  font-style: italic;
}

.listen-btn {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--teal);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: grid;
  place-items: center;
  transition: background .12s, border-color .12s;
}
.listen-btn:hover { background: var(--teal-soft); border-color: var(--teal); }
.listen-btn.playing { background: var(--teal); color: #fff; border-color: var(--teal); }
.listen-btn.generating,
.word-chip.generating { opacity: .55; animation: tts-pulse 1s ease-in-out infinite; }
@keyframes tts-pulse {
  50% { opacity: .9; }
}

/* minimal pairs */
.pairs-table { width: 100%; border-collapse: collapse; }
.pairs-table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-faint);
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
}
.pairs-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--sand);
  font-size: 15px;
}
.pairs-table tr:hover td { background: var(--cream); }
.pairs-table .pair-word { cursor: pointer; font-weight: 500; }
.pairs-table .pair-word:hover { color: var(--accent-dark); }
.pairs-table .idx { color: var(--ink-faint); font-size: 12.5px; width: 34px; }
.pairs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 34px; }
@media (max-width: 640px) { .pairs-cols { grid-template-columns: 1fr; } }

/* phrase cards */
.phrase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.phrase-card {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 11px;
  padding: 13px 16px;
  position: relative;
}
.phrase-card .p {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--accent-dark);
  margin-bottom: 3px;
  padding-right: 30px;
}
.phrase-card .s { font-size: 14px; color: var(--ink-soft); }
.phrase-card .listen-btn { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; font-size: 11px; }

/* intonation patterns */
.pattern-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pattern-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--cream);
}
.pattern-card h4 {
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pattern-card .curve { font-size: 19px; }
.pattern-card ul { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; color: var(--ink-soft); }
.pattern-card .ex {
  font-size: 14px;
  font-style: italic;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  cursor: pointer;
}
.pattern-card .ex:hover { color: var(--accent-dark); }

/* dialogue */
.dialogue { display: grid; gap: 10px; }
.dialogue .line { display: flex; gap: 12px; align-items: flex-start; }
.dialogue .who {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal);
  min-width: 74px;
  padding-top: 8px;
  text-align: right;
}
.dialogue .bubble {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  padding: 9px 15px;
  font-size: 14.5px;
}
.dialogue .line:nth-child(even) .who { color: var(--accent-dark); }
.dialogue .line:nth-child(even) .bubble { background: var(--accent-soft); border-color: #f0d5c7; }

/* passage / collapsible */
details.fold {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  overflow: hidden;
}
details.fold summary {
  cursor: pointer;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "+"; font-size: 20px; color: var(--accent); }
details.fold[open] summary::after { content: "–"; }
details.fold .fold-body { padding: 4px 22px 20px; }
details.fold .fold-body p { font-size: 15px; }
details.fold .fold-body h4 { margin-top: 18px; font-size: 16.5px; }

/* conversation */
.convo-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.convo-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--teal-soft);
  border: 1px solid #cde4df;
  border-radius: 11px;
  padding: 13px 17px;
  font-size: 15px;
  font-weight: 500;
}
.convo-list li::before { content: "💬"; font-size: 15px; }

/* homework */
.homework {
  border: 1.5px dashed var(--gold);
  background: #fdf9ef;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 14.5px;
}
.homework strong { color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; display: block; margin-bottom: 4px; }

/* lesson footer nav */
.lesson-nav {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.nav-card {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.nav-card:hover { text-decoration: none; border-color: #d9b8a5; }
.nav-card .dir { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); }
.nav-card .ttl { font-weight: 600; font-size: 15px; }
.nav-card.next { text-align: right; }
.nav-card.empty { visibility: hidden; }

.complete-btn {
  border: none;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  padding: 13px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15,110,99,.28);
  transition: background .12s, transform .12s;
}
.complete-btn:hover { transform: translateY(-1px); }
.complete-btn.done { background: var(--ink); box-shadow: none; }

@media (max-width: 720px) {
  .lesson-hero { padding: 26px 22px; }
  .sec { padding: 22px 18px; }
  .lesson-nav { grid-template-columns: 1fr; }
  .nav-card.next { text-align: left; }
  .dialogue .who { min-width: 58px; }
}
