/* hearth landing page. Tokens mirror the console (src/console/app.css) so the page feels like the product. */

:root {
  --bg: oklch(0.985 0.002 75);
  --panel: oklch(1 0 0);
  --muted: oklch(0.965 0.003 75);
  --border: oklch(0.915 0.004 75);
  --fg: oklch(0.22 0.008 60);
  --dim: oklch(0.52 0.012 60);
  --accent: oklch(0.64 0.19 42);
  --accent-soft: oklch(0.64 0.19 42 / 0.1);
  --accent-fg: oklch(0.99 0.01 60);
  --dot: oklch(0.86 0.006 75);
  --shadow: 0 1px 2px oklch(0.3 0.02 60 / 0.06), 0 24px 60px -24px oklch(0.3 0.03 50 / 0.25);
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.155 0.005 60);
    --panel: oklch(0.19 0.006 60);
    --muted: oklch(0.235 0.007 60);
    --border: oklch(0.29 0.008 60);
    --fg: oklch(0.95 0.003 75);
    --dim: oklch(0.68 0.012 70);
    --accent: oklch(0.72 0.17 48);
    --accent-soft: oklch(0.72 0.17 48 / 0.14);
    --accent-fg: oklch(0.16 0.02 50);
    --dot: oklch(0.27 0.008 60);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.4), 0 24px 60px -24px oklch(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: oklch(0.155 0.005 60);
  --panel: oklch(0.19 0.006 60);
  --muted: oklch(0.235 0.007 60);
  --border: oklch(0.29 0.008 60);
  --fg: oklch(0.95 0.003 75);
  --dim: oklch(0.68 0.012 70);
  --accent: oklch(0.72 0.17 48);
  --accent-soft: oklch(0.72 0.17 48 / 0.14);
  --accent-fg: oklch(0.16 0.02 50);
  --dot: oklch(0.27 0.008 60);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.4), 0 24px 60px -24px oklch(0 0 0 / 0.7);
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Anchor targets stop clear of the sticky nav. */
[id] { scroll-margin-top: calc(var(--nav-h) + 28px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.4em; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.1; font-weight: 650; }
h2 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.25rem); max-width: 26ch; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.accent { color: var(--accent); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  height: var(--nav-h);
  background: color-mix(in oklab, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-row { display: flex; align-items: center; gap: 24px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand .icon { width: 18px; height: 18px; }
.nav-links { display: none; gap: 22px; margin-left: 8px; color: var(--dim); font-size: 0.95rem; }
.nav-links a:hover { color: var(--fg); }
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--dim); cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); background: var(--muted); border-color: var(--border); }
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Buttons: pill, like the console's toolbar buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--fg); font-weight: 550; font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--dim); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 12px; font-size: 0.9rem; }
.btn-sm span { display: none; }
@media (min-width: 640px) { .btn-sm span { display: inline; } }

/* Hero: split, screenshot on a dotted grid like the console canvas */
.hero {
  position: relative;
  padding: 56px 0 72px;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 70%, var(--bg));
}
/* The same grid in the flame colour, shown only in a soft circle around the pointer. */
.hero-dots {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background-image: radial-gradient(var(--accent) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), #000 0%, rgb(0 0 0 / 0.35) 45%, transparent 100%);
          mask-image: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), #000 0%, rgb(0 0 0 / 0.35) 45%, transparent 100%);
  transition: opacity 0.35s ease;
}
.hero.lit .hero-dots { opacity: 0.9; }
@media (prefers-reduced-motion: reduce) { .hero-dots { transition: none; } }
.hero-grid { position: relative; display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) {
  .hero { padding: 72px 0 96px; }
  .hero-grid { grid-template-columns: 5fr 7fr; gap: 56px; }
}
.hero-copy h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem); max-width: 14ch; }
.lede { margin-top: 20px; font-size: 1.1rem; color: var(--dim); max-width: 42ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-shot { margin: 0; }
.hero-shot img {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel); box-shadow: var(--shadow);
}
.hero-shot figcaption, .cell-shot figcaption { margin-top: 12px; font-size: 0.85rem; color: var(--dim); }
@media (min-width: 960px) {
  .hero-shot { margin-right: -12vw; }
  .hero-shot img { max-width: none; width: calc(100% + 12vw); }
  .hero-shot figcaption { max-width: 100%; }
}
@media (min-width: 1400px) {
  .hero-shot { margin-right: -160px; }
  .hero-shot img { width: calc(100% + 160px); }
}

/* Problem statement */
.problem { padding: 24px 0 64px; }
.statement {
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.7rem); line-height: 1.35; letter-spacing: -0.015em;
  max-width: 34ch; font-weight: 500;
}
.statement::before {
  content: ""; display: block; width: 44px; height: 3px; border-radius: 2px;
  background: var(--accent); margin-bottom: 22px;
}

