:root {
  --ink: #17322E;
  --muted: #52655D;
  --paper: #EDF1EC;
  --paper-raised: #F8FAF6;
  --teal: #1F6F63;
  --teal-strong: #124941;
  --amber: #B8722A;
  --brick: #A84B34;
  --line: #C6D1C6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E9EFE7;
    --muted: #96A69C;
    --paper: #0F1B17;
    --paper-raised: #16241F;
    --teal: #55A897;
    --teal-strong: #83C8B9;
    --amber: #DDA05E;
    --brick: #D97F65;
    --line: #26362F;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Avenir Next", Avenir, "Century Gothic", Futura, "Segoe UI", sans-serif;
  text-wrap: balance;
  margin: 0;
}

.mono {
  font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

a { color: var(--teal-strong); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}
.brand .mark { width: 22px; height: 22px; color: var(--teal); }
.brand span {
  font-family: "Avenir Next", Avenir, sans-serif;
  font-weight: 700;
  font-size: 17px;
}
.site-header nav { display: flex; gap: 20px; }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 14px;
}
.site-header nav a:hover { color: var(--teal-strong); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
}
.site-footer .wrap {
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer nav { display: flex; gap: 16px; }
.site-footer nav a { color: var(--muted); text-decoration: underline; }

/* ---- Legal pages ---- */
.legal .wrap { padding-top: 40px; padding-bottom: 40px; }
.legal h1 { font-size: 30px; margin-bottom: 4px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.legal h2 {
  font-size: 20px;
  margin-top: 32px;
  margin-bottom: 8px;
}
.legal p { margin: 0 0 14px; }

/* ---- Forms / buttons (account.html) ---- */
.field {
  display: block;
  width: 100%;
  max-width: 360px;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-raised);
  color: var(--ink);
}
.field:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }

.btn {
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: var(--paper-raised);
  cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-danger {
  background: transparent;
  color: var(--brick);
  border-color: var(--brick);
}

.error-text { color: var(--brick); font-size: 14px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 14px; }
