@font-face {
  font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("./fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("./fonts/plex-mono-latin.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --page: #fbfafc;
  --paper: #ffffff;
  --ink: #24212a;
  --muted: #635f6c;
  --line: #dedbe4;
  --purple: #6238c5;
  --purple-dark: #462092;
  --lavender: #eee9ff;
  --green: #1c6542;
  --red: #973342;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, dl, dd, pre { margin: 0; }
button, a { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid #824bec; outline-offset: 3px; }
[hidden] { display: none !important; }
.icon { display: inline-block; flex: none; width: 18px; height: 18px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 9px 15px; border-radius: 5px; background: var(--paper); color: var(--purple-dark); }
.shell { width: min(1170px, calc(100% - 64px)); margin-inline: auto; }

.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: clamp(24px, 4vw, 58px); min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; }
.brand, .playground, .header-nav a { text-decoration: none; }
.brand { font-size: 20px; font-weight: 760; letter-spacing: -.045em; white-space: nowrap; }
.brandmark {
  position: relative; display: inline-block; flex: none; width: 29px; height: 29px;
  background: var(--purple); clip-path: polygon(0 0, 100% 0, 52% 50%, 100% 100%, 0 100%);
}
.brandmark::after {
  content: ""; position: absolute; inset: 0; background: #9e72f6;
  clip-path: polygon(0 0, 85% 0, 0 86%);
}
.header-nav { display: flex; align-self: stretch; align-items: stretch; gap: 26px; }
.track-tabs { display: flex; align-items: stretch; gap: 24px; }
.header-nav a, .header-nav button {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  border: 0; padding: 0; background: transparent; font-size: .88rem; font-weight: 580;
  color: var(--muted);
}
.header-nav .active { color: var(--purple-dark); }
.header-nav .active::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: var(--purple); }
.header-nav :is(a,button):hover { color: var(--purple-dark); }
.playground {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  margin-left: auto; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper); font-size: .83rem; font-weight: 650;
}
.playground:hover, .secondary:hover:enabled { border-color: #aaa0bd; background: #f6f3fa; }

.hero {
  position: relative; isolation: isolate; display: flex; align-items: center; overflow: hidden;
  min-height: 240px; padding: clamp(26px, 2.45vw, 32px) clamp(27px, 4.3vw, 60px);
  margin-block: 25px 32px; border-radius: 20px; background: var(--lavender);
}
.hero-copy { position: relative; z-index: 1; width: 67%; }
.hero h1 { font-size: clamp(2.75rem, 5.25vw, 4.6rem); line-height: 1.06; letter-spacing: -.06em; font-weight: 735; }
.hero h1 em { color: var(--purple); font-style: normal; }
.hero-copy > p { max-width: 560px; margin-top: 13px; font-size: clamp(.95rem, 1.28vw, 1.06rem); color: #50475f; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 23px; margin-top: 21px; padding: 0; list-style: none; }
.hero-meta li { display: flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 630; color: #493d5e; }
.hero-meta .icon { width: 16px; height: 16px; }
.hero-visual {
  position: absolute; inset: 0 2% 0 auto;
  width: 36%; pointer-events: none;
}
#hero-art {
  display: block; height: 100%; width: 100%; object-fit: contain; filter: brightness(1.012);
  mask-image: radial-gradient(ellipse 55% 84% at 50% 50%, #000 62%, transparent 100%);
}

.learning-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); align-items: start; gap: clamp(24px, 3.2vw, 44px); }
.curriculum { padding: 11px 0 0; }
.curriculum-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.curriculum h2 { font-size: 1.13rem; line-height: 1.3; letter-spacing: -.035em; font-weight: 710; }
.menu-toggle { display: none; }
.progress-line { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 7px; font-size: .77rem; color: var(--muted); }
.progress-line strong { color: var(--purple-dark); font-weight: 680; }
#progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; border-radius: 3px; overflow: hidden; color: var(--purple); background: #e8e4ec; }
#progress::-webkit-progress-bar { background: #e8e4ec; }
#progress::-webkit-progress-value { background: var(--purple); border-radius: 3px; }
#progress::-moz-progress-bar { background: var(--purple); border-radius: 3px; }
.lesson-list { margin-top: 19px; padding: 0; list-style: none; }
.lesson-list li + li { margin-top: 2px; }
#lesson-list { margin-top: 17px; }
.course-level { border-top: 1px solid var(--line); }
.course-level > summary {
  display: flex; align-items: center; gap: 7px; min-height: 45px; padding: 5px 2px;
  list-style: none; cursor: pointer; font-size: .83rem; font-weight: 670;
}
.course-level > summary::-webkit-details-marker { display: none; }
.course-level > summary .icon { width: 15px; height: 15px; transform: rotate(-90deg); color: var(--muted); }
.course-level[open] > summary .icon { transform: none; }
.level-count { margin-left: auto; color: var(--muted); font: .72rem var(--mono); }
.course-level .lesson-list { margin: 0 0 9px; }
.lesson-link {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 45px;
  padding: 7px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  text-align: left; line-height: 1.3; font-size: .86rem; font-weight: 540;
}
.lesson-link:hover { background: #f1eef4; }
.lesson-num { display: grid; place-items: center; min-width: 23px; height: 23px; color: #6c6676; font: 500 .72rem var(--mono); }
.lesson-name { flex: 1; }
.lesson-end { display: grid; place-items: center; color: var(--green); }
.lesson-end:empty { display: none; }
.lesson-end .icon { width: 16px; height: 16px; }
.lesson-link[aria-current="step"] { background: #efe8ff; color: var(--purple-dark); font-weight: 710; }
.lesson-link[aria-current="step"] .lesson-num { color: var(--purple); }
.lesson-link[aria-current="step"] .lesson-end { color: var(--purple); }

.lesson-card {
  min-width: 0; scroll-margin-top: 15px; padding: clamp(22px, 2.8vw, 38px);
  border: 1px solid var(--line); border-radius: 16px; background: var(--paper);
}
.lesson-meta { display: flex; align-items: center; gap: 8px; color: var(--purple); font: 650 .71rem/1.45 var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.lesson-heading h2 { margin-top: 5px; font-size: clamp(1.65rem, 2.55vw, 2.35rem); letter-spacing: -.047em; line-height: 1.16; font-weight: 730; text-wrap: balance; }
#lesson-summary { margin-top: 10px; font-size: .96rem; color: var(--muted); line-height: 1.65; }
.lesson-card :not(pre) > code, .memo-list code { border-radius: 4px; background: #f0eafa; color: #523284; padding: .08em .28em; font-family: var(--mono); font-size: .9em; }
.editor { overflow: hidden; margin-top: 22px; border: 1px solid #2d2839; border-radius: 10px; background: #24212d; color: #f2ecfb; }
.editor-head, .console-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: 16px; }
.editor-head { min-height: 43px; background: #302b3b; border-bottom: 1px solid #41394d; }
.file-tab, .console-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.file-tab { color: #eee6fb; font: 500 .77rem/1.4 var(--mono); }
.file-tab .icon { color: #ba99fd; width: 15px; height: 15px; }
.icon-button, .console-bar button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 42px; border: 0; border-radius: 5px; background: transparent; }
.icon-button { min-width: 42px; padding: 4px 6px; }
.editor-head .icon-button { color: #d8cfe4; font-size: .77rem; }
.editor-head button:hover, .console-bar button:hover { color: #fff; background: #43394f; }
#source { overflow-x: auto; padding: 15px 14px 16px 0; scrollbar-width: thin; }
#source, #console-output pre { font: 400 .88rem/1.7 var(--mono); tab-size: 4; }
#source > code { display: block; min-width: max-content; font: inherit; }
#source > code:has(.line) { white-space: normal; }
#source > code:not(:has(.line)) { padding-left: 18px; }
.line { display: flex; align-items: baseline; }
.line-number { flex: none; width: 44px; padding-right: 15px; color: #a89db8; font-size: .73rem; text-align: right; user-select: none; }
.line-code { white-space: pre; }
.kw { color: #d3a7ff; }
.fn { color: #a6c6ff; }
.str { color: #a7e0ba; }
.num { color: #ffcb98; }
.lit { color: #e5acdc; }
.comment { color: #b6aabf; }
.console-bar { min-height: 43px; border-top: 1px solid #443b50; background: #2a2633; color: #ddd5e9; }
.console-bar > span { font: 500 .75rem var(--mono); }
.console-bar > button { color: #ddc9ff; padding: 4px 7px; font-size: .77rem; font-weight: 600; }
.console-bar .icon { width: 15px; height: 15px; }
#console-output { padding: 11px 17px 14px; border-top: 1px solid #42394d; }
#console-output pre { overflow-x: auto; color: #c6e8cd; }

.quiz { margin-top: 24px; }
.quiz h3 { font-size: 1.11rem; line-height: 1.4; letter-spacing: -.026em; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px,100%),1fr)); gap: 9px; margin-top: 12px; }
.option {
  display: flex; align-items: center; gap: 9px; min-height: 49px; min-width: 0; padding: 8px 12px;
  border: 1px solid #d9d5e0; border-radius: 8px; background: #fff; font-size: .86rem; text-align: left;
}
.option:not([data-state]):hover:enabled { border-color: #a582df; background: #f9f6ff; }
.choice-letter {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 5px;
  background: #f0edf5; color: #51485f; font: 650 .74rem var(--mono);
}
.choice-text { min-width: 0; overflow-wrap: anywhere; }
.option[data-state="correct"] { border-color: #74a98e; background: #eef8f1; }
.option[data-state="wrong"] { border-color: #ce929d; background: #fff3f5; }
.option[data-state="correct"] .choice-letter { color: #fff; background: var(--green); }
.option[data-state="wrong"] .choice-letter { color: #fff; background: var(--red); }
.feedback { margin-top: 12px; padding: 10px 13px; border-left: 3px solid; line-height: 1.55; font-size: .88rem; }
.feedback:empty { display: none; }
.feedback[data-state="correct"] { background: #eef8f1; color: var(--green); }
.feedback[data-state="wrong"] { background: #fff3f5; color: var(--red); }
.lesson-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.primary, .secondary, .menu-toggle {
  min-height: 43px; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px;
  border: 1px solid transparent; border-radius: 8px; font-size: .84rem; font-weight: 650;
}
.primary, .secondary { display: inline-flex; }
.primary { margin-left: auto; background: var(--purple); color: #fff; }
.primary:hover:enabled { background: var(--purple-dark); }
.secondary, .menu-toggle { background: var(--paper); border-color: var(--line); }
.primary:disabled, .secondary:disabled { background: #f3f1f5; color: #706a78; border-color: #e2dee7; }
.site-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-block: 34px 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.site-footer a { text-underline-offset: .19em; }

.sheet {
  width: min(590px, calc(100% - 32px)); max-height: min(85vh, 700px); padding: clamp(20px, 4vw, 34px);
  overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--paper);
  box-shadow: 0 18px 76px #1d132b38;
}
.sheet::backdrop { background: rgb(27 21 37 / .42); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 1.65rem; line-height: 1.2; letter-spacing: -.05em; }
.sheet-head .icon-button:hover { background: #f1eef5; }
#sheet-content > h3 { margin-top: 18px; font-size: 1.2rem; letter-spacing: -.025em; }
#sheet-content > p { margin-block: 12px 18px; color: var(--muted); }
.copy-field { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font: .86rem/1.55 var(--mono); resize: vertical; }
.memo-list { margin-top: 12px; }
.memo-list dt { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); font-weight: 670; }
.memo-list dd { margin-top: 4px; font-size: .9rem; color: var(--muted); }

@media (max-width: 950px) {
  .shell { width: calc(100% - 44px); }
  .learning-layout { grid-template-columns: 208px minmax(0,1fr); gap: 22px; }
  .options { grid-template-columns: 1fr; }
  .hero { min-height: 216px; }
}
@media (max-width: 750px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 61px; gap: 18px; }
  .header-nav { gap: 15px; }
  .hero { margin-block: 17px 17px; min-height: 193px; }
  .hero h1 { font-size: clamp(2.35rem, 6.9vw, 3.25rem); }
  .hero-copy { width: 72%; }
  .hero-meta { gap: 4px 13px; margin-top: 15px; }
  .hero-visual { right: 0; width: 29%; }
  .learning-layout { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .curriculum { padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
  .curriculum-head { min-height: 54px; }
  .menu-toggle { display: inline-flex; border: 0; color: var(--purple-dark); }
  .menu-toggle:hover { background: #f5f1fa; }
  .curriculum:not([data-open="true"]) #curriculum-body { display: none; }
  .curriculum:has(.menu-toggle[aria-expanded="true"]) #curriculum-body { display: block; }
  #curriculum-body { padding: 0 0 13px; }
  .progress-line { margin-top: 3px; }
  .lesson-list { margin-top: 12px; }
  .options { grid-template-columns: repeat(auto-fit, minmax(min(145px,100%),1fr)); }
}
@media (max-width: 530px) {
  .brand { font-size: 17px; gap: 7px; }
  .brandmark { width: 24px; height: 24px; }
  .header-inner { flex-wrap: wrap; gap: 0 12px; }
  .header-nav { order: 3; flex-basis: 100%; gap: 22px; }
  .header-nav a, .header-nav button { min-height: 42px; }
  .playground { min-height: 41px; padding: 0 9px; margin-block: 4px; }
  .hero { padding: 22px; border-radius: 15px; }
  .hero-copy { width: 100%; }
  .hero h1 { max-width: 76%; }
  .hero h1 em { white-space: nowrap; }
  .hero-copy > p { max-width: 100%; margin-top: 11px; }
  .hero-meta { margin-top: 14px; }
  .hero-visual { top: 4px; right: -7px; bottom: auto; height: 84px; width: 25%; }
  .lesson-card { padding: 20px 16px; border-radius: 12px; }
  .options { grid-template-columns: minmax(0,1fr); }
  .site-footer { display: grid; }
}
@media (max-width: 360px) {
  .shell { width: calc(100% - 22px); }
  .hero { padding: 17px; }
  .hero h1 { font-size: 2.12rem; }
  .lesson-card { padding: 17px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}

.android-mode .hero { background: #e6f4ee; }
.android-mode .hero h1 em { color: #176448; }
.android-mode .hero-meta li, .android-mode .hero-copy > p { color: #36564b; }
#android-art { height: 100%; display: grid; place-items: center; }
.device {
  width: 144px; height: 197px; display: flex; flex-direction: column; align-items: center;
  padding: 7px; border: 4px solid #234d41; border-radius: 22px; background: #f9fffc;
  transform: rotate(6deg); box-shadow: 5px 6px 0 #97cdb8;
}
.device i:first-child { display: block; width: 6px; height: 6px; border-radius: 50%; background: #526e62; }
.device i:last-child { width: 32px; height: 3px; margin-top: auto; border-radius: 3px; background: #719687; }
.device-content { align-self: stretch; margin: 18px 5px; }
.device-content b { display: block; margin-bottom: 13px; letter-spacing: .07em; color: #196d4f; font-size: .65rem; }
.device-content span { display: block; font: .72rem/1.8 var(--mono); color: #26483a; }
#lesson-context { margin-top: 12px; font-size: .84rem; color: var(--muted); }
#lesson-context:not([hidden]) + .editor { margin-top: 12px; }
.android-mode #console-output pre { white-space: pre-wrap; overflow-wrap: anywhere; }
#project-practice { margin-top: 14px; font-size: .86rem; }
#project-practice summary { padding-block: 10px; color: var(--purple-dark); font-weight: 650; cursor: pointer; }
#project-practice p { padding: 0 0 7px; color: var(--muted); }
@media (max-width: 750px) {
  .track-tabs { gap: 15px; }
  .device { width: 108px; height: 151px; border-radius: 17px; }
  .device-content { margin: 11px 1px; }
  .device-content span { font-size: .56rem; }
}
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; gap: 0 12px; }
  .header-nav { order: 3; flex-basis: 100%; gap: 20px; }
  .header-nav a, .header-nav button { min-height: 44px; }
  .track-tabs { gap: 20px; }
}
@media (max-width: 530px) {
  .device { width: 46px; height: 66px; border-width: 2px; padding: 3px; border-radius: 8px; box-shadow: 2px 3px 0 #97cdb8; }
  .device i:first-child { width: 3px; height: 3px; }
  .device i:last-child { width: 13px; height: 2px; }
  .device-content { margin: 7px 1px; }
  .device-content b { font-size: 4px; margin-bottom: 4px; }
  .device-content span { font-size: 3.7px; }
  .track-tabs { gap: 17px; }
}
