@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces9pt-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces9pt-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --sky: #10141c;
  --topsoil: #3b2a1e;
  --clay: #6b4a2f;
  --slate: #4a5260;
  --bedrock: #2a2d33;
  --lava: #ff5a1f;
  --lava-ink: #ff8a5c;
  --moss: #7fd38a;
  --cream: #f3ead9;
  --dim: #d9cdb8;
  --sand: #e6c79a;
  --paper: #eadfc8;
  --ink: #231a12;
  --ink-soft: #4d3d2c;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --deep: #1d1f24;
  --core: #15171c;
  --shale: #2f2622;
  --mantle: #0c0d10;
}

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

html {
  background: var(--mantle);
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--sky);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.4;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--sand); outline-offset: 3px; }
q { quotes: "\201C" "\201D"; }
b, strong { font-weight: 600; }
.nb { white-space: nowrap; }

.slide {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background-image: url("grain.svg");
  background-size: 360px 360px;
}
.s-sky { background-color: var(--sky); background-image: none; }
.s-topsoil { background-color: var(--topsoil); }
.s-clay { background-color: #5d4029; }
.s-slate { background-color: #414956; }
.s-bedrock { background-color: var(--bedrock); }
.s-deep { background-color: var(--deep); }
.s-core { background-color: var(--core); }
.s-shale { background-color: var(--shale); }
.s-mantle { background-color: var(--mantle); }

.edge {
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: min(3.4vw, 6vh);
  max-width: none;
  pointer-events: none;
}
.edge .seam { fill: none; stroke: var(--cream); stroke-opacity: 0.2; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.f-sky { fill: var(--sky); }
.f-topsoil { fill: var(--topsoil); }
.f-clay { fill: #5d4029; }
.f-slate { fill: #414956; }
.f-bedrock { fill: var(--bedrock); }
.f-deep { fill: var(--deep); }
.f-core { fill: var(--core); }
.f-shale { fill: var(--shale); }
.f-mantle { fill: var(--mantle); }

.frame {
  --u: min(1vw, 1.7778vh);
  position: relative;
  width: calc(100 * var(--u));
  height: calc(56.25 * var(--u));
  font-size: var(--u);
  padding: 5.6em 5.5em 6em 8.4em;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 2.2em;
}
.frame::before {
  content: "";
  position: absolute;
  left: 2.6em;
  top: 0;
  bottom: 0;
  width: 1.5em;
  background-image:
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 9em),
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 1.8em);
  background-size: 1.5em 100%, 0.75em 100%;
  background-repeat: no-repeat;
  opacity: 0.38;
  pointer-events: none;
}
.depth {
  position: absolute;
  left: 4.6em;
  top: 5.9em;
  font-family: var(--mono);
  font-size: 0.95em;
  letter-spacing: 0.06em;
  color: var(--dim);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.tag {
  display: inline-block;
  margin: 0 0 1.5em;
  font-family: var(--mono);
  font-size: 1.05em;
  line-height: 1.35;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.5em 0.9em 0.5em 2.1em;
  transform: rotate(-0.8deg);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.35);
  background: var(--paper) radial-gradient(circle at 1em 50%, var(--ink) 0 0.24em, transparent 0.28em);
  clip-path: polygon(0.65em 0, 100% 0, 100% 100%, 0.65em 100%, 0 72%, 0 28%);
}
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; text-wrap: balance; }
h1 { font-size: 7.4em; line-height: 0.98; letter-spacing: -0.02em; max-width: 9ch; }
h2 { font-size: 4.1em; line-height: 1.08; letter-spacing: -0.01em; max-width: 27ch; }
.slide.is-backup h2 { font-size: 3.5em; max-width: 26ch; }
h3 { font-size: 2.1em; line-height: 1.15; }
p { margin: 0; }
.lede { font-size: 2.5em; line-height: 1.3; color: var(--cream); max-width: 28em; text-wrap: pretty; }
.text { font-size: 1.85em; line-height: 1.4; color: var(--dim); max-width: 30em; text-wrap: pretty; }
.text + .text { margin-top: 0.7em; }
.hand {
  position: relative;
  padding-left: 1.7em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.8em;
  line-height: 1.3;
  color: var(--sand);
  max-width: 28em;
}
.hand::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0;
  width: 1.05em;
  height: 0.75em;
  border-left: 1px solid var(--sand);
  border-bottom: 1px solid var(--sand);
}
.mono { font-family: var(--mono); }
.k {
  margin: 0 0 0.5em;
  font-family: var(--mono);
  font-size: 1.05em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand);
}
.src {
  font-family: var(--mono);
  font-size: 1em;
  line-height: 1.5;
  color: var(--dim);
  max-width: 78em;
}
.src b { color: var(--sand); font-weight: 400; }
sup { line-height: 0; font-family: var(--mono); font-size: 0.6em; color: var(--sand); padding-left: 0.15em; }
.fine { font-size: 1.2em; line-height: 1.4; color: var(--dim); max-width: 60em; }

