/*
 * Duneed — the one stylesheet for apps/web (ADR 049).
 *
 * Colours are the app's own tokens (apps/mobile/src/core/ui/tokens.ts), so the
 * site and the product do not drift into two different greens. Light is the
 * base and dark is a media-query override, exactly as the app resolves its
 * palette from the system scheme.
 */

:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --text: #000000;
  --text-secondary: #3c3c43bf;
  --text-tertiary: #3c3c4399;
  --border: #d1d1d6;
  --accent: #0b7a5a;
  --accent-text: #0b7a5a;
  --accent-surface: #e7f2ef;

  --measure: 42rem;
  --radius: 14px;
  --font:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #ffffff;
    --text-secondary: #ebebf599;
    --text-tertiary: #ebebf566;
    --border: #48484a;
    --accent: #0d8462;
    --accent-text: #2fb88e;
    --accent-surface: #0e3b2e;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  /* iPhone notch and home indicator: the site is read on phones more than
     anywhere else, and a header under the status bar looks broken. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

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

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

.site-header {
  border-bottom: 1px solid var(--border);
}

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

.wordmark {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

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

/* ── Type ───────────────────────────────────────────────────────────────── */

h1 {
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 2.5rem 0 0.75rem;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.5rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.35rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.4rem;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

strong {
  font-weight: 650;
}

.lede {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

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

.meta {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

/* ── Landing ────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  background: var(--accent-surface);
  color: var(--accent-text);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 2.5rem;
}

.badge + h1 {
  margin-top: 1rem;
}

.features {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.features li {
  background: var(--surface);
  margin: 0;
  padding: 1.1rem 1.25rem;
}

.features b {
  display: block;
  font-weight: 650;
}

.features span {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.pledge {
  background: var(--accent-surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 2rem 0;
}

.pledge p:last-child {
  margin-bottom: 0;
}

/* ── Legal documents ────────────────────────────────────────────────────── */

.doc h2 {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.doc th {
  font-weight: 650;
  white-space: nowrap;
}

/* Wide content must scroll inside itself, never take the page with it. */
.scroll-x {
  overflow-x: auto;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

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

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

/* Keyboard users must be able to see where they are. */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
