/* Ground0 brand: strictly monochrome (#0A0A0A / #FFFFFF, neutral greys, no accent
   colours), Space Mono for the wordmark, headings and UI labels, DM Sans for body
   text. Tokens mirror app/globals.css of the Ground0 app. Fonts are hosted here;
   nothing is loaded from third parties. */
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("fonts/space-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("fonts/space-mono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
:root {
  color-scheme: dark;
  --background: #0a0a0a;
  --foreground: hsl(0 0% 98%);
  --muted: hsl(240 3.7% 13.5%);
  --muted-foreground: hsl(240 5% 64.9%);
  --border: hsl(240 3.7% 17%);
  --line: hsl(240 3.7% 13%);
  --band: hsl(240 6% 5.6%);
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--foreground); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1152px; margin: 0 auto; padding: 0 24px; }

/* Header */
.bar { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent); background: color-mix(in srgb, var(--background) 80%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: -.025em; text-decoration: none; }
.cursor { color: var(--muted-foreground); animation: blink 1s infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } html { scroll-behavior: auto; } }
.nav { display: flex; align-items: center; gap: 24px; font-family: var(--mono); font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted-foreground); transition: color .15s; }
.nav a:hover { color: var(--foreground); }
.nav .lang { color: var(--background); background: var(--foreground); border-radius: 8px; padding: 8px 16px; }
.nav .lang:hover { color: var(--background); opacity: .9; }
@media (max-width: 680px) { .nav a:not(.lang) { display: none; } }

/* Hero */
.hero { position: relative; max-width: 896px; margin: 0 auto; padding: 72px 0 80px; text-align: center; }
.hero::before { content: ""; position: absolute; inset: 0 -20vw; z-index: -1; background-image: radial-gradient(circle, color-mix(in srgb, var(--foreground) 22%, transparent) 1px, transparent 1.4px); background-size: 22px 22px; -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 38%, #000 0%, transparent 72%); mask-image: radial-gradient(ellipse 60% 55% at 50% 38%, #000 0%, transparent 72%); }
.eyebrow { display: inline-block; font-family: var(--mono); font-size: 13px; color: var(--muted-foreground); border: 1px solid var(--border); background: var(--background); border-radius: 8px; padding: 6px 14px; margin-bottom: 28px; }
.eyebrow::before { content: "$ "; }
h1 { font-family: var(--mono); font-weight: 700; font-size: clamp(32px, 5.2vw, 56px); line-height: 1.12; letter-spacing: -.035em; margin: 0 0 24px; text-wrap: balance; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted-foreground); max-width: 42rem; margin: 0 auto 40px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.btn { display: inline-block; font-family: var(--mono); font-size: 14px; padding: 12px 32px; border-radius: 8px; text-decoration: none; border: 1px solid var(--border); background: var(--background); transition: background .15s, opacity .15s; }
.btn:hover { background: var(--muted); }
.btn.primary { font-weight: 700; background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.btn.primary:hover { background: var(--foreground); opacity: .9; }

/* Chat illustration */
.chat { max-width: 560px; margin: 64px auto 0; text-align: left; background: var(--background); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 4px 6px -1px rgb(0 0 0 / .08), 0 2px 4px -2px rgb(0 0 0 / .08); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px; font-family: var(--mono); font-size: 14px; }
.avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--foreground); color: var(--background); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.chat-head small { color: var(--muted-foreground); margin-left: auto; font-size: 12px; }
.msg { width: fit-content; max-width: 86%; padding: 10px 14px; border-radius: 12px; margin: 0 0 10px; font-size: 15px; line-height: 1.5; }
.msg.me { margin-left: auto; background: var(--foreground); color: var(--background); }
.msg.bot { background: var(--muted); }
.chips { display: flex; gap: 8px; margin-top: 10px; }
.chip { font-family: var(--mono); font-size: 12px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--background); }
.chip.ok { background: var(--foreground); color: var(--background); border-color: var(--foreground); font-weight: 700; }

