/* Slides. A slide is designed at 1280 x 720 and scaled to the window; on a narrow
   screen and in print the deck turns into a plain scrolling document. */
html, body { height: 100%; }
body { overflow: hidden; }

.deck { position: fixed; inset: 0; }

.slide {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  margin: -360px 0 0 -640px;
  padding: 52px 72px 40px;
  display: none;
  flex-direction: column;
  transform: scale(var(--fit, 1));
  transform-origin: center;
}
.slide.is-current { display: flex; }

h1, h2 { margin: 0; font-weight: 700; letter-spacing: -0.022em; text-wrap: balance; }
h1 { font-size: 92px; line-height: 1; font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: 46px; line-height: 1.1; }
p { margin: 0; }

.lede { margin-top: 14px; max-width: 62ch; font-size: 21px; line-height: 1.45; color: var(--text-2); }
.body { margin-top: 28px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.takeaway {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 21px;
  line-height: 1.4;
  max-width: 70ch;
}
.source { margin-top: 8px; font: 13px/1.5 var(--mono); color: var(--text-3); }
.source a { color: var(--text-2); }

/* status line, the way a terminal multiplexer shows it */
.status {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0;
  height: 34px;
  font: 12px/1 var(--mono);
  color: var(--text-2);
  background: var(--canvas);
  border-top: 1px solid var(--border);
}
.status > * { padding: 0 14px; height: 100%; display: flex; align-items: center; border-right: 1px solid var(--border); }
.status .grow { flex: 1; }
.status a { color: var(--text-2); text-decoration: none; }
.status a:hover { color: var(--accent); }
.status button { border: 0; border-right: 1px solid var(--border); border-radius: 0; background: none; color: var(--text-2); }
.status button:hover { color: var(--accent); }
.status .count { color: var(--text); border-right: 0; }

/* 01 title */
.title h1 { margin-top: 40px; }
.title .sub { margin-top: 18px; font-size: 30px; color: var(--accent); letter-spacing: -0.01em; }
.title .premise { margin-top: 26px; font-size: 21px; line-height: 1.5; max-width: 60ch; }
.terminal {
  margin-top: 30px;
  padding: 18px 22px;
  min-height: 136px;
  font: 15px/1.75 var(--mono);
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.terminal .cmd { color: var(--text); }
.terminal .cursor { display: inline-block; width: 9px; height: 18px; vertical-align: -3px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.byline { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.byline strong { display: block; font-size: 22px; font-weight: 600; }
.byline span { display: block; margin-top: 4px; font-size: 15px; color: var(--text-2); }
.byline .links { font: 14px/1.9 var(--mono); text-align: right; }

/* 02 task */
.steps { display: grid; gap: 30px; max-width: 900px; }
.steps dt { font: 500 14px/1 var(--mono); color: var(--text-3); }
.steps dd { margin: 10px 0 0; font-size: 25px; line-height: 1.38; }
.steps dd.now { color: var(--accent); }

/* 03 idea */
.idea { display: grid; grid-template-columns: 200px 1fr 300px; gap: 40px; align-items: center; padding: 30px 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.idea figcaption, .idea .cap { font: 13px/1.4 var(--mono); color: var(--text-2); }
.idea svg { display: block; width: 100%; height: auto; }
.dna { display: flex; height: 44px; gap: 2px; margin: 12px 0 14px; }
.dna span { min-width: 2px; display: flex; align-items: center; padding-left: 8px; font: 500 13px/1 var(--mono); overflow: hidden; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 13px/1.4 var(--mono); color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; }
.metrics { display: grid; gap: 16px; margin: 0; }
.metrics div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 16px; }
.metrics dt { font: 15px/1.2 var(--mono); color: var(--text); }
.metrics dd { margin: 0; font: 700 30px/1 var(--mono); color: var(--accent); }
.metrics small { grid-column: 1 / -1; font: 12.5px/1.3 var(--mono); color: var(--text-3); }

/* figures */
.figure { margin: 22px 0 0; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.figure svg, .figure img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.figure svg [data-tip] { cursor: crosshair; }

/* 07 stack, 09 uses, 11 errata: rows, not cards */
.rows { display: grid; margin: 0; border-top: 1px solid var(--border); }
.rows > div { display: grid; grid-template-columns: 330px 1fr; gap: 28px; padding: 13px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.rows dt { font: 600 17px/1.3 var(--mono); color: var(--accent); }
.rows dd { margin: 0; font-size: 18.5px; line-height: 1.42; color: var(--text); }
.rows dd small { display: block; margin-top: 3px; font-size: 14.5px; color: var(--text-2); }
.rows.plain dt { font: 600 19px/1.3 var(--sans); color: var(--text); }
.rows.tight > div { grid-template-columns: 250px 1fr; padding: 10px 0; }
.rows.tight dd { font-size: 17px; }

/* 08 code */
.code-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 24px; flex: 1; min-height: 0; }
.code {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.code header { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 18px; height: 40px; border-bottom: 1px solid var(--border); font: 13px/1 var(--mono); color: var(--text-2); }
.code header button { padding: 6px 10px; font-size: 12px; }
.code pre { margin: 0; padding: 12px 0; overflow: auto; flex: 1; font: 13px/1.6 var(--mono); counter-reset: line; tab-size: 4; scrollbar-color: #374151 transparent; }
.code .l { display: block; padding: 0 18px 0 0; white-space: pre; }
.code .l::before { counter-increment: line; content: counter(line); display: inline-block; width: 44px; margin-right: 16px; text-align: right; color: #4B5563; user-select: none; }
.code .l.on { background: rgba(56, 189, 248, 0.09); box-shadow: inset 2px 0 0 var(--accent); }
/* semantic tokens */
.code .k, .code .kn, .code .ow, .code .kc { color: var(--accent); }
.code .s, .code .s1, .code .s2, .code .sa, .code .sd, .code .se { color: #A7F3D0; }
.code .sd { color: var(--text-3); }
.code .si, .code .sx { color: var(--retail); }
.code .q { color: #C7D2FE; font-weight: 500; }
.code .c1, .code .ch, .code .c { color: var(--text-3); font-style: italic; }
.code .mi, .code .mf { color: var(--retail); }
.code .nb, .code .nf { color: #C7D2FE; }
.code .o, .code .p { color: var(--text-2); }
.outline { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; align-content: start; }
.outline button { width: 100%; text-align: left; padding: 8px 12px; display: grid; gap: 4px; font: 500 13.5px/1.25 var(--sans); background: none; }
.outline button small { font: 12px/1 var(--mono); color: var(--text-3); }
.outline button[aria-pressed="true"] { background: var(--surface); }

/* 10 take it */
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 6px; }
.checks > div { padding: 22px 26px; }
.checks > div + div { border-left: 1px solid var(--border); }
.checks b { display: block; font-size: 25px; font-weight: 600; }
.checks b span { font-family: var(--mono); color: var(--accent); margin-right: 14px; }
.checks p { margin-top: 8px; font-size: 18px; color: var(--text-2); }
.take { margin-top: 26px; display: grid; grid-template-columns: 190px 1fr; gap: 34px; align-items: center; }
.take img { display: block; width: 190px; height: 190px; border-radius: 4px; background: #fff; }
.take .url { font: 600 27px/1.2 var(--mono); color: var(--accent); text-decoration: none; }
.take p { margin-top: 10px; font-size: 17px; line-height: 1.5; color: var(--text-2); }
.take p.mono { font-size: 13.5px; color: var(--text-3); }

/* narrow screens and print: a scrolling document */
@media (max-width: 820px), print {
  html, body { height: auto; }
  body { overflow: auto; }
  .deck { position: static; }
  .slide {
    position: static;
    display: flex;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 40px 16px 36px;
    transform: none;
    border-bottom: 1px solid var(--border);
  }
  h1 { font-size: 46px; }
  h2 { font-size: 29px; }
  .title h1 { margin-top: 8px; }
  .title .sub { font-size: 21px; }
  .lede, .takeaway, .title .premise { font-size: 17px; }
  .terminal { font-size: 12.5px; padding: 14px; }
  .byline { margin-top: 28px; flex-direction: column; align-items: flex-start; }
  .byline .links { text-align: left; }
  .steps dd { font-size: 19px; }
  .idea { grid-template-columns: 1fr; gap: 22px; padding: 20px 16px; }
  .idea > figure:first-child { max-width: 150px; }
  .rows > div, .rows.tight > div { grid-template-columns: 1fr; gap: 4px; }
  .rows dd { font-size: 16.5px; }
  .figure { overflow-x: auto; justify-content: flex-start; }
  .figure svg, .figure img { min-width: 640px; max-height: none; }
  .code-wrap { grid-template-columns: minmax(0, 1fr); }
  .slide > *, .body > * { min-width: 0; max-width: 100%; }
  .code pre { max-height: 70vh; font-size: 12px; }
  .outline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checks { grid-template-columns: 1fr; }
  .checks > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .take { grid-template-columns: 1fr; gap: 18px; }
  .take .url { font-size: 17px; overflow-wrap: anywhere; }
  .status { position: sticky; }
  .status .wide, .status button, .status [data-status], .status .count { display: none; }
}

@media print {
  @page { size: 1280px 720px; margin: 0; }
  .slide { break-after: page; min-height: 720px; padding: 56px 72px; border: 0; }
  .status, .code header button { display: none; }
  .code pre { max-height: none; overflow: visible; font-size: 9px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