.body { min-height: 0; display: flex; flex-direction: column; gap: 1.8em; }
.body > .cols, .body > .pic, .body > .strip { flex: 1 1 auto; }
.body > .end { margin-top: auto; }
.cols { display: grid; column-gap: 4em; row-gap: 2em; min-height: 0; }
.cols > * { min-width: 0; min-height: 0; }
.c-64 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.c-73 { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
.c-55 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.c-46 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.stack { display: flex; flex-direction: column; gap: 1.5em; }
.stack > * { flex: none; }
.stack > .end { margin-top: auto; }
.mid { align-self: center; }

.foot {
  position: absolute;
  left: 8.4em;
  right: 2.4em;
  bottom: 1.3em;
  display: flex;
  align-items: center;
  gap: 1.6em;
  font-family: var(--mono);
  font-size: 1.05em;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.foot .at { margin-left: auto; }
.nav {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.5em;
  text-decoration: none;
  color: var(--dim);
  border: 1px solid rgba(243, 234, 217, 0.22);
  border-radius: 3px;
}
.nav:hover, .nav:focus-visible { color: var(--cream); border-color: var(--cream); }
.nav + .nav { margin-left: -0.9em; }
.notes { display: none; }

.core-fig { margin: 0; position: relative; min-height: 0; }
.core-fig svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cs-k { font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; fill: var(--dim); }
.cs-q { font-family: var(--serif); font-weight: 600; font-size: 34px; fill: var(--cream); }
.cs-q.lie { font-style: italic; font-weight: 400; fill: var(--sand); }
.cs-lead { fill: none; stroke: var(--cream); stroke-opacity: 0.55; stroke-width: 1.2; }
.cs-rim { fill: none; stroke: var(--cream); stroke-opacity: 0.6; stroke-width: 2; }
.cs-top { fill: #4a3526; stroke: var(--cream); stroke-opacity: 0.6; stroke-width: 2; }
.cs-seam { fill: none; stroke: var(--cream); stroke-opacity: 0.3; stroke-width: 1.4; }
.cs-crack { fill: none; stroke: var(--sand); stroke-width: 2.4; stroke-dasharray: 5 6; stroke-linecap: round; stroke-linejoin: round; }
.byline { font-family: var(--mono); font-size: 1.15em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }

.tally { margin: 0; padding: 0 0 0 2.4em; border-left: 1px dashed rgba(243, 234, 217, 0.45); display: grid; row-gap: 1.2em; align-content: start; }
.tally dt { font-family: var(--serif); font-weight: 600; font-size: 3.3em; line-height: 1; color: var(--cream); }
.tally dd { margin: 0.3em 0 0; font-size: 1.4em; line-height: 1.35; color: var(--dim); }
.pull {
  padding: 1em 1.3em;
  background: var(--sky);
  border-left: 0.3em solid var(--lava);
  font-size: 1.85em;
  line-height: 1.35;
  max-width: 29em;
}
.pull span { display: block; margin-top: 0.4em; color: var(--sand); font-family: var(--serif); font-style: italic; }

.ground svg { width: 100%; height: 100%; }
.pic { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) auto; column-gap: 3.4em; min-height: 0; }
.pic .ground { min-height: 0; height: 100%; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; row-gap: 1.3em; align-content: center; counter-reset: step; }
.steps li { position: relative; padding-left: 2.3em; font-size: 2.05em; line-height: 1.3; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 1.5em;
  height: 1.5em;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.7em;
  color: var(--ink);
  background: var(--paper);
  border-radius: 2px;
}
.steps small { display: block; font-size: 0.78em; color: var(--dim); }

.phone {
  margin: 0;
  align-self: center;
  height: 100%;
  max-height: 34em;
  aspect-ratio: 9 / 17;
  border: 0.45em solid #07080b;
  outline: 1px solid rgba(243, 234, 217, 0.4);
  border-radius: 1.7em;
  overflow: hidden;
  background: var(--sky);
  box-shadow: 0.5em 0.6em 0 rgba(0, 0, 0, 0.32);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone.tilt-l { transform: rotate(-1.6deg); }
.phone.tilt-r { transform: rotate(1.4deg); }

.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 2em; min-height: 0; }
.strip li { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); row-gap: 0.7em; justify-items: start; }
.strip .phone { height: 100%; max-height: none; aspect-ratio: 9 / 12.4; border-radius: 1.3em; border-width: 0.35em; }
.strip p { font-family: var(--mono); font-size: 1.05em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream); }
.strip b { color: var(--sand); font-weight: 400; margin-right: 0.5em; }

