/* site.css — shared styles for the public marketing pages: the landing page
   (sidecar/web/index.html, served at /) and the detail page
   (sidecar/web/public/about/index.html, served at /about/). Served at
   /assets/site.css by the public overlay. The sign-up box both pages carry is
   rendered by /assets/waitlist.js; its styles live here (.signup, .wl-*).
   The .testimonials / .proj-* rules style markup the server generates into the
   landing page's {{TESTIMONIALS}} / {{PUBLIC_PROJECTS}} slots (WebRouter.swift). */

:root {
  --ground: #f4f2f8;
  --surface: #ffffff;
  --ink: #1c1c1e;
  --ink-2: #48484a;
  --ink-muted: #8e8e93;
  --hairline: #e3e0ea;
  /* The logo's two pods. */
  --green: #34b234;
  --green-soft: #e6f6e6;
  --purple: #8575d7;
  --purple-deep: #5b4bb5;
  --purple-soft: #eeebfa;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(28, 28, 30, 0.07);
  --max: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--ground);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple-deep); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* ── top bar ─────────────────────────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 1rem 1.25rem;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem;
}
.brand img { width: 32px; height: 32px; }
.topnav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.95rem; }
.topnav a { color: var(--ink-2); text-decoration: none; }
.topnav a:hover { color: var(--ink); text-decoration: underline; }
.topnav .pill {
  color: var(--ink); background: var(--surface); border: 1px solid var(--hairline);
  padding: 0.4rem 0.9rem; border-radius: 999px;
}
.topnav .pill:hover { text-decoration: none; border-color: var(--ink-muted); }

/* ── hero ────────────────────────────────────────────────────────────── */

/* One centered column: headline, lede and buttons, then the screenshot below them. */
.hero {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem; justify-items: center; text-align: center;
  max-width: var(--max); margin: 0 auto; padding: 3.5rem 1.25rem 6rem;
}
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--purple-deep); background: var(--purple-soft);
  padding: 0.3rem 0.7rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.9rem); line-height: 1.04; letter-spacing: -0.025em;
  font-weight: 800; margin-bottom: 1.1rem;
}
.hero h1 .soft { color: var(--purple); }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 32rem; margin: 0 auto 1.75rem; }
.ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: center; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 1rem;
  padding: 0.8rem 1.4rem; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-ghost { color: var(--ink); border-color: var(--hairline); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink-muted); }

/* ── the hero screenshot: a conversation becoming a document ──────────── */

.demo {
  position: relative; width: 100%; max-width: 720px; margin-top: 2.5rem; background: var(--surface); border-radius: 22px;
  box-shadow: 0 18px 50px rgba(60, 40, 120, 0.13); padding: 0; overflow: hidden;
}
/* Full brightness: below the headline and buttons it no longer competes with the copy, so the
   old dimming (brightness .9 / opacity .9) is gone. */
.demo-shot { display: block; width: 100%; height: auto; border-radius: 22px; }

/* The same screenshot, smaller, inside a page section (About → How it works). */
.demo-fig { margin: 0 auto 2.5rem; max-width: 560px; }
.demo-sm { max-width: 560px; margin: 0 auto; }
.demo-fig figcaption { margin-top: 0.75rem; text-align: center; font-size: 0.9rem; color: var(--ink-muted); }

/* NOTE: the rules below styled the old hand-built HTML mock, now replaced by
   the .demo-shot image. They are retained only because .bubble/.chip/.tag/.term
   are also used elsewhere; the .demo-*/.doc-* rules are dead and can be removed
   once the real screenshot is wired in. */
