/* Code reading decks. No animation or simulated hardware. */
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; color: #cbd5e1; font-family: Inter, sans-serif; }
.bg-slate-950 { background: #020617; }
.bg-slate-900 { background: #0f172a; }
nav { position: fixed; inset: 0 0 auto; height: 64px; z-index: 50; background: #020617f5; border-bottom: 1px solid #1e293b; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo strong { font-size: 14px; font-weight: 600; }
.logo small { display: block; font: italic 12px Merriweather, Georgia, serif; color: #64748b; margin-top: 4px; }
#nav-end { display: flex; align-items: center; gap: 14px; }
a { color: #67e8f9; text-decoration: none; }
a:hover { text-decoration: underline; }
button, select { font: inherit; }
#notes-open { background: transparent; border: 0; color: #94a3b8; cursor: pointer; font-size: 13px; padding: 9px; }
section { padding: 104px 6vw 55px; }
.slide-inner { width: 100%; max-width: 1180px; margin: 0 auto; }
h1, h2 { color: #f8fafc; font-family: Merriweather, Georgia, serif; font-weight: 700; line-height: 1.25; }
h2 { font-size: 38px; margin: 0 0 32px; }
.context { color: #64748b; font: 13px 'Fira Code', monospace; margin-bottom: 13px; }
.code-layout { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(0,1fr); gap: 38px; align-items: center; }
.code-panel { min-width: 0; }
.code-file { font: 12px 'Fira Code', monospace; color: #64748b; padding: 0 0 12px; border-bottom: 1px solid #334155; margin-bottom: 12px; }
.code { counter-reset: line; margin: 0; font: 20px/1.48 'Fira Code', monospace; color: #cbd5e1; tab-size: 2; white-space: pre; }
.code .line { display: block; position: relative; padding-left: 38px; border-left: 2px solid transparent; min-height: 1.48em; }
.code .line:before { counter-increment: line; content: counter(line); position: absolute; left: 0; width: 24px; color: #475569; text-align: right; font-size: 12px; line-height: 2.46; }
.code .line.focus { background: #22d3ee0b; border-color: #22d3ee; }
.code .comment { color: #64748b; }
.code .instruction { color: #67e8f9; }
.analysis { border-left: 1px solid #334155; padding-left: 27px; }
.analysis p { font-size: 21px; line-height: 1.5; margin: 0 0 24px; }
.analysis p:last-child { margin-bottom: 0; }
.analysis strong { color: #f1f5f9; font-weight: 500; }
.analysis code { font: 18px 'Fira Code', monospace; color: #c4b5fd; }
.analysis .trace { font: 19px/1.6 'Fira Code', monospace; color: #6ee7b7; margin-top: 26px; }
.source-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 38px; align-items: center; }
.source-layout .code { font-size: 19px; }
.source-layout .analysis { border: 0; padding: 18px 0 0; }
.source-layout .analysis p { font-size: 19px; margin: 0 0 15px; }
figure { margin: 0; min-width: 0; }
.source-crop { display: block; width: 100%; max-height: 400px; object-fit: contain; background: white; border-radius: 3px; cursor: zoom-in; }
figcaption { font-size: 12px; line-height: 1.5; color: #94a3b8; margin-top: 10px; }
figcaption a { color: #94a3b8; text-decoration: underline; text-underline-offset: 3px; }
.image-pair { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; }
.image-pair .source-crop { max-height: 300px; }
.caption-code { display: flex; gap: 40px; align-items: center; margin-top: 28px; }
.caption-code .code-panel { flex: 1; }
.caption-code p { flex: 1; font-size: 21px; line-height: 1.5; }
.full-source .source-crop { max-height: 340px; width: auto; max-width: 100%; margin: auto; }
.full-source .caption-code .code { font-size: 20px; }
.reference-stack { display: flex; flex-direction: column; gap: 18px; }
.reference-stack .source-crop { max-height: 180px; }
.slide-source { font-size: 11px; color: #64748b; margin-top: 25px; }
.cover { max-width: 900px; margin: auto; text-align: left; }
.cover h1 { font-size: 64px; margin: 0 0 35px; }
.cover .sub { font-size: 24px; color: #94a3b8; margin: 0 0 35px; }
.cover .route { border-top: 1px solid #334155; padding-top: 25px; font-size: 20px; color: #cbd5e1; line-height: 1.6; }
.cover .file-links { display: flex; gap: 28px; font: 15px 'Fira Code', monospace; margin-top: 32px; }
.source-list { display: grid; grid-template-columns: 1fr 1fr; gap: 25px 45px; }
.source-list a { border-top: 1px solid #334155; padding-top: 20px; font-size: 22px; color: #cbd5e1; }
.source-list small { display: block; color: #64748b; margin-top: 12px; font-size: 16px; line-height: 1.5; }
dialog { position: fixed; padding: 28px; color: #cbd5e1; background: #0f172a; border: 1px solid #475569; border-radius: 8px; }
dialog::backdrop { background: #020617d9; }
#teacher-notes { width: min(650px,90vw); max-height: 76vh; overflow: auto; margin: auto 30px 80px auto; font: 17px/1.7 Inter, sans-serif; }
dialog form { text-align: right; margin-bottom: 15px; }
dialog form button { color: #cbd5e1; background: #020617; border: 1px solid #475569; border-radius: 5px; padding: 7px 13px; cursor: pointer; }
dialog h3 { font: 23px/1.4 Merriweather, Georgia, serif; color: white; }
dialog label { font-size: 13px; color: #94a3b8; }
dialog select { display: block; width: 100%; background: #020617; color: #cbd5e1; border: 1px solid #475569; padding: 8px; margin: 8px 0 22px; }
#source-view { max-width: 96vw; max-height: 96vh; width: 96vw; }
#source-view img { width: 100%; max-height: 78vh; object-fit: contain; background: white; }
#source-caption { font-size: 13px; color: #94a3b8; margin-top: 12px; }
:focus-visible { outline: 2px solid #fbbf24; outline-offset: 4px; }
@media(max-height:760px) and (min-width:900px) {
  h2 { font-size: 34px; margin-bottom: 25px; }
  .code { font-size: 19px; line-height: 1.45; }
  .source-layout .code { font-size: 18px; }
  .analysis p { font-size: 19px; margin-bottom: 20px; }
  .analysis code { font-size: 17px; }
  .source-crop { max-height: 330px; }
  .slide-source { margin-top: 18px; }
}
@media(max-width:900px) {
  nav { padding: 0 16px; }
  .logo strong { font-size: 12px; }
  .logo small { font-size: 11px; }
  h2 { font-size: 29px; margin-bottom: 25px; }
  .code-layout, .source-layout { grid-template-columns: 1fr; gap: 23px; }
  .code { font-size: 15px; }
  .source-layout .code { font-size: 15px; }
  .analysis { border-left: 0; border-top: 1px solid #334155; padding: 18px 0 0; }
  .analysis p { font-size: 17px; margin-bottom: 12px; }
  .analysis code { font-size: 15px; }
  .analysis .trace { font-size: 15px; margin-top: 15px; }
  .source-layout { gap: 15px; }
  .source-crop { max-height: 240px; }
  .source-layout .analysis p { font-size: 16px; }
  .code-file { font-size: 10px; }
  .cover h1 { font-size: 42px; }
  .cover .sub { font-size: 21px; }
  .cover .route { font-size: 18px; }
  .cover .file-links { flex-wrap: wrap; font-size: 13px; gap: 16px; }
  .image-pair { gap: 18px; }
  .caption-code { display: block; margin-top: 20px; }
  .caption-code p { font-size: 17px; }
  .full-source .caption-code .code { font-size: 15px; }
  .source-list { gap: 20px; }
  .source-list a { font-size: 18px; }
  .source-list small { font-size: 13px; }
  .reference-stack { gap: 10px; }
  .reference-stack .source-crop { max-height: 145px; }
}
@media(max-width:540px) {
  #slide-indicator { display: none !important; }
  .logo strong { font-size: 10px; }
  #notes-open { font-size: 11px; padding: 5px; }
  #nav-end { gap: 0; }
  .code { font-size: 12px; }
  .source-layout .code { font-size: 12px; }
  .code .line { padding-left: 26px; }
  .code .line:before { font-size: 9px; width: 17px; line-height: 2.1; }
  h2 { font-size: 24px; }
  .analysis p { font-size: 15px; }
  .analysis code { font-size: 13px; }
  .analysis .trace { font-size: 13px; }
  .source-crop { max-height: 200px; }
  .cover h1 { font-size: 35px; }
  .cover .route { font-size: 16px; }
  .cover .file-links { font-size: 11px; }
  .full-source .caption-code .code { font-size: 12px; }
}
@media(prefers-reduced-motion:reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media(max-height:760px) and (min-width:900px) {
  .full-source .source-crop { max-height: 260px; }
}

/* Course document excerpts must be readable beside the code. */
.reference-stack.course-reference .source-crop { max-height: 330px; }
@media (max-width: 899px) { .reference-stack.course-reference .source-crop { max-height: 240px; } }
