/* Homepage (§17). Builds on app.css: same tokens, rows, tiles, skeletons and article pane. */
:root { --hp-max: 1152px; --hp-gap: 112px; }

body.home { overflow-x: hidden; overflow-y: auto; height: auto; min-height: 100%; }
html:has(body.home) { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html:has(body.home) { scroll-behavior: auto; } }

.hp-wrap { width: 100%; max-width: calc(var(--hp-max) + 48px); margin: 0 auto; padding: 0 24px; }

/* floating top bar */
.hp-bar {
  position: fixed; z-index: 30; top: 12px; left: 50%; transform: translateX(-50%);
  width: min(var(--hp-max), calc(100% - 24px)); height: 52px; padding: 0 8px 0 14px;
  display: flex; align-items: center; gap: 24px;
  border: 1px solid var(--border-strong); border-radius: var(--r);
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.hp-links { display: flex; gap: 4px; margin-right: auto; }
.hp-links a { height: 32px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: var(--r); font: 500 12px/1 var(--mono); color: var(--muted); transition: color var(--t) var(--ease), background var(--t) var(--ease); }
.hp-links a:hover { color: var(--text); background: var(--surface); }
.btn-lg { height: 40px; padding: 0 18px; font-size: 13px; }

/* hero (§19.2): left-aligned, quiet, no glow */
.hero { position: relative; padding: 152px 0 0; }
.hero-copy { text-align: left; }
.hero-title { max-width: 820px; margin: 0; font: 400 clamp(32px, 4vw, 48px) / 1.12 var(--sans); letter-spacing: -0.02em; text-wrap: balance; color: var(--text); }
.hero-mono { font-family: var(--pixel); font-weight: 400; letter-spacing: 0; color: var(--text); font-size: 0.86em; }
.hero-lede { max-width: 560px; margin: 20px 0 0; font-size: 18px; line-height: 28px; color: var(--muted); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* window frame with the live preview */
.window { margin-top: 64px; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.window-bar { position: relative; height: 40px; display: flex; align-items: center; padding: 0 14px; background: #111113; border-bottom: 1px solid #27272a; }
[data-theme="light"] .window-bar { background: #f4f4f5; border-bottom-color: #e4e4e7; }
.window-dots { display: inline-flex; gap: 6px; }
.window-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3f3f46; }
[data-theme="light"] .window-dots i { background: #d4d4d8; }
.window-title { position: absolute; left: 50%; transform: translateX(-50%); font: 500 12px/1 var(--mono); color: var(--faint); }
.window-body { display: grid; grid-template-columns: 400px minmax(0, 1fr); height: 600px; overflow: hidden; position: relative; }
.window-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 96px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.window-body .col { border: 0; border-radius: 0; min-width: 0; overflow: hidden; container-type: normal; }
.window-body .preview-list { border-right: 1px solid var(--border); }
.preview-head { padding: 0 12px 0 10px; justify-content: space-between; }
.preview-head .col-title:hover { background: none; }
.preview-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 16px; }
.preview-tiles .sk-tile .sk-line { margin-top: 10px; }

/* sections */
.hp-section { padding: var(--hp-gap) 0; border-top: 1px solid var(--border); }
.hero + .hp-section { margin-top: var(--hp-gap); }
.hp-head { max-width: 620px; margin-bottom: 40px; }
.hp-head h2 { margin: 0; font-size: 28px; line-height: 32px; }
.hp-lede { margin: 14px 0 0; font-size: 18px; line-height: 28px; color: var(--muted); }
.count-line { margin: 18px 0 0; font: 400 clamp(28px, 3.4vw, 40px) / 1.1 var(--sans); letter-spacing: -0.02em; color: var(--text); }
.count-sk { display: inline-block; width: 260px; height: 36px; vertical-align: middle; }
.hp-link { display: inline-flex; align-items: center; height: 32px; font: 500 13px/1 var(--mono); color: var(--text); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 5px; }
.hp-link:hover { text-decoration-color: var(--text); }

/* image strip under the hero window (§19.3): 9 live tiles, edge-to-edge, one-line mono captions */
.hp-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.hp-strip .sk-tile .sk-line { margin-top: 10px; }

.hp-chips { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hp-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 8px; border: 1px solid var(--border-strong); border-radius: var(--r); font-size: 14px; line-height: 20px; background: var(--bg); }
.hp-chip.is-sk { width: 120px; padding: 0 8px; }
.chip-sk { display: block; width: 100%; height: 14px; }

.hp-layouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.layout-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 20px; align-items: center;
  padding: 20px; border: 1px solid var(--border); border-radius: var(--r); color: var(--muted);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.layout-card:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.layout-card-diagram { grid-row: span 2; display: inline-flex; }
.layout-card-diagram .diagram rect { opacity: 0.55; }
.layout-card-diagram .diagram rect.dim { opacity: 0.25; }
.layout-card:hover .diagram rect { opacity: 0.9; }
.layout-card:hover .diagram rect.dim { opacity: 0.4; }
.layout-card-name { font: 600 16px/22px var(--sans); color: var(--text); align-self: end; }
.layout-card-key { font: 12px/18px var(--mono); color: var(--faint); align-self: start; }

.reader-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: center; }
.features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 28px; }
.features li { display: grid; grid-template-columns: 40px 1fr; gap: 16px; }
.feature-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: var(--r); color: var(--text); background: var(--surface); }
.features h3 { margin: 0; font: 600 16px/24px var(--sans); }
.features p { margin: 4px 0 0; font-size: 15px; line-height: 23px; color: var(--muted); }
.reader-mock { border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; height: 520px; position: relative; }
.reader-mock .article { height: 100%; }
.reader-mock .art-bar { pointer-events: none; }
.reader-mock .art-scroll { overflow: hidden; }
.reader-mock .story { padding: 36px 32px; }
.reader-mock .story-title { font-size: 30px; }
.reader-mock .story-body { font-size: 17px; }
.reader-mock::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(transparent, #09090b); pointer-events: none; }
.reader-mock .seg-btn { display: inline-flex; align-items: center; }
.mock-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; border: 1px solid #3f3f46; border-radius: var(--r); background: #27272a; color: #fafafa; font: 600 11px/1 var(--mono); }

.hp-footer { padding: 48px 0 64px; border-top: 1px solid var(--border); }
.footer-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-row p { margin: 0; flex: 1 1 320px; font-size: 14px; line-height: 22px; color: var(--muted); }
.footer-name { font-size: 16px; }

/* tablet and phone */
@media (max-width: 899px) {
  :root { --hp-gap: 96px; }
  .window-body { grid-template-columns: minmax(0, 1fr); height: 560px; }
  .window-body .preview-grid { display: none; }
  .window-body .preview-list { border-right: 0; }
  .reader-split { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hp-layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hp-links { display: none; }
  .hp-bar { justify-content: space-between; gap: 12px; }
  .hp-wrap { padding: 0 16px; }
  .hero { padding-top: 112px; }
  .hp-bar .brand-name { display: none; }
  .hp-strip { gap: 12px; }
  .hero-lede { font-size: 16px; line-height: 25px; }
  .window { margin-top: 48px; }
  .hp-head h2 { font-size: 22px; line-height: 28px; }
  .hp-lede { font-size: 16px; line-height: 25px; }
  .layout-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; row-gap: 10px; padding: 16px; }
  .layout-card-diagram { grid-row: auto; }
  .layout-card-diagram svg { width: 60px; height: 40px; }
  .reader-mock { height: 440px; }
  .reader-mock .story { padding: 24px 18px; }
  .reader-mock .story-title { font-size: 24px; }
  .reader-mock .art-bar .btn:not(:first-of-type) { display: none; }
  .hp-chip { height: 32px; font-size: 13px; }
}
