* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}
button { font-family: inherit; font-weight: 800; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px;
  background: var(--bg-soft);
  border-bottom: 2px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { width: 36px; height: 36px; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: -0.25px; color: var(--accent-dark); }
.topbar-right { display: inline-flex; align-items: center; gap: 10px; }

.xp-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--gold); color: var(--gold-text);
  font-weight: 900;
}
.xp-pill .xp-icon { font-size: 14px; }

.lang-toggle {
  border: 2px solid var(--line); background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; letter-spacing: 1px;
  font-weight: 900; transition: all 0.15s ease;
}
.lang-toggle [data-lang].active { color: var(--primary-dark); }
.lang-toggle .lang-sep { margin: 0 4px; color: var(--line); }

/* ---------- View ---------- */
.view { max-width: 880px; margin: 0 auto; padding: 24px 16px 96px; }
@media (min-width: 600px) { .view { padding: 36px 24px 120px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 14px;
  padding: 14px 22px; min-height: 52px;
  font-size: 15px; letter-spacing: 0.5px; text-transform: uppercase;
  /* Dark text on amber gives 8:1 contrast; white on #F59B11 would fail WCAG */
  background: var(--primary); color: var(--ink);
  box-shadow: var(--shadow-btn);
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.08s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.btn.btn-lg { padding: 18px 32px; font-size: 17px; min-height: 60px; }
.btn.btn-ghost { background: transparent; color: var(--ink-soft); box-shadow: none; }
.btn.btn-ghost:hover { background: var(--line); }
.btn.btn-secondary { background: var(--bg-soft); color: var(--ink); border: 2px solid var(--line); box-shadow: var(--shadow-sm); }
/* Darker-background variants can use white text */
.btn.btn-info { background: var(--info); color: white; }
.btn.btn-accent { background: var(--accent); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-btn); }

/* ---------- Home ---------- */
.home {
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.home-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 20px 16px 32px; width: 100%;
}
.home-mascot-area {
  display: flex; align-items: center; justify-content: center;
  gap: 48px; width: 100%; max-width: 860px;
}
.home-mascot { width: 200px; max-width: 38vw; animation: bob 3.5s ease-in-out infinite; flex-shrink: 0; }
.home h1 { font-family: var(--font-display); font-size: clamp(52px, 11vw, 84px); margin: 0; color: var(--accent-dark); font-weight: 900; line-height: 1; letter-spacing: -2px; }
.home-tagline { font-size: clamp(20px, 3.5vw, 28px); color: var(--ink); margin: 0; font-weight: 800; max-width: 24ch; line-height: 1.25; }
.home-em { font-style: normal; color: var(--accent-dark); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.home-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-soft); border: 2px solid var(--line);
  border-radius: 999px; padding: 8px 18px;
  font-size: 15px; font-weight: 700; color: var(--ink-soft);
}
.home-cta { width: 100%; max-width: 380px; font-size: 19px; font-weight: 900; border-radius: 16px; letter-spacing: 2px; }
.home-disclaimer { color: var(--ink-soft); font-weight: 700; font-size: 13px; max-width: 36ch; }

