:root { color-scheme: light; --paper: #f7f7ef; --ink: #193b34; --muted: #52665e; --line: #c5cec3; --green: #214f3b; --pale: #e4eddf; --yellow: #f4df8e; --focus: #a8471d; font-family: "Avenir Next", "Helvetica Neue", sans-serif; color: var(--ink); background: var(--paper); }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 16px; line-height: 1.65; }
a { color: #27523e; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: #843e20; }
button, input, textarea { font: inherit; }
button, .button-link { min-height: 44px; padding: .65rem .9rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 4px; cursor: pointer; font-weight: 700; }
button:hover { background: var(--pale); }
button:disabled { opacity: .5; cursor: default; }
.primary { color: #f7f7ef; background: var(--green); border-color: var(--green); }
.primary:hover { color: #f7f7ef; background: #153e2b; }
.button-link { display: inline-block; text-decoration: none; }
:where(a, button, input, textarea, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 20; top: -100px; left: 1rem; padding: .7rem 1rem; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 1rem; }
h1, h2, h3, h4 { font-family: "Avenir Next", "Trebuchet MS", sans-serif; line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(2.5rem, 5vw, 4.6rem); max-width: 12ch; margin: .4rem 0 .6rem; font-weight: 800; }
h2 { font-size: clamp(2rem, 3.4vw, 3.1rem); margin: .5rem 0 1rem; }
h3 { font-size: clamp(1.3rem, 2.1vw, 1.7rem); }
h4 { font-size: 1rem; letter-spacing: 0; }
p, li, dd, a { overflow-wrap: anywhere; }
img { max-width: 100%; height: auto; }
.eyebrow { color: #4b624a; font-weight: 800; font-size: .72rem; letter-spacing: .11em; line-height: 1.6; }
.coding-masthead { width: min(100% - 3rem, 1180px); margin: 2.7rem auto 2rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.coding-masthead > div > p:last-child { margin-bottom: 0; color: var(--muted); }
.coding-masthead img { width: clamp(135px, 18vw, 240px); height: auto; object-fit: contain; }
.course-toolbar { width: min(100% - 3rem, 1180px); margin: auto; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.6rem; padding: .85rem 0; border-block: 1px solid var(--line); font-size: .85rem; }
.course-toolbar a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 650; }
.course-toolbar [data-coding-progress] { margin-right: auto; }
.course-toolbar button { border: 0; padding-inline: .5rem; }
.storage-status { width: min(100% - 3rem, 1180px); margin: .55rem auto; min-height: 1.5rem; color: var(--muted); font-size: .78rem; }
.coding-layout { width: min(100% - 3rem, 1180px); display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); margin: 1.8rem auto 5rem; align-items: start; }
.coding-sidebar { position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 0 .55rem .7rem 0; scrollbar-width: thin; }
#lesson-menu > summary { font-size: 1.05rem; font-weight: 800; cursor: pointer; padding: .55rem 0 1rem; }
#lesson-menu > summary > span { font-size: .75rem; font-weight: 500; margin-left: .7rem; }
label { display: block; font-size: .88rem; font-weight: 750; margin-bottom: .5rem; }
input[type="search"] { width: 100%; min-height: 44px; border: 1px solid #a8b7a5; background: #fafaf4; color: var(--ink); padding: .65rem; border-radius: 3px; font-size: .85rem; }
#search-result { font-size: .78rem; color: var(--muted); }
.unit-menu { border-bottom: 1px solid var(--line); }
.unit-menu summary { display: flex; justify-content: space-between; gap: .55rem; padding: 1rem .3rem; cursor: pointer; font-size: .84rem; line-height: 1.4; font-weight: 700; }
.unit-menu summary::before { content: '+'; font-weight: 500; }
.unit-menu[open] summary::before { content: '−'; }
.unit-menu summary > span:first-child { flex: 1; }
.unit-count { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.unit-menu ol { list-style: none; padding: 0; margin: 0 0 .8rem; }
.unit-menu a { display: block; text-decoration: none; padding: .7rem .8rem; font-size: .82rem; line-height: 1.45; min-height: 44px; border-radius: 3px; }
.unit-menu a:hover { background: var(--pale); }
.unit-menu a[aria-current] { color: #183e2b; background: #dde8d4; box-shadow: inset 3px 0 #476744; font-weight: 750; }
#coding-main { min-width: 0; scroll-margin-top: 1.5rem; outline-offset: .5rem; }
.intro-copy { max-width: 65ch; color: var(--muted); }
.start-line { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; margin: 1.6rem 0; }
.start-line > span { font-size: .83rem; color: var(--muted); }
details > summary { cursor: pointer; min-height: 44px; padding-block: .65rem; font-weight: 700; }
details > p { margin-top: .35rem; }
.unit-map { margin-top: 2rem; }
.unit-overview { display: grid; grid-template-columns: 45px 1fr; gap: 1.3rem; border-top: 1px solid var(--line); padding: 1.7rem 0; }
.unit-index { font-size: 1.5rem; font-weight: 750; color: #768868; line-height: 1.25; }
.unit-overview h3 { margin: 0; }
.unit-overview p { color: var(--muted); margin: .5rem 0 .9rem; }
.unit-overview ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.unit-overview a { display: inline-flex; min-height: 44px; align-items: center; text-decoration-color: #a0b09a; }
.guide-link { display: inline-block; margin-top: 2rem; }
.lesson-outcome { font-size: 1.14rem; max-width: 60ch; color: var(--muted); }
.recall { padding: 1.1rem 1.35rem; background: var(--pale); margin: 1.6rem 0; font-size: .88rem; }
.recall p { margin: .4rem 0; }
.lesson-jumps { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1.3rem 2.5rem; }
.lesson-jumps button { font-size: .82rem; padding: .5rem .8rem; }
.lesson-section { margin: 2.5rem 0; padding-top: .8rem; border-top: 1px solid var(--line); }
.lesson-section h3 { scroll-margin-top: 1.5rem; }
.lesson-section > p, .lesson-section > ol { max-width: 68ch; }
li { margin-block: .45rem; padding-left: .2rem; }
.word-list { display: grid; grid-template-columns: minmax(5rem, 1fr) 3fr; gap: .6rem 1.1rem; margin: 1.5rem 0; padding: 1.2rem 0; border-block: 1px dashed var(--line); font-size: .9rem; }
.word-list dt { font-weight: 750; }
.word-list dd { margin: 0; }
.prediction { background: #f4e9be; padding: 1.2rem 1.5rem; margin-top: 1.5rem; }
.prediction h4 { margin: 0; }
.prediction p { margin-block: .6rem; }
.python-lab { margin-top: 1.8rem; }
textarea { width: 100%; min-height: 100px; padding: 1rem; color: var(--ink); background: #fcfcf6; border: 1px solid #96a992; border-radius: 3px; resize: vertical; line-height: 1.65; }
.python-editor { color: #dcead7; background: #203b34; border: 1px solid #203b34; font: .85rem/1.8 "SFMono-Regular", Menlo, monospace; tab-size: 4; white-space: pre; overflow: auto; }
.python-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; }
.python-toolbar button { font-size: .8rem; }
.python-status { font-size: .87rem; font-weight: 650; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .83rem/1.75 "SFMono-Regular", Menlo, monospace; max-width: 100%; padding: 1rem 1.2rem; background: #e9ede2; border: 1px solid var(--line); }
.python-output { min-height: 80px; background: #edf0e6; }
.small-note { color: var(--muted); font-size: .78rem; }
.section-try > details, .section-challenge > details, .section-reflect > details { border-bottom: 1px solid var(--line); padding: .3rem 0; }
.section-reflect > label { margin-top: 1.7rem; }
.complete-lesson { margin-top: 1rem; background: var(--yellow); border-color: #bfab65; }
.complete-lesson[aria-pressed="true"] { background: #dce9d5; border-color: #91aa84; }
.unit-bridge { background: #e8eddf; padding: 1.2rem 1.5rem; font-size: .9rem; }
.unit-bridge .eyebrow { margin-top: 0; }
.unit-bridge a { font-weight: 750; }
.lesson-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 2.5rem; }
.lesson-pagination a { display: flex; align-items: center; padding: 1rem; min-height: 60px; text-decoration: none; background: #edf0e7; font-size: .9rem; }
.lesson-pagination .next-lesson { background: var(--green); color: var(--paper); }
.teaching-guide section { margin-top: 2.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { text-align: left; padding: .7rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
caption { text-align: left; font-weight: 750; margin-bottom: 1rem; }
.coding-footer { width: min(100% - 3rem, 1180px); margin: auto; padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.coding-footer p:first-child { color: var(--ink); font-weight: 750; }
noscript { display: block; padding: 1rem; }
@media (max-width: 800px) {
  .coding-masthead { margin-block: 2rem 1.5rem; gap: .5rem; }.coding-masthead img { width: 115px; }.coding-masthead h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
  .coding-layout { grid-template-columns: 1fr; gap: 1.5rem; margin-top: 1rem; }.coding-sidebar { position: static; max-height: none; padding: 0; border-bottom: 1px solid var(--line); }#lesson-menu > summary { padding: .8rem 0; }
  .course-toolbar { gap: .2rem 1rem; }.course-toolbar [data-coding-progress] { order: -1; width: 100%; }
}
@media (max-width: 480px) { .coding-masthead, .course-toolbar, .storage-status, .coding-layout, .coding-footer { width: calc(100% - 2rem); }.coding-masthead img { width: 82px; }.coding-masthead h1 { font-size: 2.15rem; }.coding-masthead > div > p:last-child { font-size: .88rem; }.unit-overview { grid-template-columns: 30px 1fr; gap: .7rem; }.lesson-pagination { grid-template-columns: 1fr; }.word-list { grid-template-columns: 1fr; gap: .3rem; }.word-list dd { margin-bottom: .7rem; }.prediction { padding: 1rem; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@page { size: letter; margin: .6in; }
@media print {
  body { background: #fffef8; font-size: 10pt; line-height: 1.45; }
  .academy-bar, .skip-link, .coding-masthead, .course-toolbar, .storage-status, .coding-sidebar, .coding-footer, noscript { display: none !important; }
  .coding-layout { display: block; width: 100%; margin: 0; }h1 { font-size: 30pt; max-width: none; }h2 { font-size: 24pt; }h3 { font-size: 15pt; }h4 { font-size: 10pt; }
  h2, h3, h4, summary { break-after: avoid; }p, li { orphans: 3; widows: 3; }
  .coding-lesson, .teaching-guide { break-before: page; }.lesson-section { margin: .2in 0; padding-top: .07in; }.lesson-outcome { font-size: 12pt; }.recall { margin: .15in 0; padding: .1in; }.recall a { display: none; }
  .word-list { padding: .1in 0; margin: .15in 0; font-size: 9pt; }.prediction, .unit-bridge { padding: .1in; }.prediction { margin-top: .15in; }
  pre { font-size: 8pt; line-height: 1.5; padding: .1in; white-space: pre-wrap; break-inside: auto; }.expected-output { break-inside: avoid; }details > summary { min-height: 0; padding: .06in 0; }details { padding: 0 !important; }
  .paper-notes { height: .65in; background: repeating-linear-gradient(transparent, transparent .21in, #c5cec3 .215in, transparent .22in); }
  .unit-bridge { break-inside: avoid; }a { color: inherit; }.teaching-guide .lesson-section { margin-top: .2in; }table { font-size: 9pt; }tr { break-inside: avoid; }
  /* A normal browser print includes the current lesson; ?print=1 includes all. */
  .lesson-jumps, .lesson-pagination, .python-lab, .section-reflect textarea, .section-reflect label, .complete-lesson { display: none !important; }
}
