/* ============================================================
   CS IB — design system
   International Typographic Style with a brutalist structure:
   visible grid, hard 2px rules, zero radius, solid offset shadows,
   one saturated accent per syllabus theme. Paper by default so it
   reads like a worksheet, not a dashboard; inverted for a dim room.
   ============================================================ */

:root {
  /* paper */
  --paper:    #F1EEE4;
  --paper-2:  #E7E3D6;
  --paper-3:  #DAD5C4;
  --ink:      #12110D;
  --ink-2:    #4A473D;
  --ink-3:    #7A756A;
  --rule:     #12110D;

  /* one accent per theme, plus a highlighter */
  --a:        #1B34D8;   /* Theme A — concepts */
  --b:        #D93207;   /* Theme B — computational thinking */
  --hl:       #FFE84A;   /* command terms */
  --ok:       #0C7A4E;
  --no:       #C0210B;

  --accent:      var(--a);
  --accent-text: var(--a);

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body:    "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono:    "IBM Plex Mono", "Courier New", monospace;

  --bw: 2px;                       /* the border width, everywhere */
  --shadow: 6px 6px 0 var(--rule); /* hard, no blur */
  --pad: clamp(1rem, 3.5vw, 3.5rem);
}

[data-theme="b"] { --accent: var(--b); --accent-text: var(--b); }

