:root {
  --sans: "Hanken Grotesk", "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Roboto Serif", Georgia, serif;
  --ui: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ink: rgba(0, 0, 0, 0.95);
  --text: rgba(0, 0, 0, 0.898);
  --muted: rgba(0, 0, 0, 0.54);
  --hair: rgba(0, 0, 0, 0.1);
  --faint: rgba(0, 0, 0, 0.05);
  --accent: #e5533d;
  --fig-bg: #fff;
  --fig-fill: #e9e9e7;
  --col: 644px;
  --wide: 811px;
  --spread: 960px;
  --gutter: 16px;
  --z-header: 10;
  --z-bar: 20;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 400 16px/24px var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 30; padding: 6px 10px; background: #000; color: #fff; font: 500 13px/20px var(--sans); text-decoration: none; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* header */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 0 max(var(--gutter), calc((100vw - 1252px) / 2));
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease-out;
}
.nav.is-scrolled { border-bottom-color: var(--faint); }
.nav-left, .nav-right { display: flex; align-items: center; gap: 16px; }
.nav-right { justify-content: flex-end; }
.nav-left a, .nav-right a {
  padding: 2px 8px;
  font: 420 14px/20px var(--sans);
  text-decoration: none;
  border-radius: 6px;
}
.nav-left a:hover, .nav-right a:not(.btn):hover { background: var(--faint); }
.nav-logo { display: block; color: var(--ink); font: 700 20px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: 0.02em; text-decoration: none; }
.btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  font: 500 14px/20px var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.nav-right .btn { padding: 6px 12px; font-weight: 500; border-radius: 9999px; }
.nav.is-scrolled .btn, .btn--lg { background: #000; color: #fff; }
.btn:hover { background: #000; color: #fff; }
.btn--lg { padding: 10px 20px; font-size: 15px; line-height: 22px; }
.cancel-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 32px; }
.cancel-actions button.btn { border: 0; cursor: pointer; }
.cancel-actions button.btn:disabled { opacity: 0.6; cursor: default; }

/* hero */
.hero { padding: 144px var(--gutter) 0; text-align: center; }
.hero-title { margin: 0; padding-bottom: 16px; font: 400 42px/48px var(--sans); color: var(--ink); }
.ht { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ht-row { display: flex; align-items: center; justify-content: center; gap: 28px; white-space: nowrap; }
.ht-row:first-child { display: block; }
.ht-stack { display: none; }
.drawn { display: block; flex: none; width: auto; height: 100px; color: var(--ink); overflow: visible; }
.drawn text { font: 400 112px var(--serif); fill: currentColor; }
.hero--page { padding-top: 160px; }
.eyebrow { margin: 0 0 12px; font: 500 13px/20px var(--sans); color: var(--muted); }
.page-title { margin: 0; font: 400 42px/48px var(--sans); color: var(--ink); text-wrap: balance; }
.page-title span { display: block; }
.hero-version { margin: 12px 0 0; font: 500 13px/20px var(--sans); }
.hero-lede {
  max-width: 520px;
  margin: 40px auto 0;
  font: 300 18px/28px var(--serif);
  color: var(--text);
  text-wrap: balance;
}

/* table of contents */
.toc { width: min(var(--spread), 100% - 2 * var(--gutter)); margin: 104px auto 0; }
.toc-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 160px; }
.toc-part { margin-bottom: 40px; }
.toc-part-title {
  margin: 0 0 22px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--hair);
  font: 300 16px/24px var(--serif);
  color: var(--ink);
}
.toc-list { margin: 0; padding: 0; list-style: none; }
.toc-list li + li { margin-top: 12px; }
.toc-list a {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-right: 24px;
  font: 420 15px/20px var(--sans);
  text-decoration: none;
}
.toc-list a:hover .toc-title { text-decoration: underline; text-underline-offset: 3px; }
.toc-num { font-variant-numeric: tabular-nums; }
.byline { margin: 24px 0 0; font: 420 12px/16px var(--sans); color: var(--text); }

/* guide */
.guide { padding: 0 var(--gutter); }
.part { width: min(var(--col), 100%); margin: 0 auto; }
.part-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: var(--spread);
  margin: 184px 0 160px calc((var(--col) - var(--spread)) / 2);
}
.part:first-child .part-divider { margin-top: 160px; }
.part-divider .rule {
  flex: 1;
  height: 1px;
  background-image: linear-gradient(to right, var(--muted) 1px, transparent 1px);
  background-size: 5px 1px;
  background-repeat: repeat-x;
}
.part-title { margin: 0; font: 300 16px/24px var(--serif); color: var(--ink); white-space: nowrap; }

