/* Homepage. Built only from the design-system tokens in tokens.css, so both palettes and
   light/dark work without a single hard-coded colour. */

body.home { background: var(--paper); color: var(--ink); font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }
.hm-wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- nav ---------- */
.hm-nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color 0.2s, box-shadow 0.2s; }
.hm-nav.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.hm-nav-in { display: flex; align-items: center; gap: 1.5rem; height: 3.8rem; }
.hm-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; }
.hm-links { display: flex; gap: 1.4rem; margin-left: 1rem; }
.hm-links a { color: var(--muted); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.hm-links a:hover { color: var(--ink); }
.hm-nav-end { margin-left: auto; display: flex; align-items: center; gap: 0.35rem; }

/* ---------- hero ---------- */
.hm-hero { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2.5rem, 6vw, 4.5rem); }
.hm-h1 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: clamp(2.5rem, 5.6vw, 4.5rem); line-height: 1.02; margin: 0.9rem 0 1.2rem; text-wrap: balance; }
.hm-h1 em { color: var(--accent); font-style: italic; }
:root[data-palette="paperclip"] .hm-h1 em { font-style: normal; }
.hm-lede { font-size: clamp(1.02rem, 1.5vw, 1.18rem); line-height: 1.6; color: var(--muted); max-width: 34rem; margin: 0 0 1.7rem; }
.hm-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.hm-btn { padding: 0.7rem 1.15rem; font-size: 0.92rem; }
.hm-facts { display: flex; flex-wrap: wrap; gap: 1.2rem 2.4rem; margin: 2.2rem 0 0; padding-top: 1.3rem; border-top: 1px solid var(--border); }
.hm-facts div { display: flex; flex-direction: column; gap: 0.15rem; }
.hm-facts dt { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.5rem; letter-spacing: var(--display-tracking); font-variant-numeric: tabular-nums; }
.hm-facts dd { margin: 0; font-size: 0.78rem; color: var(--muted); }

/* ---------- live sample ---------- */
.hm-demo { min-width: 0; }
.hm-demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.hm-live { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); }
.hm-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos) 22%, transparent); }
.hm-card { padding: 1.1rem 1.2rem 1rem; box-shadow: var(--shadow-md); }
.hm-card[hidden] { display: none; }
.hm-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.hm-card-head h3 { margin: 0.25rem 0 0; font-size: 1.02rem; font-weight: 600; }
.hm-price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.hm-price b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.hm-price span { font-family: var(--font-mono); font-size: 0.78rem; }
.hm-price small { color: var(--muted); }
.hm-line { display: block; width: 100%; height: 9.5rem; margin-top: 0.7rem; overflow: visible; }
.hm-line .l { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.hm-line.up .l { stroke: var(--pos); } .hm-line.up stop { stop-color: var(--pos); }
.hm-line.down .l { stroke: var(--neg); } .hm-line.down stop { stop-color: var(--neg); }
.hm-line-foot { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.64rem; color: var(--muted); margin-top: 0.3rem; }
.hm-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.6rem; margin-top: 0.9rem; }
.hm-chips div { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--paper-sunken); }
.hm-chips b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hm-chips small { font-size: 0.64rem; color: var(--muted); }
.hm-bars-head { display: flex; justify-content: space-between; align-items: baseline; margin: 1rem 0 0.4rem; font-size: 0.84rem; }
.hm-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0.35rem; align-items: end; }
.hm-bar { display: grid; grid-template-rows: 5.2rem auto auto; justify-items: center; gap: 0.15rem; min-width: 0; }
.hm-bar i { align-self: end; width: 62%; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--structure) 55%, transparent); min-height: 2px; }
.hm-bar.last i { background: var(--accent); }
.hm-bar .v { font-family: var(--font-mono); font-size: 0.6rem; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-bar .q { font-family: var(--font-mono); font-size: 0.58rem; color: var(--muted); white-space: nowrap; }
.hm-card-link { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.9rem; font-size: 0.82rem; font-weight: 500; color: var(--structure); text-decoration: none; }
.hm-card-link:hover { text-decoration: underline; }

/* ---------- sections ---------- */
.hm-sec { padding-block: clamp(2.8rem, 7vw, 5.5rem); }
.hm-sec-head { max-width: 40rem; margin-bottom: 2.4rem; }
.hm-h2 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1; margin: 0.6rem 0 0; text-wrap: balance; }
.hm-sub { color: var(--muted); line-height: 1.6; max-width: 34rem; margin: 0.9rem 0 0; }