/* Sections: centred mono headings, every second one on a muted full-width band */
section { padding: 64px 0; }
section.band { background: var(--band); box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); border-block: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
h2 { font-family: var(--mono); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; letter-spacing: -.03em; text-align: center; margin: 0; text-wrap: balance; }
.sub { color: var(--muted-foreground); text-align: center; max-width: 42rem; margin: 16px auto 48px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--background); border: 1px solid var(--border); border-radius: 12px; padding: 24px; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: color-mix(in srgb, var(--foreground) 20%, transparent); box-shadow: 0 4px 6px -1px rgb(0 0 0 / .08); }
.card h3 { font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted-foreground); font-size: 14.5px; }
.num { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--muted-foreground); margin-bottom: 16px; }
.num::before { content: "0"; }
.list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .list { grid-template-columns: 1fr; } }
.list li { background: var(--background); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.list b { display: block; font-family: var(--mono); font-size: 16px; letter-spacing: -.02em; margin-bottom: 8px; }
.list b::before { content: "> "; color: var(--muted-foreground); }
.list span { color: var(--muted-foreground); font-size: 14.5px; }
.note { color: var(--muted-foreground); font-size: 12.5px; text-align: center; margin: 28px 0 0; }
.closing .sub { margin-bottom: 36px; }

/* Footer */
footer { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); background: var(--band); padding: 44px 0; color: var(--muted-foreground); font-size: 12.5px; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 24px; }
.foot .mark { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--foreground); display: block; margin-bottom: 4px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot a { text-decoration: none; transition: color .15s; }
.foot a:hover { color: var(--foreground); }

/* Legal pages */
.legal { max-width: 760px; padding: 56px 0 88px; }
.legal h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 32px; }
.legal h2 { font-size: 17px; text-align: left; margin: 36px 0 8px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 20px; }
.legal address { font-style: normal; }
.legal .muted { color: var(--muted-foreground); font-size: 14px; }

/* ── Motion ──────────────────────────────────────────────────────────────
   Everything below only applies once site.js has run (html.js). Without
   scripts, or with reduced motion, the demos show their final state. */
.js [data-reveal] { opacity: 0; filter: blur(6px); transform: translateY(16px); transition: opacity .55s ease, filter .55s ease, transform .55s ease; transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; filter: none; transform: none; }

/* pointer spotlight on cards */
.card, .list li { position: relative; isolation: isolate; }
.card::after, .list li::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; transition: opacity .25s; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--foreground) 9%, transparent), transparent 70%); }
.card:hover::after, .list li:hover::after { opacity: 1; }
.list li { transition: border-color .15s; }
.list li:hover { border-color: color-mix(in srgb, var(--foreground) 20%, transparent); }