.demo-pane { border-radius: 14px; padding: 0.85rem; min-width: 0; }
.demo-chat { background: #f7f6fb; display: flex; flex-direction: column; gap: 0.55rem; }
.demo-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 0.15rem;
}
.bubble { padding: 0.5rem 0.7rem; border-radius: 14px; max-width: 92%; line-height: 1.4; }
.bubble.me { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.ai { background: #e9f7f4; color: var(--ink); align-self: flex-start; border-bottom-left-radius: 4px; }
.chip {
  align-self: flex-start; display: flex; align-items: center; gap: 0.45rem;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 0.4rem 0.55rem; font-size: 0.75rem;
}
.chip .plus { color: var(--green); font-weight: 700; }
.chip .ok {
  background: var(--green); color: #fff; border-radius: 6px; padding: 0.1rem 0.45rem;
  font-weight: 600;
}
.demo-doc { border: 1px solid var(--hairline); }
.doc-title { font-weight: 700; font-size: 0.98rem; margin-bottom: 0.3rem; }
.doc-arg { color: var(--ink-2); font-style: italic; margin-bottom: 0.55rem; line-height: 1.4; }
.doc-h { font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-muted); margin: 0.55rem 0 0.2rem; }
.doc-p { line-height: 1.45; color: var(--ink-2); }
.doc-p .term { color: var(--purple-deep); border-bottom: 1px dotted var(--purple); }
.doc-new { background: var(--green-soft); border-radius: 4px; padding: 0 0.15rem; }
.doc-foot { margin-top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  font-size: 0.68rem; background: var(--purple-soft); color: var(--purple-deep);
  padding: 0.12rem 0.45rem; border-radius: 999px;
}

/* ── three beats ─────────────────────────────────────────────────────── */

.beats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
  max-width: var(--max); margin: 0 auto; padding: 1rem 1.25rem 3rem;
}
.beat { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.beat .n {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; margin-bottom: 0.8rem; color: #fff;
}
.beat:nth-child(1) .n { background: var(--ink); }
.beat:nth-child(2) .n { background: var(--purple); }
.beat:nth-child(3) .n { background: var(--green); }
.beat h2 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.beat p { color: var(--ink-2); font-size: 0.97rem; }

.more-link { text-align: center; padding: 0 1.25rem 3rem; font-size: 1.05rem; }
.more-link a { font-weight: 600; text-decoration: none; }
.more-link a:hover { text-decoration: underline; }

/* ── sign-up box (rendered by waitlist.js) ───────────────────────────── */

.signup {
  max-width: 760px; margin: 0 auto 3.5rem; padding: 0 1.25rem; scroll-margin-top: 1.5rem;
}
.signup-card {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow);
  padding: 2rem; display: grid; grid-template-columns: 1fr 1.2fr; gap: 2rem;
  border-top: 5px solid var(--purple);
}
.signup-card h2 { font-size: 1.55rem; line-height: 1.15; margin-bottom: 0.6rem; letter-spacing: -0.01em; }
.signup-card .wl-intro { color: var(--ink-2); font-size: 0.97rem; }
.signup-card .wl-intro + .wl-intro { margin-top: 0.6rem; }
.wl-form { display: grid; gap: 0.7rem; }
.wl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.wl-field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--ink-2); }
.wl-field input, .wl-field textarea {
  width: 100%; font: inherit; font-size: 0.97rem; padding: 0.6rem 0.75rem;
  border: 1px solid #d4d0dd; border-radius: 10px; background: #fff; color: var(--ink);
}
.wl-field input:focus, .wl-field textarea:focus {
  outline: 2px solid var(--purple); outline-offset: 1px; border-color: var(--purple);
}
.wl-field textarea { resize: vertical; min-height: 4.2rem; }
.wl-submit { justify-self: start; }
.wl-submit:disabled { opacity: 0.5; cursor: default; }
.wl-msg { font-size: 0.9rem; min-height: 1.3em; }
.wl-msg.err { color: #c0392b; }
.wl-msg.ok { color: #1e7e34; font-weight: 600; }

/* ── server-generated sections on the landing page ───────────────────── */

.testimonials, .public-projects {
  max-width: var(--max); margin: 0 auto 3rem; padding: 0 1.25rem;
}
.testimonials h2, .public-projects h2 {
  font-size: 1.3rem; margin-bottom: 1rem; text-align: center;
}
.tstm-scroll {
  display: flex; gap: 1rem; overflow-x: auto; padding: 0.25rem 0.25rem 1rem;
  scroll-snap-type: x mandatory;
}
/* Few cards sit centered; many still scroll. (`justify-content: center` would strand the left
   overflow unreachable; auto margins on the first/last card only absorb LEFTOVER space.) */
.tstm-card:first-child { margin-left: auto; }
.tstm-card:last-child { margin-right: auto; }
.tstm-card {
  flex: 0 0 300px; scroll-snap-align: start; background: var(--surface);
  border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between; gap: 0.75rem;
}
.tstm-quote { font-size: 0.98rem; line-height: 1.55; color: var(--ink); }
.tstm-cite { font-size: 0.85rem; color: var(--ink-muted); font-style: normal; }
/* Cards are 240-300px wide and the tracks are centered, so a few projects sit in the middle
   instead of hugging the left edge (auto-fill + 1fr left empty tracks on the right). */
.proj-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 300px)); gap: 1rem;
  justify-content: center;
}
.proj-card {
  display: flex; gap: 0.9rem; align-items: center; background: var(--surface);
  border-radius: var(--radius); padding: 0.9rem; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); transition: transform 0.12s ease;
}
.proj-card:hover { transform: translateY(-2px); }
.proj-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.proj-thumb-default { object-fit: contain; padding: 6px; background: var(--ground); }
.proj-text { display: flex; flex-direction: column; min-width: 0; }
.proj-name { font-weight: 600; }
.proj-blurb { font-size: 0.87rem; color: var(--ink-2); margin-top: 0.15rem; }