/* Floating feature cards */
.home-fc {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-soft); border: 2px solid var(--line);
  border-radius: 20px; padding: 14px 16px;
  box-shadow: var(--shadow-card); text-align: left; max-width: 165px;
  transition: transform 0.3s ease;
}
.home-fc-icon { font-size: 26px; flex-shrink: 0; line-height: 1; }
.home-fc-text strong { font-size: 14px; font-weight: 900; color: var(--ink); display: block; }
.home-fc-text p { margin: 3px 0 0; font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.home-fc-right-group { display: flex; flex-direction: column; gap: 16px; }

/* Individual card tilts for a floating look */
.home-mascot-area > .home-fc {
  transform: rotate(-6deg) translateY(8px);
}
.home-mascot-area > .home-fc:hover {
  transform: rotate(-3deg) translateY(4px);
}
.home-fc-right-group .home-fc:first-child {
  transform: rotate(5deg) translateY(-6px);
}
.home-fc-right-group .home-fc:first-child:hover {
  transform: rotate(2deg) translateY(-3px);
}
.home-fc-right-group .home-fc:last-child {
  transform: rotate(-4deg) translateY(10px);
}
.home-fc-right-group .home-fc:last-child:hover {
  transform: rotate(-1deg) translateY(5px);
}

@media (max-width: 600px) {
  .home-fc, .home-fc-right-group { display: none; }
  .home-mascot { max-width: 55vw; }
}

/* Bottom motivation cards */
.home-bottom {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  padding: 0 16px 32px; width: 100%; max-width: 640px;
}
@media (min-width: 640px) {
  .home-bottom { grid-template-columns: repeat(4, 1fr); max-width: 900px; }
}
.home-bottom-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--bg-soft); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 16px 14px;
  box-shadow: var(--shadow-sm); text-align: left;
}
.home-bc-icon { font-size: 26px; display: block; }
.home-bc-check { color: var(--info); }
.home-bc-warn  { color: var(--danger); }
.home-bc-play  { color: var(--primary); }
.home-bottom-card strong { font-size: 13px; font-weight: 900; color: var(--ink); display: block; }
.home-bottom-card p { margin: 4px 0 0; font-size: 12px; color: var(--ink-soft); font-weight: 700; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

/* ---------- Roadmap ---------- */
.roadmap-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 20px;
}
.roadmap-header h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); font-family: var(--font-display); letter-spacing: -0.5px; }
.roadmap-header .stat { color: var(--ink-soft); font-weight: 700; }

/* Progress ring */
.stat-ring-wrap {
  position: relative; display: inline-flex; align-items: center;
  justify-content: center; width: 64px; height: 64px; flex-shrink: 0;
}
.stat-ring { position: absolute; top: 0; left: 0; }
.stat-ring-track { fill: none; stroke: var(--line); stroke-width: 6; }
.stat-ring-fill {
  fill: none; stroke: var(--primary); stroke-width: 6; stroke-linecap: round;
  transition: stroke-dasharray 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stat-ring-label { position: relative; z-index: 1; text-align: center; line-height: 1; }
.stat-done { display: block; font-size: 16px; font-weight: 900; color: var(--ink); }
.stat-sep { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 700; }

.block {
  margin: 28px 0;
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  border: 2px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.block-header {
  padding: 18px 22px;
  color: white;
  background: var(--block-color, var(--primary));
  display: flex; flex-direction: row; align-items: center; gap: 12px;
}
.block-header-content { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.block-header .block-eyebrow {
  font-size: 11px; letter-spacing: 2px; opacity: 0.9; font-weight: 800;
}
.block-header h2 { margin: 0; font-size: 22px; font-family: var(--font-display); letter-spacing: -0.25px; }
.block-header .block-sub { font-size: 13px; opacity: 0.95; font-weight: 700; }

.block-header--toggleable { cursor: pointer; user-select: none; }
.block-header--toggleable:hover { filter: brightness(0.92); }
.block-complete-badge {
  background: rgba(255,255,255,0.22); border: 2px solid rgba(255,255,255,0.5);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 900;
  letter-spacing: 0.5px; white-space: nowrap; flex-shrink: 0;
}
.block-chevron {
  font-size: 18px; transition: transform 0.25s ease; flex-shrink: 0;
}
.block--collapsed .block-chevron { transform: rotate(-90deg); }
.block--collapsed .path { display: none; }

.path { position: relative; padding: 28px 0; }
.path::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 6px; transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    var(--line) 0 12px,
    transparent 12px 22px
  );
  border-radius: 6px; z-index: 0;
}
.path-row { position: relative; display: flex; justify-content: center; padding: 12px 0; }
.path-row:nth-child(odd)  { transform: translateX(-22%); }
.path-row:nth-child(even) { transform: translateX(22%); }

.lesson-node {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--bg-soft); color: var(--block-color, var(--primary));
  border: 4px solid var(--block-color, var(--primary));
  font-size: 30px; font-weight: 900;
  box-shadow: var(--shadow-btn);
  transition: transform 0.12s ease;
}
.lesson-node:hover { transform: translateY(-2px) scale(1.04); }
.lesson-node:active { transform: translateY(2px); }
.lesson-node.done {
  background: var(--block-color, var(--primary)); color: white;
}
.lesson-node.placeholder {
  border-color: var(--line); color: var(--line);
  background: var(--bg-soft);
}
.lesson-node-label {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  white-space: nowrap; margin-top: 8px;
  font-size: 12px; font-weight: 800; color: var(--ink-soft);
  background: var(--bg-soft); padding: 2px 8px; border-radius: 8px;
  border: 1px solid var(--line);
}
.path-row { padding-bottom: 36px; }