/* scripted chat */
.chat-body { min-height: 268px; }
.status { font-family: var(--mono); font-size: 12px; color: var(--muted-foreground); margin: 14px 4px 2px; }
.status::before { content: "✓ "; color: var(--foreground); }
.js .chat [data-step] { display: none; }
.js .chat [data-step].on { display: block; animation: pop .38s cubic-bezier(.2, .9, .3, 1.25); }
.msg.me { transform-origin: 100% 100%; }
.msg.bot { transform-origin: 0 100%; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
.dots { display: flex; gap: 5px; padding: 15px 16px; animation: pop .25s ease; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-foreground); animation: bounce .9s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.chip { transition: transform .15s, opacity .3s; }
.chip.pressed { transform: scale(.9); }
.chips:has(.pressed) .chip:not(.pressed) { opacity: .35; }

/* feature rows: text on the left, a dotted stage on the right */
.rows { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
.row + .row { border-top: 1px solid var(--border); }
.row-text { padding: 44px 40px; }
.row-text h3 { font-family: var(--mono); font-size: 20px; line-height: 1.3; letter-spacing: -.03em; margin: 0 0 14px; text-wrap: balance; }
.row-text p { color: var(--muted-foreground); margin: 0 0 14px; }
.row-text .fine { font-size: 13.5px; }
.stage { border-left: 1px solid var(--border); padding: 48px 40px; display: grid; place-items: center; min-height: 440px; background-color: var(--band); background-image: radial-gradient(circle, color-mix(in srgb, var(--foreground) 16%, transparent) 1px, transparent 1.4px); background-size: 20px 20px; }
@media (max-width: 900px) { .row { grid-template-columns: 1fr; } .stage { border-left: 0; border-top: 1px solid var(--border); padding: 32px 18px; min-height: 0; } .row-text { padding: 32px 24px; } }

/* workflow that runs step by step */
.flow { width: 100%; max-width: 460px; }
.node { position: relative; display: flex; align-items: center; gap: 14px; padding: 15px 16px; margin-top: 30px; background: var(--background); border: 1px solid var(--border); border-radius: 12px; transition: border-color .4s, box-shadow .4s, opacity .45s, transform .45s cubic-bezier(.2, .9, .3, 1.15); }
.node:first-child { margin-top: 0; }
.node + .node::before { content: ""; position: absolute; left: 50%; top: -31px; width: 1.5px; height: 30px; background: var(--foreground); transform: scaleY(0); transform-origin: top; transition: transform .35s ease; }
.node.gap { margin-top: 46px; }
.node.gap::before { display: none; }
.ico { flex: none; width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 15px; background: var(--muted); }
.ico.inv { background: var(--foreground); color: var(--background); }
.node small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted-foreground); }
.node b { display: block; font-weight: 500; font-size: 14.5px; line-height: 1.4; min-height: 1.4em; }
.node > div { min-width: 0; flex: 1; }
.badge { flex: none; font-family: var(--mono); font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--foreground); border-radius: 999px; padding: 3px 9px; transition: opacity .3s, transform .3s; }
.check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--foreground); animation: spin .8s linear infinite; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.typing::after { content: "▍"; color: var(--muted-foreground); animation: blink 1s infinite; }
.addr { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; background: var(--background); border: 1px solid var(--border); border-radius: 999px; padding: 11px 18px; min-height: 46px; transition: opacity .45s, transform .45s; }
.addr::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--foreground); flex: none; }
/* final state (also what shows without scripts) */
.node.done, html:not(.js) .node:not(.plain) { border-color: var(--foreground); box-shadow: 0 4px 6px -1px rgb(0 0 0 / .08); }
.node.done .check, html:not(.js) .check { animation: none; border-color: var(--foreground); background: var(--foreground); }
.node.done .check::after, html:not(.js) .check::after { content: ""; width: 9px; height: 5px; margin-top: -2px; border-left: 2px solid var(--background); border-bottom: 2px solid var(--background); transform: rotate(-45deg); }
.node.done .badge, html:not(.js) .badge { display: none; }
html:not(.js) .node + .node::before { transform: none; }
.js .flow [data-step] { opacity: 0; transform: translateY(12px); }
.js .flow [data-step].on { opacity: 1; transform: none; }
.js .flow .node.on::before { transform: scaleY(1); }
@media (max-width: 600px) { .chat-body { min-height: 336px; } }

/* ── Backdrop: fine grid, slow grey glows and drifting particles ─────────
   Monochrome on purpose; the brand has no accent colour. */
