:root{color-scheme:light;--ink:#20251f;--muted:#505a51;--line:#cfd5c9;--paper:#f8f9f3;--acid:#d7f562;--green:#384c32;font-family:"DM Sans",system-ui,sans-serif;color:var(--ink);background:var(--paper)}
*{box-sizing:border-box}body{margin:0}a{color:inherit}button,input,select{font:inherit;color:inherit}button,select,summary{cursor:pointer}button,.button,select{border:1px solid var(--line);border-radius:.55rem;padding:.65rem .95rem;background:white}button:disabled{opacity:.45;cursor:default}button:hover:enabled,.filters button[aria-pressed=true]{background:#e4eccd}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #9c5600;outline-offset:3px}.dark,.button.dark,.filters button[aria-pressed=true]{color:white;background:var(--ink)}button.dark:hover:enabled,.button.dark:hover{background:#3c4c34}.wrap{width:min(1180px,92%);margin-inline:auto}header{background:#20251f;color:white}.top,nav,.heading,.paneltitle,.controls,.pager,.qhead,.lessonhead{display:flex;align-items:center;justify-content:space-between;gap:1rem}.top{min-height:68px}.brand,nav a,.button,.card,.qrows a,.feature{text-decoration:none}.brand{display:flex;gap:.65rem;align-items:center;font-size:1.3rem;font-weight:780;letter-spacing:-.055em}.mark{display:grid;place-items:center;transform:rotate(-7deg);width:31px;height:31px;border-radius:8px;background:var(--acid);color:var(--ink);font-size:1.6rem}nav{gap:1.3rem}nav a{font-size:.94rem;padding:.5rem 0;border-bottom:2px solid transparent}nav a[aria-current=page]{border-color:var(--acid)}.hero{display:grid;grid-template-columns:1.12fr 1fr;align-items:center;gap:5%;padding:clamp(24px,4.6vw,64px);margin:2rem 0 0;background:#e9efdb;border:1px solid #ced7be;border-radius:22px}.hero small,small,.tag,.num,.paneltitle span{font-family:"IBM Plex Mono",ui-monospace,monospace}.hero small,small{display:block;font-size:.78rem;letter-spacing:.075em;text-transform:uppercase;font-weight:650;color:#475646}.hero h1,h1,h2,h3,p{margin:0}h1,h2,h3{line-height:1.05;letter-spacing:-.055em}h1{font-size:clamp(2.6rem,5vw,4.4rem)}.hero h1{font-size:clamp(3.25rem,6.4vw,5.7rem);margin:1rem 0}h1 span{color:#678137}.hero p,.intro{font-size:1.09rem;color:var(--muted);line-height:1.55;max-width:48ch}.button{display:inline-block;font-weight:650;margin-top:1.3rem}.feature{display:block;border:1px solid #b7c2ad;border-radius:16px;background:#fff;overflow:hidden;box-shadow:7px 7px 0 #ccd6b8;transform:rotate(1deg)}.feature img{display:block;width:100%;height:clamp(150px,16vw,215px);padding:12px}.feature div{display:flex;align-items:center;justify-content:space-between;padding:.8rem 1rem;border-top:1px solid var(--line)}.feature span{font-size:.85rem;border-radius:20px;background:var(--acid);padding:.32rem .75rem;font-weight:700}.section{padding:2.7rem 0}.heading{align-items:end;flex-wrap:wrap;margin:1rem 0}h2{font-size:clamp(2rem,4vw,3rem);margin:.3rem 0}.search,label{font-size:.88rem;font-weight:650}input:not([type=range]),select{padding:.62rem .7rem;border-radius:.5rem;border:1px solid #bcc5b8;background:#fff;max-width:100%}.search input,.inputs input{display:block;margin-top:.35rem}.filters,.controls{display:flex;gap:.45rem;flex-wrap:wrap;justify-content:flex-start}.filters{margin:1.2rem 0 1.5rem}.filters button{border-radius:24px;padding:.45rem .95rem;font-size:.9rem}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.1rem}.card{border:1px solid var(--line);border-radius:14px;background:white;overflow:hidden;transition:transform .15s}.card:hover{transform:translateY(-3px);border-color:#829776}.art{height:170px;position:relative;background:#f4f6f0;border-bottom:1px solid var(--line);display:grid;place-items:center}.art img{width:90%;height:90%}.art.violet{background:#f2edf9}.art.coral{background:#faf0ec}.art.sky,.art.aqua{background:#edf5f6}.art.amber{background:#faf4e7}.playmark{position:absolute;right:10px;bottom:10px;border-radius:50%;background:white;border:1px solid var(--line);padding:.4rem .55rem;font-size:.72rem}.cardbody{padding:1.1rem}.cardbody h3{font-size:1.35rem;margin:.4rem 0}.cardbody p,.complex p{color:var(--muted);line-height:1.5}.back,.textlink,.practicebox a,.pager a{font-weight:650;text-underline-offset:4px}.back{display:inline-block;margin-bottom:1.4rem}.lessonhead{margin-bottom:1.25rem}.lessonhead h1,.reading h1,.section>h1{margin:.6rem 0}.lessonhead img{width:min(25%,200px);max-height:130px}.studio,.below{display:grid;grid-template-columns:1.12fr 1fr;gap:1rem}.panel,.codepanel,.complex,.practicebox,details{border-radius:14px;border:1px solid var(--line);overflow:hidden}.panel,.practicebox,details{background:white}.paneltitle{padding:1rem;border-bottom:1px solid var(--line)}.paneltitle span{font-size:.82rem}.stage{padding:2rem 1rem 1rem;background:#edf1e4;text-align:center;min-height:180px}.tiles{position:relative;max-width:500px;margin:auto}.tile{position:absolute;transition:left .35s,top .35s,background .22s;display:grid;place-items:center;width:calc(100% / var(--cols) - 3px);height:42px;border-radius:8px;background:white;border:1px solid #b4bfa6;font-size:clamp(.8rem,2.8vw,1.2rem);overflow:hidden}.tile.active{box-shadow:inset 0 0 0 2px #334b20;background:var(--acid)}.tile.hit,.tile.best{background:#ffdc81}.tile.done{background:#cbdae9}.tile.bad{background:#ffb4ac}.tile.miss{color:#60685e}.stage p{margin:.6rem 0;font-weight:600}.stage b#output{font-size:.9rem;color:var(--green)}.controls,.inputs{padding:1rem}.controls button,.controls select{font-size:.88rem}.inputs{display:flex;gap:.8rem;flex-wrap:wrap;align-items:center;border-top:1px solid var(--line)}.inputs label{max-width:100%}.inputs code{overflow-wrap:anywhere}#scrub{display:block;width:calc(100% - 2rem);margin:0 1rem 1rem;accent-color:#547531}.codepanel{background:#232822;color:#e7eee4;min-width:0}.codepanel .paneltitle{border-color:#455040}.codepanel .paneltitle span{color:#c4d79e}pre{margin:0;padding:.8rem 0 1rem;overflow:auto;max-height:420px;line-height:1.65;font-size:.9rem;tab-size:2}.line{display:block;padding:0 1rem;min-width:max-content;border-left:3px solid transparent}.line.current{color:#ebffac;background:#394536;border-left-color:var(--acid)}.below{margin:1rem 0}.complex,.practicebox{padding:1.3rem}.complex{background:#ecf2dd}.below h3{margin:.6rem 0;font-size:1.45rem}.pager{padding-top:1.5rem;border-top:1px solid var(--line);margin-top:1.5rem}.qrows{background:white;border:1px solid var(--line);border-radius:12px;overflow:hidden}.qrows a{display:grid;grid-template-columns:3ch 1fr auto;align-items:center;gap:1rem;padding:1.05rem;border-bottom:1px solid var(--line)}.qrows a:hover{background:#f2f6e9}.qrows a:last-child{border:0}.qrows strong{display:block;margin-top:.35rem}.num{color:#65785a}.reading{max-width:800px;margin:2.5rem auto 5rem}.qhead{justify-content:flex-start}.tag{background:#e1eacb;border-radius:18px;padding:.35rem .75rem;font-size:.85rem}.reading h1{font-size:clamp(2.1rem,4vw,3.4rem);margin:1rem 0}.reading details{margin:2rem 0 1rem;padding:1rem}.reading details summary{font-weight:700}.reading details>p{line-height:1.65;margin:.9rem 0}.reading .complex{padding:.85rem}.intro{margin:.7rem 0}footer{border-top:1px solid var(--line);padding:1.3rem 0 2.5rem;font-weight:700}footer span{float:right;color:var(--muted);font-weight:400}
@media(max-width:820px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.studio{grid-template-columns:1fr}.hero{gap:1rem}.hero h1{font-size:3.5rem}}
@media(max-width:600px){.top{min-height:60px}.brand{font-size:1.1rem}nav{gap:.75rem}nav a{font-size:.83rem}.hero,.below,.grid{grid-template-columns:1fr}.hero{margin-top:1rem;padding:1.35rem}.hero h1{font-size:3.2rem}.feature{margin:.4rem .2rem}.feature img{height:140px}.section{padding:1.7rem 0}.lessonhead{display:block}.lessonhead img{width:100%;max-height:110px;margin-top:.5rem}.art{height:185px}.search{width:100%}.search input{width:100%}.controls{gap:.3rem}.controls button,.controls select{padding:.55rem .6rem}.stage{padding:1.2rem .45rem}.reading{margin:1.4rem auto 3rem}.qrows a{gap:.55rem}.wrap{width:92%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}

.resources{display:flex;flex-wrap:wrap;gap:1.25rem;margin:1rem 0;font-weight:650;text-underline-offset:4px}
@media(max-width:420px){.top{flex-wrap:wrap;gap:.15rem;padding:.55rem 0}.top nav{min-height:32px;gap:1rem}.top nav a{padding:.3rem 0}}

/* ── "Visualized" design language · light mode ─────────────────────────
   Same anatomy as the dark reference (gradient-edged regions, floating tab
   labels, monospace chips) re-tuned for white paper and AA contrast. */
.visual-page, .v-shelf {
  --v-paper: #ffffff; --v-canvas: #f6f7fb; --v-panel: #ffffff; --v-chip: #f1f3f8;
  --v-line: #dfe3ec; --v-ink: #161a24; --v-soft: #4a5368; --v-faint: #687189;
  --v-tab: #ffffff; --v-tab-line: #c9cfdc; --v-accent: #f2d33c; --v-accent-ink: #1d1a0a;
  --v-link: #0b63a6;
}
.v-shelf { margin: 2rem 0 2.8rem; }
.v-shelf-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.v-shelf-head h2 { margin: 0; }
.v-shelf-head span { font: .8rem ui-monospace, monospace; color: var(--v-faint); }
.v-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.v-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--v-line); border-radius: 14px; background: var(--v-paper);
  color: var(--v-ink); text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.v-card:hover { border-color: #aab3c7; transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgb(22 26 36 / .35); }
.v-card-body { padding: .95rem 1.1rem 1.15rem; border-top: 1px solid var(--v-line); }
.v-card-body small { color: var(--v-faint); font-size: .7rem; }
.v-card-body h3 { margin: .25rem 0 .4rem; font-size: 1.05rem; }
.v-card-body p, .v-intro { color: var(--v-soft); line-height: 1.5; margin: 0; }
.v-preview {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start; gap: .6rem; padding: 1.4rem .8rem .9rem; background: var(--v-canvas);
  background-image: radial-gradient(#d9dde7 1px, transparent 1px); background-size: 14px 14px;
  height: 150px; overflow: hidden; font-size: .67rem;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent);
}
.visual-page {
  color-scheme: light; margin: 1.5rem 0 2.5rem; padding: clamp(1rem, 3vw, 2.5rem);
  border: 1px solid var(--v-line); border-radius: 20px; background: var(--v-paper); color: var(--v-ink);
  box-shadow: 0 24px 60px -40px rgb(22 26 36 / .35);
}
.v-back { display: inline-block; margin-bottom: 1.5rem; color: var(--v-soft); text-underline-offset: 4px; }
.v-title { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; font: 700 1.05rem ui-monospace, monospace; color: var(--v-soft); }
.v-mark {
  display: grid; place-items: end end; width: 2.15rem; height: 2.15rem; padding: .15rem .2rem;
  border-radius: 5px; background: var(--v-accent); color: var(--v-accent-ink); font: 800 .95rem system-ui, sans-serif;
}
.v-mark.v-react { place-items: center; background: #e6f7fd; color: #087ea4; border: 1px solid #a9def0; font-size: 1.3rem; }
.visual-page h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); letter-spacing: -.045em; line-height: 1; margin: 0; }
.v-intro { margin: .85rem 0 1.6rem; max-width: 65ch; }
.v-workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .95rem; align-items: start; }
.v-workbench, .v-source, .v-notes > section {
  min-width: 0; background: var(--v-panel); border: 1px solid var(--v-line); border-radius: 12px; overflow: hidden;
}
.v-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: .7rem;
  min-height: 3rem; padding: .75rem 1rem; border-bottom: 1px solid var(--v-line); background: #fbfcfe;
}
.v-toolbar h2 { font-size: .93rem; letter-spacing: 0; margin: 0; }
#v-count { font: .85rem ui-monospace, monospace; color: var(--v-faint); }
.v-diagram {
  min-height: 15rem; padding: 1.7rem .9rem 1rem; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem .8rem; align-items: start;
  background: var(--v-canvas); background-image: radial-gradient(#d9dde7 1px, transparent 1px); background-size: 16px 16px;
}
.v-region {
  --edge: #8a94ab; --edge-end: var(--edge);
  min-width: 0; position: relative; padding: 1rem .6rem .6rem; border: 2px solid transparent;
  border-radius: 10px; background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--edge), var(--edge-end)) border-box;
  box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--edge) 60%, transparent);
}
.v-diagram .v-region { animation: v-in .28s ease-out both; }
.v-wide { grid-column: 1 / -1; }
.v-stack { --edge: #e94f7c; --edge-end: #f2a541; }
.v-purple { --edge: #9b5cf0; --edge-end: #6f45d6; }
.v-cyan { --edge: #2bb4e0; --edge-end: #2a6fd1; }
.v-teal { --edge: #14b892; --edge-end: #6fd99b; }
.v-magenta { --edge: #e046a8; --edge-end: #9a4fe0; }
.v-slate { --edge: #8a94ab; --edge-end: #b9c0d0; }
.v-region h3, .v-region h4 {
  position: relative; width: fit-content; max-width: 100%; margin: -1.65rem auto .55rem;
  padding: .3rem .55rem; border: 1px solid var(--v-tab-line); border-radius: 6px;
  background: var(--v-tab); color: var(--v-ink); font-size: .77rem; line-height: 1.25;
  text-align: center; letter-spacing: 0; overflow-wrap: anywhere; box-shadow: 0 2px 0 #e4e7ef;
}
.v-preview .v-region h4 { font-size: .66rem; }
.v-chip, .v-row, .v-nested { margin-top: .38rem; padding: .43rem .55rem; border-radius: 5px; overflow-wrap: anywhere; }
.v-chip, .v-row { background: var(--v-chip); border: 1px solid #e6e9f1; font: .76rem/1.45 ui-monospace, monospace; color: var(--v-ink); }
.v-preview .v-row, .v-preview .v-chip { font-size: .63rem; }
.v-chip code { white-space: pre-wrap; }
.v-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; justify-content: space-between; }
.v-row > span { color: var(--v-soft); }
.v-active { box-shadow: inset 3px 0 var(--edge); background: color-mix(in srgb, var(--edge) 10%, #fff); border-color: color-mix(in srgb, var(--edge) 35%, #fff); }
.v-diagram .v-active { animation: v-pulse 1.4s ease-in-out 1; }
.v-nested { border: 1px solid #cfd5e2; background: #fafbfd; }
.v-dashed { border-style: dashed; border-color: #aeb6c8; }
.v-nested > b { display: block; width: fit-content; margin: 0 auto .1rem; font: 600 .72rem ui-monospace, monospace; color: var(--v-soft); }
.v-tone-muted, .v-comment { color: var(--v-faint); }
.v-tone-purple, .v-keyword { color: #7a35d8; }
.v-tone-green { color: #0d7a3f; }
.v-tone-cyan { color: #0b62a3; }
.v-tone-pink { color: #c0225f; }
.v-tone-orange, .v-string { color: #a24f00; }
.v-tone-green, .v-tone-pink, .v-tone-orange, .v-tone-cyan, .v-tone-purple { font-weight: 650; }
.v-note { min-height: 5.3rem; padding: .85rem 1rem; color: var(--v-soft); line-height: 1.5; border-top: 1px solid var(--v-line); }
.v-note code, .v-notes code { padding: .05rem .3rem; border-radius: 4px; background: #eef1f7; color: #0b4f86; overflow-wrap: anywhere; }
.v-controls { display: flex; flex-wrap: wrap; gap: .4rem; padding: .25rem 1rem .65rem; }
.v-controls button, .v-controls select {
  padding: .4rem .7rem; border-color: var(--v-tab-line); background: #fff; color: var(--v-ink); font-size: .86rem;
}
.v-controls button:hover:enabled { background: #eef1f7; }
.v-controls .v-primary, .v-controls .v-primary:hover:enabled { background: var(--v-accent); color: var(--v-accent-ink); border-color: #d9b91c; font-weight: 700; }
#v-scrub { display: block; width: calc(100% - 2rem); margin: .05rem 1rem 1rem; accent-color: #d9b91c; }
.v-source pre { position: relative; max-height: 27rem; margin: 0; padding: .75rem 0; font-size: .83rem; background: #fff; color: var(--v-ink); overflow: auto; }
.v-line { display: inline-block; min-width: 100%; padding: 0 .8rem 0 .42rem; border-left: 3px solid transparent; }
.v-number { display: inline-block; width: 3ch; margin-right: .6rem; text-align: right; color: #9aa2b5; user-select: none; }
.v-current { border-color: #d9b91c; background: #fff7cf; }
.v-notes { display: grid; grid-template-columns: 1fr 1fr; gap: .95rem; margin-top: 1rem; }
.v-notes > section { padding: 1rem; line-height: 1.55; color: var(--v-soft); }
.v-notes h2 { font-size: 1.05rem; letter-spacing: -.02em; margin: 0 0 .55rem; color: var(--v-ink); }
.v-notes ul { margin: 0; padding-left: 1.15rem; }
.v-notes li + li { margin-top: .35rem; }
.v-related { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1rem; color: var(--v-link); }
.visual-page :focus-visible, .v-card:focus-visible { outline: 3px solid #d9b91c; outline-offset: 3px; }
@keyframes v-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes v-pulse { 50% { box-shadow: inset 3px 0 var(--edge), 0 0 0 3px color-mix(in srgb, var(--edge) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .v-diagram .v-region, .v-diagram .v-active { animation: none; } .v-card:hover { transform: none; } }
@media (max-width: 960px) { .v-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 850px) { .v-workspace { grid-template-columns: 1fr; } }
@media (max-width: 580px) {
  .v-cards, .v-notes { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; gap: .15rem; padding-block: .55rem; }
  .top nav { flex-wrap: wrap; gap: .2rem .85rem; }
}
@media (max-width: 380px) { .v-diagram { grid-template-columns: 1fr; } }
/* Long-form step explanations */
.v-more { padding: 0 1rem .6rem; }
.v-long-toggle { padding: .3rem .65rem; font-size: .8rem; border-color: var(--v-tab-line); background: #fff; color: var(--v-link); font-weight: 600; }
.v-long-toggle:hover:enabled { background: #eef4fb; }
.v-note-detailed { line-height: 1.6; max-height: 22rem; overflow: auto; }
.v-note-detailed p + p { margin-top: .6rem; }
/* React page sub-navigation */
.subtabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.6rem 0 1.4rem; padding: .3rem; border: 1px solid var(--line); border-radius: .8rem; background: white; width: fit-content; max-width: 100%; }
.subtabs a { display: flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border-radius: .55rem; text-decoration: none; font-weight: 600; font-size: .93rem; }
.subtabs a span { font: .72rem "IBM Plex Mono", ui-monospace, monospace; padding: .1rem .4rem; border-radius: 99px; background: #eef0e8; }
.subtabs a:hover { background: #f1f4e8; }
.subtabs a[aria-current=page] { background: var(--ink); color: white; }
.subtabs a[aria-current=page] span { background: var(--acid); color: var(--ink); }
.tabintro { color: var(--muted); max-width: 62ch; margin: 0 0 1.2rem; line-height: 1.5; }
.subtabs + .v-shelf { margin-top: 0; }
@media (max-width: 580px) { .subtabs { width: 100%; } .subtabs a { flex: 1 1 auto; justify-content: space-between; } }

.lesson-notes { margin-top: 1.35rem; }
.notes-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.notes-heading h2 { font-size: 1.25rem; letter-spacing: -.025em; }
.notes-heading button { padding: .45rem .7rem; font-size: .88rem; }
.notes-heading button[aria-expanded=true] { background: var(--ink); color: white; }
.notes-long, .notes-summary { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; line-height: 1.6; }
.notes-long section + section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.notes-long h3, .notes-summary h3 { font-size: 1.05rem; letter-spacing: -.02em; margin-bottom: .35rem; }
.notes-long p { max-width: 76ch; }
