/* Sundial website stylesheet.
 *
 * Tokens are a 1:1 projection of docs/design/platform/design-system/design.md
 * §4.1–§4.4 (raw palette -> semantic tokens). Components reference semantic
 * tokens only — no raw hex appears outside the :root blocks below.
 *
 * Type is the system sans only (the design system's type rule; SF on iOS,
 * the platform system font elsewhere). No webfont is loaded.
 * Type steps: display 34/800/1.20, title 22/800/1.25, heading 17/700/1.35,
 * body 16/400/1.50, subtext 13/400/1.40, caption 12/700/1.35.
 * Spacing is the 4pt scale (4/8/12/16/24/32); content sides 16px;
 * contentMaxWidth 640px; radii card 18, button 14.
 * No gradients, no glow shadows, no centered hero, no badge pill.
 * Dark values are the design system's dark column, applied only under
 * prefers-color-scheme. Gap: the design system has no web/landing tokens
 * yet — this file maps its mobile tokens directly and notes the gap in
 * website/README.md.
 */

:root {
  --bg: #faf3e3;
  --surface: #fffbf2;
  --surface-raised: #ffffff;
  --surface-muted: #f4edde;
  --ink: #3a2618;
  --ink-muted: #6e5b47;
  --line: #e7dccb;
  --line-strong: #9c8152;
  --brand: #f7b500;
  --brand-strong: #b97e04;
  --brand-text: #7a5e00;
  --brand-bg: #fff8cc;
  --success: #5f7a3d;
  --danger: #dc2626;
  --danger-text: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16100a;
    --surface: #231a10;
    --surface-raised: #2e2214;
    --surface-muted: #2a1e11;
    --ink: #f6ecda;
    --ink-muted: #bca98d;
    --line: #473824;
    --line-strong: #8a6d4a;
    --brand: #f7b500;
    --brand-strong: #e9bc45;
    --brand-text: #f2c94c;
    --brand-bg: #3a2e0e;
    --success: #9dbe7a;
    --danger: #f87171;
    --danger-text: #f87171;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

a {
  color: var(--brand-strong);
}
a:visited {
  color: var(--brand-strong);
}

/* Header: wordmark left, nav right, hairline below. */
header {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
}

header nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

header nav a {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-muted);
  text-decoration: none;
}

header nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Main column. Left-aligned throughout; no centered hero. */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px;
}

h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 16px;
}

main.landing > h1:first-of-type {
  /* Landing page only: the one big statement uses the display step. */
  font-size: 34px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin: 32px 0 8px;
}

h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin: 24px 0 8px;
}

p {
  margin: 0 0 16px;
}

ul {
  margin: 0 0 16px;
  padding-left: 24px;
}
li {
  margin-bottom: 8px;
}
li:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
}

/* Draft banner: brand-tinted background, brand text, card radius. */
.draft-banner {
  background: var(--brand-bg);
  color: var(--brand-text);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.4;
}

/* Provider table (Privacy Policy §3). */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.4;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink-muted);
}

/* Footer: legal links, then the MHMD policy as its own prominent line. */
footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-muted);
}

footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

footer nav a {
  color: var(--ink-muted);
}

.mhmd-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
  margin: 0 0 16px;
}

.mhmd-link a {
  color: var(--brand-strong);
}

.footer-note {
  margin: 0;
}

/* Print: legal pages read as plain documents. */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  header nav,
  footer nav {
    display: none;
  }
  .draft-banner {
    border: 1px solid #000;
    background: none;
    color: #000;
  }
  main,
  header,
  footer {
    max-width: none;
  }
}