.hero, section.closing { position: relative; isolation: isolate; }
.backdrop { position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); overflow: hidden; pointer-events: none; color: var(--foreground); -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
section.closing .backdrop { -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%); }
.backdrop::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(to right, color-mix(in srgb, var(--foreground) 7%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--foreground) 7%, transparent) 1px, transparent 1px); background-size: 56px 56px; background-position: center top; -webkit-mask-image: radial-gradient(ellipse 75% 80% at 50% 35%, #000 20%, transparent 78%); mask-image: radial-gradient(ellipse 75% 80% at 50% 35%, #000 20%, transparent 78%); }
.backdrop::after { content: ""; position: absolute; inset: -25%; background: radial-gradient(38% 46% at 24% 34%, color-mix(in srgb, var(--foreground) 13%, transparent), transparent 70%), radial-gradient(34% 42% at 76% 24%, color-mix(in srgb, var(--foreground) 9%, transparent), transparent 70%), radial-gradient(44% 38% at 62% 82%, color-mix(in srgb, var(--foreground) 8%, transparent), transparent 70%); filter: blur(48px); animation: drift 22s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .backdrop::after { animation: none; } }
.backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::before { display: none; }

/* hero: text left, chat window right on wide screens */
@media (min-width: 1000px) {
  .hero { max-width: none; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 56px; align-items: center; text-align: left; padding: 80px 0 104px; }
  .hero h1 { font-size: clamp(36px, 4.1vw, 52px); }
  .hero .lead { margin-left: 0; }
  .hero .actions { justify-content: flex-start; }
  .hero .chat { margin: 0; max-width: none; }
}

/* chat window: fixed height, scrolls, shows its working */
.chat { padding: 0; overflow: hidden; border-radius: 14px; background: color-mix(in srgb, var(--background) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 20px 50px -12px rgb(0 0 0 / .18); }
.chat-head { padding: 14px 18px; margin: 0; }
.chat-head .pill { margin-left: auto; display: none; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; background: var(--foreground); color: var(--background); border-radius: 999px; padding: 4px 11px; animation: pop .4s cubic-bezier(.2, .9, .3, 1.25); }
.chat.finished .chat-head .pill, html:not(.js) .chat-head .pill { display: inline-flex; }
.chat.finished .chat-head small, html:not(.js) .chat-head small { display: none; }
.chat-body { min-height: 0; height: 400px; overflow-y: auto; overscroll-behavior: contain; padding: 18px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
html:not(.js) .chat-body { height: auto; }
@media (max-width: 600px) { .chat-body { min-height: 0; height: 380px; } }
.meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-foreground); margin: 14px 2px 8px; }
.meta:first-child { margin-top: 0; }
.meta.me { justify-content: flex-end; }
.meta b { color: var(--foreground); font-weight: 500; }
.who { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 9.5px; font-weight: 700; background: var(--muted); color: var(--foreground); }
.who.inv { border-radius: 6px; background: var(--foreground); color: var(--background); }
.tool { display: flex; width: fit-content; max-width: 100%; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; border: 1px solid var(--border); background: var(--background); border-radius: 10px; padding: 6px 7px 6px 11px; margin: 0 0 8px; }
.tool .tico { font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--muted-foreground); }
.tstate { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--muted); border-radius: 999px; padding: 3px 9px 3px 5px; }
.tstate .check { width: 14px; height: 14px; border-width: 1.5px; }
.tool.done .tstate .check::after, html:not(.js) .tstate .check::after { content: ""; width: 6px; height: 3px; margin-top: -1px; border-left: 1.5px solid var(--background); border-bottom: 1.5px solid var(--background); transform: rotate(-45deg); }
.tool.done .check, html:not(.js) .tool .check { animation: none; border-color: var(--foreground); background: var(--foreground); }
.tstate .ok, .tool.done .tstate .run, html:not(.js) .tstate .run { display: none; }
.tool.done .tstate .ok, html:not(.js) .tstate .ok { display: inline; }
.tstate em { font-style: normal; }
.chat-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--border); padding: 8px 12px; }
.replay { font: 12.5px var(--mono); color: var(--muted-foreground); background: none; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; transition: color .15s, background .15s; }
.replay::before { content: "↻ "; }
.replay:hover { color: var(--foreground); background: var(--muted); }
html:not(.js) .chat-foot { display: none; }
.js .chat .meta.on, .js .chat .tool.on { display: flex; }
.msg [data-stream].typing::after { content: "▍"; }

/* ── Structure lines, as on a blueprint: hairlines frame the page column and
   separate the sections; no filled bands. */
body > .wrap { max-width: 1200px; border-inline: 1px solid var(--line); }
section { border-top: 1px solid var(--line); }
section.band { background: none; box-shadow: none; clip-path: none; border-block: 0; border-top: 1px solid var(--line); }
.bar { border-bottom-color: var(--line); }
footer { background: none; border-top-color: var(--line); }
.rows, .row + .row, .stage { border-color: var(--line); }
.stage { background-color: transparent; }
.card, .list li, .node, .addr, .tool { background: color-mix(in srgb, var(--background) 70%, var(--muted)); }
.chat { background: color-mix(in srgb, var(--background) 82%, transparent); border-color: var(--border); box-shadow: 0 0 0 1px rgb(255 255 255 / .02), 0 30px 80px -20px rgb(0 0 0 / .9); }
.backdrop::before { background-image: linear-gradient(to right, color-mix(in srgb, var(--foreground) 5%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--foreground) 5%, transparent) 1px, transparent 1px); }
body > .wrap > main > section { margin-inline: -24px; padding-inline: 24px; }
