/* Game Lab website layout. Tokens are copied from docs/design/tokens.css at build time (tokens.css). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--weight-regular) var(--step-0)/var(--leading-body) var(--font-body); overflow-wrap: break-word; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--leading-heading); letter-spacing: var(--tracking-display); margin: 0 0 .5em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p, ul, ol { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--font-mono); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--signal-deep); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 10; }
.skip:focus { top: 1rem; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* Header + hero */
.masthead { background: var(--asphalt-900); color: var(--chalk); }
.masthead__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: var(--space-4); padding-bottom: var(--space-4); flex-wrap: wrap; }
.wordmark { font: 700 1rem/1 var(--font-display); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--chalk); text-decoration: none; display: inline-flex; align-items: center; gap: .6rem; }
.wordmark::before { content: ""; width: 14px; height: 14px; background: var(--signal); display: inline-block; }
.wordmark small { font-weight: 400; letter-spacing: .02em; text-transform: none; color: var(--chalk-2); font-size: .9rem; }
.masthead nav a { color: var(--chalk); margin-left: 1rem; }
.masthead nav a:focus-visible, .hero a:focus-visible, .footer a:focus-visible { outline-color: var(--amber); }
.hero { padding-top: var(--space-6); padding-bottom: var(--space-7); }
.hero--split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-6); align-items: center; }
.hero__art { margin: 0; }
.hero__art img { display: block; width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-stage); border-top: 4px solid var(--signal); }
.hero__art figcaption { color: var(--chalk-2); font-size: var(--step--1); margin-top: .5rem; }
.lesson h3[tabindex="-1"]:focus { outline: none; }
.hero h1 { font-size: var(--step-5); line-height: var(--leading-tight); max-width: 18ch; margin-bottom: .3em; }
.hero__lead { font-size: var(--step-1); max-width: 42rem; color: var(--chalk); }
.hero__byline { color: var(--chalk-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.2rem 0; }
.btn-link { display: inline-flex; align-items: center; min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--radius-md); font-weight: 600; text-decoration: none; border: 2px solid currentColor; }
.btn-link--signal { background: var(--signal); color: var(--asphalt-900); border-color: var(--signal); }
.btn-link--dark { color: var(--chalk); }
.status-note { border-left: 4px solid var(--amber); background: var(--asphalt-800); padding: .8rem 1rem; border-radius: 0 var(--radius-md) var(--radius-md) 0; max-width: 52rem; }
.status-note dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: .4rem 0 0; }
.status-note dt { color: var(--chalk-2); }
.status-note dd { margin: 0; font-weight: 600; }
.status-note .untested { color: var(--amber); }

.eyebrow--dark { color: var(--amber); }
.spaced { margin-top: 2rem; }
.cmd { white-space: pre-wrap; word-break: break-word; background: var(--paper-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: .8rem 1rem; font-size: .95rem; }

/* Stage */
.stage-band { background: var(--asphalt-900); padding-bottom: var(--space-7); }
.stage-band__intro { color: var(--chalk-2); max-width: 52rem; }
.stage-band h2 { color: var(--chalk); }
.stage-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-top: 1rem; color: var(--chalk); }
.stage-facts p { margin: 0; border-top: 2px solid var(--asphalt-600); padding-top: .6rem; }
.stage-facts strong { color: var(--amber); display: block; }