.answers { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
.answers > .wide { grid-column: 1 / -1; }
.ans { margin: 0; padding: 0.9em 1.1em; background: var(--sky); border-left: 0.35em solid var(--dim); }
.ans.bad { border-left-color: var(--lava); }
.ans.good { border-left-color: var(--moss); }
.ans dt { font-size: 1.35em; color: var(--dim); }
.ans dd { margin: 0.2em 0 0; font-family: var(--mono); font-size: 1.5em; line-height: 1.4; overflow-wrap: anywhere; }
.ans.bad b { color: var(--lava-ink); font-weight: 400; }
.ans.good b { color: var(--moss); font-weight: 400; }
.verdict {
  align-self: flex-start;
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.35em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3em 0.7em;
  border: 2px solid currentColor;
  border-radius: 2px;
  transform: rotate(-1.5deg);
}
.verdict.bad { color: var(--lava-ink); }
.verdict.ok { color: var(--moss); }

.measure { margin: 0; display: grid; row-gap: 0.9em; align-content: start; padding-left: 2.4em; border-left: 1px dashed rgba(243, 234, 217, 0.45); }
.measure dt { font-family: var(--serif); font-weight: 600; font-size: 2.7em; line-height: 1; }
.measure .zero dt { font-size: 5.2em; color: var(--moss); line-height: 0.85; }
.measure dd { margin: 0.3em 0 0; font-size: 1.45em; line-height: 1.35; color: var(--dim); }

.who { margin: 0; display: grid; }
.who > div { display: grid; grid-template-columns: 15em minmax(0, 1fr); column-gap: 2em; align-items: baseline; padding: 0.72em 0; border-bottom: 1px dashed rgba(243, 234, 217, 0.3); }
.who > div:first-child { border-top: 1px dashed rgba(243, 234, 217, 0.3); }
.who dt { font-family: var(--mono); font-size: 1.1em; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sand); }
.who dd { margin: 0; font-size: 1.85em; line-height: 1.3; }
.who.tight dd { font-size: 1.55em; color: var(--dim); }
.who.tight > div { padding: 0.55em 0; }

.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 4em; }
.links li { display: grid; grid-template-columns: auto auto; column-gap: 1.6em; align-items: center; }
.qr { width: 11em; height: 11em; padding: 0.7em; background: var(--paper); box-shadow: 0.4em 0.5em 0 rgba(0, 0, 0, 0.35); }
.qr.tilt { transform: rotate(-1.2deg); }
.qr svg { width: 100%; height: 100%; }
.qr path { fill: var(--ink); }
.links .k { margin: 0 0 0.3em; }
.links a { font-family: var(--mono); font-size: 2em; text-decoration: none; }

.index { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 4em; counter-reset: idx 8; }
.index li { break-inside: avoid; counter-increment: idx; border-bottom: 1px dashed rgba(243, 234, 217, 0.3); }
.index a { display: flex; align-items: baseline; gap: 1em; min-height: 44px; padding: 0.5em 0; font-size: 1.9em; text-decoration: none; }
.index a::before { content: counter(idx); font-family: var(--mono); font-size: 0.6em; color: var(--sand); min-width: 1.6em; }
.index a:hover { color: var(--sand); }

.rules { margin: 0; padding: 0; list-style: none; display: grid; counter-reset: rule; }
.rules li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) 9em; column-gap: 1em; align-items: baseline; padding: 0.5em 0; border-bottom: 1px dashed rgba(243, 234, 217, 0.28); font-size: 1.55em; line-height: 1.3; counter-increment: rule; }
.rules li::before { content: counter(rule); font-family: var(--mono); font-size: 0.8em; color: var(--sand); }
.rules b { font-family: var(--mono); font-weight: 400; font-size: 0.86em; letter-spacing: 0.1em; text-transform: uppercase; }
.rules .v-ok { color: var(--moss); }
.rules .v-warn { color: var(--sand); }
.rules .v-bad { color: var(--lava-ink); }