.sec + .sec { margin-top: 184px; }
.sec-num { margin: 0 0 12px; text-align: center; font: 500 15px/20px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-title {
  margin: 0 0 160px;
  text-align: center;
  font: 400 64px/64px var(--sans);
  color: var(--ink);
  text-wrap: balance;
}

.prose { position: relative; font: 300 18px/28px var(--serif); color: var(--text); }
.prose > p, .prose li > p { margin: 0 0 24px; text-wrap: pretty; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 24px; }
.prose li { margin: 5px 0; padding-left: 4px; text-wrap: pretty; }
.prose strong { font-weight: 500; color: var(--ink); }
.prose a { text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose > :last-child { margin-bottom: 0; }

/* side notes */
.fn { position: relative; top: -0.45em; line-height: 0; vertical-align: baseline; font-size: 100%; }
.fn-ref {
  margin: 0 1px;
  padding: 0 2px;
  border: 0;
  background: none;
  font: 700 12px/1 var(--sans);
  color: var(--muted);
  cursor: pointer;
}
.notes {
  position: absolute;
  left: calc(100% + clamp(48px, 7vw, 100px));
  width: 226px;
  margin-top: 4px;
  font: 420 12px/16px var(--sans);
  color: var(--muted);
}
.notes p { margin: 0 0 12px; }
.notes a { color: inherit; }

/* pull quotes */
.pull {
  width: var(--wide);
  margin: 80px 0 80px calc((var(--col) - var(--wide)) / 2);
  padding: 0;
  text-align: center;
}
.pull p { margin: 0; font: 400 42px/48px var(--sans); color: var(--ink); text-wrap: balance; }
.pull footer { margin-top: 20px; font: 500 15px/20px var(--sans); color: var(--muted); }

/* figures */
.fig {
  width: var(--wide);
  margin: 100px 0 100px calc((var(--col) - var(--wide)) / 2);
  padding: 48px 48px 64px;
  border: 1px solid var(--hair);
  color: var(--ink);
}
.fig-title { margin: 0 0 32px; text-align: center; font: italic 300 18px/28px var(--serif); color: var(--text); }
.fig-row { display: grid; gap: 24px; }
.fig-row--2 { grid-template-columns: 1fr 1fr; }
.fig-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.fig-art svg { width: 100%; height: auto; max-height: 240px; margin: 0 auto 20px; overflow: visible; }
.fig-art text { font: 500 12px var(--sans); fill: currentColor; }
.fig-art text.strong { font-weight: 600; font-size: 13px; }
.fig .accent { fill: var(--accent); stroke: none; }
.fig-label { margin: 0 0 8px; text-align: center; font: 600 11px/16px var(--sans); }
.fig-items { margin: 0 auto; padding-left: 16px; max-width: 220px; font: 420 12px/18px var(--sans); color: var(--text); }
.fig-caption { margin: 0 auto; max-width: 260px; text-align: center; font: 420 12px/18px var(--sans); color: var(--text); }
.fig--business-map .fig-art svg, .fig--simplest-routine .fig-art svg { max-height: 320px; }

/* tables */
.table-wrap { margin: 0 0 24px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font: 420 12px/16px var(--sans); color: var(--text); }
.prose th, .prose td { padding: 12px; border: 1px solid var(--hair); text-align: left; vertical-align: top; }
.prose th { background: var(--muted); color: #fff; font-weight: 600; border-color: var(--muted); }
.prose td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* closing */
.cta { width: min(var(--col), 100% - 2 * var(--gutter)); margin: 184px auto 0; text-align: center; }
.cta-title { margin: 0 0 24px; font: 400 42px/48px var(--sans); text-wrap: balance; }
.cta-lede { margin: 0 auto 32px; max-width: 520px; font: 300 18px/28px var(--serif); color: var(--text); text-wrap: pretty; }
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 160px auto 0;
  padding: 24px max(var(--gutter), calc((100vw - 1252px) / 2)) 112px;
  border-top: 1px solid var(--hair);
  font: 420 12px/16px var(--sans);
  color: var(--muted);
}
.foot p { margin: 0; }
.foot a { margin-left: 16px; text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* chapter bar */
.chapter-bar {
  position: fixed;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: var(--z-bar);
  width: min(380px, 100vw - 32px);
  translate: -50% 0;
  background: #fff;
  border: 1px solid var(--faint);
  border-radius: 20px;
  box-shadow: 0 14px 28px -6px rgba(0, 0, 0, 0.25);
  font: 420 14px/20px var(--sans);
  transition: opacity 200ms ease-out, translate 200ms ease-out;
}
.chapter-bar[data-state="hidden"] { opacity: 0; translate: -50% 12px; pointer-events: none; }
.cb-row { display: flex; align-items: center; height: 38px; padding: 0 4px; }
.cb-prev, .cb-next {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  color: var(--ink);
}
.cb-prev svg, .cb-next svg { width: 14px; height: 14px; }
.cb-prev[aria-disabled="true"], .cb-next[aria-disabled="true"] { color: rgba(0, 0, 0, 0.2); pointer-events: none; }
.cb-menu {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 9999px;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.cb-menu svg { flex: none; width: 16px; height: 16px; color: var(--muted); }
.cb-current { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cb-prev:hover, .cb-next:hover, .cb-menu:hover { background: rgba(0, 0, 0, 0.04); }
.cb-panel { border-bottom: 1px solid var(--faint); }
.cb-panel-scroll {
  position: relative;
  max-height: min(330px, 60dvh);
  overflow-y: auto;
  padding: 16px 20px 8px;
  mask-image: linear-gradient(to bottom, #000 85%, transparent);
}
.menu-part { margin: 8px 0 4px 32px; font: 500 13px/20px var(--sans); color: var(--ink); }
.cb-panel ol { margin: 0; padding: 0; list-style: none; }
.cb-panel a { display: flex; gap: 12px; padding: 2px 0; font: 420 13px/20px var(--sans); color: var(--muted); text-decoration: none; }
.cb-panel a:hover, .cb-panel a[aria-current] { color: var(--ink); }
.cb-panel a[aria-current] { font-weight: 500; }
.menu-num { width: 20px; flex: none; font-variant-numeric: tabular-nums; }


/* inner pages */
.guide--page { margin-top: 120px; }
.fig.fig--cover { margin-top: 0; padding: 0; }
.fig--cover img { display: block; width: 100%; height: auto; }
.guide--page .fig--cover + .sec { margin-top: 160px; }
.fig--systems .fig-art svg { max-height: 220px; margin-bottom: 32px; }
.fig-art text.muted { fill: var(--muted); }
.fig-items--num { max-width: none; padding-left: 18px; list-style: decimal; }
.fig-caption--left { max-width: none; margin: 0; text-align: left; }
.fig-caption--left b { font-weight: 600; color: var(--ink); }
.gallery { display: grid; gap: 48px; }
.shot-img img { display: block; width: 100%; height: auto; }
.shot .fig-label { margin-top: 16px; }
.g-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.g-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.g-narrow { width: 50%; margin: 0 auto; }
.prose--legal h2 { margin: 56px 0 16px; font: 500 22px/28px var(--sans); color: var(--ink); text-wrap: balance; }
.prose--legal > h2:first-child { margin-top: 0; }

/* book a diagnosis */
.book {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 420px);
  justify-content: center;
  align-items: start;
  column-gap: 120px;
  padding: 120px var(--gutter) 0;
}
.book-title { margin: 0; font: 400 42px/48px var(--sans); color: var(--ink); text-wrap: balance; }
.book-lede { margin: 20px 0 0; font: 300 18px/28px var(--serif); color: var(--text); text-wrap: pretty; }
.book-art { position: sticky; top: 160px; padding-top: 72px; color: var(--ink); }
.book-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.book-art text { font: 500 12px var(--sans); fill: currentColor; }
.book-art text.strong { font-weight: 600; font-size: 13px; }
.book-art .accent { fill: var(--accent); stroke: none; }
.book-form { margin-top: 48px; }
.book__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 32px;
  padding: 0 0 16px;
  list-style: none;
  border-bottom: 1px solid var(--hair);
  font: 420 13px/20px var(--sans);
  color: var(--muted);
}
.book__steps li { display: flex; align-items: center; gap: 8px; }
.book__steps li span { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--hair); border-radius: 9999px; font-size: 11px; font-variant-numeric: tabular-nums; }
.book__steps li.on { color: var(--ink); }
.book__steps li.on span { background: #000; border-color: #000; color: #fff; }
.book__steps li.past span { border-color: var(--muted); }
.step { min-width: 0; margin: 0; padding: 0; border: 0; }
.step[hidden] { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.field { display: block; margin: 0 0 24px; }
.field-label { display: block; margin-bottom: 8px; font: 500 14px/20px var(--sans); color: var(--ink); }
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
  font: 400 16px/24px var(--sans);
  color: var(--ink);
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid #000; outline-offset: -1px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b3261e; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chip span {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 9999px;
  font: 420 14px/20px var(--sans);
  color: var(--ink);
  cursor: pointer;
}
@media (hover: hover) { .chip span:hover { background: var(--faint); } }
.chip input:checked + span { background: #000; border-color: #000; color: #fff; }
.chip input:focus-visible + span { outline: 2px solid #000; outline-offset: 2px; }
.chips[aria-invalid="true"] .chip span { border-color: #b3261e; }
.err { margin: 0 0 16px; font: 500 14px/20px var(--sans); color: #b3261e; }
.err:empty { display: none; }
.note { margin: 0 0 16px; font: 420 13px/20px var(--sans); color: var(--muted); }
.days { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 6px; margin-bottom: 24px; }
.dow { padding-bottom: 2px; text-align: center; font: 500 11px/16px var(--sans); color: var(--muted); }
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 52px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
  font: 500 15px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  cursor: pointer;
}
.day .dm { font-size: 10px; font-weight: 500; color: var(--muted); }
.day--off { border-color: transparent; color: rgba(0, 0, 0, 0.25); cursor: default; }
@media (hover: hover) { button.day:hover { background: var(--faint); } }
.day[aria-pressed="true"], .day[aria-pressed="true"]:hover { background: #000; border-color: #000; color: #fff; }
.day[aria-pressed="true"] .dm { color: rgba(255, 255, 255, 0.7); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 24px; }
.time {
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 9999px;
  background: #fff;
  font: 420 14px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  cursor: pointer;
}
@media (hover: hover) { .time:hover { background: var(--faint); } }
.time[aria-pressed="true"], .time[aria-pressed="true"]:hover { background: #000; border-color: #000; color: #fff; }
.chosen { margin: 0 0 24px; padding: 12px 14px; border-radius: 8px; background: rgba(0, 0, 0, 0.03); font: 500 15px/22px var(--sans); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.btn--block {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 9999px;
  background: #000;
  color: #fff;
  font: 500 15px/1 var(--sans);
  cursor: pointer;
}
.btn--block:disabled { opacity: 0.5; cursor: progress; }
.btn--text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 9999px;
  background: none;
  font: 420 15px/1 var(--sans);
  color: var(--ink);
  cursor: pointer;
}
.btn--text:hover { background: var(--faint); color: var(--ink); }
.icon-next svg, .icon-back svg { display: block; width: 16px; height: 16px; }
.done-when { margin: 0; font: 400 32px/38px var(--sans); color: var(--ink); }
.done .eyebrow { margin-bottom: 8px; }
.book-proof { margin: 40px 0 0; padding-top: 20px; border-top: 1px solid var(--hair); font: 420 14px/20px var(--sans); color: var(--muted); }
.book-proof a { color: var(--ink); text-underline-offset: 3px; }

/* without room for margin notes: notes open under the paragraph */
@media (max-width: 1279px) {
  .notes { display: none; position: static; width: auto; margin: -8px 0 24px; padding: 12px 14px; background: rgba(0, 0, 0, 0.03); border-radius: 8px; font-size: 13px; line-height: 18px; }
  .notes.is-open { display: block; }
  .notes p:last-child { margin-bottom: 0; }
  li .notes { margin: 8px 0; }
}

@media (max-width: 1023px) {
  .ht-wide { display: none; }
  .ht-stack { display: inline; }
  .ht-row.ht-stack { display: flex; }
  .drawn { width: min(100%, 461px); height: auto; }
  .book { grid-template-columns: minmax(0, 560px); }
  .book-art { display: none; }
}

@media (max-width: 860px) {
  .part-divider, .pull, .fig { width: auto; margin-left: 0; margin-right: 0; }
  .fig { padding: 32px 20px 40px; }
  .fig-row--2, .fig-row--3 { grid-template-columns: 1fr; gap: 40px; }
  .g-cards { grid-template-columns: 1fr 1fr; }
  .g-narrow { width: 100%; }
}

@media (max-width: 640px) {
  .nav { grid-template-columns: auto 1fr; }
  .nav-left { display: none; }
  .nav-logo { order: -1; }
  .nav-right a:not(.btn) { display: none; }
  .hero { padding-top: 64px; }
  .hero--page { padding-top: 72px; }
  .drawn { width: min(100%, 340px); }
  .page-title span { display: inline; }
  .hero-lede { font-size: 16px; line-height: 24px; }
  .toc { margin-top: 96px; }
  .toc-grid { grid-template-columns: 1fr; }
  .toc-list a { padding-right: 32px; }
  .part-divider { margin: 120px 0 96px; }
  .part:first-child .part-divider { margin-top: 96px; }
  .part-title { white-space: normal; text-align: center; }
  .sec + .sec { margin-top: 120px; }
  .sec-title { margin-bottom: 72px; font-size: 42px; line-height: 48px; }
  .prose { font-size: 16px; line-height: 24px; }
  .pull { margin: 56px 0; }
  .pull p { font-size: 26px; line-height: 32px; }
  .fig { margin: 56px 0; }
  .cta { margin-top: 120px; }
  .book { padding-top: 56px; }
  .book-title { font-size: 32px; line-height: 38px; }
  .book-lede { font-size: 16px; line-height: 24px; }
  .guide--page { margin-top: 72px; }
  .cta-title { font-size: 32px; line-height: 38px; }
  .foot { flex-direction: column; margin-top: 96px; }
  .foot a { margin: 0 16px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
