:root {
  --bg: #fbf8f3; --fg: #1d1712; --muted: #6b5f55; --card: #fff; --line: #e8dfd3; --soft: #f4ece1;
  --brand: #c2410c; --brand-ink: #fff; --accent: #0f766e; --ok: #15803d; --bad: #b91c1c;
  --radius: 14px; --shadow: 0 1px 2px rgba(60, 30, 10, .06), 0 10px 30px rgba(60, 30, 10, .07);
  --head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121016; --fg: #f3eee8; --muted: #b3a89c; --card: #1c1920; --line: #322c34; --soft: #26212a; --brand: #fb923c; --brand-ink: #1a1208; --accent: #2dd4bf; --ok: #4ade80; --bad: #f87171; --shadow: none; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
header.site { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--head); font-weight: 700; font-size: 21px; color: var(--fg); text-decoration: none; }
.brand svg { width: 28px; height: 28px; color: var(--brand); }
nav.top { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 15px; }
nav.top a { color: var(--muted); text-decoration: none; padding: 4px 0; }
nav.top a[aria-current="page"], nav.top a:hover { color: var(--fg); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5.4vw, 56px); margin: 10px 0 12px; }
h1 em { color: var(--brand); }
h2 { font-size: clamp(23px, 3vw, 32px); margin: 40px 0 12px; }
h3 { font-size: 19px; margin: 18px 0 6px; }
.lede { font-size: clamp(17px, 2.1vw, 20px); color: var(--muted); max-width: 42em; }
.hero { padding: 18px 0 8px; max-width: 900px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.proof { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.proof li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { border-color: var(--brand); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; }
.btn.big { padding: 12px 22px; font-size: 17px; min-height: 48px; }
.btn.small { padding: 5px 12px; min-height: 32px; font-size: 14px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.linklike:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- player ---------- */
.demo-title { margin-top: 28px; }
.player-wrap { margin: 8px 0 24px; }
.rh { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, 1fr); grid-template-areas: "head head" "crumbs crumbs" "stage map" "pad map" "share share" "embed embed"; gap: 12px 18px; }
.rh > * { min-width: 0; }
.rh-head { grid-area: head; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rh-kicker { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.rh-hole-title { margin: 2px 0 0; font-size: clamp(21px, 2.6vw, 28px); }
.rh-auto { font-size: 14px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.rh-auto input { accent-color: var(--brand); }
.rh-crumbs { grid-area: crumbs; font-size: 14px; color: var(--muted); }
.rh-crumbs a { color: var(--muted); }
.rh-crumbs [aria-current] { color: var(--fg); font-weight: 600; }
.rh-stage { grid-area: stage; position: relative; }
.rh-video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; min-height: 200px; }
.rh-video > div, .rh-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rh-blocked { margin-top: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.rh-blocked p { margin: 4px 0; }
.rh-pad { grid-area: pad; border: 2px dashed var(--line); border-radius: 16px; padding: 12px 14px; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: contain; }
.rh-pad:focus-visible { border-color: var(--brand); }
.rh-card { min-height: 72px; }
.rh-card.enter[data-dir="next"] { animation: in-up .28s ease-out; }
.rh-card.enter[data-dir="prev"] { animation: in-down .28s ease-out; }
.rh-card.enter[data-dir="deeper"] { animation: in-left .28s ease-out; }
.rh-card.enter[data-dir="out"] { animation: in-right .28s ease-out; }
.rh-card.bump { animation: bump .3s ease-in-out; }
@keyframes in-up { from { transform: translateY(18px); opacity: .2; } }
@keyframes in-down { from { transform: translateY(-18px); opacity: .2; } }
@keyframes in-left { from { transform: translateX(26px); opacity: .2; } }
@keyframes in-right { from { transform: translateX(-26px); opacity: .2; } }
@keyframes bump { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.rh-pos { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.rh-title { margin: 2px 0 4px; font-size: 20px; }
.rh-note { margin: 0; color: var(--muted); }
.rh-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.rh-btn { border: 1px solid var(--line); background: var(--soft); color: var(--fg); border-radius: 12px; padding: 10px 6px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; min-height: 48px; }
.rh-btn:hover:not(:disabled) { border-color: var(--brand); }
.rh-btn:disabled { opacity: .4; cursor: default; }
.rh-btn.next { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.rh-pad.has-deeper .rh-btn.deeper { border-color: var(--accent); color: var(--accent); }
.rh-btn small { font-weight: 600; }
.rh-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.rh-map-wrap { grid-area: map; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; align-self: start; max-height: 560px; overflow: auto; background: var(--bg); }
.rh-map-wrap summary { font-weight: 700; cursor: pointer; font-size: 15px; }
.rh-progress { font-weight: 400; color: var(--muted); font-size: 13px; }
.rh-map ol { list-style: none; margin: 0; padding: 0; }
.rh-map .rh-main > li { margin: 6px 0; }
.rh-map .rh-deeper { margin: 4px 0 4px 22px; padding-left: 10px; border-left: 2px solid var(--accent); }
.rh-map a { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--fg); padding: 4px; border-radius: 8px; font-size: 14px; line-height: 1.3; }
.rh-map a:hover { background: var(--soft); }
.rh-map img { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; flex: none; background: var(--soft); }
.rh-map li.seen > a span::after { content: " ✓"; color: var(--ok); }
.rh-map li.now > a { background: var(--soft); outline: 2px solid var(--brand); }
.rh-map li.gone > a { opacity: .45; }
.rh-share { grid-area: share; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rh-share-msg { color: var(--ok); font-weight: 600; font-size: 14px; }
.rh-embed { grid-area: embed; }
.rh-embed textarea, .b-share textarea { width: 100%; font: 13px/1.4 ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--bg); color: var(--fg); margin-top: 4px; }
.watch-status { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }

/* embedded player page */
body.embed { background: transparent; }
body.embed main { padding: 0; }
body.embed .rh { border-radius: 14px; box-shadow: none; grid-template-columns: 1fr; grid-template-areas: "head" "crumbs" "stage" "pad" "map" "share" "embed"; }
body.embed .rh-map-wrap { max-height: 240px; }

/* ---------- builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.builder > * { min-width: 0; }
.b-meta label, .b-add > label { display: block; font-weight: 700; margin: 0 0 10px; }
.b-meta input, .b-meta textarea, .b-add input, .b-share input { display: block; width: 100%; margin-top: 4px; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg); }
.b-add { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.b-add .row { display: flex; gap: 8px; }
.b-add .row input { margin-top: 0; }
.b-target { margin: 8px 0 0; font-size: 14px; color: var(--accent); }
.b-error { margin: 8px 0 0; color: var(--bad); font-weight: 600; font-size: 14px; }
.b-error:empty { display: none; }
.b-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 6px; gap: 8px; }
.b-empty { border: 2px dashed var(--line); border-radius: 14px; padding: 14px; }
.b-track { list-style: none; margin: 0; padding: 0; }
.b-track.deeper { margin: 6px 0 6px 26px; padding-left: 12px; border-left: 3px solid var(--accent); }
.b-track > li { margin: 8px 0; }
.b-clip { display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "handle thumb fields" "actions actions actions"; gap: 6px 10px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; position: relative; }
.b-handle { grid-area: handle; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: grab; padding: 4px 2px; touch-action: none; }
.dragging .b-handle { cursor: grabbing; }
.b-thumb { grid-area: thumb; border: 0; padding: 0; background: none; cursor: pointer; }
.b-thumb img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; display: block; background: var(--soft); }
.b-fields { grid-area: fields; min-width: 0; }
.b-fields input { width: 100%; font: inherit; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; background: transparent; color: var(--fg); }
.b-fields input:hover, .b-fields input:focus { border-color: var(--line); background: var(--bg); }
.b-ctitle { font-weight: 700; }
.b-note { font-size: 14px; color: var(--muted); }
.b-times { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.b-times input { width: 5.5em; display: inline-block; }
.b-yt { font-size: 13px; }
.b-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 6px; }
.b-actions button { border: 1px solid var(--line); background: var(--soft); color: var(--fg); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 14px; cursor: pointer; min-height: 32px; }
.b-actions button:disabled { opacity: .35; cursor: default; }
.b-actions .b-add-deeper { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.b-clip.drop-before { box-shadow: 0 -4px 0 var(--brand); }
.b-clip.drop-after { box-shadow: 0 4px 0 var(--brand); }
.b-clip.drop-inside { outline: 3px solid var(--accent); }
.b-side { position: sticky; top: 12px; display: grid; gap: 16px; }
.b-share { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.b-share h2, .b-preview h2 { margin: 0 0 8px; font-size: 22px; }
.b-msg { margin: 6px 0 0; font-size: 14px; color: var(--ok); font-weight: 600; }
.b-msg.bad { color: var(--bad); }
.b-preview .rh { grid-template-columns: 1fr; grid-template-areas: "head" "crumbs" "stage" "pad" "map" "share" "embed"; padding: 12px; }
.b-preview .rh-map-wrap { max-height: 260px; }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- content ---------- */
.band { padding: 8px 0 20px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; list-style: none; padding: 0; counter-reset: s; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; margin-bottom: 6px; }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cards a { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--fg); }
.cards a:hover { border-color: var(--brand); }
.cards b { display: block; font-family: var(--head); font-size: 18px; margin-bottom: 4px; }
.cards span { color: var(--muted); font-size: 15px; }
.cards.holes img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 8px; display: block; background: var(--soft); }
.prose { max-width: 46em; }
.prose.wide { max-width: 60em; }
.prose p, .prose li { font-size: 17px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose pre { background: var(--soft); padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 14px; }
.prose code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.prose pre code { background: none; padding: 0; }
.outline li { margin: 8px 0; }
.outline .by { color: var(--muted); font-size: 15px; }
.outline .note { color: var(--muted); font-size: 15px; }
.outline .gone { color: var(--bad); font-size: 14px; }
.outline .deeper-label { margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--accent); }
.outline ol { border-left: 3px solid var(--accent); padding-left: 22px; }
.meta { color: var(--muted); font-size: 14px; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; background: var(--card); }
details summary { font-weight: 700; cursor: pointer; }
.slot { border: 1px solid var(--line); background: var(--soft); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 40px; color: var(--muted); font-size: 14px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
footer.site a { color: var(--muted); }

@media (max-width: 880px) {
  .rh { grid-template-columns: 1fr; grid-template-areas: "head" "crumbs" "stage" "pad" "map" "share" "embed"; padding: 12px; border-radius: 16px; }
  .rh-map-wrap { max-height: 320px; }
  .builder { grid-template-columns: 1fr; }
  .b-side { position: static; }
  .rh-nav { grid-template-columns: repeat(2, 1fr); }
  .rh-nav [data-go="prev"] { order: 1; } .rh-nav [data-go="next"] { order: 2; } .rh-nav [data-go="out"] { order: 3; } .rh-nav [data-go="deeper"] { order: 4; }
}
/* Phones: the video runs edge to edge, so YouTube's player always gets at least 200 x 200 pixels. */
@media (max-width: 600px) {
  .rh-video { width: 100vw; margin-left: calc(50% - 50vw); border-radius: 0; aspect-ratio: auto; height: max(200px, calc(100vw * 9 / 16)); min-height: 0; }
  .rh-blocked { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .rh-card.enter, .rh-card.bump { animation: none !important; } }
