:root {
  color-scheme: dark;
  font-family: Geist, Arial, sans-serif;
  color: #fff;
  background: #000;
  --muted: #a3a3a3;
  --rule: #4b4b4b;
  --gutter: clamp(12px, 2vw, 32px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  padding: 8px var(--gutter);
}

a { color: inherit; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.masthead,
footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: baseline;
  padding-block: 7px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.masthead { border-top: 1px solid #fff; }
.masthead a, footer a { text-decoration: none; }
.masthead a:hover, footer a:hover { text-decoration: underline; }
.masthead > :last-child, footer > :last-child { text-align: right; }

#deck { flex: 1; display: grid; align-content: center; }

.class-index {
  flex: 1;
  width: min(100%, 72rem);
  margin-inline: auto;
  padding-block: clamp(3rem, 12vh, 8rem);
}

.class-index h1 {
  margin: 0 0 clamp(2rem, 6vw, 4.5rem);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.class-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}

.class-list a:last-child { border-bottom: 1px solid var(--rule); }
.class-list a:hover h2 { text-decoration: underline; }
.class-list h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.5rem); }
.class-list p { margin: 0.5rem 0 0; color: var(--muted); }

.slide {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  column-gap: var(--gutter);
  row-gap: clamp(18px, 4vw, 56px);
  align-content: center;
  min-height: clamp(24rem, 58vh, 48rem);
  padding-block: clamp(40px, 8vh, 112px);
  scroll-margin-top: 64px;
}

.slide + .slide:not([hidden]) { border-top: 1px solid var(--rule); }
.slide[hidden] + .slide { border-top: 0; }
.slide > * { margin: 0; }

.label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.slide :is(h1, h2) {
  font-weight: 600;
  font-size: clamp(2.75rem, 7vw, 8rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.cover h1 { font-size: clamp(3.5rem, 10vw, 12rem); }
.punctuation { color: var(--muted); }

.project {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: center;
  row-gap: 16px;
  padding-block: clamp(28px, 5vh, 72px);
}

.project h2 { font-size: clamp(2.25rem, 5vw, 6rem); }
.project h2 a { text-decoration-thickness: 1px; text-underline-offset: 0.1em; }
.project :is(video, img) {
  display: block;
  width: 100%;
  max-height: 63svh;
  object-fit: contain;
}

.project video { aspect-ratio: 16 / 9; background: #111; }
.project img { height: auto; }

.copy {
  align-self: end;
  max-width: 43ch;
  min-width: 0;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  line-height: 1.45;
}

.project .copy { align-self: center; }
.project .copy h2 { margin-bottom: 0.35em; }
.cover .copy { color: var(--muted); }
.copy > :first-child { margin-top: 0; }
.copy > :last-child { margin-bottom: 0; }
.copy li + li { margin-top: 0.65em; }
.copy ol { padding-left: 1.3em; }
.resources { padding: 0; list-style: none; }

.git-recap pre { font-size: clamp(0.875rem, 1.2vw, 1.125rem); }

.course-plan {
  grid-template-columns: minmax(0, 1fr);
  row-gap: clamp(16px, 3vw, 36px);
}

.course-plan h2 { font-size: clamp(2.5rem, 5.5vw, 6rem); }
.course-sessions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--gutter);
}

.course-sessions section {
  border-top: 1px solid var(--rule);
  padding-top: 0.85rem;
  line-height: 1.45;
}

.course-sessions h3 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.course-sessions p { max-width: 64ch; margin: 0 0 0.65rem; }
.course-sessions p:last-child { margin-bottom: 0; }
.session-date { color: var(--muted); font-size: 0.875rem; }

.speaker-notes {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  line-height: 1.55;
}

.speaker-notes > * { max-width: 72ch; }
.speaker-notes > :first-child { margin-top: 0; }
.speaker-notes ol { padding-inline-start: 1.3em; }
.speaker-notes li + li { margin-top: 0.4em; }

dl { font-size: 0.9em; }
dl div { padding-block: 0.55rem; border-top: 1px solid var(--rule); }
dt { color: var(--muted); font-size: 0.8em; }
dd { margin: 0.15em 0 0; }

pre {
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 0.8rem;
  border: 1px solid var(--rule);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid #fff;
}

.controls button,
summary {
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: 600 0.875rem Geist, Arial, sans-serif;
  cursor: pointer;
}

.controls button:first-child { justify-self: start; }
.controls button:last-child { justify-self: end; }
.controls button { min-width: 44px; }
.controls button[aria-disabled="true"] { color: var(--muted); cursor: default; }
.controls button:not([aria-disabled="true"]):hover, summary:hover { text-decoration: underline; }
#position { margin: 0; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.contents { border-top: 1px solid var(--rule); }
summary { align-content: center; }
.contents ol { margin: 0; padding: 0; list-style: none; }

.contents a {
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 44px;
  padding-block: 6px;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  font-weight: 500;
}

.contents a:hover { text-decoration: underline; }
.contents a[aria-current="step"] { font-weight: 600; }
.contents a > :is(:first-child, :last-child) { color: var(--muted); font-size: 0.8125rem; }
footer { border-top: 1px solid var(--rule); color: var(--muted); }
footer > :last-child { grid-column: 2 / -1; }

@media (max-width: 680px) {
  .slide { grid-template-columns: minmax(0, 1fr); align-content: start; min-height: 0; }
  .slide :is(h1, h2) { letter-spacing: -0.065em; }
  .copy { max-width: 100%; }
  .controls button { text-align: start; }
  .controls button:last-child { text-align: end; }
  footer { display: flex; justify-content: space-between; flex-wrap: wrap; }
  footer > :last-child { text-align: start; }
}

@media print {
  :root { color-scheme: light; color: #000; background: #fff; --muted: #555; }
  body { display: block; }
  #deck { display: block; }
  .slide, .slide[hidden] { display: grid !important; min-height: 0; break-inside: avoid; break-after: page; }
  .slide:last-child { break-after: auto; }
  .slide + .slide:not([hidden]) { border: 0; }
  .slide :is(h1, h2) { font-size: 42pt; }
  #deck-controls, footer, .speaker-notes { display: none !important; }
}