/* Generic sections */
.section { padding: var(--space-7) 0; border-bottom: var(--hairline); }
.eyebrow { font: 600 var(--step--1)/1.3 var(--font-display); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--signal-text); margin-bottom: .4rem; }
.prose { max-width: var(--reader); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--space-5); }
.panel { background: var(--surface); border: var(--hairline); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-1); }
.panel h3 { margin-top: 0; }
.callout { border-left: 4px solid var(--note-unverified-rule); background: var(--note-unverified-bg); padding: .8rem 1rem; border-radius: 0 var(--radius-md) var(--radius-md) 0; margin: 1rem 0; }
.callout > :last-child { margin-bottom: 0; }
.callout__label { display: block; font: 700 var(--step--1)/1.3 var(--font-display); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .25rem; }
.callout--teacher { background: var(--note-teacher-bg); border-color: var(--note-teacher-rule); } .callout--teacher .callout__label { color: var(--note-teacher-label); }
.callout--safety { background: var(--note-safety-bg); border-color: var(--note-safety-rule); } .callout--safety .callout__label { color: var(--note-safety-label); }
.callout--expect { background: var(--note-expect-bg); border-color: var(--note-expect-rule); } .callout--expect .callout__label { color: var(--note-expect-label); }
.callout--trouble { background: var(--note-trouble-bg); border-color: var(--note-trouble-rule); } .callout--trouble .callout__label { color: var(--note-trouble-label); }
.callout--untested .callout__label { color: var(--ink-2); }
table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
th, td { text-align: left; vertical-align: top; padding: .55rem .6rem; border-bottom: var(--hairline); }
th { font-family: var(--font-display); }
.table-scroll { overflow-x: auto; max-width: 100%; }
.tag { display: inline-block; font: 700 .8rem/1.4 var(--font-display); letter-spacing: .06em; text-transform: uppercase; padding: .1rem .45rem; border-radius: 4px; border: 1px solid currentColor; }
.tag--untested { color: var(--amber-text); }
.tag--checked { color: var(--sky-text); }
.tag--tested { color: var(--mint-text); }