.list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; }
.list li { position: relative; padding: 0.5em 0 0.5em 1.5em; border-bottom: 1px dashed rgba(243, 234, 217, 0.26); font-size: 1.5em; line-height: 1.33; color: var(--dim); }
.list li::before { content: ""; position: absolute; left: 0.1em; top: 1.15em; width: 0.8em; height: 2px; background: var(--sand); }
.list.cannot li::before { width: 0.55em; height: 0.55em; top: 0.9em; background: none; border: 2px solid var(--sand); transform: rotate(45deg); }
.list b { color: var(--cream); }
.list.big li { font-size: 1.6em; }

.shot { margin: 0; min-height: 0; }
.shot img { width: 100%; height: auto; border: 1px solid rgba(243, 234, 217, 0.35); box-shadow: 0.5em 0.6em 0 rgba(0, 0, 0, 0.3); }
.shot figcaption { margin-top: 0.9em; font-family: var(--serif); font-style: italic; font-size: 1.3em; color: var(--dim); }

.term {
  margin: 0;
  padding: 1.2em 1.4em;
  background: #0a0c10;
  border-left: 0.35em solid var(--sand);
  font-family: var(--mono);
  font-size: 1.12em;
  line-height: 1.5;
  color: var(--cream);
  overflow: hidden;
  white-space: pre;
}
.term .p { color: var(--sand); }
.term .bad { color: var(--lava-ink); }
.term .ok { color: var(--moss); }
.term .dim { color: #9d937f; }

.big-n { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 3em; margin: 0; }
.big-n dt { font-family: var(--serif); font-weight: 600; font-size: 4.4em; line-height: 1; }
.big-n dd { margin: 0.4em 0 0; font-size: 1.5em; line-height: 1.35; color: var(--dim); }


@media (max-aspect-ratio: 1/1) {
  html { scroll-snap-type: y proximity; }
  .slide { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; place-items: stretch; }
  .frame {
    --u: 1.9vw;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 7em 4em 9em 7em;
    grid-template-rows: auto auto;
    align-content: start;
  }
  .cols, .pic { grid-template-columns: minmax(0, 1fr); }
  .pic .ground { height: auto; aspect-ratio: 10 / 9; }
  .core-fig { height: 40em; }
  .phone { height: auto; width: 24em; max-height: none; justify-self: start; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2em; }
  .strip .phone { width: 100%; max-height: none; height: auto; }
  .tally, .measure { border-left: 0; padding-left: 0; }
  .who > div { grid-template-columns: minmax(0, 1fr); row-gap: 0.2em; }
  .links { grid-template-columns: auto; row-gap: 2.5em; }
  .index { columns: 1; }
  .big-n { grid-template-columns: minmax(0, 1fr); row-gap: 2em; }
  .rules li { grid-template-columns: 2.2em minmax(0, 1fr); }
  .rules b { grid-column: 2; }
  .foot { left: 7em; bottom: 2.4em; }
  .term { font-size: 0.85em; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.pv { height: 100%; overflow: hidden; }
.pv body { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--core); font-size: clamp(15px, 1.5vw, 22px); }
.pv-top { display: flex; align-items: baseline; gap: 1.5em; padding: 1em 1.4em; background: var(--topsoil); }
.pv-clock { font-family: var(--mono); font-size: 3.2em; line-height: 1; }
.pv-clock.late { color: var(--lava-ink); }
.pv-by { font-family: var(--mono); color: var(--sand); }
.pv-where { margin-left: auto; font-family: var(--mono); color: var(--dim); }
.pv-main { overflow: auto; padding: 1.4em; display: grid; align-content: start; row-gap: 1em; }
.pv-title { font-family: var(--serif); font-weight: 600; font-size: 1.7em; line-height: 1.15; }
.pv-notes { font-size: 1.35em; line-height: 1.45; max-width: 44em; }
.pv-notes p + p { margin-top: 0.7em; }
.pv-notes em { font-style: normal; color: var(--sand); font-family: var(--mono); font-size: 0.82em; letter-spacing: 0.04em; }
.pv-next { font-family: var(--mono); color: var(--dim); }
.pv-keys { display: flex; flex-wrap: wrap; gap: 0.7em; padding: 0.9em 1.4em; background: var(--deep); }
.pv-keys button {
  min-height: 48px;
  min-width: 48px;
  padding: 0.4em 1.1em;
  font: inherit;
  color: var(--cream);
  background: none;
  border: 1px solid rgba(243, 234, 217, 0.45);
  border-radius: 3px;
  cursor: pointer;
}
.pv-keys button:hover { border-color: var(--cream); }
.chev { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 5;
  transform: translateX(-50%);
  max-width: min(90vw, 40rem);
  padding: 0.8rem 1.1rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.4;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.4);
}
