/* The public home page (home/show.html.erb). Colours come from the site theme
   picker's tokens; scrollcraft.css and home.js are loaded on this page only. */

@font-face { font-family: "Geist"; src: url("/assets/geist-latin-9741eb25.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/geist-mono-latin-cf2b23e0.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

body.site:has(> .home) {
  --font: "Geist", var(--font-sans);
  --font-mono: "Geist Mono", var(--font-mono);
  --home-gut: clamp(16px, 5vw, 80px);
  --home-max: 1120px;
  --home-r: var(--radius-lg, 14px);
  --home-hi: var(--accent);
  --home-hi-ink: var(--accent-ink);
  --home-hi-soft: color-mix(in srgb, var(--accent-ink) 80%, var(--accent));
  /* scrollcraft.css reads these; map them onto the site theme. */
  --sc-canvas: var(--bg);
  --sc-surface: var(--surface);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-2);
  --sc-accent: var(--home-hi);
  --sc-accent-ink: var(--home-hi-ink);
  --sc-font-text: var(--font);
  --sc-font-display: var(--font);
  --sc-font-mono: var(--font-mono);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: normal;
  color: var(--ink);
  background: var(--bg);
}

/* Chapters carry their own navigation; the bar scrolls away with the title page. */
body.site:has(> .home) .site-header { position: static; }
body.site:has(> .home) .site-bar { max-width: none; width: min(100% - 2 * var(--home-gut), var(--home-max)); padding-inline: 0; }
body.site:has(> .home) svg.logo { display: inline-block; }

.home.site-main { max-width: none; padding: 0; }
.home-wrap { width: min(100% - 2 * var(--home-gut), var(--home-max)); margin-inline: auto; }

.home h1, .home h2, .home-colophon h2 { font-weight: 500; text-wrap: balance; margin: 0; }
.home h2 { font-size: clamp(32px, 4.2vw, 52px); line-height: 1.06; letter-spacing: -0.035em; max-width: 18ch; }
.home h3 { font-size: 20px; line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.home p { margin: 0; text-wrap: pretty; }
.home code, .home kbd, .home pre { font-family: var(--font-mono); }
.home :not(pre) > code { font-size: 0.9em; padding: 0.1em 0.35em; border-radius: 5px; background: color-mix(in oklab, var(--ink) 7%, transparent); }
.home kbd { font-size: 0.82em; padding: 0.1em 0.45em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; }
.home a:not(.home-btn) { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.home ::selection, .home-colophon ::selection { background: var(--home-hi); color: var(--home-hi-ink); }

/* Buttons: one filled main action with an arrow, one outlined secondary. */
.home-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 22px; border-radius: 10px;
  border: 1px solid var(--line-strong); color: var(--ink); background: var(--bg);
  font-size: 16px; font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.home-btn:hover { text-decoration: none; background: var(--surface); }
.home-btn:active { transform: scale(0.97); }
.home-btn:focus-visible, .home a:focus-visible, .home button:focus-visible, .home input:focus-visible, .home-folio a:focus-visible, .home-colophon a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.home-btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.home-btn-primary:hover { background: color-mix(in oklab, var(--ink) 86%, var(--bg)); }
.home-arrow { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .home-btn:hover .home-arrow { transform: translateX(3px); } }

/* Folio: chapter list in the left margin on wide screens. */
.home-folio { display: none; }
@media (min-width: 1400px) {
  .home-folio { display: block; position: fixed; left: 28px; top: 50%; transform: translateY(-50%); z-index: 5; }
  .home-folio ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .home-folio a { display: flex; gap: 10px; align-items: baseline; padding: 4px 8px; border-radius: 6px; font-size: 13px; color: var(--ink-3, var(--ink-2)); text-decoration: none; transition: color 160ms var(--ease-out); }
  .home-folio a span { font-family: var(--font-mono); font-size: 11px; width: 1ch; }
  .home-folio a:hover { color: var(--ink); }
  .home-folio a[aria-current="true"] { color: var(--ink); font-weight: 500; }
  .home-folio a[aria-current="true"] span { color: var(--ink); }
  body.site:has(> .home):not(.home-past-title) .home-folio { opacity: 0; pointer-events: none; }
  body[data-chapter="files"] .home-folio a { color: var(--home-hi-soft); }
  body[data-chapter="files"] .home-folio a[aria-current="true"], body[data-chapter="files"] .home-folio a[aria-current="true"] span { color: var(--home-hi-ink); }
  .home-folio { transition: opacity 200ms var(--ease-out); }
}

/* Title page: type only, in three planes. */
.home-title { position: relative; overflow: clip; min-height: calc(100svh - 49px); display: grid; align-items: center; padding: 64px 0 96px; }
.home-title-text { position: relative; z-index: 2; display: grid; gap: 20px; justify-items: start; }
.home-title h1 { font-size: clamp(44px, 7.4vw, 96px); line-height: 0.98; letter-spacing: -0.045em; max-width: 13ch; }
/* The highlight starts below the line above so it doesn't cover its descenders. */
.home-title mark { background: linear-gradient(transparent 0.24em, var(--home-hi) 0.24em); color: var(--home-hi-ink); padding: 0 0.12em; border-radius: 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.home-lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 44ch; }
.home-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.home-title-back {
  position: absolute; z-index: 1; right: var(--home-gut); top: 14%;
  display: grid; gap: 6px; justify-items: end; pointer-events: none;
  font-family: var(--font-mono); font-size: clamp(16px, 2vw, 26px); line-height: 1.4;
  color: color-mix(in oklab, var(--ink) 16%, transparent); filter: blur(0.4px);
}
.home-title-front { position: absolute; z-index: 3; right: calc(var(--home-gut) + 4%); bottom: 16%; pointer-events: none; }
.home-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px 12px 14px;
  border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 1px 0 color-mix(in oklab, var(--bg) 60%, white) inset, 0 18px 40px -18px rgb(28 28 26 / 0.35);
  font-size: 15px; font-weight: 500; white-space: nowrap; transform: rotate(-2deg);
}
.home-chip i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.home-chip b { font-weight: 500; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.home-chip b:nth-of-type(2) { background: var(--home-hi); color: var(--home-hi-ink); }

/* Chapters */
.home-ch { padding: clamp(88px, 12vw, 160px) 0 clamp(72px, 9vw, 120px); }
.home-ch-alt { background: var(--surface); }
.home-spread { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.home-spread-flip { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); }
.home-spread-text { display: grid; gap: 16px; max-width: 48ch; }
.home-spread-text h2 { margin-bottom: 8px; }
.home-spread-text p { color: var(--ink-2); font-size: 17px; }

/* Copies of app views (home/_app_page, home/_app_plan), drawn with theme tokens. */
.home-app { margin: 0; display: grid; grid-template-columns: 180px minmax(0, 1fr); background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--home-r); box-shadow: 0 24px 48px -28px rgb(0 0 0 / 0.35); overflow: hidden; font-size: 14px; line-height: 1.5; text-align: left; }
.home-app p, .home-app ul { margin: 0; }
.home-app ul { list-style: none; padding: 0; }
.home-app-pane { grid-template-columns: minmax(0, 1fr); }
.home-app-side { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: grid; align-content: start; gap: 2px; }
.home-app-ws { font-weight: 600; padding: 0 8px 10px; }
.home-app-side li { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 6px; color: var(--ink-2); }
.home-app-side li span { color: var(--ink-3); font-size: 12px; }
.home-app-side li.is-on { background: var(--surface-2); color: var(--ink); }
.home-app-label { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 14px 8px 4px; }
.home-app-label span { color: var(--ink-3); font-weight: 400; margin-left: 4px; }
.home-app-main { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.home-app-tabs { background: var(--surface); border-bottom: 1px solid var(--line); padding: 6px 8px 0; }
.home-app-tabs span { display: inline-block; padding: 5px 14px; background: var(--bg); border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.home-app-page { padding: clamp(18px, 3vw, 32px); display: grid; gap: 10px; align-content: start; min-width: 0; }
.home-app-page > .home-app-label { padding: 8px 0 0; }
.home-app-h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.home-app-h1 small { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.home-app-meta { font-size: 12px; color: var(--ink-3); margin-top: -6px; }
.home-app-h2 { font-size: 17px; font-weight: 700; margin-top: 6px; }
.home-app-wl { color: var(--link); background: var(--accent-soft); border-radius: 3px; padding: 0 2px; }
.home-app-checks li, .home-app-tasks li { display: flex; align-items: start; gap: 10px; padding: 3px 0; }
.home-app i { flex: none; width: 14px; height: 14px; margin-top: 3px; border: 1.5px solid var(--line-strong); border-radius: 3px; }
.home-app-tasks i { border-radius: 50%; }
.home-app-checks .is-done { color: var(--ink-3); text-decoration: line-through; }
.home-app-checks .is-done i { background: var(--accent); border-color: var(--accent); }
.home-app table { border-collapse: collapse; font-size: 13px; width: max-content; max-width: 100%; }
.home-app th, .home-app td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; }
.home-app th { background: var(--surface); color: var(--ink-2); font-weight: 600; }
.home-app-back { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; color: var(--ink-2); }
.home-app-back .home-app-label { padding: 6px 0 2px; }
.home-app-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; background: var(--bg); }
.home-app-card > .home-app-label { padding: 0; }
.home-app-big { font-size: 22px; font-weight: 700; }
.home-app-big small { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.home-app-bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.home-app-bar i { display: block; height: 100%; width: auto; margin: 0; border: 0; border-radius: 0; background: var(--accent); }
.home-app-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; font-size: 12px; color: var(--ink-2); }
.home-app-stats b { display: block; font-size: 15px; color: var(--ink); }
.home-app .is-warn, .home-app .is-warn b { color: var(--warn); font-style: normal; }
.home-app-row { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.home-app-row small, .home-app-sched small { color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.home-app-sched li { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); }
.home-app-sched li:first-child { border-top: 0; }
.home-app-sched small { width: 40px; }
.home-app-sched i { margin-top: 0; border-radius: 50%; }
.home-app-sched b { flex: none; width: 3px; height: 16px; border-radius: 2px; background: var(--link); margin: 0 5px; }
.home-app-tasks li > span { display: grid; gap: 2px; min-width: 0; }
.home-app-tasks small { color: var(--ink-2); font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.home-app-tag { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.home-app-btns { display: flex; gap: 6px; }
.home-app-btns span { font-size: 12px; font-weight: 500; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 6px; }
.home-app-btns span:first-child { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.home-app-btns span.is-quiet { background: none; color: var(--ink); border-color: var(--line-strong); }
/* Rules copied from clients/app/src/styles/app.css (.ext-*, .recipe-*), scoped to the copy. */
.home-app-ext { grid-template-columns: 150px minmax(0, 1fr); }
.home-app-ext .home-app-page { display: block; }
.home-app-ext header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.home-app-ext h1 { margin: 0; font-size: 24px; font-weight: 700; }
.home-app-ext .ext-back { display: inline-flex; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--ink-3); }
.home-app-ext .ext-back::before { content: "‹"; font-size: 16px; line-height: 1; }
.home-app-ext .ext-chips { list-style: none; margin: 0 0 0 21px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.home-app-ext .ext-chips > li { border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12px; color: var(--ink-2); }
.home-app-ext .ext-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.home-app-ext .ext-toggle span { font-size: 13px; padding: 4px 10px; color: var(--ink-2); }
.home-app-ext .ext-toggle span + span { border-left: 1px solid var(--line); }
.home-app-ext .ext-toggle [aria-pressed="true"] { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.home-app-ext .recipe-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin: 4px 0 16px; padding: 12px 0; border-block: 1px solid var(--line); }
.home-app-ext .recipe-facts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0; }
.home-app-ext .recipe-facts dt { font-size: 12px; color: var(--ink-3); }
.home-app-ext .recipe-facts dd { margin: 2px 0 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.home-app-ext .recipe-scaler dd { display: flex; align-items: center; gap: 4px; }
.home-app-ext .recipe-scaler .btn.small { min-width: 28px; padding: 0; justify-content: center; }
.home-app-ext .recipe-scaler b { width: 44px; min-height: 28px; display: grid; place-items: center; font-weight: 400; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.home-app-ext .recipe-scaler span:last-child { margin: 0 4px; }
.home-app-ext .recipe-body { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: 28px; align-items: start; }
.home-app-ext .recipe-body h2 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.home-app-ext .recipe-checks { font-size: 14px; }
.home-app-ext .recipe-checks li { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line); }
.home-app-ext .recipe-checks .is-done { color: var(--ink-3); }
.home-app-ext .recipe-checks .is-done span { text-decoration: line-through; }
.home-app-ext .recipe-checks .is-done i { background: var(--accent); border-color: var(--accent); }
.home-app-ext .recipe-steps { padding-left: 22px; margin: 0; list-style: decimal; }
.home-app-ext .recipe-steps > li { margin-bottom: 14px; padding-left: 4px; }
.home-app-ext .recipe-steps > li::marker { color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.home-app-ext .recipe-step-text { display: flex; gap: 8px; align-items: baseline; margin: 0 0 6px; line-height: 1.5; }
.home-app-ext .recipe-step-text em { font-style: normal; color: var(--ink-2); }
.home-app-ext .recipe-ingredients h3 { margin: 14px 0 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.home-app-ext .recipe-ingredients h2 + h3 { margin-top: 0; }
.home-app-ext .recipe-ingredients h3::before, .home-app-ext .recipe-steps .ext-chips > li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--cat); }
.home-app-ext .recipe-cat-produce { --cat: #3f9a5a; }
.home-app-ext .recipe-cat-dairy { --cat: #4a86c8; }
.home-app-ext .recipe-cat-spice { --cat: #c56d1f; }

.home-ai-stack { display: grid; gap: 16px; width: 100%; max-width: 560px; justify-self: end; }
.home-ai-stack .home-ai { max-width: none; }
.home-mcp-h { margin: 0; padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
.home-mcp ul { list-style: none; margin: 0; padding: 0 16px; }
.home-mcp li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.home-mcp li:first-child { border-top: 0; }
.home-mcp li > span { display: grid; min-width: 0; }
.home-mcp small { font: 12px var(--font-mono); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-mcp b { flex: none; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.home-mcp b.is-warn { background: var(--warn-bg); color: var(--warn); }
.home-chat { justify-self: stretch; }
.home-chat-tool { justify-self: start; display: flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.home-chat-tool span { color: var(--link); }

.home-api { margin: 0; display: grid; gap: 14px; }
.home-api-clients { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.home-api-clients li { position: relative; text-align: center; font-size: 13px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.home-api-clients li::after { content: ""; position: absolute; left: 50%; top: 100%; height: 14px; border-left: 1px solid var(--line-strong); }
.home-api-clients .is-you { background: var(--home-hi); color: var(--home-hi-ink); border-color: var(--home-hi); font-weight: 600; }
.home-api-hub { margin: 0; text-align: center; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); }
.home-api-hub code { font-size: 15px; font-weight: 600; background: none; }

/* Quick add, live. */
.home-qa { display: grid; gap: 14px; padding: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--home-r); box-shadow: 0 24px 48px -32px rgb(28 28 26 / 0.3); }
.home-qa label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.home-qa input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
  font: 500 18px/1.2 var(--font); caret-color: var(--ink);
}
.home-qa input:focus-visible { outline-offset: 2px; }
.home-qa-out { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.home-qa-out div { padding: 10px 12px; border-radius: 10px; background: var(--surface); min-width: 0; }
.home-qa-out div:first-child { grid-column: 1 / -1; }
.home-qa-out dt { font-size: 12px; color: var(--ink-2); }
.home-qa-out dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.home-qa-out .is-new { animation: home-pop 260ms var(--ease-out); }
@keyframes home-pop { from { background: var(--home-hi); color: var(--home-hi-ink); } }
.home-qa-try { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2); }
.home-qa-try button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em;
}


/* Files: the peak. The seam moves with --sc-p from the engine. */
.home-files { background: var(--home-hi); color: var(--home-hi-ink); }
.home-files-text h2 { color: var(--home-hi-ink); }
.home-files-stage { display: grid; align-items: center; }
.home-files-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.home-files-text { display: grid; gap: 16px; max-width: 44ch; }
.home-files-text p { color: var(--home-hi-soft); font-size: 17px; }
.home-files-hint { font-weight: 500; color: var(--home-hi-ink) !important; }

.home-sheet {
  --a: clamp(0, (var(--sc-p, 0) - 0.08) / 0.38, 1);
  --b: clamp(0, (var(--sc-p, 0) - 0.5) / 0.24, 1);
  --seam: calc((var(--a) - var(--b) * 0.5) * 100%);
  width: 100%; max-width: 520px; justify-self: center;
  margin: 0; color: var(--ink); background: var(--bg); border-radius: var(--home-r);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.5);
  overflow: hidden;
}
.home-sheet-path { display: flex; align-items: center; gap: 8px; padding: 12px 20px; font: 13px/1 var(--font-mono); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.home-sheet-body { position: relative; }
.home-sheet-rendered, .home-sheet-source { padding: 24px 28px 28px; }
.home-sheet-source { position: absolute; inset: 0; background: var(--surface); font-family: var(--font-mono); font-size: 14px; color: var(--ink-2); clip-path: inset(0 calc(100% - var(--seam)) 0 0); }
.home-sheet-rendered { clip-path: inset(0 0 0 var(--seam)); }
/* When the seam settles at 50%, the rendered text moves into the right half
   so both sides of the same file are readable at once. */
.home-sheet-rendered > * { transform: translateX(calc(var(--b) * (50% + 14px))); }
.home-sheet-seam { position: absolute; top: 0; bottom: 0; left: var(--seam); width: 2px; margin-left: -1px; background: var(--ink); opacity: calc(var(--a) * (1 - var(--b) * 0.4)); }
.home-sheet .r-h, .home-sheet .r-p, .home-sheet li { height: 40px; display: flex; align-items: center; white-space: nowrap; margin: 0; }
.home-sheet .r-h { height: 52px; }
.home-sheet .r-p { display: block; line-height: 40px; }
.home-sheet-rendered .r-h { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.home-sheet-source .r-h { font-size: 15px; font-weight: 600; }
.home-sheet-source b { color: var(--link); font-weight: 600; margin-right: 0.2ch; }
.home-sheet-source .r-p b { margin: 0; }
.home-sheet .r-list { list-style: none; margin: 0; padding: 0; }
.home-sheet-rendered a { color: var(--link); }
.home-sheet-rendered label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.home-sheet-rendered input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.home-sheet-rendered label:has(input:checked) { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.home-sheet .r-tag { font-size: 14px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--link); }
.home-sheet-source button { font: inherit; color: var(--link); font-weight: 600; background: none; border: 0; padding: 0 1ch 0 0; cursor: pointer; }
.home-sheet-source button.is-flash { animation: home-flash 600ms var(--ease-out); }
@keyframes home-flash { from { background: var(--accent-soft); } }
.home-sheet-sync { list-style: none; margin: 0; padding: 10px 20px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.home-sheet-sync li { display: flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.home-sheet-sync li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.home-sheet-sync li.is-flash { animation: home-flash 900ms var(--ease-out); }

/* Build: two rows, text against code. */
.home-build { display: grid; gap: clamp(48px, 7vw, 88px); margin-top: clamp(40px, 6vw, 72px); }
.home-build-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.home-build-row:nth-child(2) { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.home-build-row:nth-child(2) .home-build-text { order: 2; }
.home-build-text { display: grid; gap: 14px; max-width: 46ch; }
.home-build-text h3 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -0.02em; }
.home-build-text p { color: var(--ink-2); font-size: 17px; }
.home-code { margin: 0; padding: 22px 24px; border-radius: var(--home-r); background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.6; overflow-x: auto; tab-size: 2; }
.home-code b { font-weight: 600; color: var(--ink); }

/* Screenshots under the plan chapter, and the AI screenshot. */
.home-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 32px); margin-top: clamp(48px, 7vw, 88px); }
/* A copy of the app's AI bar (clients/app/src/screens/ai_bar.tsx), drawn with theme tokens. */
.home-ai { margin: 0; width: 100%; max-width: 560px; justify-self: end; background: var(--bg); border: 1px solid var(--line); border-radius: var(--home-r); box-shadow: 0 24px 48px -28px rgb(0 0 0 / 0.35); font-size: 15px; overflow: hidden; }
.home-ai-log { display: grid; gap: 12px; padding: 14px 16px 20px; }
.home-ai-log p, .home-ai-log ul { margin: 0; }
.home-ai-log ul { padding-left: 20px; }
.home-ai-log hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.home-ai-me { justify-self: end; max-width: 90%; padding: 6px 10px; border-radius: 6px; background: var(--accent-soft); }
.home-ai-link { color: var(--link); }
.home-ai-card { display: grid; gap: 8px; justify-items: start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; }
.home-ai-card small { font-size: 13px; color: var(--ink-2); }
.home-ai-actions { display: flex; gap: 6px; }
.home-ai-actions b { font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line-strong); }
.home-ai-actions b:first-child { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.home-ai-reply { margin: 0; padding: 14px 16px 48px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 16px; }
.home-ai-foot { margin: 0; display: flex; justify-content: space-between; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }

/* Self-host facts */
.home-facts { margin: 0; display: grid; border-top: 1px solid var(--line); }
.home-facts div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.home-facts dt { color: var(--ink-2); font-size: 14px; padding-top: 2px; }
.home-facts dd { margin: 0; font-size: 17px; }
.home-facts img { display: inline-block; vertical-align: -2px; margin: 0 6px 0 2px; }

/* Colophon */
.home-colophon { padding: clamp(96px, 14vw, 180px) 0 40px; border-top: 1px solid var(--line); }
.home-colophon h2 { font-size: clamp(44px, 7vw, 88px); line-height: 1.02; letter-spacing: -0.04em; max-width: 12ch; }
.home-bars { display: grid; gap: 12px; margin-top: clamp(32px, 5vw, 56px); }
.home-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 72px; padding: 0 28px; border-radius: var(--home-r);
  font-size: clamp(20px, 2.4vw, 28px); font-weight: 500; letter-spacing: -0.01em; text-decoration: none;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.home-bar:hover { background: var(--surface-2, var(--surface)); }
.home-bar:active { transform: scale(0.99); }
.home-bar-primary, .home-bar-primary:hover { background: var(--home-hi); color: var(--home-hi-ink); border-color: transparent; }
.home-bar .home-arrow { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .home-bar:hover .home-arrow { transform: translateX(4px); } }
.home-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; margin-top: clamp(80px, 12vw, 140px); padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.home-foot nav { display: flex; gap: 20px; }
.home-foot nav a { color: var(--ink-2); }
.home-foot p { margin: 0 0 0 auto; }

@media (max-width: 1023px) {
  .home-spread, .home-spread-flip, .home-build-row, .home-build-row:nth-child(2), .home-files-grid, .home-pair { grid-template-columns: minmax(0, 1fr); }
  .home-ai, .home-ai-stack { justify-self: stretch; max-width: none; }
  .home-app { grid-template-columns: minmax(0, 1fr); }
  .home-app-side { display: none; }
  .home-build-row:nth-child(2) .home-build-text { order: 0; }
  .home-title-back { top: 6%; opacity: 0.8; }
  .home-files-grid { gap: 24px; }
}

@media (max-width: 639px) {
  .home-title { padding: 56px 0 64px; align-content: center; gap: 40px; }
  .home-title-back { display: none; }
  /* The engine writes an inline transform; on a phone the chip sits in flow. */
  .home-title-front { position: static; padding-inline: var(--home-gut); transform: none !important; }
  .home-chip { font-size: 13px; gap: 6px; padding: 10px 12px; }
  .home-chip b { font-size: 12px; padding: 2px 6px; }
  .home-qa { padding: 16px; }
  .home-files-text p:not(.home-files-hint) { font-size: 15px; }
  .home-files-text h2 { font-size: 30px; }
  .home-sheet-rendered, .home-sheet-source { padding: 16px 18px 18px; }
  .home-sheet .r-h, .home-sheet .r-p, .home-sheet li { height: 34px; }
  .home-sheet .r-h { height: 44px; }
  .home-sheet .r-p { line-height: 34px; }
  .home-sheet-source { font-size: 11px; }
  .home-sheet-rendered { font-size: 14px; }
  .home-sheet-rendered .r-h { font-size: 18px; }
  .home-facts div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .home-foot p { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .home-sheet { --seam: 50%; --b: 1; }
  .home-sheet-seam { opacity: 1; }
  .home-files-hint { opacity: 1 !important; transform: none !important; }
  .home-qa-out .is-new, .home-sheet-source button.is-flash, .home-sheet-sync li.is-flash { animation: none; }
}
