/*
 * Family Knowledge Vault — marketing one-pager.
 *
 * Palette is intentionally identical to src/theme.ts so the site and the app
 * read as one product. Per docs/10-ui-ux-design.md the feel should be warm,
 * calm, and timeless rather than technical.
 *
 * No build step, no external requests: system fonts only, so the page loads
 * instantly and works offline in a preview.
 */

:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --text: #2e2a25;
  --text-muted: #7a7069;
  --primary: #b5743f;
  --primary-dark: #90592e;
  --border: #e8dfd3;
  --shadow: 0 1px 2px rgba(46, 42, 37, 0.04), 0 8px 24px rgba(46, 42, 37, 0.06);

  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4.5rem;

  --radius-md: 12px;
  --radius-lg: 20px;

  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1917;
    --surface: #262220;
    --text: #f0eae2;
    --text-muted: #a89e93;
    --primary: #d9975c;
    --primary-dark: #e8b184;
    --border: #3a342f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.24);
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-dark);
}

/* Visible focus ring everywhere — accessibility is built in, not added later. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

.section {
  padding-block: var(--space-2xl);
}

.section + .section {
  border-top: 1px solid var(--border);
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(3.5rem, 12vw, 7rem);
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  max-width: 18ch;
}

.hero .lede {
  margin-top: var(--space-lg);
  max-width: var(--measure);
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--primary);
}

/* ---------- Problem ---------- */

/* Constrained to a comfortable measure — full-container prose runs to ~150
   characters per line on a wide display, which is well past readable. */
.prose {
  max-width: var(--measure);
  margin-top: var(--space-lg);
  color: var(--text-muted);
}

.scattered {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: 0;
  list-style: none;
}

.scattered li {
  padding: 0.375rem 0.875rem;
  border: 1px dashed var(--border);
  border-radius: 999px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ---------- Modules ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--text-muted);
  font-size: 0.9688rem;
}

.card .icon {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
  margin-bottom: var(--space-md);
}

/* ---------- Principles ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
  padding: 0;
  list-style: none;
}

.principles h3 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.principles p {
  color: var(--text-muted);
  font-size: 0.9688rem;
}

/* ---------- Build in public ---------- */

.build {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-lg), 5vw, var(--space-2xl));
  box-shadow: var(--shadow);
}

.build h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  max-width: 20ch;
}

.build p {
  margin-top: var(--space-md);
  max-width: var(--measure);
  color: var(--text-muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-lg);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Paired with text, never colour alone (NFR-018). */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f7a52;
  flex-shrink: 0;
}

/* ---------- Footer ---------- */

.footer {
  padding-block: var(--space-xl);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9375rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
