:root {
  --ink: #17221d;
  --muted: #6d756f;
  --line: #dfe3dc;
  --paper: #f6f5ef;
  --white: #fffef9;
  --lime: #d9ff63;
  --lime-deep: #c7ef4e;
  --green: #173f33;
  --orange: #ff8d5b;
  --lavender: #b8b3ff;
  --shadow: 0 18px 50px rgba(31, 45, 37, 0.09);
}

html[data-theme="ocean"] {
  --ink: #122431;
  --muted: #62727c;
  --line: #d7e1e5;
  --paper: #f2f7f8;
  --white: #fbfeff;
  --lime: #8bddff;
  --lime-deep: #6ecff5;
  --green: #163b56;
  --orange: #ffb15f;
  --lavender: #aebeff;
  --shadow: 0 18px 50px rgba(18, 55, 79, 0.1);
}

html[data-theme="peach"] {
  --ink: #30201b;
  --muted: #796a64;
  --line: #e6d9d2;
  --paper: #fbf4ee;
  --white: #fffdf9;
  --lime: #ffb08b;
  --lime-deep: #fb9871;
  --green: #5a342b;
  --orange: #ffd15f;
  --lavender: #e7b6ee;
  --shadow: 0 18px 50px rgba(86, 52, 38, 0.1);
}

