:root {
  --ink: #14221f;
  --muted: #71807c;
  --paper: #f6f7f3;
  --card: #ffffff;
  --line: #dfe5df;
  --mint: #bfe9d3;
  --mint-deep: #287c61;
  --yellow: #f6d76e;
  --coral: #e77962;
  --violet: #8a76c8;
  --shadow: 0 18px 50px rgba(20, 34, 31, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Manrope, system-ui, sans-serif; }
button { font: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 5.5vw; border-bottom: 1px solid var(--line); background: rgba(246,247,243,.88); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.brand { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 11px; color: var(--ink); cursor: pointer; text-align: left; padding: 0; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: -.04em; }
.brand strong { display: block; font-size: 14px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 2px; font-family: 'DM Mono', monospace; color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.save-state { color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .02em; }
.save-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #65b98b; vertical-align: 1px; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--muted); cursor: pointer; transition: .2s; }
.icon-button:hover { color: var(--ink); border-color: var(--ink); transform: rotate(-20deg); }
.main-content { width: min(1120px, 89vw); margin: 0 auto; flex: 1; padding: 7.5vh 0 8vh; }
.eyebrow { font-family: 'DM Mono', monospace; color: var(--mint-deep); letter-spacing: .13em; font-size: 11px; text-transform: uppercase; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: 7vw; margin-bottom: 55px; }
h1 { max-width: 700px; margin: 13px 0 18px; font-size: clamp(42px, 6.2vw, 78px); line-height: .98; letter-spacing: -.075em; font-weight: 800; }
.hero p { max-width: 555px; color: var(--muted); font-size: 16px; line-height: 1.7; margin: 0; }
.hero-note { justify-self: end; max-width: 255px; padding: 20px; border-left: 2px solid var(--yellow); color: var(--muted); font-size: 13px; line-height: 1.6; }
.hero-note strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 14px; }
.language-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.language-card { min-height: 254px; padding: 27px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--card); text-align: left; cursor: pointer; transition: transform .23s, box-shadow .23s, border-color .23s; }
.language-card:hover { transform: translateY(-5px); border-color: transparent; box-shadow: var(--shadow); }
.language-card::after { content: ''; position: absolute; right: -35px; bottom: -60px; width: 145px; height: 145px; border-radius: 50%; background: var(--accent); opacity: .19; }
.lang-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 47px; border-radius: 12px; background: var(--accent); color: var(--ink); font-size: 21px; }
.language-card h2 { margin: 0; font-size: 25px; letter-spacing: -.055em; }
.language-card .native { color: var(--muted); font-size: 12px; margin-top: 5px; }
.language-card .card-bottom { display: flex; justify-content: space-between; align-items: center; position: absolute; right: 27px; left: 27px; bottom: 21px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; }
.arrow { color: var(--ink); font-size: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin: 66px 0 18px; }
.section-head h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.section-head span { color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; }
.progress-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.progress-card { padding: 18px 19px; border-top: 2px solid var(--accent); background: rgba(255,255,255,.65); }
.progress-card-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.progress-card-head span:last-child { color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 400; }
.progress-track { height: 6px; overflow: hidden; margin: 15px 0 12px; border-radius: 10px; background: var(--line); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 9px; }
.quiz-layout { display: grid; grid-template-columns: 180px minmax(0, 660px); justify-content: center; gap: 7vw; align-items: start; }
.quiz-side { padding-top: 10px; }
.back-link { border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; font-family: 'DM Mono', monospace; font-size: 10px; }
.back-link:hover { color: var(--ink); }
.quiz-side h1 { font-size: 34px; margin-top: 46px; }
.side-stat { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 26px; }
.side-stat span { display: block; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.side-stat strong { display: block; margin-top: 5px; font-size: 20px; letter-spacing: -.04em; }
.quiz-main { min-width: 0; }
.quiz-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; }
.quiz-progress-track { width: 100%; height: 5px; margin-bottom: 40px; background: var(--line); border-radius: 20px; }
.quiz-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s; }
.question-card { padding: 41px clamp(24px, 5vw, 60px) 34px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.question-label { display: flex; gap: 9px; align-items: center; color: var(--mint-deep); font-family: 'DM Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.question-label::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.question-card h2 { margin: 28px 0 7px; font-size: clamp(34px, 5vw, 54px); line-height: 1; letter-spacing: -.075em; }
.question-prompt { margin: 0 0 27px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; width: 100%; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; color: var(--ink); cursor: pointer; text-align: left; transition: .18s; }
.option:hover { border-color: var(--mint-deep); background: #f6fcf8; }
.option.selected { border-color: var(--ink); background: var(--mint); }
.option:disabled { cursor: default; }
.option-letter { width: 25px; height: 25px; display: grid; place-items: center; margin-right: 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; }
.option.selected .option-letter { border-color: var(--ink); color: var(--ink); }
.primary-button { border: 0; border-radius: 10px; padding: 14px 22px; background: var(--ink); color: white; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .18s, opacity .18s; }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); }
.primary-button:disabled { opacity: .3; cursor: not-allowed; }
.feedback { margin-top: 14px; padding: 14px 17px; border-radius: 11px; font-size: 12px; line-height: 1.5; }
.feedback.correct { background: #e5f6eb; color: #256847; }
.feedback.incorrect { background: #fff0ed; color: #a64e3c; }
.feedback strong { color: inherit; }
.next-row { display: flex; justify-content: flex-end; margin-top: 14px; }
.next-button { border: 1px solid var(--ink); border-radius: 10px; padding: 12px 18px; background: white; color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 700; }
.next-button:hover { background: var(--ink); color: white; }
.results { max-width: 650px; margin: 0 auto; text-align: center; }
.results .eyebrow { color: var(--violet); }
.results h1 { margin-right: auto; margin-left: auto; font-size: clamp(44px, 7vw, 72px); }
.score-ring { width: 145px; height: 145px; display: grid; place-items: center; margin: 35px auto; border: 10px solid var(--mint); border-radius: 50%; background: var(--card); box-shadow: var(--shadow); }
.score-ring strong { display: block; font-size: 38px; letter-spacing: -.08em; }
.score-ring span { display: block; margin-top: -8px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 9px; }
.results p { color: var(--muted); line-height: 1.6; }
.results-actions { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.secondary-button { border: 1px solid var(--line); border-radius: 10px; padding: 13px 18px; background: white; color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 700; }
.footer { display: flex; justify-content: center; align-items: center; gap: 13px; padding: 18px 5.5vw 26px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 9px; }
.footer-rule { width: 22px; height: 1px; background: var(--line); }
@media (max-width: 760px) {
  .topbar { padding: 0 5vw; }
  .save-state { display: none; }
  .main-content { width: 90vw; padding-top: 48px; }
  .hero { display: block; margin-bottom: 35px; }
  .hero-note { margin-top: 28px; max-width: 100%; }
  .language-grid, .progress-list { grid-template-columns: 1fr; }
  .language-card { min-height: 200px; }
  .lang-icon { margin-bottom: 28px; }
  .quiz-layout { display: block; }
  .quiz-side h1 { margin: 24px 0 12px; font-size: 34px; }
  .side-stat { display: inline-block; min-width: 115px; margin: 0 25px 22px 0; }
  .quiz-progress-track { margin-bottom: 24px; }
  .question-card { padding: 30px 20px 24px; }
}
