:root {
  color-scheme: light;
  --ink: #132d29;
  --muted: #52645c;
  --paper: #f7f7ef;
  --white: #fff;
  --line: #dce4d8;
  --green: #bfed72;
  --dark: #17342e;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #3d7755; outline-offset: 3px; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--white); }
.top-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; min-height: 66px; gap: 18px; }
.brand { text-decoration: none; font-size: 1.12rem; font-weight: 850; letter-spacing: -.035em; white-space: nowrap; }
.brand span { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 6px; border-radius: 9px; color: var(--ink); background: var(--green); font-size: 21px; }
nav, .footer-inner > div { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); }
nav a, footer a, footer button { font-size: .9rem; font-weight: 650; }
nav a { text-decoration: none; }
nav a:hover, footer button:hover { text-decoration: underline; }
.hero { margin-top: 36px; display: grid; grid-template-columns: 1.55fr 1fr; align-items: center; overflow: hidden; background: var(--dark); color: #fff; border-radius: 26px; padding: clamp(26px, 6vw, 66px); min-height: 340px; }
.eyebrow { margin: 0 0 9px; font-size: .73rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero .eyebrow, h1 span { color: var(--green); }
.hero .eyebrow span { display: inline-block; width: 8px; height: 8px; background: var(--green); border-radius: 50%; margin-right: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -.045em; }
h1 { font-size: clamp(3.1rem, 8vw, 6.3rem); }
h2 { font-size: clamp(1.65rem, 3.8vw, 2.55rem); }
h3 { font-size: 1.34rem; }
.intro { max-width: 440px; margin: 15px 0 25px; color: #e0e9df; line-height: 1.55; font-size: 1.12rem; }
.button { display: inline-flex; gap: .65rem; align-items: center; justify-content: center; border-radius: 8px; padding: 10px 14px; font-weight: 750; text-decoration: none; border: 1px solid transparent; color: var(--ink); }
.primary { background: var(--green); }
.primary:hover { background: #d4f7a1; }
.secondary { background: #f3f6ee; border-color: var(--line); }
.secondary:hover { background: #e7efdc; }
.hero-keys { display: grid; grid-template-columns: repeat(2, minmax(50px, 112px)); place-content: center; gap: 14px; transform: rotate(-10deg); padding: 15px; }
.hero-keys span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 18px; background: #e2edda; color: var(--dark); font: 800 clamp(2rem, 5vw, 4rem) ui-monospace, monospace; border: 1px solid #ecf5e4; box-shadow: 0 7px 0 #5f7865, 0 17px 22px #101f19; }
.hero-keys span:nth-child(2) { background: var(--green); transform: translateY(14px); }
.hero-keys span:nth-child(3) { grid-column: span 2; aspect-ratio: auto; height: 59px; }
main > section:not(.hero) { margin-block: 50px; scroll-margin-top: 16px; }
.section-top { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.muted, .progress { color: var(--muted); margin: 8px 0 0; line-height: 1.55; }
.progress { font-size: .88rem; font-weight: 700; }
.studio, .games article, .guide, .policy { background: var(--white); border: 1px solid var(--line); border-radius: 17px; }
.studio { overflow: hidden; }
.modes { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px clamp(12px, 3vw, 26px); background: #edf2e8; border-bottom: 1px solid var(--line); }
.modes button, .tracks button { background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: 8px; padding: 8px 12px; font-weight: 700; }
.modes button[aria-pressed="true"] { background: var(--white); border-color: var(--line); }
.work { padding: clamp(13px, 3vw, 28px); }
.exercise-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.exercise-head .eyebrow { color: #416540; }
.stats { display: flex; gap: 8px; }
.stats div { min-width: 66px; text-align: center; background: #edf2e8; border-radius: 8px; padding: 7px; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: 1.18rem; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .72rem; }
#duration-box, #custom-form { margin-top: 14px; }
select, textarea { border-radius: 8px; border: 1px solid #b2c3b2; padding: 8px 10px; background: #fff; color: var(--ink); }
textarea { display: block; width: 100%; resize: vertical; margin: 7px 0; }
#typing { font: 1rem/1.45 ui-monospace, monospace; }
#prompt { position: relative; white-space: pre-wrap; overflow-wrap: anywhere; margin: 18px 0 10px; padding: 16px; border-radius: 10px; min-height: 84px; max-height: 224px; overflow: auto; background: #f0f3ea; color: #546458; font: 1.13rem/1.8 ui-monospace, monospace; }
#prompt .correct { color: #205c36; }
#prompt .wrong { color: #9c1d22; background: #ffdbd9; text-decoration: underline; }
#prompt .current { color: #17342e; background: #c5ed91; box-shadow: -2px 0 #377346; }
#prompt [data-newline]::before { content: attr(data-newline); }
#result { min-height: 1.25em; font-weight: 700; margin: 10px 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toggle { margin-left: auto; color: var(--muted); font-size: .9rem; }
.toggle input { accent-color: #416540; }
#keyboard { margin: 20px auto 0; max-width: 610px; display: grid; gap: 4px; }
.key-row { display: flex; justify-content: center; gap: 4px; }
.key-row span { display: grid; place-items: center; flex: 0 1 38px; min-width: 0; min-height: 31px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 5px; background: #f5f7f0; font: 700 clamp(.61rem, 2vw, .85rem) ui-monospace, monospace; }
.key-row .home { border-bottom-color: #8ba887; }
.key-row .space { flex-basis: 160px; }
.key-row .active { background: var(--green); border-color: #a5cf66; }
.tracks { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.tracks button { background: #eef1e9; border-color: var(--line); }
.tracks button[aria-pressed="true"] { background: var(--dark); color: #fff; border-color: var(--dark); }
.lesson-list, .games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lesson-list button { text-align: left; padding: 13px; min-height: 85px; background: #fff; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); }
.lesson-list button:hover { border-color: #668765; }
.lesson-list small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.4; }
.games article, .guide, .policy { padding: clamp(16px, 3vw, 28px); }
.games article { display: flex; flex-direction: column; align-items: flex-start; }
.games p, .guide p, .policy p { color: var(--muted); line-height: 1.6; }
.games .button { margin-top: auto; }
.tile-icon { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 12px; border-radius: 9px; background: #e5f4d3; font-weight: 850; }
details { padding: 12px 0; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; }
.policy h2 { margin-top: 24px; font-size: 1.4rem; }
.ad { margin: 48px 0; padding: 16px; border: 1px solid var(--line); }
.ad p { color: var(--muted); text-align: center; font-size: .75rem; }
footer { border-top: 1px solid var(--line); }
footer button { border: 0; background: transparent; color: var(--ink); padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-keys { grid-template-columns: repeat(2, 48px); padding: 8px; }
  .hero-keys span { border-radius: 9px; }
  .hero-keys span:nth-child(3) { height: 32px; }
  .lesson-list, .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
  .wrap { width: calc(100% - 24px); }
  .hero { grid-template-columns: 1fr; min-height: auto; margin-top: 20px; }
  .hero-keys { display: none; }
  .top-inner { min-height: 56px; gap: 8px; }
  nav { gap: 9px; }
  nav a { font-size: .77rem; }
  .brand span { width: 26px; height: 26px; margin-right: 1px; }
  .games { grid-template-columns: 1fr; }
  .toggle { margin-left: 0; }
}
@media (max-width: 360px) {
  .top-inner { flex-wrap: wrap; padding-block: 8px; }
}