/* What it does: 2+1 text cells and one tall screenshot cell */
.what { padding: 40px 0 80px; border-top: 1px solid var(--border); }
.what h2 { margin-bottom: 36px; }
.what-grid { display: grid; gap: 14px; }
.cell { border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel); padding: 24px; }
.cell .icon { width: 20px; height: 20px; margin-bottom: 16px; }
.cell h3 { margin-bottom: 10px; }
.cell p { color: var(--dim); }
.cell-queue { background: var(--accent-soft); border-color: transparent; }
.cell-queue p { color: var(--fg); opacity: 0.8; }
.cell-shot { margin: 0; padding: 16px; background: var(--muted); overflow: hidden; }
.cell-shot img { border-radius: 8px; border: 1px solid var(--border); background: var(--panel); }
@media (min-width: 900px) {
  .what-grid { grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(0, auto); }
  .cell-queue { grid-column: 1 / 8; }
  .cell-openai { grid-column: 1 / 5; }
  .cell-peers { grid-column: 5 / 8; }
  .cell-shot { grid-column: 8 / 13; grid-row: 1 / 3; }
  .cell-shot img { height: 100%; object-fit: cover; object-position: top; }
}

/* Quick start */
.start { padding: 72px 0; background: var(--muted); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.start h2 { max-width: 30ch; margin-bottom: 28px; }
.terminal { border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.terminal-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); font-size: 0.8rem; color: var(--dim); font-family: var(--font-mono); }
.terminal pre { margin: 0; padding: 20px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.95rem; line-height: 1.7; }
.terminal pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.terminal .c { color: var(--dim); }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--dim); font: inherit; cursor: pointer;
}
.copy-btn:hover { color: var(--fg); }
.copy-btn .icon-check { display: none; color: var(--accent); }
.copy-btn.copied .icon-check { display: block; }
.copy-btn.copied .icon-copy { display: none; }
.aside { margin-top: 20px; color: var(--dim); max-width: 70ch; }
.sources { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.sources a {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.sources a:hover { border-color: var(--accent); }
.sources a:active { transform: translateY(1px); }
.sources .icon { width: 20px; height: 20px; color: var(--accent); }
.sources span { display: flex; flex-direction: column; line-height: 1.25; }
.sources strong { font-weight: 600; }
.sources small { font-family: var(--font-mono); font-size: 0.8rem; color: var(--dim); }
.sources .source-demo { background: var(--accent-soft); border-color: transparent; }
.sources .source-demo:hover { border-color: var(--accent); }
.sources .source-demo small { font-family: var(--font-sans); }

/* ASCII smoke behind "Beyond the queue" and the docs (assets/smoke.js). */
.smoke-zone { position: relative; }
.smoke-zone > section { position: relative; z-index: 1; }
.smoke { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
/* A halo in the page colour clears the smoke around the words: invisible on
   the page itself, it keeps the text readable while the smoke shows between. */
.more h2, .more .sub, .feature-list strong, .feature-list span, .feature-list a, .docs h2 {
  text-shadow: 0 0 3px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg), 0 0 22px var(--bg);
}

/* Beyond the queue: two-column list, no cards */
.more { padding: 80px 0; }
.more .sub { margin-top: 12px; color: var(--dim); }
.feature-list { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 28px 48px; }
@media (min-width: 768px) { .feature-list { grid-template-columns: 1fr 1fr; } }
.feature-list li { display: grid; grid-template-columns: 20px 1fr; gap: 14px; align-items: start; }
.feature-list .icon { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.feature-list div { display: flex; flex-direction: column; gap: 4px; }
.feature-list span { color: var(--dim); }
.feature-list a { color: var(--accent); font-size: 0.92rem; font-weight: 550; width: fit-content; }
.feature-list a:hover { text-decoration: underline; }

/* Docs: three groups by what you are doing, each a list of links */
.docs { padding: 0 0 96px; }
.docs h2 { margin-bottom: 28px; }
.doc-groups { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: stretch; }
.doc-group {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 10px 10px;
  background: color-mix(in oklab, var(--panel) 84%, transparent);   /* the smoke shows faintly through */
}
.doc-group h3 {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--dim); padding: 0 10px 10px; margin: 0;
}
.doc-group ul { list-style: none; margin: 0; padding: 0; }
.doc-group li + li { border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent); }
.doc-group a {
  display: grid; grid-template-columns: 20px 1fr 16px; gap: 12px; align-items: start;
  padding: 12px 10px; border-radius: 8px;
}
.doc-group a:hover { background: color-mix(in oklab, var(--muted) 80%, transparent); }
.doc-group a .icon { width: 18px; height: 18px; color: var(--dim); margin-top: 2px; transition: color 0.15s ease; }
.doc-group a:hover .icon { color: var(--accent); }
.doc-group a span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-group a strong { font-weight: 600; }
.doc-group a small { font-size: 0.88rem; color: var(--dim); line-height: 1.4; }
.doc-group a .go { width: 15px; height: 15px; opacity: 0; transform: translate(-4px, 4px); transition: opacity 0.15s ease, transform 0.15s ease; }
.doc-group a:hover .go, .doc-group a:focus-visible .go { opacity: 1; transform: none; }
@media (hover: none) { .doc-group a .go { opacity: 0.6; transform: none; } }

/* Footer */
.foot { border-top: 1px solid var(--border); padding: 28px 0; font-size: 0.92rem; color: var(--dim); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.foot .brand { color: var(--fg); }
.foot p a { color: var(--fg); font-weight: 550; }
.foot p a:hover { color: var(--accent); }
.foot-links { display: flex; gap: 20px; margin-left: auto; }
.foot-links a:hover { color: var(--fg); }

/* Motion: a short entry on the hero only, off under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .hero-shot { animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
  .hero-shot { animation-delay: 0.18s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.aside a { color: var(--accent); font-weight: 550; }
.aside a:hover { text-decoration: underline; }
