:root {
  color-scheme: light;
  --page: #f5f5f5;
  --paper: #fff;
  --ink: #212121;
  --muted: #585858;
  --soft: #5d5d5d;
  --line: #e1e1e1;
  --forest: #292929;
  --action: #d3d3d3;
  --dark: #202020;
  --dark-line: #3f3f3f;
  --sans: Inter, "Noto Sans Thai", system-ui, sans-serif;
  --mono: "Geist Mono", "Noto Sans Thai", ui-monospace, Consolas, monospace;
  font-family: var(--sans);
  font-feature-settings: "cv01", "ss03";
  font-synthesis: none;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 1rem; line-height: 1.625; }
h1, h2, h3, p, pre { margin: 0; }
h1, h2, h3 { font-weight: 550; text-wrap: balance; }
p { max-inline-size: 42rem; text-wrap: pretty; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, .sample-code:focus-visible { outline: 2px solid #616161; outline-offset: 3px; }
.lab button:focus-visible { outline-color: var(--action); }
.ph { display: inline-block; flex: none; line-height: 1; vertical-align: -0.1em; }
code, pre, kbd, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
::selection { color: #202020; background: #d8d8d8; }

.shell { width: min(100% - 5rem, 80rem); margin-inline: auto; }
.topbar { background: #fbfbfb; border-block-end: 1px solid #e3e3e3; }
.topbar-row { min-height: 4.4rem; padding-block: .55rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 590; font-size: 1.5rem; line-height: 1.75rem; letter-spacing: -.022em; }
.brand-mark { display: grid; place-items: center; inline-size: 2.42rem; block-size: 2.42rem; border-radius: .76rem; background: var(--action); font-size: 1.45rem; }
.brand-accent { color: #4c4c4c; }
.course-progress { display: flex; align-items: center; gap: .65rem; color: #505050; font-size: .875rem; line-height: 1.42rem; }
.course-progress > .ph { font-size: 1.13rem; }
.progress-track { display: flex; gap: .22rem; }
.progress-track span { width: .45rem; height: .34rem; border-radius: 1rem; background: #e0e0e0; }
.progress-track .filled { background: #6b6b6b; }
#progress-text { min-inline-size: 2.7rem; text-align: end; font-size: .8125rem; line-height: 1.25rem; color: #474747; }

.hero { position:relative; isolation:isolate; overflow:hidden; display:flex; align-items:center; min-height:11.8rem; margin-block:1.3rem 0; border-radius:.9rem; color:white; background:#151515; }
.hero-copy { position:relative; z-index:1; padding:1.7rem 2.2rem; }
.course-tag { display:flex; align-items:center; gap:.55rem; color:#d1d1d1; font-size:.8rem; }
.ts-mark { display:inline-grid; place-items:center; min-width:1.45rem; height:1.35rem; border:1px solid #777; border-radius:.25rem; font:600 .66rem/1 var(--mono); }
.hero h1 { margin:.38rem 0; font:650 clamp(2.5rem,5.2vw,4.65rem)/1.06 var(--sans); letter-spacing:-.07em; }
.hero h1 span { color:#aaa; }
.hero p { font-size:.94rem; color:#d2d2d2; }
.wire-art { position:absolute; top:50%; right:2%; width:43%; height:100%; transform:translateY(-50%); }
.wire-art i { position:absolute; top:50%; left:calc(11% + var(--n)*2.35%); width:33%; height:79%; border:1px solid #aaa; border-radius:50%; transform:translate(-50%,-50%) rotate(calc(-51deg + var(--n)*3.8deg)) skewY(-15deg); }
.navigation { position:relative; display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 0; border-bottom:1px solid var(--line); }
.syllabus summary { display:flex; align-items:center; gap:.55rem; cursor:pointer; font-weight:600; padding:.45rem .75rem; border:1px solid #ccc; background:white; border-radius:.5rem; list-style:none; }
.syllabus summary::-webkit-details-marker { display:none; }
.syllabus summary::after { content:""; width:.48rem; height:.48rem; margin:-.22rem .1rem 0 .25rem; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(45deg); }
.syllabus[open] summary::after { transform:rotate(225deg); margin-top:.22rem; }
.syllabus[open] .lesson-list { display:grid; position:absolute; z-index:3; right:0; top:calc(100% - .4rem); width:min(100%,55rem); padding:.8rem; background:white; border:1px solid #c9c9c9; border-radius:.75rem; box-shadow:0 1rem 2.5rem #0002; grid-template-columns:repeat(4,minmax(0,1fr)); max-height:55vh; overflow:auto; }
.position { color: var(--soft); font: .8125rem/1.32rem var(--sans); font-variant-numeric: tabular-nums; }
.lesson-list { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: .55rem; }
.courses { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1rem; padding-block-end: 1rem; margin-block-end: .91rem; border-block-end: 1px solid var(--line); }
.courses h2 { display: flex; align-items: center; gap: .48rem; font-size: 1.05rem; line-height: 1.55rem; }
.courses h2 .ph { color: #585858; font-size: 1.21rem; }
.course-list { display: flex; gap: .47rem; flex-wrap: wrap; }
.course-option { display: inline-flex; align-items: center; gap: .49rem; padding: .3rem .72rem .3rem .42rem; border: 1px solid var(--line); border-radius: .55rem; background: #fbfbfb; color: #3e3e3e; font-size: .875rem; font-weight: 550; line-height: 1.4rem; }
.course-option:hover:not(:disabled) { border-color: #949494; background: #f0f0f0; }
.course-option[aria-pressed="true"] { border-color: #545454; background: #3b3b3b; color: #f4f4f4; }
.course-option:disabled { opacity: .56; }
.course-symbol { display: grid; place-items: center; min-width: 1.6rem; min-height: 1.52rem; border-radius: .32rem; font: 550 .68rem/1rem var(--mono); }
.symbol-rust { background: #d7d7d7; color: #3b3b3b; }
.symbol-go { background: #dfdfdf; color: #474747; }
.symbol-next { background: #e0e0e0; color: #343434; }
.lesson-button { min-width: 0; min-height: 2.85rem; display: flex; align-items: center; gap: .57rem; padding: .42rem .65rem; background: #fcfcfc; border: 1px solid var(--line); border-radius: .68rem; color: #3f3f3f; font-size: .875rem; line-height: 1.38rem; font-weight: 510; text-align: start; transition: background .15s, border-color .15s; }
.lesson-button:hover { background: #f1f1f1; border-color: #b3b3b3; }
.lesson-button[aria-current="step"] { background: #ebebeb; color: #343434; border-color: #8e8e8e; box-shadow: inset 0 0 0 1px #9b9b9b; }
.lesson-step { flex: none; display: grid; place-items: center; padding: .19rem; min-inline-size: 1.6rem; min-block-size: 1.6rem; border-radius: .44rem; color: #545454; background: #efefef; font: 500 .715rem/1 var(--mono); }
.lesson-button[aria-current="step"] .lesson-step { background: #484848; color: #fafafa; }
.lesson-button.passed .lesson-step { background: #d7d7d7; color: #3e3e3e; }
.lesson-button.passed[aria-current="step"] .lesson-step { background: #484848; color: #fafafa; }

.workspace { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 1.05rem; align-items: stretch; margin-block: 1.02rem .55rem; }
.lesson-card { min-width: 0; background: var(--paper); border: 1px solid #e1e1e1; border-radius: 1rem; box-shadow: 0 .15rem .4rem #2a2a2a07; }
.lesson-inner { padding: 1.4rem; }
.lesson-kicker { display: flex; align-items: center; gap: .38rem; color: #5b5b5b; font-size: .8125rem; line-height: 1.3rem; font-weight: 510; }
.lesson-kicker .ph { font-size: 1rem; }
.lesson-card h2 { margin-block: .38rem .39rem; font-size: 1.5rem; line-height: 2rem; letter-spacing: -.0125em; }
.lesson-card p { color: var(--muted); overflow-wrap: anywhere; }
.lesson-card p code, .lesson-card li code { color: #464646; background: #f1f1f1; padding: .11em .25em; border-radius: .22rem; font-size: .8125em; line-height: 0; }
.sample { overflow: hidden; margin-block: 1.12rem 1rem; border: 1px solid #e2e2e2; border-radius: .68rem; background: #f7f7f7; }
.sample-bar, .console-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; min-height: 2.52rem; padding: .24rem .77rem; border-block-end: 1px solid #e3e3e3; font-size: .875rem; line-height: 1.4rem; }
.sample-bar > span { display: flex; align-items: center; gap: .39rem; font-weight: 510; color: #505050; }
.sample-bar .ph, .console-bar .ph { font-size: 1rem; }
.plain-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .24rem .35rem; white-space: nowrap; color: #565656; background: transparent; border: 0; border-radius: .35rem; font-size: .875rem; line-height: 1.35rem; }
.plain-btn:hover { background: #e9e9e9; }
.sample-code { overflow: auto; padding: .68rem .88rem; color: #404040; font: .8125rem/1.4rem var(--mono); tab-size: 2; }
.sample-code code { font: inherit; }
.lesson-walkthrough { margin-block: .25rem 1rem; color: #404040; }
.lesson-walkthrough summary { cursor: pointer; width: fit-content; font-weight: 550; }
.lesson-walkthrough ol { margin: .4rem 0 0; padding-inline-start: 1.35rem; }
.lesson-walkthrough li + li { margin-block-start: .25rem; }
#expected-output { margin-block: .35rem .5rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: .84rem/1.45 var(--mono); }
.token-comment { color: #5e5e5e; }
.token-keyword { color: #5f5f5f; }
.token-string { color: #535353; }
.token-number { color: #565656; }
.token-function { color: #4e4e4e; }
.exercise { display: flex; align-items: start; gap: .7rem; padding: .88rem; background: #f2f2f2; border: 1px solid #e3e3e3; border-radius: .65rem; }
.exercise-icon { flex: none; display: grid; place-items: center; width: 1.87rem; height: 1.87rem; background: #e3e3e3; color: #565656; border-radius: .47rem; font-size: 1.1rem; }
.exercise-content { min-width: 0; }
.exercise h3 { font-size: 1rem; line-height: 1.5rem; }
.exercise p { margin-block: .17rem .42rem; font-size: .9375rem; line-height: 1.5rem; }
.exercise details { margin-block: .25rem .45rem; }
.exercise summary { width: fit-content; cursor: pointer; color: #535353; font-size: .875rem; line-height: 1.38rem; }
.check-button { display: inline-flex; gap: .36rem; align-items: center; padding: .26rem .6rem; background: #fff; border: 1px solid #b6b6b6; border-radius: .38rem; color: #484848; font-size: .875rem; line-height: 1.38rem; font-weight: 510; }
.check-button:hover { background: #eaeaea; }
.check-button:disabled { opacity: .65; }
#assessment { margin-block: .48rem 0; color: #444444; }
#assessment.passed { color: #494949; }

.lab { display: flex; flex-direction: column; min-width: 0; min-height: 29.5rem; overflow: hidden; border-radius: 1rem; background: var(--dark); border: 1px solid #313131; color: #f0f0f0; box-shadow: 0 .15rem .5rem #1919191a; }
.lab-top { min-height: 3.65rem; display: flex; justify-content: space-between; align-items: center; gap: .46rem; padding: .55rem .85rem .55rem .98rem; background: #303030; border-block-end: 1px solid #474747; }
.lab-heading, .lab-actions { display: flex; align-items: center; }
.lab-heading { gap: .55rem; }
.lab-heading .ph { color: #cacaca; font-size: 1.25rem; }
.lab-heading h2 { font-size: 1rem; line-height: 1.5rem; }
.lab-actions { gap: .46rem; }
.reset-button, .run-button { display: inline-flex; justify-content: center; align-items: center; gap: .39rem; flex: none; min-height: 2.28rem; border-radius: .46rem; font-size: .875rem; line-height: 1.4rem; font-weight: 550; white-space: nowrap; }
.reset-button { width: 2.28rem; padding: .28rem; color: #e2e2e2; background: #3c3c3c; border: 1px solid #5e5e5e; }
.reset-button:hover { background: #4d4d4d; }
.reset-button .ph { font-size: 1.14rem; }
.run-button { padding: .32rem .73rem; color: #2d2d2d; background: var(--action); border: 1px solid #e3e3e3; }
.run-button:hover:not(:disabled) { background: #e5e5e5; }
.run-button:disabled { opacity: .69; }
.run-button .ph { font-size: 1rem; }
.editor-tabbar { display: flex; align-items: center; justify-content: space-between; min-height: 2.36rem; background: #272727; border-block-end: 1px solid var(--dark-line); font: .8125rem/1.25rem var(--mono); }
.file-tab { display: flex; gap: .47rem; align-items: center; align-self: stretch; padding: .34rem .9rem; color: #f0f0f0; background: #202020; border-block-start: 2px solid #bcbcbc; border-inline-end: 1px solid var(--dark-line); }
.editor-language { padding-inline-end: .92rem; color: #c5c5c5; font: .75rem/1.25rem var(--mono); }
.editor { display: grid; grid-template-columns: 2.85rem minmax(0, 1fr); position: relative; flex: 1; min-height: 12.85rem; background: #202020; }
.editor:focus-within { box-shadow: inset 0 0 0 1px #8d8d8d; }
.editor-gutter { position: relative; overflow: hidden; text-align: end; }
.editor-gutter pre { padding: .76rem .8rem .76rem .2rem; font: .845rem/1.43rem var(--mono); color: #adadad; }
.editor-body, .highlight-window { position: relative; min-width: 0; overflow: hidden; }
.highlight-window, #editor { position: absolute; inset: 0; }
#editor-highlight, #editor { margin: 0; padding: .76rem .8rem .76rem 0; border: 0; border-radius: 0; font: .845rem/1.43rem var(--mono); font-variant-ligatures: none; letter-spacing: normal; white-space: pre; tab-size: 2; }
#editor-highlight { width: max-content; min-width: 100%; color: #eeeeee; }
#editor { resize: none; width: 100%; height: 100%; outline: 0; background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: #e5e5e5; overflow: auto; scrollbar-color: #6d6d6d #202020; }
#editor::selection { color: transparent; background: #dfdfdf3d; }
.lab .token-comment { color: #b3b3b3; }
.lab .token-keyword { color: #cccccc; }
.lab .token-string { color: #d9d9d9; }
.lab .token-number { color: #cdcdcd; }
.lab .token-function { color: #cfcfcf; }
.console { background: #1c1c1c; border-block-start: 1px solid var(--dark-line); }
.console-bar { background: #272727; border-color: var(--dark-line); color: #e8e8e8; padding-inline: .91rem; }
.console-label { display: flex; align-items: center; gap: .45rem; }
.console-label .ph { color: #b7b7b7; }
.console-label h3 { font-size: .875rem; line-height: 1.4rem; }
.console-bar .plain-btn { color: #d9d9d9; }
.console-bar .plain-btn:hover:not(:disabled) { background: #414141; }
.console-bar .plain-btn:disabled { color: #9b9b9b; }
.console-body { min-height: 5.28rem; max-height: 12rem; overflow: auto; padding: .58rem .92rem .65rem; color: #f1f1f1; font: .8125rem/1.35rem var(--mono); overflow-wrap: anywhere; }
.console-body p { max-inline-size: none; white-space: pre-wrap; }
.output-placeholder { color: #bfbfbf; font-family: var(--sans); font-size: .875rem; line-height: 1.38rem; }
.output-placeholder span { color: #cecece; padding-inline-end: .3rem; }
.output-error { color: #d2d2d2; }
.output-warn { color: #dadada; }
.lab-footer { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: .37rem .9rem; min-height: 2.1rem; margin-top: auto; background: #323232; border-block-start: 1px solid #494949; color: #e5e5e5; font-size: .75rem; line-height: 1.15rem; }
#next-preview { display: block; width: calc(100% - 1.8rem); min-height: 10rem; margin: 0 .9rem .8rem; border: 1px solid #646464; border-radius: .55rem; background: white; }
.console:has(#next-preview:not([hidden])) .console-body { min-height: 2.15rem; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-block: .65rem 1.25rem; }
.runner-info { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; }
.runner-note { color: var(--muted); font-size: .8125rem; line-height: 1.42rem; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: .42rem; }
.lesson-actions .course-option { justify-content: center; padding-inline: .67rem; }
.run-state { display: inline-flex; align-items: center; gap: .39rem; }
.state-dot { width: .42rem; height: .42rem; flex: none; border-radius: 50%; background: #c6c6c6; }
.run-state[data-state="error"] .state-dot { background: #bcbcbc; }
.run-state[data-state="busy"] .state-dot { background: #d0d0d0; }
.shortcut { color: #cccccc; white-space: nowrap; }
kbd { padding: .04rem .17rem; border-radius: .22rem; background: #414141; border: 1px solid #5c5c5c; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem 1rem; padding-block: .85rem 1.2rem; border-block-start: 1px solid var(--line); color: var(--soft); font-size: .8125rem; line-height: 1.35rem; }

.topbar { background:white; }
.brand-mark { background:#171717; color:white; border-radius:.55rem; }
.brand { font-weight:680; }
.brand-accent { color:#535353; font-weight:475; }
.courses { border:0; padding:0; margin:0; }
.course-option[aria-pressed="true"], .lesson-button[aria-current="step"] { color:white; background:#181818; border-color:#181818; }
.lesson-button[aria-current="step"] .lesson-step { color:black; background:#eee; }
.course-list .course-option { padding:.42rem .7rem; }
.workspace { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); align-items:start; }
.lesson-inner { padding:clamp(1rem,2.4vw,2rem); }
.lesson-card h2 { font-size:clamp(1.7rem,2.7vw,2.45rem); font-weight:650; line-height:1.3; letter-spacing:-.045em; }
.lab { background:#171717; min-height:32rem; }
.lab-top, .lab-footer { background:#242424; }
.editor, .file-tab { background:#171717; }
.file-tab { border-top-color:white; }
.run-button { background:white; color:#161616; border-color:white; }
.sample-code { padding:1rem; }
.exercise { border:0; border-left:3px solid #292929; border-radius:0 .5rem .5rem 0; }
.token-keyword { font-weight:680; }
.token-comment { font-style:italic; }
.lab .token-keyword { color:white; }
#editor::selection { background:#ffffff42; }
@media (max-width:55rem) {
  .shell { width:calc(100% - 2rem); }
  .courses h2 { display:none; }
  .workspace { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
}
@media (max-width:44rem) {
  .workspace { grid-template-columns:minmax(0,1fr); }
  .hero { min-height:10rem; }
  .hero-copy { padding:1.2rem; }
  .wire-art { right:-12%; opacity:.45; mask-image:linear-gradient(90deg,transparent,#000 60%); }
  .navigation { flex-wrap:wrap; gap:.7rem; }
  .syllabus[open] .lesson-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .editor-gutter pre, #editor-highlight, #editor { font-size:1rem; line-height:1.5rem; }
  .lab { min-height:27rem; }
}
@media (max-width:32rem) {
  .topbar-row { min-height:3.65rem; }
  .brand { font-size:1.16rem; }
  .brand-mark { width:2rem; height:2rem; }
  .progress-track,.progress-label { display:none; }
  .course-list { flex-wrap:nowrap; }
  .navigation > nav, .syllabus summary { width:100%; }
  .syllabus summary .position { margin-left:auto; }
  .hero h1 { font-size:2.7rem; }
  .hero p { max-width:15rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}

.course-list .course-option[aria-pressed="true"]:hover { background:#333; color:white; }

.editor-jump { display:none; }
@media (max-width:44rem) {
  .editor-jump { display:inline-block; padding-top:.65rem; font-size:.86rem; text-underline-offset:.18em; }
}
