:root {
  color-scheme: light dark;
  --bg: #f8f7fc;
  --surface: #ffffff;
  --ink: #20202a;
  --muted: #5f5f6b;
  --primary: #5145cd;
  --border: #e8e7ef;
  --focus: #5145cd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15151c;
    --surface: #1e1e28;
    --ink: #ececf3;
    --muted: #b0b0be;
    --primary: #b3aafa;
    --border: #2e2e3a;
    --focus: #b3aafa;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* rem, not px, so the page follows the reader's own text-size setting. */
  font: 1rem/1.65 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow-wrap: break-word;
}

main {
  /* ~70 characters per line on wide screens; full width with a 16px gutter on phones. */
  max-width: 45rem;
  margin: 0 auto;
  padding: 2rem max(1rem, env(safe-area-inset-right)) 3rem max(1rem, env(safe-area-inset-left));
}

header { margin-bottom: 1.5rem; }

.brand {
  margin: 0;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8125rem;
}

h1 {
  font-size: clamp(1.75rem, 1.35rem + 2vw, 2.5rem);
  line-height: 1.2;
  margin: 0.375rem 0 0.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.3;
  margin: 2rem 0 0.5rem;
}

p { margin: 0 0 1rem; }

.meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

.lead {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 1rem 1.125rem;
}

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
  /* Long email addresses must wrap on 320px screens instead of widening the page. */
  overflow-wrap: anywhere;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

ul,
ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin: 0.375rem 0; }
li::marker { color: var(--muted); }

/* Link-only lists get comfortable tap targets (at least 44px tall). */
.links { list-style: none; padding: 0; }
.links li { margin: 0; }
.links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.icon {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.125rem;
  margin-bottom: 0.75rem;
}

footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}
footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* Slightly larger reading size on desktops (column width stays ~70 characters). */
@media (min-width: 64rem) {
  body { font-size: 1.0625rem; }
}

@media print {
  :root { --bg: #fff; --ink: #000; --muted: #444; --primary: #000; }
  .lead { border-color: #ccc; }
  footer { display: none; }
}