.hm-feature { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.hm-feature.flip { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.hm-feature.flip .hm-feature-copy { order: 2; }
.hm-feature-copy h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: 1.6rem; margin: 0 0 0.7rem; line-height: 1.15; }
.hm-feature-copy p { color: var(--muted); line-height: 1.65; margin: 0 0 1rem; max-width: 34rem; }
.hm-ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; }
.hm-ticks li { display: flex; gap: 0.6rem; align-items: baseline; }
.hm-ticks li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.hm-feature-art { min-width: 0; }

.hm-mini { padding: 0.9rem 1rem 0.5rem; box-shadow: var(--shadow-md); overflow-x: auto; }
.hm-mini-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.4rem; }
.hm-mini table { width: 100%; }
.hm-mini table.fin th, .hm-mini table.fin td { padding: 0.5rem 0.55rem; font-size: 0.78rem; white-space: nowrap; }
.hm-mini table.fin th:first-child, .hm-mini table.fin td:first-child { min-width: 0; position: static; border-right: 0; }
.hm-mini .spark-col { padding-left: 0.2rem; }
.hm-story { padding: 1.1rem 1.2rem; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 0.8rem; }
.hm-story-head { display: flex; justify-content: space-between; align-items: center; }
.hm-story-text { margin: 0; line-height: 1.6; font-size: 0.95rem; }

.hm-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.hm-tile { padding: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; box-shadow: var(--shadow-sm); }
.hm-tile h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.hm-tile p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
.hm-tile-icon { width: 1.5rem; height: 1.5rem; color: var(--structure); }
.hm-alloc { display: flex; height: 0.7rem; border-radius: 999px; overflow: hidden; gap: 2px; margin-top: auto; }
.hm-alloc i { flex: 0 0 var(--w); background: var(--c); }
.hm-cap { font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted); }
.hm-topics { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.hm-ask { margin-top: auto; border: 1px solid var(--border); border-radius: 999px; padding: 0.55rem 0.9rem; font-size: 0.82rem; color: var(--muted); background: var(--paper-sunken); }

/* ---------- how it works ---------- */
.hm-how { background: var(--paper-sunken); border-block: 1px solid var(--border); }
.hm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); counter-reset: s; }
.hm-steps li { position: relative; padding-top: 1.1rem; border-top: 2px solid var(--structure); }
.hm-step-n { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--structure); color: var(--on-structure); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; margin-bottom: 0.7rem; }
.hm-steps h3 { margin: 0 0 0.4rem; font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: 1.3rem; }
.hm-steps p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 0.92rem; max-width: 22rem; }

/* ---------- AI models ---------- */
.hm-ai { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.hm-providers { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.hm-prov { padding: 0.55rem 1rem; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 0.92rem; font-weight: 500; background: var(--card); box-shadow: var(--shadow-sm); }

/* ---------- final CTA + footer ---------- */
.hm-final { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.hm-final-in { background: var(--structure); color: var(--on-structure); border-radius: var(--r-lg); padding: clamp(2rem, 5vw, 3.5rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.hm-final-in .hm-h2 { margin: 0; max-width: 22ch; }
.hm-final-in .btn:not(.btn-primary) { background: transparent; color: var(--on-structure); border-color: color-mix(in srgb, var(--on-structure) 40%, transparent); }
.hm-final-in .btn-primary { background: var(--on-structure); color: var(--structure); border-color: var(--on-structure); }
.hm-foot { border-top: 1px solid var(--border); padding-block: 1.6rem 2.4rem; }
.hm-foot-in { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem 3rem; }
.hm-foot p { margin: 0; max-width: 46rem; font-size: 0.78rem; color: var(--muted); line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hm-hero, .hm-feature, .hm-feature.flip, .hm-ai { grid-template-columns: minmax(0, 1fr); }
  .hm-feature.flip .hm-feature-copy { order: 0; }
  .hm-trio, .hm-steps { grid-template-columns: minmax(0, 1fr); }
  .hm-links { display: none; }
}
@media (max-width: 520px) {
  .hm-login { display: none; }
  .hm-facts { gap: 1rem 1.6rem; }
  .hm-bar .v { font-size: 0.52rem; }
  .hm-nav-in { gap: 0.6rem; }
}
