:root {
  --bg: #f8fafb;
  --surface: #ffffff;
  --band: #eef4f3;
  --text: #17202b;
  --muted: #4a5664;
  --border: #d8e0e4;
  --primary: #1d7c72;
  --primary-hover: #165f58;
  --on-primary: #ffffff;
  --focus: #e8a33d;
  --radius: 10px;
  --wrap: 72rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171f;
    --surface: #19212b;
    --band: #161d26;
    --text: #e8edf1;
    --muted: #a9b4bf;
    --border: #2c3744;
    --primary: #2fa596;
    --primary-hover: #3cbcab;
    --on-primary: #08201d;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-underline-offset: 0.15em; }
a:hover { color: var(--primary-hover); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  z-index: 10;
}
.skip:focus { left: 0.5rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
.narrow > * { max-width: 46rem; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.75rem; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand img { width: 190px; height: auto; }
.nav { display: flex; align-items: center; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--primary); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); font-size: 0.95rem; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }
.footer-row p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--on-primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.65rem 1.2rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--band); color: var(--primary-hover); }
.btn-small { padding: 0.45rem 0.9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Sections */
main > section { padding: 3rem 0; }
.hero { padding: 4.5rem 0 3.5rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 44rem; }
.band { background: var(--band); }

.cards { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.25rem 0.5rem; }
.card p { color: var(--muted); }

.split { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin-top: 1.5rem; }
.panel { padding-bottom: 0.75rem; }
.code-label { margin-bottom: 0.25rem; font-weight: 600; font-size: 0.95rem; }
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  background: var(--band);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  overflow-wrap: anywhere;
}

.steps { padding-left: 1.25rem; }
.steps li { margin-bottom: 0.75rem; }

/* Legal and 404 */
.legal, .notfound { padding-top: 2.5rem; padding-bottom: 3rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; }
.legal a { overflow-wrap: anywhere; }
.updated { margin-top: 2rem; color: var(--muted); font-size: 0.95rem; }

@media (max-width: 40rem) {
  .nav li:not(:last-child) { display: none; }
  .hero { padding: 3rem 0 2.5rem; }
  main > section { padding: 2.25rem 0; }
}
