/* Hand-written, no build step. System fonts only: the site loads nothing from other hosts. */

:root {
  color-scheme: light dark;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #eef1f5;
  --text: #1b1f24;
  --text-muted: #4d5560;
  --border: #d9dee5;
  --accent: #2f6fa8;          /* the app's light-theme accent */
  --accent-strong: #245a8a;
  --on-accent: #ffffff;
  --accent-soft: #e3edf7;
  --focus: #1a5fb4;
  --chart-a: #2f6fa8;
  --chart-b: #7a9cc0;
  --chart-c: #b9c9da;
  --radius: 10px;
  --wrap: 68rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --surface: #1e2126;
    --surface-alt: #252931;
    --text: #e8eaed;
    --text-muted: #a9b0ba;
    --border: #353a43;
    --accent: #5b9dd9;        /* the app's dark-theme accent */
    --accent-strong: #7db2e3;
    --on-accent: #0d1620;
    --accent-soft: #1f2e3e;
    --focus: #8cc0f0;
    --chart-a: #5b9dd9;
    --chart-b: #3f6f9c;
    --chart-c: #2b4560;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent-strong); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

code, kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.25em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 46rem; }

.skip {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--surface); color: var(--text); padding: 0.5rem 0.9rem;
  border-radius: var(--radius); z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 650; font-size: 1.1rem; color: var(--text); text-decoration: none;
}
.brand img { width: 28px; height: 28px; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

/* Sections */
section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--border); }
.section-intro { color: var(--text-muted); max-width: 44rem; margin-bottom: 2rem; }

/* Hero */
.hero { padding: 4rem 0 3.5rem; }
.hero .wrap {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
.lead { font-size: 1.2rem; color: var(--text-muted); max-width: 36rem; }
.download { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 1.75rem 0 1rem; }
.button {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  font-weight: 600; text-decoration: none; padding: 0.8rem 1.4rem; border-radius: var(--radius);
}
.button:hover { background: var(--accent-strong); text-decoration: none; }
.download-meta { color: var(--text-muted); font-size: 0.95rem; }
.small { font-size: 0.95rem; color: var(--text-muted); }

.illustration {
  margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.25rem 0.75rem;
}
.illustration svg { display: block; width: 100%; }
.illustration figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; }
.chart-axis { stroke: var(--border); stroke-width: 1.5; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-a { fill: var(--chart-a); }
.chart-b { fill: var(--chart-b); }
.chart-c { fill: var(--chart-c); }
.chart-mark { stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-label { fill: var(--text-muted); font: 13px var(--font); }

/* Cards */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 52rem) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.4rem 0.6rem;
}
.card p { color: var(--text-muted); }
.example {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 0.6rem 0.9rem; border-radius: 0 6px 6px 0; color: var(--text);
}

.alt { background: var(--surface-alt); }
.alt .card { background: var(--surface); }

/* Budget table */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border-radius: var(--radius); }
caption { text-align: left; font-weight: 600; padding-bottom: 0.6rem; }
th, td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th[scope="row"] { font-weight: 600; }
thead th { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

.two-col { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* FAQ */
details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
summary { cursor: pointer; font-weight: 600; padding: 1rem 1.2rem; }
details[open] summary { border-bottom: 1px solid var(--border); }
details > div { padding: 1rem 1.2rem 0.2rem; }

.note {
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.3rem 0.2rem;
}

/* Privacy page */
.doc { padding: 3rem 0 4rem; }
.doc h2 { margin-top: 2.5rem; }
.doc h3 { margin-top: 1.75rem; }
.doc .note { margin: 1.5rem 0 2rem; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.3rem 0.4rem; }
.toc h2 { font-size: 1rem; margin: 0 0 0.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2rem 0; font-size: 0.95rem; color: var(--text-muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }
.site-footer p { margin: 0; }

@media (max-width: 52rem) {
  .hero { padding-top: 2.5rem; }
  .hero .wrap, .two-col { grid-template-columns: minmax(0, 1fr); }
  section { padding: 2.5rem 0; }
}

@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .wrap { padding: 0 1rem; }
  th, td { padding: 0.55rem 0.6rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
