:root {
  --bg: #f6f1e6;
  --surface: #fffdf7;
  --surface-2: #f0eadf;
  --text: #1f2320;
  --muted: #72736c;
  --border: rgba(31, 35, 32, 0.12);
  --accent: #55765d;
  --accent-soft: rgba(85, 118, 93, 0.12);
  --shadow: 0 18px 48px rgba(31, 35, 32, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171914;
    --surface: #20241d;
    --surface-2: #2b3028;
    --text: #f5f4ee;
    --muted: #b7b8ad;
    --border: rgba(245, 244, 238, 0.12);
    --accent: #9fb99c;
    --accent-soft: rgba(159, 185, 156, 0.16);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(85, 118, 93, 0.10), transparent 32rem), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Segoe UI", sans-serif;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.page-shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.brand-text { font-size: 18px; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent);
  background: var(--accent-soft);
}

.content-card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 56px);
}

h1, h2, h3 {
  line-height: 1.35;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(30px, 6vw, 48px);
  margin: 0 0 18px;
}

h2 {
  font-size: clamp(22px, 3.4vw, 30px);
  margin: 48px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 18px;
  margin: 28px 0 8px;
}

p { margin: 0 0 16px; }

.lead {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 28px;
}

.note {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 18px;
  padding: 16px 18px;
  color: var(--text);
}

ul, ol { padding-left: 1.35em; }
li { margin: 0.35em 0; }

a { color: var(--accent); text-underline-offset: 0.18em; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 28px;
  font-size: 15px;
}

th, td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
}

th { color: var(--muted); font-weight: 700; }

.page-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.page-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  background: var(--surface);
}

.page-link strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.page-link span { color: var(--muted); }

.site-footer {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 24px 0 0;
}

.site-footer p { margin: 4px 0; }

@media (max-width: 640px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .site-nav { justify-content: flex-start; }
  .content-card { border-radius: 24px; }
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.content-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