/* ── footer ──────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--hairline); margin-top: 1rem;
  padding: 2rem 1.25rem 2.5rem; text-align: center; color: var(--ink-muted); font-size: 0.88rem;
}
.footer p + p { margin-top: 0.5rem; }
.footer a { color: var(--ink-2); }
.build-info { font-size: 0.72rem; color: #b5b2bd; font-variant-numeric: tabular-nums; }

/* ── detail page ─────────────────────────────────────────────────────── */

.page-hero { max-width: 820px; margin: 0 auto; padding: 3.5rem 1.25rem 2rem; text-align: center; }
.page-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.08; letter-spacing: -0.02em;
  font-weight: 800; margin-bottom: 1rem;
}
.page-hero .lede { margin: 0 auto; }

.section { max-width: var(--max); margin: 0 auto; padding: 2.5rem 1.25rem; }
.section-head { max-width: 680px; margin-bottom: 1.75rem; }
.section-head .kicker {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--purple-deep); margin-bottom: 0.4rem;
}
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 0.6rem; }
.section-head p { color: var(--ink-2); font-size: 1.05rem; }

.story {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow);
  padding: 2rem 2.25rem; max-width: 820px; margin: 0 auto;
}
.story p { color: var(--ink-2); font-size: 1.05rem; line-height: 1.65; }
.story p + p { margin-top: 0.9rem; }
.story .pull { color: var(--ink); font-weight: 600; font-size: 1.15rem; }

.steps { display: grid; gap: 1.25rem; }
.step {
  display: grid; grid-template-columns: 3.25rem 1fr; gap: 1.1rem; background: var(--surface);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.step .n {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 1.1rem; color: #fff; background: var(--purple);
}
.step h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.step p { color: var(--ink-2); }
.step ul { margin: 0.6rem 0 0 1.1rem; color: var(--ink-2); }
.step li + li { margin-top: 0.2rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.tile {
  background: var(--surface); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow);
}
.tile .ic { font-size: 1.5rem; margin-bottom: 0.5rem; }
.tile h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.tile p { color: var(--ink-2); font-size: 0.95rem; }

.usecase { border-left: 4px solid var(--purple); }
.usecase:nth-child(3n+2) { border-left-color: var(--green); }
.usecase:nth-child(3n) { border-left-color: var(--ink); }

.band {
  background: var(--ink); color: #fff; border-radius: 22px; padding: 2.25rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center;
}
.band h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.2; margin-bottom: 0.5rem; }
.band p { color: #d1d1d6; }
.band ul { list-style: none; display: grid; gap: 0.55rem; }
.band li { padding-left: 1.6rem; position: relative; color: #e5e5ea; }
.band li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 0.75rem; }
.faq details {
  background: var(--surface); border-radius: 14px; padding: 1rem 1.25rem; box-shadow: var(--shadow);
}
.faq summary { font-weight: 600; cursor: pointer; list-style-position: outside; }
.faq details p { color: var(--ink-2); margin-top: 0.6rem; }
.faq details ul { color: var(--ink-2); margin: 0.6rem 0 0 1.25rem; display: grid; gap: 0.35rem; }

/* ── narrow screens ──────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2rem; }
  .beats, .grid-3 { grid-template-columns: 1fr; }
  .grid-2, .band { grid-template-columns: 1fr; }
  .signup-card { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.5rem; }
}
@media (max-width: 520px) {
  .topnav { gap: 0.8rem; font-size: 0.9rem; }
  .topnav .hide-sm { display: none; }
  .wl-row { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: 0.6rem; }
  .story { padding: 1.5rem; }
  .band { padding: 1.6rem; }
}

/* ── Click-to-enlarge screenshot (home hero; behaviour in lightbox.js) ────────────── */
.demo a { display: block; cursor: zoom-in; }
dialog.lightbox {
  margin: auto;   /* the page's `* { margin: 0 }` reset otherwise pins a modal dialog top-left */
  padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible;
}
dialog.lightbox::backdrop { background: rgba(20, 19, 26, 0.82); }
dialog.lightbox img {
  display: block; max-width: 96vw; max-height: 94vh; width: auto; height: auto;
  border-radius: 10px; cursor: zoom-out;
}
dialog.lightbox .lightbox-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1;
  cursor: pointer; box-shadow: var(--shadow);
}
