:root {
  --ink: #172333;
  --muted: #657287;
  --line: #dfe6ee;
  --surface: #ffffff;
  --canvas: #f5f8fb;
  --green: #159f68;
  --green-dark: #0d7f52;
  --green-soft: #e5f7ef;
  --blue: #246bfd;
  --blue-soft: #e9f0ff;
  --yellow: #ffb000;
  --red: #e84b5b;
  --red-soft: #ffebee;
  --shadow: 0 18px 45px rgba(32, 55, 79, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(36, 107, 253, 0.28);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(223, 230, 238, 0.88);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.back-link,
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.back-link {
  color: var(--muted);
  font-size: 14px;
}

.back-link:hover {
  color: var(--green-dark);
}

.brand {
  justify-self: center;
  font-size: 20px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.stats {
  display: flex;
  justify-self: end;
  gap: 10px;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 62px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  align-items: center;
  min-height: 520px;
  gap: clamp(36px, 8vw, 100px);
  padding: 72px 0 60px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

h1 span {
  color: var(--green);
}

.hero-copy {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.7;
}

.hero-orbit {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  justify-self: end;
  border: 2px dashed #cfe0d8;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 36%, transparent 37%);
}

.orbit-center {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  transform: translate(-50%, -50%) rotate(-6deg);
  border-radius: 34px;
  background: var(--green);
  color: #fff;
  font-size: 48px;
  font-weight: 900;
  box-shadow: 0 22px 45px rgba(21, 159, 104, 0.28), inset 0 -8px 0 rgba(0, 0, 0, 0.1);
}

.orbit-word {
  position: absolute;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.orbit-word-de {
  top: 8%;
  left: 10%;
  transform: rotate(-8deg);
}

.orbit-word-en {
  top: 34%;
  right: -4%;
  transform: rotate(7deg);
}

.orbit-word-fr {
  bottom: 9%;
  left: 14%;
  transform: rotate(5deg);
}

.course-picker,
.benefits {
  padding: 60px 0;
}

.section-heading,
.path-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-heading h2,
.path-heading h2,
.course-summary h2,
.result-view h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.035em;
}

.progress-copy,
.path-hint {
  color: var(--muted);
  font-size: 14px;
}

.language-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.language-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 104px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.language-button:hover {
  transform: translateY(-3px);
  border-color: #a9c9ba;
  box-shadow: var(--shadow);
}

.language-button.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 -4px 0 rgba(21, 159, 104, 0.14);
}

.language-button .flag {
  font-size: 38px;
}

.language-button strong,
.language-button small {
  display: block;
}

.language-button strong {
  margin-bottom: 4px;
  font-size: 18px;
}

.language-button small {
  color: var(--muted);
}

.language-button .check {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: transparent;
}

.language-button.is-active .check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.learning-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  padding: 30px 0 70px;
}

.course-summary,
.lesson-path {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.course-summary {
  position: sticky;
  top: 96px;
  padding: 28px;
}

.course-flag {
  margin-bottom: 24px;
  font-size: 52px;
}

.course-summary > p:not(.eyebrow) {
  min-height: 72px;
  margin: 16px 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.course-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.progress-track,
.lesson-progress {
  overflow: hidden;
  height: 12px;
  border-radius: 99px;
  background: #e7edf3;
}

.progress-track span,
.lesson-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 240ms ease;
}

.primary-button,
.text-button {
  width: 100%;
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  min-height: 50px;
  padding: 13px 20px;
  border-radius: 15px;
  background: var(--green);
  color: #fff;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.14);
  transition: transform 120ms ease, background 120ms ease;
}

.primary-button:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.primary-button:disabled {
  background: #cbd4de;
  color: #7c8997;
  box-shadow: none;
  cursor: not-allowed;
}

.text-button {
  margin-top: 12px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.text-button:hover {
  color: var(--red);
}

.lesson-path {
  padding: clamp(22px, 4vw, 38px);
}

.lesson-list {
  position: relative;
  display: grid;
  gap: 18px;
}

.lesson-list::before {
  content: "";
  position: absolute;
  top: 44px;
  bottom: 44px;
  left: 38px;
  width: 4px;
  border-radius: 10px;
  background: #e6edf2;
}

.lesson-card {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 106px;
  padding: 14px 18px 14px 0;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.lesson-card:hover:not(:disabled) {
  transform: translateX(4px);
  border-color: #9fcbb8;
  box-shadow: 0 12px 28px rgba(32, 55, 79, 0.09);
}

.lesson-card:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.lesson-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 58px;
  height: 58px;
  margin-left: 10px;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #e7edf3;
  font-size: 25px;
}

.lesson-card.is-available .lesson-icon,
.lesson-card.is-complete .lesson-icon {
  background: var(--green);
  color: #fff;
}

.lesson-card.is-complete {
  border-color: #b7dfcd;
  background: #f8fffb;
}

.lesson-card.is-challenge:not(.is-complete) {
  border-color: #d6c1f3;
  background: #fbf8ff;
}

.lesson-card.is-challenge.is-available .lesson-icon {
  background: #7546c8;
}

.lesson-card.is-challenge .lesson-copy small {
  color: #7546c8;
  font-weight: 800;
}

.lesson-copy strong,
.lesson-copy small {
  display: block;
}

.lesson-copy strong {
  margin-bottom: 7px;
  font-size: 18px;
}

.lesson-copy small {
  color: var(--muted);
}

.lesson-state {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.lesson-card.is-complete .lesson-state {
  color: var(--green-dark);
}

.compact-heading {
  margin-bottom: 24px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.benefit-grid article {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.benefit-grid article > span {
  font-size: 34px;
}

.benefit-grid h3 {
  margin: 18px 0 8px;
}

.benefit-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 36px));
  margin: 30px auto 0;
  padding: 30px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer strong {
  color: var(--ink);
}

.lesson-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  padding: 24px;
  background: rgba(16, 28, 42, 0.76);
  backdrop-filter: blur(10px);
}

.lesson-modal[hidden] {
  display: none;
}

.lesson-dialog {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  min-height: min(690px, calc(100vh - 48px));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.lesson-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eef2f6;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
}

.heart-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
}

.exercise-view,
.result-view {
  flex: 1;
  padding: clamp(36px, 7vw, 64px) clamp(0px, 4vw, 32px) 26px;
}

.exercise-view h2,
.result-view h2 {
  margin: 0;
}

.question-instruction {
  margin: 12px 0 30px;
  color: var(--muted);
  font-size: 18px;
}

.question-prompt {
  min-height: 110px;
  margin-bottom: 26px;
  padding: 24px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: #f9fbfd;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 900;
  line-height: 1.25;
}

.listen-prompt {
  display: flex;
  align-items: center;
  gap: 18px;
}

.sound-button {
  display: grid;
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 0;
  border-radius: 20px;
  background: var(--blue);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.14);
}

.answer-area {
  display: grid;
  gap: 12px;
}

.choice-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.choice-button:hover:not(:disabled) {
  border-color: #9eb8e9;
  background: var(--blue-soft);
}

.choice-button.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.choice-key {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.typing-answer {
  width: 100%;
  min-height: 64px;
  padding: 14px 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font-size: 20px;
}

.typing-answer:focus {
  border-color: var(--blue);
}

.feedback {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border-radius: 18px;
}

.feedback.is-correct {
  background: var(--green-soft);
  color: var(--green-dark);
}

.feedback.is-wrong {
  background: var(--red-soft);
  color: #b72d3b;
}

.feedback-icon {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
}

.feedback p {
  margin: 4px 0 0;
  color: var(--muted);
}

.lesson-actions {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.lesson-actions .primary-button {
  max-width: 260px;
  margin-left: auto;
}

.result-view {
  display: grid;
  place-content: center;
  text-align: center;
}

.result-view[hidden] {
  display: none;
}

.result-badge {
  margin-bottom: 20px;
  font-size: 72px;
}

.result-view > p:not(.eyebrow) {
  max-width: 500px;
  margin: 16px auto 28px;
  color: var(--muted);
  line-height: 1.6;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: min(420px, 100%);
  margin: 0 auto;
}

.result-stats div {
  padding: 18px;
  border-radius: 18px;
  background: #f1f5f8;
}

.result-stats span,
.result-stats strong {
  display: block;
}

.result-stats span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.result-stats strong {
  font-size: 24px;
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 100;
  padding: 14px;
  border-radius: 12px;
  background: #fff2d3;
  color: #714b00;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-orbit {
    width: min(390px, 88%);
    justify-self: center;
  }

  .learning-layout {
    grid-template-columns: 1fr;
  }

  .course-summary {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .brand {
    justify-self: start;
    margin-left: 12px;
    font-size: 0;
  }

  .brand-mark {
    font-size: 18px;
  }

  .back-label {
    display: none;
  }

  main {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding-top: 48px;
  }

  .language-options,
  .benefit-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .path-heading {
    align-items: start;
    flex-direction: column;
  }

  .lesson-card {
    grid-template-columns: 68px 1fr;
  }

  .lesson-state {
    grid-column: 2;
  }

  .lesson-list::before {
    left: 33px;
  }

  .lesson-modal {
    padding: 0;
  }

  .lesson-dialog {
    min-height: 100vh;
    border-radius: 0;
  }

  .lesson-actions .primary-button {
    max-width: none;
  }
}

@media (max-width: 440px) {
  .stat {
    min-width: 48px;
    padding: 8px;
  }

  h1 {
    font-size: 46px;
  }

  .hero-orbit {
    width: 300px;
  }

  .orbit-center {
    width: 106px;
    height: 106px;
    border-radius: 28px;
    font-size: 40px;
  }

  .orbit-word {
    padding: 9px 12px;
    font-size: 13px;
  }

  .course-summary,
  .lesson-path {
    border-radius: 22px;
  }

  .lesson-top {
    gap: 10px;
  }

  .question-prompt {
    min-height: 92px;
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