/* ---------- Lesson ---------- */
.lesson-header {
  position: sticky; top: 60px; z-index: 5;
  background: var(--bg);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}
.lesson-back {
  background: transparent; border: none; font-size: 22px; color: var(--ink-soft);
  padding: 4px 8px; border-radius: 8px;
}
.lesson-back:hover { background: var(--line); }
.progress-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.progress {
  flex: 1; height: 14px; background: var(--line); border-radius: 999px; overflow: hidden;
}
.progress > div {
  height: 100%; width: 0;
  background: var(--block-color, var(--primary));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.progress-pct {
  font-size: 11px; font-weight: 700; color: var(--ink-soft);
  min-width: 2.8ch; text-align: right; flex-shrink: 0;
}

.lesson-meta {
  margin: 16px 0 8px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline;
}
.lesson-meta h1 { margin: 0; font-size: clamp(20px, 3.4vw, 28px); font-family: var(--font-display); letter-spacing: -0.25px; }
.lesson-meta .topic-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--block-color, var(--primary)); color: white;
  font-size: 12px; letter-spacing: 1px; font-weight: 900;
}
.lesson-meta .extra-pill { background: var(--accent); }

.goal {
  background: var(--bg-soft); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 14px; color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 16px;
}
.goal strong { color: var(--ink); }

.card {
  background: var(--bg-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
}
.card .prompt { font-size: 14px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.card .target { font-size: clamp(22px, 4vw, 32px); font-weight: 900; margin: 0; }
.card .target.ca { color: var(--block-color, var(--primary)); }

.tts-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--info); color: white; border: none;
  box-shadow: var(--shadow-btn);
  font-size: 22px; margin-top: 8px;
}
.tts-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.18); }

.choices { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
@media (min-width: 540px) { .choices.two-col { grid-template-columns: 1fr 1fr; } }

.choice {
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  font-size: 16px; font-weight: 800; color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease;
}
.choice:hover { border-color: var(--block-color, var(--primary)); }
.choice.selected {
  border-color: var(--block-color, var(--primary));
  background: var(--block-soft, var(--primary-soft));
}
.choice.correct { border-color: var(--success); background: var(--success-soft); }
.choice.incorrect { border-color: var(--danger); background: var(--danger-soft); }
.choice:disabled { cursor: default; }

.bank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.bank-slot, .bank-token {
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.bank-token { cursor: pointer; }
.bank-token.used { opacity: 0.25; pointer-events: none; }
.answer-slot {
  min-height: 56px;
  border: 2px dashed var(--line); border-radius: 14px;
  padding: 10px;
  display: flex; flex-wrap: wrap; gap: 8px;
  background: var(--bg);
  margin-top: 12px;
}
.answer-slot .bank-token { background: var(--block-soft, var(--primary-soft)); }

.compare-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 16px;
}
.compare-cell {
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px; background: var(--bg);
}
.compare-cell .compare-lang { font-size: 11px; letter-spacing: 2px; color: var(--ink-soft); }
.compare-cell .compare-text { font-size: 22px; font-weight: 900; margin-top: 4px; }
.compare-note {
  margin-top: 14px; padding: 12px 14px;
  background: var(--block-soft, var(--primary-soft));
  border-radius: var(--radius); font-size: 14px;
  color: var(--ink);
}

/* Footer feedback */
.feedback {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--bg-soft); border-top: 2px solid var(--line);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  transform: translateY(100%); transition: transform 0.3s ease;
}
.feedback.shown { transform: translateY(0); }
.feedback.correct { background: var(--success-soft); border-color: var(--success); }
.feedback.incorrect { background: var(--danger-soft); border-color: var(--danger); }
.feedback-text { flex: 1; font-weight: 900; }
.feedback.correct .feedback-text { color: var(--success-dark); }
.feedback.incorrect .feedback-text { color: var(--danger); }