/* inverted paper — for projecting in a dark room */
[data-mode="dark"] {
  --paper: #131210; --paper-2: #1D1B18; --paper-3: #2A2723;
  --ink: #F2EFE4; --ink-2: #B5AF9F; --ink-3: #85806F;
  --rule: #F2EFE4;
  --a: #7C93FF; --b: #FF7A54; --hl: #FFE84A; --ok: #4FD69B; --no: #FF6B4A;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
code, kbd, pre { font-family: var(--f-mono); }

#app { position: relative; min-height: 100%; }
body[data-view="deck"], body[data-view="deck"] #app { height: 100vh; overflow: hidden; }

::selection { background: var(--hl); color: #12110D; }

/* ---------- boot ---------- */
.boot { height: 100vh; display: grid; place-content: center; gap: .9rem; justify-items: center; }
.boot__bar { width: 200px; height: 10px; border: var(--bw) solid var(--rule); position: relative; overflow: hidden; }
.boot__bar::after { content: ""; position: absolute; inset: 0; width: 30%; background: var(--rule); animation: boot .9s steps(6) infinite; }
@keyframes boot { from { transform: translateX(-110%); } to { transform: translateX(440%); } }
.boot__label { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; }

/* ============================================================
   Shared type
   ============================================================ */
.mono {
  font-family: var(--f-mono); font-size: .7rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
}
mark, .term {
  background: var(--hl); color: #12110D;
  padding: .06em .3em; font-weight: 600;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* ============================================================
   HUB
   ============================================================ */
.hub { max-width: 1440px; margin: 0 auto; padding: 0 0 6rem; }

.masthead {
  border-bottom: var(--bw) solid var(--rule);
  padding: var(--pad) var(--pad) 1.25rem;
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end;
}
.masthead h1 {
  font-family: var(--f-display); font-weight: 900;
  font-variation-settings: "wdth" 112;
  font-size: clamp(2.6rem, 9vw, 8rem); line-height: .82;
  letter-spacing: -.04em; margin: 0; text-transform: uppercase;
}
.masthead h1 span { display: block; }
.masthead h1 em { font-style: normal; -webkit-text-stroke: 2px var(--ink); color: transparent; }
.masthead__side { text-align: right; }
.masthead__side p { margin: 0 0 .3rem; }

.lede {
  padding: 1.75rem var(--pad) 2.25rem;
  border-bottom: var(--bw) solid var(--rule);
  font-size: clamp(1.05rem, 1.7vw, 1.4rem); line-height: 1.5; font-weight: 300;
  margin: 0;
}
.lede > span { display: block; max-width: 62ch; }

/* --- course block --- */
.course { border-bottom: var(--bw) solid var(--rule); }
.course__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .9rem 1.4rem;
  padding: 1.1rem var(--pad);
  background: var(--accent); color: #FFF;
}
[data-mode="dark"] .course__head { color: #12110D; }
.course__head .mono { opacity: .85; }
.course__head h2 {
  font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 100;
  font-size: clamp(1.2rem, 2.6vw, 1.9rem); letter-spacing: -.02em; margin: 0; text-transform: uppercase;
}
.course__head .spacer { margin-left: auto; }

.week { border-top: var(--bw) solid var(--rule); }
.week:first-child { border-top: 0; }
.week__bar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .9rem;
  padding: .6rem var(--pad); background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.week__bar b { font-family: var(--f-display); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.week__bar .spacer { margin-left: auto; }

.sessions { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: .55rem;
  padding: 1.15rem var(--pad) 1.3rem;
  border-right: 1px solid var(--rule); text-decoration: none;
  position: relative; transition: background .12s;
}
.card:last-child { border-right: 0; }
.card:hover { background: var(--hl); }
.card:hover .card__arrow { transform: translateX(4px); }
.card__id { font-family: var(--f-mono); font-size: .68rem; font-weight: 600; letter-spacing: .14em; }
.card h3 {
  font-family: var(--f-display); font-weight: 700; font-variation-settings: "wdth" 100;
  font-size: 1.22rem; line-height: 1.1; letter-spacing: -.02em; margin: 0; text-transform: uppercase;
}
.card p { margin: 0; font-size: .93rem; line-height: 1.45; color: var(--ink-2); font-weight: 300; }
.card__foot { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: auto; padding-top: .6rem; }
.card__arrow { margin-left: auto; font-family: var(--f-mono); font-weight: 700; transition: transform .12s; }

.tag {
  font-family: var(--f-mono); font-size: .62rem; font-weight: 600; letter-spacing: .1em;
  border: 1px solid var(--rule); padding: .16rem .38rem; text-transform: uppercase;
}
.tag--code { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-mode="dark"] .tag--code { color: #12110D; }
.tag--act  { background: var(--hl); color: #12110D; border-color: #12110D; }

/* open early as pre-work — the flipped HL workshop */
.card--pre { border-left: 6px solid var(--accent); }
.card--pre .card__id { color: var(--accent-text); font-weight: 700; }

/* locked / not-yet-built */
.card--locked { background: repeating-linear-gradient(45deg, transparent 0 9px, var(--paper-2) 9px 18px); }
.card--locked:hover { background: repeating-linear-gradient(45deg, transparent 0 9px, var(--paper-2) 9px 18px); }
.card--locked h3, .card--locked p { color: var(--ink-3); }
.card--locked .card__arrow { display: none; }
.card__lock {
  font-family: var(--f-mono); font-size: .62rem; font-weight: 700; letter-spacing: .1em;
  border: 1px solid var(--ink-3); color: var(--ink-3); padding: .16rem .38rem; text-transform: uppercase;
}

.hub__foot {
  padding: 1.5rem var(--pad); display: flex; gap: 1.5rem; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .06em;
}
.hub__foot a { text-decoration: none; border-bottom: var(--bw) solid var(--accent); }

/* generic hard-edged button */
.btn {
  font-family: var(--f-mono); font-size: .7rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  border: var(--bw) solid var(--rule); padding: .5rem .8rem;
  background: var(--paper); transition: transform .1s, box-shadow .1s;
}
.btn:hover { box-shadow: 3px 3px 0 var(--rule); transform: translate(-1px, -1px); }
.btn:active { box-shadow: none; transform: none; }
.btn--go { background: var(--hl); color: #12110D; }
.btn--solid { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-mode="dark"] .btn--solid { color: #12110D; }

/* ============================================================
   DECK
   ============================================================ */
.deck { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* register strip — always shows the syllabus statement in play */
.reg {
  flex: 0 0 auto; display: flex; align-items: stretch;
  border-bottom: var(--bw) solid var(--rule); background: var(--paper-2);
  font-family: var(--f-mono); font-size: .68rem;
}
.reg__cell {
  padding: .45rem .8rem; border-right: 1px solid var(--rule);
  display: flex; gap: .45rem; align-items: baseline; white-space: nowrap;
}
.reg__k { font-size: .58rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.reg__v { font-weight: 600; letter-spacing: .04em; }
.reg__cell--accent { background: var(--accent); }
.reg__cell--accent .reg__k, .reg__cell--accent .reg__v { color: #fff; }
[data-mode="dark"] .reg__cell--accent .reg__k, [data-mode="dark"] .reg__cell--accent .reg__v { color: #12110D; }
.reg__cell--term { background: var(--hl); }
.reg__cell--term .reg__k, .reg__cell--term .reg__v { color: #12110D; }
.reg__spacer { flex: 1; min-width: 0; border-right: 1px solid var(--rule); }
.reg__spacer .reg__v { overflow: hidden; text-overflow: ellipsis; display: block; font-weight: 400; }
.reg__home { padding: .45rem .8rem; text-decoration: none; font-weight: 600; letter-spacing: .1em; }
.reg__home:hover { background: var(--hl); color: #12110D; }

/* stage: a visible Swiss rail on the left, content in the field */
.stage { flex: 1 1 auto; position: relative; overflow: hidden; }
.slide {
  position: absolute; inset: 0; overflow-y: auto;
  display: grid; grid-template-columns: clamp(2.5rem, 5vw, 5rem) 1fr;
}
.slide[hidden] { display: none; }
.rail {
  border-right: 1px solid var(--rule); background: var(--paper-2);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: .8rem 0; font-family: var(--f-mono); font-size: .64rem; font-weight: 600; letter-spacing: .12em;
}
.rail__n { font-family: var(--f-display); font-weight: 900; font-size: 1.1rem; letter-spacing: -.02em; }
.rail__v { writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.field {
  padding: clamp(1rem, 3.5vh, 3rem) var(--pad);
  display: flex; flex-direction: column; justify-content: safe center;
  max-width: 1400px;
}
.field > * { flex: 0 0 auto; }

/* entrance — a hard step, not a fade */
.field > * { animation: step .28s steps(3) both; }
.field > *:nth-child(1) { animation-delay: 0s; }
.field > *:nth-child(2) { animation-delay: .05s; }
.field > *:nth-child(3) { animation-delay: .1s; }
.field > *:nth-child(4) { animation-delay: .15s; }
.field > *:nth-child(5) { animation-delay: .2s; }
@keyframes step { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .field > * { animation: none; } }

.eyebrow {
  font-family: var(--f-mono); font-size: .7rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  margin: 0 0 1rem; padding-bottom: .4rem;
  border-bottom: var(--bw) solid var(--rule); align-self: flex-start;
}

.s-title, .hook-q {
  font-family: var(--f-display); font-weight: 900;
  font-variation-settings: "wdth" 105;
  letter-spacing: -.045em; text-transform: uppercase;
  margin: 0 0 1.1rem;
}
.s-title { font-size: clamp(2.1rem, 6.4vw, 5.4rem); line-height: .86; max-width: 18ch; }
.hook-q  { font-size: clamp(2.3rem, 7.6vw, 6.6rem); line-height: .84; max-width: 15ch; }
.s-title em, .hook-q em { font-style: normal; -webkit-text-stroke: 2px var(--ink); color: transparent; }
.s-title strong, .hook-q strong { font-weight: 900; background: var(--hl); color: #12110D; padding: 0 .12em; }

.s-h {
  font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 100;
  font-size: clamp(1.5rem, 3.6vw, 2.9rem); line-height: 1.02; letter-spacing: -.03em;
  margin: 0 0 1.1rem; max-width: 24ch; text-transform: uppercase;
}
.s-h em { font-style: normal; color: var(--accent-text); }
.s-lede { font-size: clamp(1.05rem, 1.9vw, 1.5rem); line-height: 1.4; max-width: 48ch; margin: 0 0 1.2rem; font-weight: 300; }
.s-body { font-size: clamp(.98rem, 1.4vw, 1.18rem); line-height: 1.6; max-width: 58ch; font-weight: 300; }
.s-body strong, .s-lede strong { font-weight: 600; }
.hook-note { font-family: var(--f-mono); font-size: .82rem; letter-spacing: .04em; margin: 1.4rem 0 0; max-width: 52ch; }

/* ---------- stepped list ---------- */
.steps { list-style: none; margin: 0; padding: 0; max-width: 66ch; border-top: 1px solid var(--rule); }
.steps li {
  display: grid; grid-template-columns: 2.6rem 1fr; gap: 1rem; align-items: baseline;
  padding: .6rem 0; border-bottom: 1px solid var(--rule);
  font-size: clamp(.95rem, 1.5vw, 1.2rem); line-height: 1.4; font-weight: 300;
  opacity: .22; transition: opacity .2s steps(2);
}
.steps li.on { opacity: 1; }
.steps li::before {
  content: attr(data-n);
  font-family: var(--f-mono); font-size: .78rem; font-weight: 700;
  padding: .1rem 0; text-align: center; border: 1px solid var(--rule);
}
.steps li.on::before { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-mode="dark"] .steps li.on::before { color: #12110D; }
.steps li b { font-weight: 600; }

/* ---------- two-column compare ---------- */
.cmp { display: grid; grid-template-columns: 1fr 1fr; border: var(--bw) solid var(--rule); box-shadow: var(--shadow); }
.cmp__col { padding: clamp(.9rem, 2vw, 1.6rem); }
.cmp__col + .cmp__col { border-left: var(--bw) solid var(--rule); }
.cmp__h {
  font-family: var(--f-mono); font-size: .68rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; margin: -.3rem -.3rem 1rem; padding: .3rem;
  background: var(--accent); color: #fff;
}
.cmp__col:nth-child(2) .cmp__h { background: var(--hl); color: #12110D; }
[data-mode="dark"] .cmp__h { color: #12110D; }
.cmp ul { margin: 0; padding-left: 1.05rem; display: grid; gap: .5rem; }
.cmp li { font-size: clamp(.9rem, 1.3vw, 1.08rem); line-height: 1.4; font-weight: 300; }
@media (max-width: 780px) { .cmp { grid-template-columns: 1fr; } .cmp__col + .cmp__col { border-left: 0; border-top: var(--bw) solid var(--rule); } }

/* ---------- code ---------- */
.code { border: var(--bw) solid var(--rule); box-shadow: var(--shadow); margin: 0 0 1.2rem; background: var(--paper-2); }
.code__bar {
  padding: .35rem .7rem; border-bottom: 1px solid var(--rule); background: var(--rule); color: var(--paper);
  font-family: var(--f-mono); font-size: .64rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.code pre { margin: 0; padding: .9rem 1rem; overflow-x: auto; }
.code code { font-size: clamp(.8rem, 1.15vw, 1.02rem); line-height: 1.6; display: block; white-space: pre; }
.code .ln { color: var(--ink-3); user-select: none; display: inline-block; width: 2.2em; }
.code .hl { background: var(--hl); color: #12110D; display: inline-block; width: 100%; }
.code .kw { color: var(--a); font-weight: 600; }
.code .st { color: var(--ok); }
.code .cm { color: var(--ink-3); font-style: italic; }
.code .nm { color: var(--b); font-weight: 600; }
.caption { font-size: .95rem; line-height: 1.5; max-width: 62ch; font-weight: 300; }

/* ---------- callout ---------- */
.note {
  border: var(--bw) solid var(--rule); padding: .9rem 1.05rem; max-width: 64ch;
  font-size: clamp(.94rem, 1.35vw, 1.12rem); line-height: 1.5; font-weight: 300;
  background: var(--paper-2);
}
.field > .note { margin-top: 1.4rem; }
.note strong { font-weight: 600; }
.note__tag {
  display: block; width: fit-content;
  font-family: var(--f-mono); font-size: .62rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: .5rem;
  background: var(--rule); color: var(--paper); padding: .12rem .4rem;
}
.note--warn { background: var(--hl); color: #12110D; border-color: #12110D; }
.note--warn .note__tag { background: #12110D; color: var(--hl); }
.note--exam { border-color: var(--b); box-shadow: 5px 5px 0 var(--b); }
.note--exam .note__tag { background: var(--b); color: #fff; }

/* ---------- activity ---------- */
.act { border: var(--bw) solid var(--rule); box-shadow: var(--shadow); max-width: 80ch; background: var(--paper-2); }
.act__bar {
  padding: .8rem 1.1rem; background: var(--hl); color: #12110D;
  font-family: var(--f-display); font-weight: 900; letter-spacing: -.02em;
  font-size: clamp(1.4rem, 3.6vw, 2.8rem); line-height: 1; text-transform: uppercase;
}
.act__bar + .act__scn { border-top: var(--bw) solid #12110D; }
.act__body { padding: 1.05rem 1.2rem 1.2rem; }
.act__how { margin: 0 0 .9rem; padding-left: 1.15rem; display: grid; gap: .45rem; }
.act__how li { font-size: clamp(.94rem, 1.3vw, 1.1rem); line-height: 1.45; font-weight: 300; }
.act__how li b { font-weight: 600; }
.act__why { font-size: .93rem; line-height: 1.45; border-top: 1px solid var(--rule); padding-top: .8rem; font-weight: 300; }

.timer { display: flex; align-items: center; gap: .8rem; margin-top: 1.1rem; }
.timer__read {
  font-family: var(--f-display); font-weight: 900; font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  border: var(--bw) solid var(--rule); padding: 0 .3rem; min-width: 3.6em; text-align: center;
}
.timer--run .timer__read { background: var(--hl); color: #12110D; }
.timer--done .timer__read { background: var(--no); color: #fff; animation: blink .6s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- trace table ---------- */
.trace__wrap { overflow-x: auto; border: var(--bw) solid var(--rule); box-shadow: var(--shadow); }
table.tt { border-collapse: collapse; width: 100%; font-family: var(--f-mono); font-size: clamp(.78rem, 1.1vw, .98rem); }
table.tt th, table.tt td { border: 1px solid var(--rule); padding: .4rem .6rem; text-align: center; }
table.tt th { background: var(--rule); color: var(--paper); font-weight: 700; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
table.tt td { color: var(--ink-3); }
table.tt tr.on td { color: var(--ink); background: var(--paper-2); }
table.tt tr.on td.out { background: var(--hl); color: #12110D; font-weight: 700; }
.trace__ctl { display: flex; gap: .55rem; margin-top: .8rem; align-items: center; flex-wrap: wrap; }
.trace__pos { font-family: var(--f-mono); font-size: .7rem; font-weight: 600; letter-spacing: .1em; }

/* ---------- quiz ---------- */
.quiz { max-width: 70ch; }
.quiz__q { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.15rem, 2.2vw, 1.75rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5rem; }
.quiz__marks { font-family: var(--f-mono); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 1rem; }
.quiz__marks span { background: var(--hl); color: #12110D; padding: .12rem .4rem; }
.quiz__opts { display: grid; border: var(--bw) solid var(--rule); }
.opt {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: .7rem; align-items: baseline;
  text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--rule);
  font-size: clamp(.93rem, 1.35vw, 1.1rem); line-height: 1.35; font-weight: 300;
}
.opt:last-child { border-bottom: 0; }
.opt:hover { background: var(--paper-2); }
.opt__k { font-family: var(--f-mono); font-size: .8rem; font-weight: 700; }
.opt.right { background: var(--ok); color: #fff; }
.opt.wrong { opacity: .4; }
.quiz__why { margin-top: 1rem; border: var(--bw) solid var(--ok); border-left-width: 8px; padding: .8rem 1rem; font-size: 1rem; line-height: 1.5; font-weight: 300; }

/* ---------- call stack ---------- */
.cs { display: grid; grid-template-columns: 1fr 220px; gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .cs { grid-template-columns: 1fr; } }
.cs__frames { display: flex; flex-direction: column-reverse; gap: 0; min-height: 220px; justify-content: flex-end; border: var(--bw) solid var(--rule); }
.frame {
  padding: .45rem .8rem; border-top: 1px solid var(--rule);
  font-family: var(--f-mono); font-size: clamp(.78rem, 1.1vw, .98rem);
  display: flex; justify-content: space-between; gap: 1rem;
  animation: push .18s steps(2) both;
}
.frame:last-child { border-top: 0; }
@keyframes push { from { opacity: 0; transform: translateY(8px); } }
.frame--active { background: var(--hl); color: #12110D; }
.frame--returning { background: var(--ok); color: #fff; }
.cs__side { border: var(--bw) solid var(--rule); padding: .8rem; background: var(--paper-2); }
.cs__label { font-family: var(--f-mono); font-size: .6rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .3rem; }
.cs__depth { font-family: var(--f-display); font-weight: 900; font-size: 2.4rem; line-height: 1; }
.cs__status { font-family: var(--f-mono); font-size: .78rem; }

/* ---------- flowchart ---------- */
.flow { display: grid; justify-items: center; }
.fnode {
  border: var(--bw) solid var(--rule); background: var(--paper);
  padding: .55rem 1.2rem; font-family: var(--f-mono); font-weight: 500;
  font-size: clamp(.78rem, 1.1vw, .98rem); text-align: center; min-width: 190px;
}
.fnode--terminal { border-radius: 999px; }
.fnode--decision {
  transform: rotate(45deg); width: 108px; height: 108px; display: grid; place-content: center;
  padding: 0; min-width: 0; margin: -14px 0;
}
.fnode--decision span { transform: rotate(-45deg); display: block; width: 128px; font-size: .82em; }
.fnode--io { clip-path: polygon(9% 0, 100% 0, 91% 100%, 0 100%); padding: .55rem 2rem; }
.fnode.on { background: var(--hl); color: #12110D; }
.farrow { width: var(--bw); height: 24px; background: var(--rule); position: relative; }
.farrow::after { content: ""; position: absolute; bottom: 0; left: -4px; border: 5px solid transparent; border-top-color: var(--rule); }

/* ============================================================
   Visual widgets — figure, branching flowchart, poll, match,
   buckets, confetti. Same language: hard rules, solid shadows.
   ============================================================ */

/* ---------- figure (drawn SVG example) ---------- */
.fig {
  border: var(--bw) solid var(--rule); box-shadow: var(--shadow);
  background: var(--paper); padding: clamp(.7rem, 1.6vw, 1.4rem);
  max-width: 1080px;
}
.fig svg { display: block; width: 100%; height: auto; max-height: 58vh; }
.fig svg text { font-family: var(--f-mono); fill: var(--ink); }
.fig .fx-box   { fill: var(--paper-2); stroke: var(--rule); stroke-width: 2; }
.fig .fx-boxp  { fill: var(--paper);   stroke: var(--rule); stroke-width: 2; }
.fig .fx-hlbox { fill: var(--hl); stroke: #12110D; stroke-width: 2; }
.fig .fx-line  { stroke: var(--rule); stroke-width: 2; fill: none; }
.fig .fx-thin  { stroke: var(--ink-3); stroke-width: 1.5; fill: none; }
.fig .fx-river { stroke: var(--paper-3); stroke-width: 26; fill: none; }
.fig .fx-acc   { stroke: var(--accent); stroke-width: 4; fill: none; }
.fig .fx-fill  { fill: var(--rule); }
.fig .fx-dim   { fill: var(--ink-3); }
.fig .fx-dot   { fill: var(--paper); stroke: var(--rule); stroke-width: 3; }
.fig .fx-dot--on { fill: var(--accent); stroke: var(--ink); }
.fig .fx-t   { font-size: 15px; font-weight: 600; }
.fig .fx-ts  { font-size: 12px; fill: var(--ink-2); }
.fig .fx-tt  { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.fig .fx-big { font-family: var(--f-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.fig .fx-on-dark { fill: #12110D; }
.fig .fx-tp { fill: var(--paper); }
.fig .fx-dash { stroke: var(--rule); stroke-width: 2; fill: none; stroke-dasharray: 6 5; }
.fig .fx-no-s { stroke: var(--no); stroke-width: 4; fill: none; }
.fig .fx-ok-s { stroke: var(--ok); stroke-width: 5; fill: none; }

/* ---------- concept deep-dive: text column + drawn example ---------- */
.con { display: grid; grid-template-columns: minmax(32ch, 46ch) 1fr; gap: clamp(1rem, 2.5vw, 2.4rem); align-items: start; }
@media (max-width: 980px) { .con { grid-template-columns: 1fr; } }
.con__def {
  border: var(--bw) solid var(--rule); background: var(--paper-2); box-shadow: var(--shadow);
  padding: .8rem 1rem; margin-bottom: 1rem;
  font-size: clamp(1rem, 1.6vw, 1.3rem); line-height: 1.45; font-weight: 500;
}
.con__why { font-size: clamp(.92rem, 1.3vw, 1.08rem); line-height: 1.55; font-weight: 300; margin: 0 0 1.1rem; max-width: 52ch; }
.con__why b { font-weight: 700; }
.con__fig { align-self: center; }

/* named tip boxes — the recurring characters: trap, survival tip, real world, TOK */
.tipbox {
  border: var(--bw) solid var(--rule); background: var(--paper);
  padding: .75rem .95rem; max-width: 48ch;
  font-size: .95rem; line-height: 1.5; font-weight: 300;
  transform: rotate(-1.2deg); box-shadow: 5px 5px 0 var(--rule);
}
.tipbox__tag {
  display: block; width: fit-content;
  font-family: var(--f-mono); font-size: .6rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  padding: .12rem .45rem; margin-bottom: .45rem;
}
.tipbox--trap { border-color: var(--b); box-shadow: 5px 5px 0 var(--b); }
.tipbox--trap .tipbox__tag { background: var(--b); color: #fff; }
.tipbox--tip { background: var(--hl); color: #12110D; border-color: #12110D; box-shadow: 5px 5px 0 #12110D; }
.tipbox--tip .tipbox__tag { background: #12110D; color: var(--hl); }
.tipbox--world { border-color: var(--a); box-shadow: 5px 5px 0 var(--a); }
.tipbox--world .tipbox__tag { background: var(--a); color: #fff; }
.tipbox--tok { border-style: dashed; transform: rotate(1deg); }
.tipbox--tok .tipbox__tag { background: var(--rule); color: var(--paper); }
[data-mode="dark"] .tipbox--trap .tipbox__tag,
[data-mode="dark"] .tipbox--world .tipbox__tag { color: #12110D; }

/* ---------- example cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; max-width: 1100px; }
.cardx {
  border: var(--bw) solid var(--rule); background: var(--paper-2); box-shadow: var(--shadow);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem;
}
.cardx__icon svg { width: 60px; height: 60px; display: block; }
.cardx__icon .ic { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.cardx__t {
  font-family: var(--f-display); font-weight: 800; font-size: 1.12rem;
  text-transform: uppercase; letter-spacing: -.01em;
  border-bottom: var(--bw) solid var(--accent); padding-bottom: .35rem;
}
.cardx__d { font-size: .93rem; line-height: 1.5; font-weight: 300; }

/* mission briefing strip inside an activity */
.act__scn {
  padding: .85rem 1.2rem; background: var(--paper);
  font-size: clamp(1rem, 1.6vw, 1.3rem); line-height: 1.5; font-weight: 300;
}
.act__scn b { font-weight: 600; }

/* ---------- flowchart (2D, branching) ---------- */
.fc {
  border: var(--bw) solid var(--rule); box-shadow: var(--shadow);
  background: var(--paper); padding: clamp(.6rem, 1.4vw, 1.1rem);
  align-self: center; width: 100%; max-width: 62rem; min-height: 0;
}
/* `width: auto` collapsed the box to zero height: an inline <svg> with only a
   viewBox has no intrinsic size to resolve `auto` against, so the graphics
   painted outside a 0px-tall box — visible, but past the fold and unreachable,
   because the slide's scrollHeight never counted them. Giving width a real
   value lets the viewBox supply the ratio and the box gets a true height. */
.fc svg { display: block; width: 100%; height: auto; max-height: 58vh; margin: 0 auto; }
.fc .fcn .shape { fill: var(--paper-2); stroke: var(--rule); stroke-width: 2; }
.fc .fcn text { font-family: var(--f-mono); font-size: 15px; font-weight: 500; fill: var(--ink); }
.fc .fcn.on .shape { fill: var(--hl); stroke: #12110D; }
.fc .fcn.on text { fill: #12110D; font-weight: 700; }
.fc .fce { stroke: var(--rule); stroke-width: 2; fill: none; }
.fc .fce-h { fill: var(--rule); }
.fc .fce-g.on .fce { stroke: var(--accent); stroke-width: 4; }
.fc .fce-g.on .fce-h { fill: var(--accent); }
.fc .fcl {
  font-family: var(--f-mono); font-size: 13px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; fill: var(--ink-2);
}

/* ---------- poll (live prediction) ---------- */
.poll { max-width: 78ch; }
.poll__opts { display: grid; border: var(--bw) solid var(--rule); box-shadow: var(--shadow); }
.popt {
  display: grid; grid-template-columns: 2rem minmax(0, 1.3fr) minmax(90px, 1fr) 2.6ch;
  gap: .7rem; align-items: center; text-align: left;
  padding: .6rem .9rem; border-bottom: 1px solid var(--rule);
  font-size: clamp(.95rem, 1.4vw, 1.18rem); font-weight: 300;
  background: var(--paper);
}
.popt:last-child { border-bottom: 0; }
.popt:hover { background: var(--paper-2); }
.popt__k { font-family: var(--f-mono); font-size: .8rem; font-weight: 700; }
.popt__bar { height: 16px; border: 1px solid var(--rule); background: var(--paper); }
.popt__bar i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width .18s steps(4); }
.popt__n {
  font-family: var(--f-mono); font-weight: 700; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 1.05rem;
}
.popt.right { background: var(--ok); color: #fff; }
.popt.right .popt__bar { border-color: #fff; }
.popt.right .popt__bar i { background: #fff; }
.popt.dim { opacity: .4; }
.poll__ctl { display: flex; gap: .55rem; align-items: center; margin-top: .8rem; flex-wrap: wrap; }
.poll__total { font-size: .8rem; color: var(--ink-2); margin-right: auto; }
.poll__reveal {
  margin-top: 1rem; border: var(--bw) solid var(--rule); border-left-width: 8px;
  border-left-color: var(--accent); padding: .8rem 1rem;
  font-size: 1rem; line-height: 1.5; font-weight: 300; background: var(--paper-2);
}

/* ---------- match (pairs game) ---------- */
.match { display: grid; grid-template-columns: 1fr 1.4fr; gap: .9rem; max-width: 1000px; }
.match__col { display: grid; gap: .55rem; align-content: start; }
.mt {
  border: var(--bw) solid var(--rule); background: var(--paper);
  padding: .5rem .8rem; text-align: left; min-height: 3.1rem;
  display: flex; align-items: center; gap: .6rem;
  font-size: clamp(.88rem, 1.25vw, 1.05rem); font-weight: 300; line-height: 1.3;
}
.mt:hover { background: var(--paper-2); box-shadow: 3px 3px 0 var(--rule); transform: translate(-1px, -1px); }
.mt.sel { outline: 3px solid var(--accent); outline-offset: -3px; background: var(--paper-2); }
.mt.done { background: var(--ok); color: #fff; border-color: var(--ok); pointer-events: none; box-shadow: none; transform: none; }
.mt.bad { background: var(--no); color: #fff; animation: shake .18s steps(2) 2; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.mt svg { width: 104px; height: 50px; flex: 0 0 auto; }
.mt svg .sym  { stroke: var(--rule); fill: var(--paper-2); stroke-width: 2.5; }
.mt svg .symf { fill: var(--rule); }
.mt svg .symt { font-family: var(--f-mono); font-size: 13px; font-weight: 700; fill: var(--ink); }
.mt.done svg .sym  { stroke: #fff; fill: transparent; }
.mt.done svg .symf { fill: #fff; }
.mt.done svg .symt { fill: #fff; }
.match__ctl { display: flex; gap: 1rem; align-items: center; margin-top: .8rem; flex-wrap: wrap; }
.match__ctl .mono { font-size: .78rem; }
.match__win { background: var(--ok); color: #fff; padding: .15rem .5rem; }
@media (max-width: 820px) { .match { grid-template-columns: 1fr; } }

/* ---------- buckets (rapid-fire classification) ---------- */
.bkt { max-width: 78ch; }
.bkt__card {
  border: var(--bw) solid var(--rule); box-shadow: var(--shadow); background: var(--paper-2);
  padding: 1.1rem 1.3rem; min-height: 5.2rem; display: flex; align-items: center;
  font-family: var(--f-display); font-weight: 800; letter-spacing: -.02em;
  font-size: clamp(1.15rem, 2.6vw, 2rem); line-height: 1.15;
}
.bkt__card.right { background: var(--ok); color: #fff; }
.bkt__card.wrong { background: var(--no); color: #fff; }
.bkt__btns { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: .9rem; }
.bkt__b {
  border: var(--bw) solid var(--rule); background: var(--paper);
  padding: .85rem .6rem; font-family: var(--f-mono); font-weight: 700;
  font-size: clamp(.78rem, 1.4vw, 1rem); letter-spacing: .14em; text-transform: uppercase;
}
.bkt__b:hover { background: var(--hl); color: #12110D; box-shadow: 4px 4px 0 var(--rule); transform: translate(-1px, -1px); }
.bkt__b:active { box-shadow: none; transform: none; }
.bkt__b:disabled { opacity: .35; pointer-events: none; }
.bkt__why {
  margin-top: .9rem; border: var(--bw) solid var(--rule); border-left-width: 8px;
  padding: .7rem .9rem; font-size: .98rem; line-height: 1.5; font-weight: 300; background: var(--paper);
}
.bkt__why b { font-weight: 600; }
.bkt__why .btn { margin-left: .6rem; }
.bkt__stamp {
  display: inline-block; font-family: var(--f-mono); font-size: .66rem; font-weight: 700;
  letter-spacing: .16em; padding: .12rem .45rem; margin-right: .55rem;
  border: 2px solid currentColor; transform: rotate(-3deg);
}
.bkt__stamp--ok { color: var(--ok); }
.bkt__stamp--no { color: var(--no); }
.bkt__row { display: flex; gap: 1rem; align-items: center; margin-top: .8rem; }
.bkt__row .mono { font-size: .78rem; }
.bkt__streak {
  font-family: var(--f-mono); font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; background: var(--hl); color: #12110D;
  padding: .15rem .5rem; transform: rotate(-2deg); border: 2px solid #12110D;
}

/* ---------- confetti — solid squares, no gradients, no blur ---------- */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 40; }
.confetti i {
  position: absolute; top: -20px; display: block;
  animation: cfall linear both;
}
@keyframes cfall {
  from { transform: translateY(-4vh) rotate(0deg); }
  to   { transform: translateY(104vh) rotate(540deg); }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* ---------- exit ticket ---------- */
.exit { display: grid; gap: 0; max-width: 72ch; border: var(--bw) solid var(--rule); box-shadow: var(--shadow); }
.exit__q { padding: .9rem 1.05rem; border-bottom: 1px solid var(--rule); font-size: clamp(.97rem, 1.4vw, 1.16rem); line-height: 1.4; font-weight: 300; }
.exit__q:last-child { border-bottom: 0; }
.exit__q em {
  font-style: normal; font-family: var(--f-mono); font-size: .64rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  display: block; width: fit-content;
  background: var(--hl); color: #12110D; padding: .1rem .35rem; margin-bottom: .45rem;
}

/* ---------- answer box (AI check) ---------- */
.ans { margin-top: .75rem; }
.ans textarea {
  width: 100%; min-height: 4.5rem; resize: vertical;
  border: var(--bw) solid var(--rule); background: var(--paper);
  padding: .55rem .7rem; font-family: var(--f-body); font-size: 1rem; line-height: 1.45; color: var(--ink);
}
.ans textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.ans__row { display: flex; gap: .55rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.ans__left { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; color: var(--ink-3); margin-left: auto; }
.fb { margin-top: .7rem; border: var(--bw) solid var(--rule); }
.fb__head {
  padding: .4rem .7rem; font-family: var(--f-mono); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; display: flex; gap: .7rem; align-items: baseline;
}
.fb--yes .fb__head { background: var(--ok); color: #fff; }
.fb--part .fb__head { background: var(--hl); color: #12110D; }
.fb--no  .fb__head { background: var(--no); color: #fff; }
.fb__body { padding: .7rem .85rem; font-size: .98rem; line-height: 1.5; font-weight: 300; }
.fb__body h5 { margin: .8rem 0 .3rem; font-family: var(--f-mono); font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.fb__body h5:first-child { margin-top: 0; }
.fb__body ul { margin: .2rem 0; padding-left: 1.1rem; }
.fb__body li { margin-bottom: .3rem; }

/* ============================================================
   Student explanation panel (right-click / E)
   ============================================================ */
.es {
  position: fixed; inset: auto 0 0 0; z-index: 60; max-height: 70vh; overflow-y: auto;
  background: var(--paper); border-top: 4px solid var(--accent);
  transform: translateY(101%); transition: transform .2s steps(4);
  box-shadow: 0 -6px 0 var(--rule);
}
.es.open { transform: none; }
.es__in { padding: 1.2rem var(--pad) 2rem; max-width: 900px; margin: 0 auto; }
.es__h {
  font-family: var(--f-mono); font-size: .68rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; margin-bottom: .9rem; display: flex; gap: 1rem; align-items: center;
}
.es__h span { margin-left: auto; color: var(--ink-3); }
.es p { font-size: 1.02rem; line-height: 1.55; margin: 0 0 .8rem; font-weight: 300; }
.es b { font-weight: 600; }
.es__none { color: var(--ink-3); font-style: italic; }

/* the button that tells students the panel exists — lives in the deck footer */
.es-tab {
  font-family: var(--f-mono); font-size: .66rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; padding: .25rem .6rem;
  border: var(--bw) solid var(--rule); white-space: nowrap;
  background: var(--paper);
}
.es-tab[data-has="1"] { background: var(--accent); color: #fff; }
[data-mode="dark"] .es-tab[data-has="1"] { color: #12110D; }
.es-tab:hover { background: var(--hl); color: #12110D; }

/* ============================================================
   Plan semestral (/plan) — built to be printed
   ============================================================ */
.plan { max-width: 1600px; margin: 0 auto; padding-bottom: 5rem; }
.plan__meta {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline;
  padding: .6rem var(--pad); border-bottom: 1px solid var(--rule); background: var(--paper-2);
}
.plan__warn { background: var(--hl); color: #12110D; padding: .1rem .4rem; }
.plan__wrap { overflow-x: auto; }

table.plan__t { border-collapse: collapse; width: 100%; }
table.plan__t th {
  font-family: var(--f-mono); font-size: .62rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; text-align: left; padding: .45rem .6rem;
  background: var(--rule); color: var(--paper); white-space: nowrap;
}
table.plan__t td {
  padding: .5rem .6rem; vertical-align: top; font-size: .9rem; line-height: 1.35;
  border-bottom: 1px solid var(--line-soft, var(--paper-3));
}
table.plan__t tr.plan__wstart td { border-top: var(--bw) solid var(--rule); }
table.plan__t td.mono { font-family: var(--f-mono); font-size: .76rem; white-space: nowrap; }
.plan__w { font-family: var(--f-display); font-weight: 900; font-size: 1.1rem; }
.plan__topic {
  display: block; font-family: var(--f-mono); font-size: .62rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-top: .15rem;
}
.plan__note2 { display: block; color: var(--ink-2); font-weight: 300; font-size: .84rem; margin-top: .2rem; max-width: 46ch; }
.plan__dash, .plan__todo { color: var(--ink-3); }
.plan__i { color: var(--ink-3); font-size: .7rem; }
.plan__fit { color: var(--ok); }
.plan__badge {
  display: inline-block; margin-left: .4rem; font-family: var(--f-mono);
  font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--rule); padding: .05rem .3rem;
}
tr.plan__async td { background: repeating-linear-gradient(45deg, transparent 0 6px, var(--paper-2) 6px 12px); }
tr.plan__event td { background: var(--rule); color: var(--paper); font-weight: 600; }
tr.plan__event--exam td { background: var(--b); color: #fff; }
.plan__ok { text-decoration: none; border-bottom: var(--bw) solid var(--accent); font-weight: 700; }
.plan__foot { padding: 2rem var(--pad); border-top: var(--bw) solid var(--rule); }
.plan__foot h4 { font-family: var(--f-mono); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 .6rem; }
.plan__foot ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.plan__foot li { font-size: .95rem; line-height: 1.6; }
.plan__note { font-size: .93rem; line-height: 1.55; font-weight: 300; max-width: 78ch; }

@media print {
  .plan__meta, .masthead__side { break-inside: avoid; }
  table.plan__t { font-size: 9pt; }
  table.plan__t th { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .course { break-before: page; }
  .course:first-of-type { break-before: auto; }
  .plan__note2 { max-width: none; }
}

/* ============================================================
   Mapa del curso (/mapa) — proportional timeline
   ============================================================ */
.rm__legend {
  display: flex; flex-wrap: wrap; gap: .5rem 1.4rem;
  padding: .8rem var(--pad); border-bottom: var(--bw) solid var(--rule);
  font-family: var(--f-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase;
}
.rm__key { display: flex; align-items: center; gap: .4rem; }
.rm__sw { width: 14px; height: 14px; border: 1px solid var(--rule); display: inline-block; }
.rm__sw--a { background: var(--a); }
.rm__sw--b { background: var(--b); }
.rm__sw--case { background: var(--hl); }
.rm__sw--ia { background: var(--ok); }
.rm__sw--csp { background: var(--paper-3); }
.rm__sw--prac { background: repeating-linear-gradient(45deg, var(--paper-2) 0 4px, var(--paper-3) 4px 8px); }

.rm__row { display: grid; grid-template-columns: 12rem 1fr; border-bottom: 1px solid var(--rule); }
.rm__row:last-child { border-bottom: 0; }
.rm__row--live { background: color-mix(in oklab, var(--hl) 22%, transparent); }
@media (max-width: 780px) { .rm__row { grid-template-columns: 1fr; } }

.rm__label {
  padding: .9rem var(--pad); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: .12rem;
}
.rm__label b { font-family: var(--f-display); font-weight: 900; font-size: 1.15rem; }
.rm__label .mono { font-size: .66rem; letter-spacing: .08em; color: var(--ink-2); }
.rm__term { color: var(--ink-3) !important; }
.rm__now {
  align-self: flex-start; margin-top: .25rem;
  font-family: var(--f-mono); font-size: .58rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; background: var(--rule); color: var(--paper); padding: .1rem .35rem;
}

.rm__track { padding: .9rem var(--pad) 1rem; min-width: 0; }
.rm__bars { display: flex; position: relative; border: var(--bw) solid var(--rule); min-height: 3.6rem; }
.rm__bar {
  border-right: 1px solid var(--rule); padding: .3rem .4rem; min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: .05rem;
}
.rm__bar:last-of-type { border-right: 0; }
.rm__bar--a { background: var(--a); color: #fff; }
.rm__bar--b { background: var(--b); color: #fff; }
.rm__bar--case { background: var(--hl); color: #12110D; }
.rm__bar--ia { background: var(--ok); color: #fff; }
.rm__bar--csp { background: var(--paper-3); }
.rm__bar--prac { background: repeating-linear-gradient(45deg, var(--paper-2) 0 5px, var(--paper-3) 5px 10px); }
[data-mode="dark"] .rm__bar--a, [data-mode="dark"] .rm__bar--b, [data-mode="dark"] .rm__bar--ia { color: #12110D; }
.rm__code { font-family: var(--f-mono); font-size: .62rem; font-weight: 700; letter-spacing: .08em; }
.rm__title { font-size: .74rem; line-height: 1.15; font-weight: 500; }
.rm__h { font-family: var(--f-mono); font-size: .6rem; opacity: .8; }
.rm__bar[style*="width:1"] .rm__title, .rm__bar[style*="width:2"] .rm__title,
.rm__bar[style*="width:3"] .rm__title { display: none; }

/* the dotted line marking how many classes the semester really gives */
.rm__cap { position: absolute; top: -.55rem; bottom: -.55rem; }
.rm__cap i { position: absolute; inset: 0; border-left: 2px dashed var(--rule); }
.rm__cap em {
  position: absolute; top: -.2rem; left: .3rem; white-space: nowrap; font-style: normal;
  font-family: var(--f-mono); font-size: .56rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; background: var(--rule); color: var(--paper); padding: .05rem .3rem;
}
.rm__sum { margin-top: .9rem; font-size: .7rem; letter-spacing: .06em; display: flex; gap: .8rem; flex-wrap: wrap; }
.rm__over { background: var(--no); color: #fff; padding: .05rem .35rem; font-weight: 700; }
.rm__fit { color: var(--ok); font-weight: 700; }
/* blocks are buttons — clicking opens the class-by-class breakdown */
button.rm__bar { border-top: 0; border-bottom: 0; border-left: 0; text-align: left; cursor: pointer; font: inherit; }
button.rm__bar:hover { outline: 3px solid var(--rule); outline-offset: -3px; }
button.rm__bar:focus-visible { outline: 3px solid var(--rule); outline-offset: -3px; }
.rm__hint { color: var(--ink-3); }

.modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: color-mix(in oklab, var(--ink) 55%, transparent); padding: 1rem;
}
.modal[hidden] { display: none; }
.modal__box {
  background: var(--paper); border: var(--bw) solid var(--rule); box-shadow: 10px 10px 0 var(--rule);
  max-width: 780px; width: 100%; max-height: 86vh; overflow-y: auto;
}
.modal__head { display: flex; align-items: flex-start; gap: 1rem; padding: .9rem 1.1rem; border-bottom: var(--bw) solid var(--rule); }
.modal__head .mono { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.modal__head h3 { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; margin: .2rem 0 0; text-transform: uppercase; }
.modal__x { margin-left: auto; font-family: var(--f-mono); font-size: 1rem; font-weight: 700; line-height: 1; padding: .2rem .4rem; border: 1px solid currentColor; }
.modal__meta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; padding: .55rem 1.1rem; border-bottom: 1px solid var(--rule); background: var(--paper-2); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
.modal__list { list-style: none; margin: 0; padding: 0; }
.modal__list li {
  display: grid; grid-template-columns: 2.2rem 6.5rem 1fr auto; gap: .7rem; align-items: baseline;
  padding: .5rem 1.1rem; border-bottom: 1px solid var(--paper-3); font-size: .93rem; line-height: 1.35;
}
.modal__list li:last-child { border-bottom: 0; }
.modal__n { color: var(--ink-3); font-size: .7rem; }
.modal__code { font-size: .68rem; color: var(--accent-text); font-weight: 700; }
.modal__go { font-size: .66rem; font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--accent); }
.modal__go--none { border: 0; color: var(--ink-3); }
.modal .plan__note { padding: .8rem 1.1rem; margin: 0; border-top: 1px solid var(--rule); }
@media (max-width: 620px) {
  .modal__list li { grid-template-columns: 2rem 1fr; }
  .modal__code, .modal__go { grid-column: 2; }
}
@media print { .modal { display: none !important; } }

.rm__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1rem 0; }
.rm__cols > div { border: var(--bw) solid var(--rule); padding: .8rem 1rem; }
.rm__cols .mono { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 700px) { .rm__cols { grid-template-columns: 1fr; } }
.rm__detail { padding-left: 1.2rem; margin: .4rem 0 1rem; }
.rm__detail li { font-size: .95rem; line-height: 1.55; margin-bottom: .3rem; }

@media print {
  .rm__row { break-inside: avoid; }
  .rm__bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- teacher notes (own route) ---------- */
.teach { max-width: 900px; margin: 0 auto; padding: var(--pad) var(--pad) 6rem; }
.teach h1 { font-family: var(--f-display); font-weight: 900; font-size: clamp(1.8rem, 5vw, 3.4rem); line-height: .9; letter-spacing: -.03em; text-transform: uppercase; margin: 0 0 .5rem; }
.teach h4 { font-family: var(--f-mono); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin: 2rem 0 .5rem; padding-bottom: .3rem; border-bottom: var(--bw) solid var(--rule); }
.teach p, .teach li { font-size: 1rem; line-height: 1.55; font-weight: 300; }
.teach ul { padding-left: 1.2rem; }
.teach__es { border-left: 6px solid var(--accent); padding-left: 1rem; }
.gate { max-width: 420px; margin: 15vh auto; padding: 0 var(--pad); }
.gate input { width: 100%; border: var(--bw) solid var(--rule); background: var(--paper); padding: .6rem .7rem; font-family: var(--f-mono); font-size: 1rem; color: var(--ink); }

/* ---------- deck footer ---------- */
.foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: .9rem;
  padding: .4rem .8rem; border-top: var(--bw) solid var(--rule); background: var(--paper-2);
  font-family: var(--f-mono); font-size: .68rem; font-weight: 500;
}
.foot__prog { flex: 1; height: 8px; border: 1px solid var(--rule); }
.foot__prog i { display: block; height: 100%; background: var(--accent); transition: width .2s steps(4); }
.foot__n { font-weight: 700; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.foot__keys { letter-spacing: .04em; color: var(--ink-2); }
.foot__keys kbd { border: 1px solid var(--rule); padding: .05rem .28rem; font-size: .64rem; }

@media (max-width: 760px) {
  .reg__cell--hide, .foot__keys { display: none; }
  .masthead { grid-template-columns: 1fr; }
  .masthead__side { text-align: left; }
}

@media print {
  .foot, .reg, .es, .es-tab, .rail { display: none !important; }
  .slide { position: static; page-break-after: always; grid-template-columns: 1fr; }
  .slide[hidden] { display: grid !important; }
}

/* a block that rides inside other sessions, shown under the bar row */
.rm__embedded {
  margin-top: .5rem; font-family: var(--f-mono); font-size: .64rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; text-align: left;
  border: 1px dashed var(--rule); padding: .3rem .55rem; background: var(--paper-2);
}
.rm__embedded:hover { background: var(--hl); color: #12110D; }

/* real date and home study, inside the class-by-class modal */
.modal__when { display: block; font-size: .6rem; color: var(--ink-3); letter-spacing: .1em; margin-top: .15rem; }
.modal__pre {
  display: block; margin-top: .3rem; padding: .35rem .5rem;
  border-left: 3px solid var(--accent); background: var(--paper-2);
  font-size: .84rem; line-height: 1.4; font-weight: 300;
}
.rm__flip, .rm__est {
  align-self: flex-start; margin-top: .25rem;
  font-family: var(--f-mono); font-size: .56rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: .1rem .35rem; border: 1px solid var(--rule);
}
.rm__flip { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-mode="dark"] .rm__flip { color: #12110D; }
.rm__est { color: var(--ink-3); border-style: dashed; }

/* ---------- blank the projector, and the clicker panel ---------- */

/* A black curtain over everything: the fastest way to get 22 pairs of eyes
   off the screen and onto you. Nothing is unmounted, so nothing is lost. */
.curtain {
  position: fixed; inset: 0; z-index: 90;
  background: #000; display: none;
}
body.blanked .curtain { display: block; }
body.blanked .curtain::after {
  content: 'B o Esc para volver';
  position: absolute; left: 50%; bottom: 2rem; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .18em;
  text-transform: uppercase; color: #333;
}

.keys {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(18, 17, 13, .55);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.keys[hidden] { display: none; }
.keys__box {
  background: var(--paper); border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  width: min(34rem, 100%); max-height: 86vh; overflow: auto; padding: 1.4rem;
}
.keys__h {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: .8rem;
}
.keys__h b { font-family: var(--f-display); font-size: 1.1rem; letter-spacing: -.01em; }
.keys__h span, .keys__foot { font-family: var(--f-mono); font-size: .6rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.keys__msg { font-size: .92rem; margin: 0 0 .5rem; }
.keys__last { font-size: .82rem; margin: 0 0 .8rem; color: var(--ink-2); }
.keys__list { list-style: none; margin: 0; padding: 0; }
.keys__list li {
  display: grid; grid-template-columns: 1fr auto auto; gap: .6rem;
  align-items: center; padding: .45rem 0; border-top: 1px solid var(--rule);
}
.keys__lbl { font-size: .9rem; }
.keys__ks { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.keys__foot { margin: .9rem 0 0; padding-top: .7rem; border-top: 2px solid var(--ink); }

/* ---------- a slide taller than the stage ---------- */

/* From the back of the room you cannot tell a slide continues below the fold.
   This marks it, and disappears the moment you reach the bottom. */
.slide--more::after {
  content: '↓ sigue';
  position: absolute; right: 1rem; bottom: .8rem; z-index: 5;
  font-family: var(--f-mono); font-size: .6rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding: .2rem .45rem;
  background: var(--accent); color: #fff;
  border: var(--bw) solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  animation: nudge 1.6s ease-in-out infinite;
}
[data-mode="dark"] .slide--more::after { color: #12110D; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .slide--more::after { animation: none; } }

/* the scrollbar should not be a design element; keep it thin and quiet */
.slide { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.slide::-webkit-scrollbar { width: 8px; }
.slide::-webkit-scrollbar-thumb { background: var(--rule); }

/* a photograph in a figure slide: portrait beside the prose, not stacked above
   it — a tall image centred on its own leaves the text stranded under a column */
.photo { display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 3vw, 2.2rem); align-items: center; }
.photo__img {
  display: block; height: clamp(200px, 42vh, 400px); width: auto;
  border: var(--bw) solid var(--ink); box-shadow: var(--shadow);
}
.photo__txt { font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.5; font-weight: 300; }
@media (max-width: 800px) { .photo { grid-template-columns: 1fr; justify-items: center; } }
