:root {
  --bg: #f0eee6;
  --surface: #f2f0ed;
  --ink: #141413;
  --ink-muted: #87867f;
  --ink-subtle: #a1a0a0;
  --border: #e2dfd9;
  --accent: #d97757;
  --code-bg: #e7e4df;
  --user-bubble: #fff8f5;
  --user-bubble-text: #92400e;
  --user-bubble-border: #f0e9e3;
  --asst-bubble: #f5f4f2;
  --asst-bubble-border: #eae9e6;

  --serif: ui-serif, "New York", "Charter", Georgia, serif;
  --mono: "Fira Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max-w: 1100px;
  --max-w-hero: 1280px;
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient radial wash from upper-left, matches AppBackground in the iOS app. */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 1040px;
  height: 1040px;
  background: radial-gradient(circle at center, rgba(217, 119, 87, 0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 13px;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { left: 16px; top: 16px; }

a { color: var(--ink); }
a:hover { color: var(--accent); }

/* ============ Nav ============ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  max-width: var(--max-w-hero);
  margin: 0 auto;
}
.wordmark {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav a {
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
}
.nav a[aria-current="page"] {
  color: var(--accent);
}

/* ============ Hero ============ */
.hero {
  max-width: var(--max-w-hero);
  margin: 0 auto;
  padding: 64px 32px 96px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 20px;
  color: var(--ink-muted);
  margin-bottom: 36px;
  max-width: 540px;
}
.install-block {
  background: var(--code-bg);
  border-radius: 12px;
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  display: inline-block;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}
.install-hint {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
  max-width: 540px;
}
.install-hint code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.price {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-subtle);
}
.hero-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-mockup svg { width: 100%; max-width: 360px; height: auto; }

/* ============ Features ============ */
.features {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 96px 32px;
}
.section-heading {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 64px;
  letter-spacing: -0.01em;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
.feature {
  display: flex;
  flex-direction: column;
}
.feature-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 20px;
  color: var(--accent);
}
.feature h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.005em;
}
.feature p {
  color: var(--ink-muted);
  font-size: 17px;
  line-height: 1.5;
}

/* ============ In action ============ */
.in-action {
  background: var(--surface);
  padding: 96px 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.in-action-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.bridge {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 48px;
  align-items: center;
}
.terminal-card {
  background: #1a1a18;
  color: #f0eee6;
  border-radius: 12px;
  padding: 24px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  box-shadow: 0 24px 48px rgba(20, 20, 19, 0.18);
}
.bridge-arrow {
  display: block;
  color: var(--accent);
  font-size: 32px;
  font-family: var(--serif);
  text-align: center;
}
.in-action-mockup {
  display: flex;
  justify-content: center;
}
.in-action-mockup svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}
.bridge-caption {
  text-align: center;
  margin-top: 48px;
  color: var(--ink-muted);
  font-size: 16px;
}

/* ============ FAQ ============ */
.faq {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 96px 32px;
}
.faq-heading {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.faq details:first-of-type {
  border-top: 1px solid var(--border);
}
.faq summary {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: var(--mono);
  font-size: 24px;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq details[open] summary::after { content: '–'; }
.faq summary code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}
.faq details > p {
  color: var(--ink-muted);
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.55;
  max-width: 720px;
}

/* ============ Footer ============ */
footer {
  border-top: 1px solid var(--border);
  padding: 32px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
}
footer a {
  color: var(--ink-muted);
  text-decoration: none;
}
footer a:hover { color: var(--accent); }

/* ============ Changelog ============ */
.changelog {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}
.changelog > h1 {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 12px;
}
.changelog > .lead {
  color: var(--ink-muted);
  font-size: 18px;
  margin-bottom: 64px;
  max-width: 540px;
}
.release {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.release:last-child {
  border-bottom: 1px solid var(--border);
}
.release-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.release-version {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.release-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
}
.release-tag {
  background: var(--code-bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
}
.release-summary {
  font-size: 18px;
  color: var(--ink-muted);
  margin-bottom: 28px;
  max-width: 640px;
}
.release-section {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 32px 0 12px;
}
.release ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
.release li {
  padding: 10px 0;
  color: var(--ink-muted);
  font-size: 17px;
  line-height: 1.55;
  border-bottom: 1px solid var(--border);
}
.release li:last-child {
  border-bottom: none;
}
.release li strong {
  color: var(--ink);
  font-weight: 600;
  margin-right: 4px;
}
.release li code,
.release p code {
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--mono);
}
.release a {
  color: var(--accent);
  text-decoration: none;
}
.release a:hover {
  text-decoration: underline;
}

/* ============ Focus styles ============ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ============ Responsive ============ */

/* Tablet: stack the hero and bridge, keep features 2-up */
@media (max-width: 1023px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 48px 24px 64px;
  }
  .hero h1 { font-size: 56px; }
  .hero-mockup svg { max-width: 320px; }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
  .feature-grid .feature:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 480px;
    margin: 0 auto;
  }

  .bridge {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .bridge-arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .features, .in-action, .faq { padding: 64px 24px; }
  .section-heading, .faq-heading { font-size: 32px; }
}

/* Mobile: single column everywhere, smaller type */
@media (max-width: 640px) {
  .nav { padding: 16px 24px; }
  .hero { padding: 32px 20px 48px; }
  .hero h1 { font-size: 40px; }
  .hero-sub { font-size: 18px; margin-bottom: 28px; }
  .hero-mockup svg { max-width: 280px; }
  .install-block { font-size: 12px; padding: 12px 16px; }
  .install-hint { font-size: 12px; }
  .install-hint code { display: inline-block; word-break: break-all; }

  .feature-grid { grid-template-columns: 1fr; gap: 32px; }
  .feature-grid .feature:nth-child(3) { grid-column: auto; max-width: none; }

  .features, .in-action, .faq { padding: 56px 20px; }
  .section-heading, .faq-heading { font-size: 28px; margin-bottom: 40px; }

  .terminal-card { font-size: 10px; padding: 16px; }

  .faq summary { font-size: 18px; }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  footer { padding: 24px 20px; }

  .nav-links { gap: 20px; }
  .changelog { padding: 40px 20px 64px; }
  .changelog > h1 { font-size: 40px; }
  .release { padding: 32px 0 16px; }
  .release-summary { font-size: 17px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
