:root {
  --ink: #173c35;
  --muted: #66746e;
  --cream: #f7f4ec;
  --paper: #fffdf8;
  --green: #27685c;
  --green-dark: #163f38;
  --mint: #dcebe2;
  --coral: #e76f51;
  --gold: #e8b44b;
  --line: #deddd5;
  --shadow: 0 18px 50px rgba(29, 57, 50, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: "DM Sans", sans-serif; }
button { font: inherit; }
.site-header { height: 82px; display: flex; align-items: center; padding: 0 clamp(22px, 5vw, 74px); border-bottom: 1px solid rgba(23,60,53,.12); background: rgba(247,244,236,.92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.brand { color: var(--ink); text-decoration: none; font-family: Manrope, sans-serif; font-weight: 800; font-size: 23px; letter-spacing: -.7px; }
.brand-mark span { color: var(--coral); font-size: 17px; }
.brand-dot { color: var(--coral); }
nav { display: flex; align-self: stretch; gap: 28px; margin-left: clamp(34px, 8vw, 130px); }
.nav-link { border: 0; background: none; color: var(--muted); padding: 3px 0 0; cursor: pointer; border-bottom: 3px solid transparent; font-weight: 600; }
.nav-link.active { color: var(--ink); border-color: var(--coral); }
.profile-pill { margin-left: auto; border: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border-radius: 999px; color: var(--ink); cursor: pointer; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); font-weight: 700; }
.profile-copy { display: grid; text-align: left; line-height: 1.15; }
.profile-copy small { color: var(--muted); font-size: 11px; }
main { max-width: 1220px; margin: auto; padding: 0 28px 80px; }
.view { display: none; }
.view.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } }
.hero-grid { padding: 72px 0 48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; font-weight: 800; color: var(--green); margin: 0 0 13px; }
.eyebrow.coral { color: var(--coral); }
h1, h2 { font-family: Manrope, sans-serif; margin: 0; letter-spacing: -.045em; }
h1 { font-size: clamp(42px, 5.5vw, 72px); line-height: 1.03; }
h1 em { color: var(--coral); font-style: normal; }
.hero-subtitle { color: var(--muted); font-size: 18px; margin: 22px 0 20px; }
.context-line { display: flex; gap: 11px; color: var(--green); font-weight: 700; font-size: 13px; }
.context-line b { color: #aab3ae; }
.streak-card { display: flex; align-items: center; gap: 14px; padding: 17px 20px; background: #f1e4c6; border-radius: 16px; min-width: 230px; }
.streak-icon { font-size: 25px; color: #b87321; }
.streak-card div:last-child { display: grid; }
.streak-card small { color: #7f7359; margin-top: 4px; }
.continue-card, .chart-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 30px 34px; box-shadow: var(--shadow); }
.card-topline, .section-heading, .card-actions { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.card-topline h2, .section-heading h2 { font-size: 27px; }
.card-topline p:not(.eyebrow) { color: var(--muted); margin: 6px 0 0; }
.level-badge { color: var(--green); background: var(--mint); border-radius: 999px; padding: 8px 13px; font-size: 11px; font-weight: 800; letter-spacing: .8px; white-space: nowrap; }
.mastery-road { display: grid; grid-template-columns: repeat(9, 1fr); position: relative; padding: 35px 0 30px; margin: 10px 0; }
.road-line { height: 2px; background: #d8ddd8; position: absolute; left: 5%; right: 5%; top: 54px; }
.road-line span { display: block; height: 100%; width: 12.5%; background: var(--coral); }
.road-level { display: grid; place-items: center; position: relative; gap: 6px; color: #8e9894; font-size: 12px; font-weight: 700; }
.road-level i { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #d3d8d4; background: var(--paper); font-style: normal; z-index: 1; }
.road-level small { font-weight: 500; color: #9ba49f; }
.road-level.complete i { background: var(--coral); color: white; border-color: var(--coral); }
.road-level.current i { border: 3px solid var(--coral); color: var(--coral); box-shadow: 0 0 0 5px #f8ded6; }
.road-level.complete span, .road-level.current span { color: var(--ink); }
.card-actions { padding-top: 24px; border-top: 1px solid var(--line); }
.micro-progress { min-width: 240px; color: var(--muted); font-size: 13px; }
.micro-progress div { height: 6px; margin-top: 9px; background: #e5e7e2; border-radius: 9px; overflow: hidden; }
.micro-progress i { display: block; width: 33%; height: 100%; background: var(--coral); border-radius: 9px; transition: width .3s; }
.primary-button { border: 0; color: white; background: var(--green); border-radius: 12px; padding: 14px 21px; font-weight: 700; cursor: pointer; box-shadow: 0 7px 18px rgba(39,104,92,.2); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button span { margin-left: 15px; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.chapters-section { padding-top: 64px; }
.text-button { border: 0; background: none; color: var(--green); font-weight: 700; cursor: pointer; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.chapter-card { border: 1px solid var(--line); background: rgba(255,253,248,.7); border-radius: 18px; padding: 23px; text-align: left; color: var(--ink); cursor: pointer; transition: .2s; }
.chapter-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); background: var(--paper); }
.chapter-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--mint); color: var(--green); font-weight: 800; }
.chapter-card h3 { font-family: Manrope; margin: 30px 0 8px; font-size: 18px; }
.chapter-card p { color: var(--muted); margin: 0; font-size: 13px; }
.chapter-card footer { display: flex; justify-content: space-between; margin-top: 20px; color: var(--green); font-weight: 700; font-size: 12px; }
.progress-header { padding: 70px 0 42px; display: grid; grid-template-columns: 1fr repeat(3, 140px); gap: 16px; align-items: end; }
.progress-header h1 { font-size: 48px; }
.progress-header p:last-child { color: var(--muted); }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: grid; }
.stat strong { font: 800 30px Manrope; }
.stat span { color: var(--muted); font-size: 12px; }
.chart { height: 290px; display: flex; align-items: flex-end; gap: clamp(8px, 2vw, 22px); padding: 40px 15px 28px; border-bottom: 1px solid var(--line); }
.bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar { width: 100%; max-width: 48px; min-height: 20px; background: var(--green); border-radius: 8px 8px 3px 3px; position: relative; }
.bar.retry { background: var(--coral); }
.bar::before { content: attr(data-time); position: absolute; top: -23px; left: 50%; transform: translateX(-50%); font-size: 10px; white-space: nowrap; color: var(--muted); }
.bar-wrap small { color: var(--muted); font-size: 10px; }
.chart-legend { display: flex; gap: 24px; padding-top: 22px; color: var(--muted); font-size: 12px; }
.chart-legend span:last-child { margin-left: auto; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }
.correct-key { background: var(--green); }.retry-key { background: var(--coral); }
dialog { width: 100%; max-width: none; height: 100%; max-height: none; border: 0; padding: 0; background: var(--cream); }
dialog::backdrop { background: var(--cream); }
.quiz-shell { min-height: 100%; }
.quiz-header { height: 82px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 5vw; border-bottom: 1px solid var(--line); }
.icon-button { border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 50%; background: var(--paper); font-size: 23px; color: var(--ink); cursor: pointer; }
.quiz-context { display: grid; text-align: center; gap: 3px; }.quiz-context span { color: var(--muted); font-size: 12px; }.quiz-context strong { font-size: 14px; }
.timer { justify-self: end; border-radius: 999px; background: var(--mint); padding: 9px 14px; display: flex; gap: 8px; }
.quiz-progress { height: 4px; background: #e0e2dd; }.quiz-progress span { display: block; width: 33%; height: 100%; background: var(--coral); transition: width .3s; }
.question-card { width: min(720px, calc(100% - 40px)); margin: 8vh auto; }
.question-card h2 { font-size: clamp(27px, 4vw, 42px); line-height: 1.2; margin-bottom: 32px; }
.answers { display: grid; gap: 12px; }
.answer { display: flex; align-items: center; gap: 15px; width: 100%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 17px 18px; border-radius: 14px; text-align: left; cursor: pointer; }
.answer:hover { border-color: #88a39b; }.answer.selected { border: 2px solid var(--green); background: #edf5f0; }.answer.correct { border-color: var(--green); background: #dceee2; }.answer.wrong { border-color: var(--coral); background: #fbe7e1; }
.answer-letter { width: 31px; height: 31px; border: 1px solid #cdd2ce; border-radius: 8px; display: grid; place-items: center; font-weight: 700; }
.feedback { min-height: 46px; margin: 18px 0; color: var(--muted); }.feedback strong { color: var(--ink); }
.submit-button { float: right; min-width: 190px; }
@media (max-width: 760px) {
  .site-header { padding: 0 18px; }.profile-copy, .profile-pill > span:last-child { display: none; } nav { margin-left: 28px; gap: 18px; }
  main { padding: 0 17px 60px; }.hero-grid { padding-top: 48px; align-items: flex-start; flex-direction: column; }.streak-card { width: 100%; }
  .continue-card, .chart-card { padding: 23px 18px; }.mastery-road { grid-template-columns: repeat(3, 1fr); row-gap: 22px; }.road-line { display: none; }
  .card-actions { align-items: stretch; flex-direction: column; }.primary-button { width: 100%; }.chapter-grid { grid-template-columns: 1fr; }
  .progress-header { grid-template-columns: repeat(3, 1fr); }.progress-header > div:first-child { grid-column: 1/-1; }.stat { padding: 14px; }.stat strong { font-size: 23px; }
  .chart-legend { flex-wrap: wrap; }.chart-legend span:last-child { margin-left: 0; width: 100%; }.quiz-header { padding: 0 18px; }.quiz-context span { display: none; }
}