/* Roadmap */
.roadmap { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.roadmap li { border-top: 3px solid var(--signal); padding-top: .6rem; }
.roadmap a { font-weight: 700; font-family: var(--font-display); font-size: var(--step-1); color: var(--text); text-decoration: none; }
.roadmap a:hover { color: var(--link); text-decoration: underline; }
.roadmap .num { font: 700 var(--step-3)/1 var(--font-display); color: var(--signal-text); display: block; }
.roadmap p { color: var(--text-muted); font-size: var(--step--1); margin: .3rem 0 0; }

/* Lesson reader */
.reader { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.course-nav { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding-right: .5rem; }
.course-nav details { border: var(--hairline); border-radius: var(--radius-md); background: var(--surface); padding: .4rem .8rem; }
.course-nav summary { font-weight: 700; min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.course-nav ol { list-style: none; padding: 0; margin: 0 0 .5rem; }
.course-nav .chap { margin-top: .6rem; font: 700 var(--step--1)/1.3 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.course-nav a { display: block; padding: .3rem 0; color: var(--text); text-decoration: none; font-size: var(--step--1); }
.course-nav a:hover { color: var(--link); text-decoration: underline; }
.progress-box { margin-top: 1rem; background: var(--paper-2); border-radius: var(--radius-md); padding: .8rem; font-size: var(--step--1); }
.progress-box p { margin: 0 0 .5rem; }
.progress-box [data-progress-count] { font-weight: 700; font-size: var(--step-0); }
.progress-box [data-state="blocked"], .progress-box [data-state="corrupt"] { color: var(--amber-text); font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem 1rem; border-radius: var(--radius-md);
  border: 2px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 1rem/1.2 var(--font-body); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn--primary { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn--primary:hover { background: var(--btn-primary-hover); }
.chapter { margin-bottom: var(--space-7); }
.chapter__head { border-top: 4px solid var(--signal); padding-top: var(--space-4); margin-bottom: var(--space-5); max-width: var(--reader); }
.chapter__num { font: 700 var(--step-4)/1 var(--font-display); color: var(--signal-text); display: block; }
.lesson { max-width: var(--reader); padding: var(--space-5) 0 var(--space-6); border-top: var(--hairline); }
.lesson h3 { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; }
.lesson h3 .lnum { font-size: var(--step--1); color: var(--signal-text); letter-spacing: .08em; text-transform: uppercase; }
.lesson [data-lesson-state] { font: 700 var(--step--1)/1 var(--font-display); color: var(--mint-text); }
.lesson h4 { margin-top: 1.4rem; }
.prompt { background: var(--paper-2); border-radius: var(--radius-md); border: 1px solid var(--border); padding: .9rem 1rem; margin: .8rem 0; }
.prompt__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.prompt__label { font-weight: 700; font-size: var(--step--1); }
.prompt pre { white-space: pre-wrap; word-break: break-word; margin: 0; font-size: .95rem; line-height: 1.55; background: var(--surface); padding: .8rem; border-radius: 6px; border: 1px solid var(--border); max-height: 22rem; overflow: auto; }
.prompt__status { font-size: var(--step--1); color: var(--sky-text); margin: .5rem 0 0; min-height: 1.4em; }
.ican { display: flex; gap: .7rem; align-items: center; background: var(--surface); border: 2px solid var(--border-strong); border-radius: var(--radius-md); padding: .6rem .9rem; min-height: 48px; margin-top: 1rem; cursor: pointer; }
.ican input { width: 1.4rem; height: 1.4rem; accent-color: var(--signal-deep); flex: none; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: var(--step--1); margin-top: 1rem; }

/* Downloads, sheets, glossary */
.downloads { list-style: none; padding: 0; display: grid; gap: 1rem; }
.downloads li { background: var(--surface); border: var(--hairline); border-radius: var(--radius-lg); padding: var(--space-5); }
.downloads code { font-size: .9em; word-break: break-all; }
.sheet { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-md); padding: var(--space-5); max-width: 52rem; }
.sheet h3 { border-bottom: 2px solid var(--ink); padding-bottom: .4rem; }
.sheet .line { border-bottom: 1px solid var(--ink-3); min-height: 2.2rem; margin-bottom: .6rem; display: flex; align-items: flex-end; padding-bottom: .2rem; }
.sheet table td, .sheet table th { border: 1px solid var(--ink-3); height: 2.4rem; }
.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: .3rem 2rem; }
.glossary dt { font-weight: 700; margin-top: .6rem; }
.glossary dd { margin: 0; color: var(--text-muted); }
.footer { background: var(--asphalt-900); color: var(--chalk); padding: var(--space-7) 0; font-size: var(--step--1); }
.footer a { color: #ffb38a; }
.footer h2 { font-size: var(--step-2); color: var(--chalk); }
.footer ul { padding-left: 1.2rem; }

@media (max-width: 1023px) {
  .hero--split { grid-template-columns: minmax(0, 1fr); }
  .hero__art { display: none; }
  .reader { grid-template-columns: minmax(0, 1fr); }
  .course-nav { position: static; max-height: none; padding: 0; }
}
@media (max-width: 639px) {
  .masthead nav { width: 100%; }
  .masthead nav a { margin: 0 1rem 0 0; }
  .status-note dl { grid-template-columns: 1fr; }
  .status-note dd { margin-bottom: .4rem; }
}

/* Print: lessons, prompts, sheet and status — no interactive controls */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .masthead, .stage-band, .footer { background: #fff !important; color: #000 !important; }
  .hero__actions, .skip, .masthead nav, .course-nav, .prompt__head button, .prompt__status, .lesson-nav, .no-print, .ican input, [data-action] { display: none !important; }
  .stage-band h2, .stage-facts, .hero__lead, .hero__byline, .status-note, .footer h2 { color: #000 !important; }
  .status-note { background: #fff; border: 1px solid #000; }
  .reader { display: block; }
  .prompt pre { max-height: none; overflow: visible; border: 1px solid #000; }
  .lesson, .sheet, .callout, .prompt { break-inside: avoid-page; }
  .chapter { break-before: page; }
  .sheet { break-before: page; border: 2px solid #000; }
  a { color: #000; }
  .footer a::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