.lesson-footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 14px 16px; background: var(--bg-soft);
  border-top: 2px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.lesson-footer .btn { min-width: 140px; }
.lesson-footer #skip { margin-left: auto; }
.lesson-footer .lesson-prev {
  min-width: 0; width: 52px; padding: 0; font-size: 22px;
}

/* ---------- Completion ---------- */
.completion {
  text-align: center; padding: 60px 16px;
  display: flex; flex-direction: column; gap: 18px; align-items: center;
}
.completion h1 { font-family: var(--font-display); font-size: 36px; margin: 0; color: var(--accent-dark); letter-spacing: -0.5px; }
.completion .xp-gain {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: var(--gold-text);
  padding: 8px 14px; border-radius: 999px; font-weight: 900;
}
.completion-mascot { width: 180px; }

/* ---------- Placeholder ---------- */
.placeholder {
  text-align: center; padding: 50px 16px;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.placeholder .ph-emoji { font-size: 64px; }

/* ---------- Transitions ---------- */
.view { animation: fade-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.25s; }

/* small */
@media (max-width: 480px) {
  .lesson-node { width: 64px; height: 64px; font-size: 24px; }
  .path-row:nth-child(odd) { transform: translateX(-18%); }
  .path-row:nth-child(even) { transform: translateX(18%); }
}

/* ---------- Pattern exercise ---------- */
.pattern-rule {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; margin: 20px 0; flex-wrap: wrap;
}
.pattern-from, .pattern-to {
  font-size: clamp(26px, 5vw, 38px); font-weight: 900;
}
.pattern-from { color: var(--ink-soft); }
.pattern-arrow { font-size: clamp(26px, 5vw, 38px); color: var(--accent); font-weight: 900; }
.pattern-to { color: var(--block-color, var(--primary)); }
.pattern-lang {
  font-size: 10px; letter-spacing: 2px; color: var(--ink-soft);
  display: block; margin-bottom: 4px;
}
.pattern-examples {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px;
}
.pattern-pair {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--bg);
}
.ex-es { color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.pattern-tts {
  color: var(--block-color, var(--primary)); font-weight: 900; font-size: 15px;
  background: none; border: none; padding: 0; cursor: pointer;
}

/* ---------- Streak badge (ADHD feedback) ---------- */
.feedback-streak {
  display: inline-flex; align-items: center;
  background: var(--accent); color: white;
  border-radius: 999px; padding: 2px 10px;
  font-size: 13px; font-weight: 900;
  margin-left: 10px; vertical-align: middle;
}

/* ---------- Locked block ---------- */
.block--locked .block-header {
  background: var(--ink-soft);
  opacity: 0.75;
}
.block-locked-badge {
  font-size: 20px; flex-shrink: 0;
}

/* ---------- Exam node ---------- */
.lesson-node.exam-node {
  border-style: dashed;
  font-size: 26px;
}
.lesson-node.exam-node.done {
  border-style: solid;
}

/* ---------- Locked block modal ---------- */
.lock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 1rem;
  animation: lock-fade 0.18s ease;
}
@keyframes lock-fade { from { opacity: 0; } to { opacity: 1; } }
.lock-modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-card);
  animation: lock-modal-in 0.18s ease;
}
@keyframes lock-modal-in {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.lock-modal-icon { font-size: 3rem; line-height: 1; margin-bottom: 0.75rem; }
.lock-modal h2   { margin: 0 0 0.6rem; font-size: 1.3rem; font-family: var(--font-display); }
.lock-modal p    { color: var(--ink-soft); margin: 0 0 1.75rem; font-size: 0.95rem; line-height: 1.55; }

/* ---------- Roadmap congrats ---------- */
.roadmap-congrats {
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--radius-lg);
  background: var(--primary-soft);
  border: 2px solid var(--primary);
  margin-top: 28px;
}
.roadmap-congrats-emoji { font-size: 56px; margin-bottom: 8px; }
.roadmap-congrats h2 { margin: 0 0 8px; font-size: 28px; color: var(--primary-dark); font-family: var(--font-display); letter-spacing: -0.5px; }
.roadmap-congrats p { margin: 0; font-size: 16px; color: var(--ink); font-weight: 700; }

