/*
 * tendgratitude.app — the public pages.
 *
 * These exist because Apple requires a reachable privacy policy and support URL
 * (#104), and because someone deciding whether to trust a gratitude app with
 * their private words will look here first. So: quiet, readable, and obviously
 * the same product as the app.
 *
 * Palette is the app's own "Warm Optimism" — primary green #63A002, deepened to
 * #4E7F02 for AA contrast on paper. Neutrals are biased green rather than pure
 * grey, so they read as chosen. No webfonts: the CSP forbids external requests,
 * and a silent fallback is worse than a well-set system stack.
 */

:root {
  --paper: #fbfaf7;
  --paper-raised: #ffffff;
  --ink: #1c2116;
  --ink-muted: #5f6857;
  --accent: #4e7f02;
  --accent-ink: #3d6402;
  --rule: #e4e2da;
  --focus: #63a002;

  --measure: 62ch;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 2.125rem;
  --step-4: 2.75rem;

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14170f;
    --paper-raised: #1b1f16;
    --ink: #e8eade;
    --ink-muted: #9aa38e;
    --accent: #a3d152;
    --accent-ink: #b8e069;
    --rule: #2b3123;
    --focus: #a3d152;
  }
}

/* The viewer's toggle stamps data-theme on the root and must win either way. */
:root[data-theme="dark"] {
  --paper: #14170f;
  --paper-raised: #1b1f16;
  --ink: #e8eade;
  --ink-muted: #9aa38e;
  --accent: #a3d152;
  --accent-ink: #b8e069;
  --rule: #2b3123;
  --focus: #a3d152;
}

:root[data-theme="light"] {
  --paper: #fbfaf7;
  --paper-raised: #ffffff;
  --ink: #1c2116;
  --ink-muted: #5f6857;
  --accent: #4e7f02;
  --accent-ink: #3d6402;
  --rule: #e4e2da;
  --focus: #63a002;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 0 1.375rem;
}

/* ---- masthead ---------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding-block: 1.5rem 1.25rem;
  margin-bottom: 3rem;
}

.masthead__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.wordmark {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.wordmark::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50% 0 50% 50%;
  background: var(--accent);
  transform: rotate(-15deg);
  flex: none;
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

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

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--accent);
}

.nav a[aria-current="page"] {
  font-weight: 600;
}

/* ---- content ----------------------------------------------------------- */

main {
  padding-bottom: 4rem;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.5rem;
}

h1 {
  font-size: var(--step-3);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 680;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

h2 {
  font-size: var(--step-1);
  line-height: 1.3;
  font-weight: 640;
  color: var(--accent-ink);
  margin: 2.75rem 0 0.6rem;
  text-wrap: balance;
}

h3 {
  font-size: var(--step-0);
  font-weight: 650;
  margin: 1.75rem 0 0.4rem;
}

p,
ul,
ol {
  margin: 0 0 1.05rem;
}

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

li {
  margin-bottom: 0.35rem;
}

li::marker {
  color: var(--accent);
}

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

a:focus-visible,
.nav a:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

strong {
  font-weight: 640;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-muted);
  margin-bottom: 2rem;
  text-wrap: pretty;
}

.stamp {
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2.5rem;
}

/* A quiet block for the things a reader might need to copy: an address, an
   email, a jurisdiction. Not a "card" — just a held-apart passage. */
.plate {
  border-left: 2px solid var(--accent);
  padding: 0.15rem 0 0.15rem 1rem;
  margin: 0 0 1.25rem;
  color: var(--ink);
}

.plate p {
  margin-bottom: 0.2rem;
}

/* The one claim on the site that is a promise rather than a disclosure. */
.pledge {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.25rem 1.375rem;
  margin: 0 0 2rem;
}

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

footer {
  border-top: 1px solid var(--rule);
  padding-block: 1.5rem 3rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

footer .nav {
  margin-bottom: 0.75rem;
}

/* Wide content must scroll inside itself, never the page. */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.scroller {
  overflow-x: auto;
}

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

th {
  font-weight: 640;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

@media (max-width: 30rem) {
  :root {
    --step-3: 1.75rem;
  }

  .masthead {
    margin-bottom: 2.25rem;
  }
}
