/*
 * The landing page at / (web/landing.html, rendered by lib/landing.ts).
 *
 * The tokens are web/style.css's, copied rather than linked: style.css also styles the
 * picker and the chat, and the landing must not inherit their rules. Change a colour in
 * both places. The type follows the app: a serif headline at weight 500 (book voice),
 * a mono eyebrow, the system sans for everything else, and one violet accent.
 *
 * Layout rule for every section: one column below 860 px, nothing wider than the
 * viewport at 360 px, and a stage never narrower than 240 px.
 */

:root {
  --ink: #16131c;        /* page */
  --panel: #201b2b;      /* raised surfaces */
  --panel-2: #282136;    /* interactive surfaces */
  --line: #352c48;       /* hairlines */
  --text: #ece9f2;
  --muted: #9d94b0;
  --accent: #b48eff;     /* violet: interaction */
  --accent-ink: #1d1329; /* text on accent */
  --danger: #ff9b9b;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --top-h: 64px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.landing {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.landing-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  max-width: 1200px;
  min-height: var(--top-h);
  margin: 0 auto;
  padding: 12px var(--gutter);
}

.landing-brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  font-size: 14px;
}

.landing-nav a {
  color: var(--muted);
  text-decoration: none;
}

.landing-nav a:hover { color: var(--text); }

.landing-nav .landing-cta {
  color: var(--accent-ink);
  background: var(--accent);
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
}

.landing-nav .landing-cta:hover { color: var(--accent-ink); filter: brightness(1.08); }

/* ── Sections ────────────────────────────────────────────────────────────── */

.landing-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter) 96px;
}

.use-case {
  padding: clamp(48px, 9vh, 112px) 0;
  border-top: 1px solid var(--line);
}

.use-case:first-child { border-top: 0; }

.use-case-title:is(h3) { font-size: clamp(28px, 4vw, 48px); }

.use-case-copy { min-width: 0; }

.use-case-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.use-case-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.use-case-body {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  max-width: 32em;
  margin: 0;
  color: var(--text);
  text-wrap: pretty;
}

/* ── The hero: the page's first screen ───────────────────────────────────
   The first enabled beat (lib/landing.ts). Its own layout is in its section sheet,
   web/landing/sections/<beat>.css; these are the rules every hero shares. */

.use-case[data-kind="hero"] {
  min-height: calc(100svh - var(--top-h));
  padding-top: clamp(16px, 4vh, 48px);
  border-top: 0;
}

.use-case[data-kind="hero"] .use-case-title { font-size: clamp(36px, 4.4vw, 56px); }

/* ── Groups: the jump links and the headings ─────────────────────────────── */

.landing-groups {
  flex-basis: 100%;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 13px;
}

.landing-groups::-webkit-scrollbar { display: none; }

.landing-groups a {
  flex: none;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}

.landing-groups a:hover { color: var(--text); border-color: var(--muted); }

.beat-group-title {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  padding: clamp(40px, 7vh, 80px) 0 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.beat-group-title + .use-case { border-top: 0; padding-top: 24px; }

/* ── Tap for sound ───────────────────────────────────────────────────────── */

.sound-pill {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 9px 16px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(32, 27, 43, .92);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sound-pill[hidden] { display: none; }
.sound-pill svg { width: 16px; height: 16px; flex: none; color: var(--accent); }

/* ── The closing block: the way in for a coding agent ────────────────────
   web/landing.html's section.convert, after the last beat. The words on the left, the
   prompt and the ways in on the right; one column below 860 px, and the three links
   stacked below 520 px so each is a whole-width target. The prompt wraps in its box at
   every width, as the hero's code block does. */

.convert {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: start;
  gap: 28px clamp(32px, 5vw, 72px);
  padding: clamp(48px, 9vh, 112px) 0 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.convert-intro,
.convert-act { min-width: 0; }

.convert-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.convert-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.convert-body {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  max-width: 32em;
  margin: 0;
  text-wrap: pretty;
}

.convert-act {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.convert-prompt {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.convert-prompt-text {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.convert-copy-button {
  justify-self: start;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .12s, color .12s;
}

.convert-copy-button:hover { border-color: var(--muted); }
.convert-copy-button[hidden] { display: none; }

.convert-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.convert-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .12s, filter .12s;
}

.convert-link:hover { border-color: var(--muted); }

.convert-link-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.convert-link-primary:hover { border-color: var(--accent); filter: brightness(1.08); }

.convert-agents {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.convert-agents a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.convert-agents a:hover { color: var(--text); text-decoration-color: var(--muted); }

@media (max-width: 860px) {
  .convert { grid-template-columns: minmax(0, 1fr); }
  .convert-prompt { padding: 14px; }
  .convert-prompt-text { font-size: 12.5px; }
}

@media (max-width: 520px) {
  .convert-links { flex-direction: column; }
}