html[data-theme="violet"] {
  --ink: #211d36;
  --muted: #716c82;
  --line: #dfdbe9;
  --paper: #f7f4fb;
  --white: #fefcff;
  --lime: #c7b5ff;
  --lime-deep: #ac98f4;
  --green: #372d60;
  --orange: #ff987c;
  --lavender: #d8cbff;
  --shadow: 0 18px 50px rgba(52, 42, 86, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  width: min(1180px, calc(100% - 48px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 34, 29, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--lime);
  transform: rotate(-4deg);
  box-shadow: 3px 3px 0 var(--lime);
}

.brand-mark span {
  transform: rotate(4deg);
  font-size: 20px;
  line-height: 1;
}

.brand-name {
  font-family: "DM Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(23, 34, 29, 0.11);
  border-radius: 999px;
  background: rgba(255, 254, 249, 0.6);
}

.nav-item {
  padding: 9px 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--ink);
  color: white;
}

.header-actions,
.streak-pill {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 12px;
}

.theme-picker {
  position: relative;
}

.theme-toggle {
  height: 38px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.theme-toggle:hover,
.theme-toggle[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--lime);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  fill: var(--lime);
  stroke: var(--ink);
  stroke-width: 1.4;
}

.theme-menu {
  position: absolute;
  z-index: 30;
  top: 48px;
  right: 0;
  width: 270px;
  padding: 10px;
  border: 1px solid var(--ink);
  border-radius: 13px;
  background: var(--white);
  box-shadow: 6px 6px 0 var(--ink), 0 20px 45px rgba(23, 34, 29, .16);
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu-head {
  padding: 7px 8px 10px;
}

.theme-menu-head strong,
.theme-menu-head span {
  display: block;
}

.theme-menu-head strong {
  font-size: 15px;
}

.theme-menu-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.theme-option {
  width: 100%;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: 42px 1fr 18px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.theme-option:hover,
.theme-option.active {
  background: color-mix(in srgb, var(--lime) 20%, var(--white));
}

.theme-option > span:nth-child(2) strong,
.theme-option > span:nth-child(2) small {
  display: block;
}

.theme-option > span:nth-child(2) strong {
  font-size: 13px;
}

.theme-option > span:nth-child(2) small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.theme-option b {
  display: none;
  color: var(--green);
  font-size: 13px;
}

.theme-option.active b {
  display: block;
}

.theme-swatches {
  width: 40px;
  height: 27px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 6px;
}

.theme-swatches i {
  flex: 1;
}

[data-theme-choice="forest"] .theme-swatches i:nth-child(1) { background: #d9ff63; }
[data-theme-choice="forest"] .theme-swatches i:nth-child(2) { background: #173f33; }
[data-theme-choice="forest"] .theme-swatches i:nth-child(3) { background: #f6f5ef; }
[data-theme-choice="ocean"] .theme-swatches i:nth-child(1) { background: #8bddff; }
[data-theme-choice="ocean"] .theme-swatches i:nth-child(2) { background: #163b56; }
[data-theme-choice="ocean"] .theme-swatches i:nth-child(3) { background: #f2f7f8; }
[data-theme-choice="peach"] .theme-swatches i:nth-child(1) { background: #ffb08b; }
[data-theme-choice="peach"] .theme-swatches i:nth-child(2) { background: #5a342b; }
[data-theme-choice="peach"] .theme-swatches i:nth-child(3) { background: #fbf4ee; }
[data-theme-choice="violet"] .theme-swatches i:nth-child(1) { background: #c7b5ff; }
[data-theme-choice="violet"] .theme-swatches i:nth-child(2) { background: #372d60; }
[data-theme-choice="violet"] .theme-swatches i:nth-child(3) { background: #f7f4fb; }

.streak-pill {
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}

.streak-pill strong {
  color: var(--ink);
}

.streak-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffeadc;
  color: #e76732;
}

.profile-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

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

.hero {
  min-height: 580px;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  align-items: center;
  gap: 50px;
  padding: 76px 0 66px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--green);
}

.eyebrow span {
  width: 25px;
  height: 2px;
  background: var(--green);
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 5vw, 70px);
  line-height: 1.12;
  letter-spacing: -4.4px;
  font-weight: 800;
}

.hero h1 em {
  position: relative;
  z-index: 1;
  font-style: normal;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -4px;
  right: -9px;
  bottom: 6px;
  height: 20px;
  background: var(--lime);
  transform: rotate(-1.5deg);
}

.hero-copy > p {
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

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

.primary-button {
  min-width: 170px;
  padding: 15px 19px 15px 23px;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--lime);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--lime);
}

.primary-button span {
  color: var(--lime);
  font-size: 18px;
}

.text-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hero-visual {
  position: relative;
  min-height: 415px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.hero-visual::before {
  content: "";
  position: absolute;
  z-index: -3;
  width: 395px;
  height: 395px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 28px 70px rgba(23,63,51,.18);
}

.hero-visual::after {
  content: "";
  position: absolute;
  z-index: -2;
  width: 448px;
  height: 150px;
  bottom: 2px;
  border-radius: 50%;
  background: rgba(23, 34, 29, 0.09);
  filter: blur(3px);
  transform: rotate(-3deg);
}

.visual-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(217, 255, 99, 0.35);
  border-radius: 50%;
}

.orbit-one {
  width: 285px;
  height: 285px;
}

.orbit-two {
  width: 340px;
  height: 340px;
  border-style: dashed;
}

.hero-key {
  position: relative;
  width: 192px;
  height: 192px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 33px;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 13px 0 #a9c94e, 0 27px 40px rgba(7, 20, 14, 0.34);
  transform: rotate(-8deg);
}

.hero-key::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(23,34,29,.2);
  border-radius: 27px;
}

.hero-key-symbol {
  align-self: center;
  margin-top: 8px;
  font-family: "DM Sans", sans-serif;
  font-size: 96px;
  font-weight: 600;
  line-height: 1;
}

.hero-key-caption {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: right;
}

.floating-label {
  position: absolute;
  padding: 7px 12px;
  border-radius: 5px;
  background: var(--orange);
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  box-shadow: 3px 3px 0 rgba(23,34,29,.8);
}

.label-top {
  top: 29px;
  right: 93px;
  transform: rotate(7deg);
}

.floating-card {
  position: absolute;
  display: flex;
  align-items: center;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 5px 5px 0 var(--ink);
}

.floating-card small {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
}

.floating-card strong {
  display: block;
  font-size: 12px;
}

.use-card {
  left: 23px;
  bottom: 57px;
  gap: 11px;
  padding: 11px 17px 11px 12px;
  transform: rotate(2deg);
}

.mini-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #ecebe4;
  font-weight: 700;
}

.keys-card {
  right: 8px;
  bottom: 72px;
  padding: 11px 13px;
  display: block;
  transform: rotate(-3deg);
}

.mini-keys {
  display: flex;
  gap: 4px;
}

.mini-keys kbd {
  width: 27px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid #c6cac3;
  border-radius: 4px;
  background: white;
  font-family: "DM Sans", sans-serif;
  box-shadow: 0 2px 0 #c6cac3;
}

.progress-strip {
  min-height: 116px;
  padding: 25px 32px;
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 0.8fr;
  align-items: center;
  gap: 45px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 7px 7px 0 rgba(23,34,29,.92);
}

.progress-copy span,
.progress-copy strong {
  display: block;
}

.progress-kicker {
  margin-bottom: 7px;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.progress-copy strong {
  font-size: 15px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

.progress-meta strong {
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: #e8e8e0;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  border-right: 1px solid var(--ink);
  transition: width .5s ease;
}

.progress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.progress-stats > div {
  padding: 1px 20px;
  text-align: center;
  border-left: 1px solid var(--line);
}

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

.progress-stats strong {
  margin-bottom: 2px;
  font-family: "DM Sans", sans-serif;
  font-size: 22px;
}

.progress-stats span {
  color: var(--muted);
  font-size: 10px;
}

.learning-section,
.library-section {
  padding: 120px 0 20px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-number {
  display: inline-flex;
  padding: 3px 7px;
  margin-bottom: 11px;
  background: var(--lime);
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-family: "DM Sans", sans-serif;
  font-size: 9px;
  font-weight: 700;
}

.section-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.35;
  letter-spacing: -1.4px;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mode-switch {
  display: flex;
  padding: 4px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--white);
}

.mode-switch button {
  min-width: 88px;
  padding: 9px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.mode-switch button span {
  margin-right: 5px;
}

.mode-switch button.active {
  background: var(--ink);
  color: white;
}

.workspace-card {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(290px, .75fr);
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.keyboard-panel {
  padding: 28px 30px 25px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ink);
}

.keyboard-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.category-filter {
  display: flex;
  gap: 7px;
}

.category-filter button {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.category-filter button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.keyboard-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.keyboard-hint i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  border: 1px solid var(--ink);
  background: var(--lime);
}

.keyboard-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  padding: 10px 3px 18px;
}

.keyboard {
  width: 100%;
  min-width: 630px;
  padding: 14px;
  border: 1px solid #adb2ac;
  border-radius: 12px;
  background: #e4e5df;
  box-shadow: 0 9px 0 #c8cac4, 0 11px 0 var(--ink);
}

.keyboard-row {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}

.keyboard-row:last-child {
  margin-bottom: 0;
}

.key {
  position: relative;
  min-width: 0;
  height: 48px;
  flex: var(--key-width, 1);
  padding: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border: 1px solid #b9bcb7;
  border-radius: 6px;
  background: #fafaf7;
  color: #717772;
  box-shadow: 0 3px 0 #b9bcb7;
  font-family: "DM Sans", sans-serif;
  font-size: 8px;
  cursor: default;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease, opacity .2s ease;
}

.key span:first-child {
  font-size: 13px;
  line-height: 1;
}

.key.center-label {
  align-items: center;
  justify-content: center;
}

.key.learning-key {
  border-color: var(--ink);
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 3px 0 #8c9f4a;
  cursor: pointer;
  font-weight: 700;
}

.key.learning-key:hover,
.key.learning-key.active {
  z-index: 2;
  transform: translateY(-2px);
  background: var(--lime-deep);
  box-shadow: 0 5px 0 var(--ink), 0 7px 12px rgba(23,34,29,.18);
}

.key.learning-key.learned::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -4px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 8px;
}

.keyboard.filtered .key.learning-key:not(.filter-match) {
  opacity: .25;
  background: #f4f4ef;
}

.keyboard.quiz-active .key.learning-key {
  background: white;
  box-shadow: 0 3px 0 #aeb3ac;
}

.keyboard.quiz-active .key.learning-key:hover {
  background: var(--lime);
}

.key.correct {
  animation: correctPulse .65s ease;
  background: var(--lime) !important;
}

.key.wrong {
  animation: wrongShake .45s ease;
  background: #ffb29a !important;
}

@keyframes correctPulse {
  50% { transform: translateY(-5px) scale(1.06); box-shadow: 0 7px 0 var(--ink); }
}

@keyframes wrongShake {
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.keyboard-footnote {
  margin: 15px 0 0;
  text-align: center;
  color: #8a918b;
  font-size: 10px;
}

.keyboard-footnote span {
  margin-right: 4px;
  color: var(--green);
}

.detail-panel,
.result-panel {
  padding: 27px 28px;
  background: #f0f0e9;
}

.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--lime);
  font-family: "DM Sans", sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.3px;
}

.sound-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

.sound-button svg {
  width: 14px;
  height: 14px;
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.symbol-card {
  width: 82px;
  height: 82px;
  margin: 24px auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--lime);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 48px;
  font-weight: 600;
}

.detail-title {
  position: relative;
  text-align: center;
}

.detail-name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-name-block {
  min-width: 0;
  padding: 12px 7px 13px;
}

.detail-name-block + .detail-name-block {
  border-left: 1px solid var(--line);
}

.name-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: "DM Sans", "Noto Sans KR", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .8px;
}

.detail-title h3 {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.6px;
}

.detail-title p {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
}

.detail-title .pronunciation {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
}

.detail-description {
  margin-top: 22px;
  color: #59615c;
  font-size: 11px;
  line-height: 1.7;
}

.use-example {
  margin-top: 17px;
}

.use-example > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.use-example code {
  min-height: 42px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  border: 1px solid #d1d5ce;
  border-radius: 7px;
  background: var(--ink);
  color: #e9f4c7;
  font-family: Consolas, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.memory-tip {
  margin-top: 13px;
  padding: 11px;
  display: flex;
  gap: 9px;
  border: 1px dashed #bdc1ba;
  border-radius: 7px;
  background: rgba(255,255,255,.5);
}

.tip-bulb {
  color: #e56c3a;
}

.memory-tip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 9px;
}

.memory-tip p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.learned-button {
  width: 100%;
  margin-top: 17px;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--white);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.learned-button:hover,
.learned-button.is-learned {
  background: var(--ink);
  color: white;
}

.quiz-prompt {
  margin-bottom: 12px;
  padding: 18px 20px 16px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--green);
  color: white;
}

.quiz-prompt-top {
  display: flex;
  justify-content: space-between;
  color: var(--lime);
  font-family: "DM Sans", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.quiz-prompt h3 {
  margin: 10px 0 3px;
  font-size: 18px;
  letter-spacing: -.5px;
}

.quiz-prompt p {
  margin: 0;
  color: rgba(255,255,255,.65);
  font-size: 10px;
}

.quiz-progress {
  height: 3px;
  margin-top: 13px;
  overflow: hidden;
  background: rgba(255,255,255,.15);
}

.quiz-progress span {
  display: block;
  height: 100%;
  width: 12.5%;
  background: var(--lime);
  transition: width .25s ease;
}

.result-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.result-panel[hidden],
.detail-panel[hidden],
.quiz-prompt[hidden] {
  display: none;
}

.result-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 22px;
  font-weight: 700;
}

.result-panel h3 {
  margin: 18px 0 11px;
  font-size: 23px;
  letter-spacing: -1px;
}

.result-score {
  display: flex;
  align-items: baseline;
  color: var(--green);
  font-family: "DM Sans", sans-serif;
}

.result-score strong {
  font-size: 56px;
  line-height: 1;
}

.result-score span {
  font-size: 18px;
  color: var(--muted);
}

.result-panel > p {
  max-width: 220px;
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.result-secondary {
  margin-top: 11px;
  padding: 7px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.library-section {
  padding-bottom: 100px;
}

.library-count {
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.key-library {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.library-card {
  min-height: 130px;
  padding: 18px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,254,249,.65);
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
}

.library-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 4px 5px 0 var(--ink);
}

.library-symbol {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--lime);
  font-family: "DM Sans", sans-serif;
  font-size: 28px;
  box-shadow: 3px 3px 0 var(--ink);
}

.library-card strong,
.library-card small,
.library-card em {
  display: block;
}

.library-card strong {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
}

.library-card em {
  margin: 2px 0 7px;
  color: var(--green);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.library-card small {
  color: var(--muted);
  font-size: 9px;
}

.library-card.learned {
  background: #eff6d8;
}

footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 40px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-top: 1px solid rgba(23,34,29,.15);
  color: var(--muted);
  font-size: 10px;
}

footer p {
  text-align: center;
}

footer > span {
  text-align: right;
  font-family: "DM Sans", sans-serif;
  letter-spacing: 1px;
}

.footer-brand .brand-mark {
  width: 27px;
  height: 27px;
  border-radius: 7px;
}

.footer-brand .brand-name {
  font-size: 17px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 4px 4px 0 var(--lime);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: .25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Legibility upgrade: core learning text stays comfortably readable. */
.nav-item { font-size: 14px; }
.streak-pill { font-size: 13px; }
.hero-copy > p { font-size: 18px; }
.primary-button { font-size: 15px; }
.text-button { font-size: 14px; }
.progress-kicker { font-size: 10px; }
.progress-copy strong { font-size: 17px; }
.progress-meta { font-size: 13px; }
.progress-stats span { font-size: 12px; }
.section-heading h2 { font-size: 34px; }
.section-heading p { font-size: 15px; }
.mode-switch button { font-size: 13px; }
.category-filter button,
.keyboard-hint,
.keyboard-footnote { font-size: 12px; }
.key { font-size: 10px; }
.key span:first-child { font-size: 16px; }
.detail-badge { font-size: 10px; }
.detail-description { font-size: 14px; }
.use-example > span { font-size: 11px; }
.use-example code { font-size: 12px; }
.memory-tip strong { font-size: 11px; }
.memory-tip p { font-size: 11px; }
.learned-button { font-size: 13px; }
.quiz-prompt-top { font-size: 11px; }
.quiz-prompt h3 { font-size: 20px; }
.quiz-prompt p { font-size: 12px; }
.result-panel > p { font-size: 13px; }
.result-secondary { font-size: 12px; }
.library-count { font-size: 11px; }
.library-card strong,
.library-card em {
  color: var(--ink);
  font-family: "DM Sans", "Noto Sans KR", sans-serif;
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}
.library-card em { margin-top: 4px; }
.library-card small { margin-top: 8px; font-size: 10px; }
footer { font-size: 12px; }

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .hero-visual {
    transform: scale(.88);
  }

  .progress-strip {
    gap: 20px;
  }

  .workspace-card {
    grid-template-columns: minmax(0, 1fr) 285px;
  }

  .keyboard-panel {
    padding: 24px 20px;
  }

  .key-library {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 780px) {
  .topbar,
  main,
  footer {
    width: min(100% - 30px, 620px);
  }

  .topbar {
    height: 72px;
  }

  .main-nav,
  .streak-pill {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 60px 0 25px;
  }

  .hero-copy {
    text-align: center;
  }

  .eyebrow,
  .hero-actions {
    justify-content: center;
  }

  .hero h1 {
    font-size: clamp(45px, 13vw, 64px);
    letter-spacing: -3.5px;
  }

  .hero-visual {
    margin-top: 22px;
    transform: scale(.82);
  }

  .progress-strip {
    grid-template-columns: 1fr 1fr;
  }

  .progress-copy {
    grid-column: 1 / -1;
  }

  .progress-stats > div:first-child {
    border-left: 0;
  }

  .learning-section,
  .library-section {
    padding-top: 85px;
  }

  .workspace-card {
    grid-template-columns: 1fr;
  }

  .keyboard-panel {
    min-height: 520px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .detail-panel,
  .result-panel {
    min-height: 500px;
  }

  .key-library {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .desktop-only,
  .streak-pill,
  .profile-button {
    display: none;
  }

  .theme-toggle {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .theme-toggle > span {
    display: none;
  }

  .hero {
    padding-top: 48px;
  }

  .hero h1 {
    font-size: 43px;
    letter-spacing: -3px;
  }

  .hero-copy > p {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 14px;
  }

  .hero-visual {
    min-height: 385px;
    margin-left: -50px;
    margin-right: -50px;
    transform: scale(.72);
  }

  .progress-strip {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 23px;
  }

  .progress-copy {
    grid-column: auto;
  }

  .progress-stats > div:first-child {
    border-left: 0;
  }

  .section-heading {
    align-items: flex-start;
    gap: 22px;
    flex-direction: column;
  }

  .section-heading h2 {
    font-size: 28px;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-switch button {
    flex: 1;
  }

  .keyboard-panel {
    padding: 20px 15px;
  }

  .keyboard-topline {
    align-items: flex-start;
  }

  .keyboard-hint {
    display: none;
  }

  .keyboard-wrap {
    justify-content: flex-start;
  }

  .key-library {
    grid-template-columns: 1fr;
  }

  .library-card {
    min-height: 100px;
  }

  footer {
    grid-template-columns: 1fr 1fr;
  }

  footer p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
