:root {
  --bg: #ffffff;
  --bg-soft: #f4f6f4;
  --fg: #1a1d1b;
  --fg-muted: #5c6660;
  --line: #dfe4e0;
  --accent: #1b5e3f;
  --accent-fg: #ffffff;
  --radius: 14px;
  --wrap: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12150f;
    --bg-soft: #191d17;
    --fg: #eef1ea;
    --fg-muted: #a3ac9f;
    --line: #2b312a;
    --accent: #7dc79b;
    --accent-fg: #0d1210;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); }
a:hover { text-decoration: none; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.25rem; }

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 6px;
  background: var(--accent);
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

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

.site-header nav a:hover,
.site-header nav a.current { color: var(--fg); }

/* Hero */

.hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: clamp(3rem, 9vw, 6rem) 0;
}

.hero h1 { max-width: 20ch; }

.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 58ch;
  margin: 0 0 1.75rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.button:hover { filter: brightness(1.08); }

/* Sections */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section + .section { padding-top: 0; }

/* App cards */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  align-items: start;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 1.5rem;
}

.app-card-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.app-icon {
  border-radius: 16px;
  flex: 0 0 auto;
  background: var(--bg);
}

.app-summary {
  color: var(--fg-muted);
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

.app-card p { margin: 0; }

.badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.features {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.features li { margin-bottom: 0.3rem; }

/* Pins the store button to the bottom so cards of differing length still
   line their buttons up across the row. */
.app-card .button { align-self: flex-start; margin-top: auto; }

/* Prose pages (privacy, terms, 404) */

.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.5rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

.updated {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-top: -0.5rem;
}

/* Docs / FAQ */

.docs-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.75rem 0 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.docs-jump a {
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--fg-muted);
}

.docs-jump a:hover { color: var(--accent); }

.docs-group { margin-bottom: 2.5rem; scroll-margin-top: 5rem; }
.docs-group h2 { border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }

.docs-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  margin-top: 0.7rem;
  background: var(--bg-soft);
  scroll-margin-top: 5rem;
}

.docs-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.9rem 1.1rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.docs-item summary::-webkit-details-marker { display: none; }

.docs-item summary::before {
  content: "+";
  color: var(--accent);
  font-weight: 700;
  width: 1em;
  flex: 0 0 auto;
}

.docs-item[open] summary::before { content: "\2212"; }

.docs-answer {
  padding: 0 1.1rem 1rem 2.6rem;
  color: var(--fg-muted);
}

.docs-answer p { margin: 0 0 0.7rem; }
.docs-answer p:last-child { margin-bottom: 0; }
.docs-answer ol,
.docs-answer ul { margin: 0 0 0.7rem; padding-left: 1.2rem; }
.docs-answer li { margin-bottom: 0.35rem; }

.docs-permalink {
  display: block;
  padding: 0 1.1rem 0.85rem 2.6rem;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.docs-more { margin-top: 2.5rem; }

/* Contact form */

.form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 2rem 0 1rem;
}

.form label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.9rem;
}

.form .optional { font-weight: 400; color: var(--fg-muted); }

.form input[type="text"],
.form input[type="email"],
.form textarea {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  width: 100%;
}

.form textarea { resize: vertical; min-height: 9rem; }

.form input:focus-visible,
.form textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.form .button {
  align-self: flex-start;
  margin-top: 1.5rem;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.hint { color: var(--fg-muted); font-size: 0.88rem; margin: 0.15rem 0 0; }

/* Honeypot — off-screen rather than display:none, which some bots detect. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 1.5rem 0;
}

.notice ul { margin: 0; }
.notice-ok { border-left-color: var(--accent); background: var(--bg-soft); }
.notice-error { border-left-color: #c0392b; background: var(--bg-soft); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 2rem 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner p { margin: 0; }
.footer-inner a { color: var(--fg-muted); margin-right: 1rem; }
.footer-inner a:hover { color: var(--fg); }