/* ---------- Site footer ---------- */
.site-footer {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 16px; border-top: 2px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.footer-sep { opacity: 0.5; }
.footer-contact-btn {
  background: none; border: none; padding: 0;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  font-family: inherit;
}
.footer-contact-btn:hover { color: var(--primary-dark); }

/* ---------- Contact modal ---------- */
.contact-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 400; padding: 1rem; animation: lock-fade 0.18s ease;
}
.contact-overlay[hidden] { display: none; }
.contact-modal {
  position: relative;
  background: var(--bg); border-radius: var(--radius-lg);
  padding: 2rem 1.75rem; max-width: 340px; width: 100%;
  text-align: center; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: lock-modal-in 0.18s ease;
}
.contact-text { margin: 0; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; }
.contact-email {
  font-size: 1.05rem; font-weight: 900; color: var(--accent-dark);
  text-decoration: none; border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.contact-email:hover { color: var(--accent); }
.contact-modal-close {
  position: absolute; top: 0.85rem; right: 0.85rem;
  background: none; border: none; font-size: 18px; line-height: 1;
  color: var(--ink-soft); cursor: pointer; padding: 4px 6px;
  border-radius: 8px; font-family: inherit;
}
.contact-modal-close:hover { background: var(--line); color: var(--ink); }

/* ── Level selector overlay ──────────────────────────────────────── */
.level-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.level-modal {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem 1.75rem;
  max-width: 580px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.level-modal-close {
  position: absolute; top: 0.85rem; right: 0.85rem;
  background: none; border: none; font-size: 18px; line-height: 1;
  color: var(--ink-soft); cursor: pointer; padding: 4px 6px;
  border-radius: 8px; font-family: inherit;
}
.level-modal-close:hover { background: var(--line); color: var(--ink); }
.level-modal h2 { margin: 0 0 0.25rem; font-size: 1.35rem; font-family: var(--font-display); }
.level-modal > p { color: var(--ink-soft); margin: 0 0 1.5rem; font-size: 0.95rem; }
.level-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}
.level-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 0.35rem;
  cursor: pointer;
  background: none;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.level-card:hover,
.level-card:focus-visible {
  outline: none;
  transform: translateY(-3px);
  border-color: var(--level-color);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--level-color) 28%, transparent);
}
.level-badge {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--level-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.level-label { font-weight: 700; font-size: 0.88rem; }
.level-hint {
  font-size: 0.68rem;
  color: var(--ink-soft);
  line-height: 1.3;
}
@media (max-width: 480px) {
  .level-cards { grid-template-columns: repeat(3, 1fr); }
}
