/*
 * capt.page — the plain page.
 *
 * Phone first (../../../MOBILE_FIRST_STANDARD.md): the base rules are the
 * 320px layout, and every rule that widens it is a `min-width` query on the
 * fleet's ladder (40 / 48 / 64rem). There is no `max-width` media query here.
 *
 * The palette is the app's own asset catalogue, light and dark: AccentColor,
 * CaptCanvas, CaptSurface, CaptStacked. js/demo.js reads the same custom
 * properties, so the demo changes with the page.
 */

:root {
  --accent: #0d7e8a;
  --bg: #f2f2f4;
  --surface: #ffffff;
  --canvas: #dadadf;
  --chrome: #ffffff;
  --edge: #5c5c66;
  --stacked: #8a5d00;
  --text: #1c1c1e;
  --text-2: rgb(28 28 30 / 0.72);
  --text-3: rgb(28 28 30 / 0.6);
  --line: rgb(28 28 30 / 0.12);
  --bubble-them: #e6e6ea;
  --bubble-me: #0d7e8a;

  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #4cc2ce;
    --bg: #1c1c1e;
    --surface: #1c1c1e;
    --canvas: #28282b;
    --chrome: #3e3e42;
    --edge: #9e9ea6;
    --stacked: #f0b84a;
    --text: #f2f2f4;
    --text-2: rgb(242 242 244 / 0.74);
    --text-3: rgb(242 242 244 / 0.62);
    --line: rgb(242 242 244 / 0.14);
    --bubble-them: #3a3a3e;
    --bubble-me: #1f8f9b;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
}

.skip-link:focus {
  top: 8px;
}

.secondary {
  color: var(--text-2);
}

.tertiary {
  color: var(--text-3);
}

.small {
  font-size: 0.875rem;
}

/* ── Frame ─────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  padding-bottom: 8px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}

.wordmark img {
  border-radius: 7px;
}

.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}

.site-footer {
  margin-top: 48px;
  padding: 24px 0 max(24px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ── Home ──────────────────────────────────────────────────────────────── */

.hero {
  padding: 24px 0 8px;
}

.hero h1 {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 8px 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.hero .secondary {
  margin: 0 0 12px;
}

.status {
  display: inline-block;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.demo {
  padding: 24px 0 8px;
}

.demo-stage {
  border-radius: 16px;
  background: var(--canvas);
  overflow: hidden;
}

.demo-stage canvas {
  display: block;
  width: 100%;
  height: 400px;
}

.demo-caption {
  min-height: 3em;
  margin: 12px 0 8px;
}

.button,
.button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button {
  background: var(--accent);
  color: #fff;
  border: 0;
}

.button-quiet {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

.facts-section h2,
.prose h2 {
  margin: 32px 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.facts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}

.facts strong {
  display: block;
  color: var(--text);
}

/* ── Waitlist ──────────────────────────────────────────────────────────── */

.waitlist {
  margin-top: 32px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--line);
}

.waitlist h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.waitlist-form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.platforms legend {
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--text-3);
}

/* 16px or larger, so iOS does not zoom the page on focus. */
.field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.platforms {
  margin: 0;
  padding: 0;
  border: 0;
}

.platforms legend {
  margin-bottom: 6px;
  padding: 0;
}

.platform-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle {
  position: relative;
  display: inline-flex;
}

.toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.toggle span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.toggle input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.toggle input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.waitlist-form .button {
  justify-self: start;
}

.waitlist-status {
  margin: 0;
  color: var(--stacked);
}

.form-note {
  margin: 0;
}

/* ── Prose pages ───────────────────────────────────────────────────────── */

.prose {
  padding-top: 16px;
}

.prose h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.15;
}

.prose li {
  margin-bottom: 10px;
}

.prose ul {
  padding-left: 1.25rem;
}

/* ── Wider screens ─────────────────────────────────────────────────────── */

@media (min-width: 40rem) {
  .hero {
    padding-top: 48px;
  }

  .hero h1 {
    font-size: 3.25rem;
  }

  .demo-stage canvas {
    height: 520px;
  }
}

@media (min-width: 64rem) {
  .demo-stage canvas {
    height: 600px;
  }
}
