/* Keepsake — marketing site.
   Design tokens mirror the app's DesignSystem (Palette, Typography) so the site and the app
   read as one thing. Values duplicated deliberately: the site is a separate repo with no build
   step, and a shared token pipeline would be more machinery than two surfaces justify. */

:root {
  color-scheme: light dark;

  --canvas: #faf8f5;
  --surface: #ffffff;
  --surface-sunken: #f2efea;
  --text-primary: #1a1715;
  --text-secondary: #6b625b;
  --text-tertiary: #9a918a;
  --accent: #b4552f;
  --accent-quiet: #f6e7e0;
  --rule: #e4ded6;

  --measure: 34rem;
  --radius: 14px;
  --gap: 1.5rem;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #16130f;
    --surface: #211d19;
    --surface-sunken: #1b1714;
    --text-primary: #f3efe9;
    --text-secondary: #b3a89f;
    --text-tertiary: #857c74;
    --accent: #e08256;
    --accent-quiet: #3a241a;
    --rule: #332c26;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font: 1rem/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- chrome ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 1.25rem max(1rem, 5vw);
  max-width: 68rem;
  margin: 0 auto;
}

.wordmark {
  font: 600 1.3rem/1 var(--serif);
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 2rem max(1rem, 5vw) 3rem;
  max-width: 68rem;
  margin-inline: auto;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer nav { margin-bottom: 0.5rem; }

/* ---------- home ---------- */

.hero {
  max-width: 68rem;
  margin: 0 auto;
  padding: 3rem max(1rem, 5vw) 2rem;
}

.hero h1 {
  font: 600 clamp(2rem, 6vw, 3.25rem)/1.1 var(--serif);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 18ch;
}

.hero p {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--text-secondary);
  max-width: var(--measure);
  margin: 0 0 1.5rem;
}

.status {
  display: inline-block;
  background: var(--accent-quiet);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.features {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1rem max(1rem, 5vw) 2rem;
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.feature {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.feature h2 {
  font: 600 1.1rem/1.3 var(--sans);
  margin: 0 0 0.5rem;
}

.feature p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---------- legal pages ---------- */

.legal {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1rem max(1rem, 5vw) 2rem;
}

.legal h1 {
  font: 600 clamp(1.9rem, 5vw, 2.5rem)/1.15 var(--serif);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.legal h2 {
  font: 600 1.35rem/1.3 var(--serif);
  margin: 2.5rem 0 0.75rem;
}

.legal h3 {
  font: 600 1.05rem/1.4 var(--sans);
  margin: 1.75rem 0 0.5rem;
}

.legal p, .legal li { color: var(--text-primary); }
.legal li { margin-bottom: 0.4rem; }
.legal hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.legal blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface-sunken);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.legal blockquote p { margin: 0; }

.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-sunken);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Tables scroll rather than forcing the page to — the one element allowed to overflow. */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }

.legal table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

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

.legal th { font-weight: 600; color: var(--text-secondary); }

/* ---------- 404 ---------- */

.notfound {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 5rem max(1rem, 5vw);
  text-align: center;
}

.notfound h1 { font: 600 2rem/1.2 var(--serif); margin: 0 0 0.75rem; }
.notfound p { color: var(--text-secondary); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
