:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1c1f22;
  --muted: #5a6168;
  --line: #dcd8cf;
  --accent: #1f5a6e;
  --accent-text: #ffffff;
  --note-bg: #fff6dc;
  --note-line: #e2c46b;
  --todo-bg: #ffe1dc;
  --todo-text: #7a1a0e;
  --radius: 10px;
  --measure: 46rem;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Charter", "Georgia", "Times New Roman", serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --text: #e8e6e1;
    --muted: #a3aab1;
    --line: #2f353b;
    --accent: #7cc2d6;
    --accent-text: #0e1214;
    --note-bg: #2a2516;
    --note-line: #7a6730;
    --todo-bg: #3a1d18;
    --todo-text: #ffb4a6;
  }
}

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

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

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

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 16px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus { left: 16px; top: 8px; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

header.site {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.95rem;
}
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

main { padding: 32px 0 48px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.25; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); margin: 0.2em 0 0.4em; }
h2 { font-size: 1.5rem; margin: 2.2em 0 0.5em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 0.3em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }

.lead { font-size: 1.2rem; color: var(--muted); }
.small { font-size: 0.92rem; color: var(--muted); }

.note {
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 1.5em 0;
}
.note > :last-child { margin-bottom: 0; }

code { overflow-wrap: anywhere; }

.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 12px;
  margin: 1em 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.price {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.price .big {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1em 0 1.4em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; background: var(--bg); }

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px 12px 36px;
}
.toc li { margin-bottom: 0.15em; }

blockquote {
  margin: 1em 0;
  padding: 10px 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 20px 0 32px;
  font-size: 0.9rem;
  color: var(--muted);
}
footer.site p { margin: 0 0 0.5em; }
