:root {
  --bg: #f4efe6;
  --bg-elev: #fffaf2;
  --ink: #1c1712;
  --muted: #6b6156;
  --line: rgba(28, 23, 18, 0.12);
  --accent: #9c3118;
  --accent-soft: #f3d4c4;
  --code: #2a241e;
  --shadow: 0 24px 60px rgba(28, 23, 18, 0.08);
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110e;
    --bg-elev: #1d1914;
    --ink: #f4ece2;
    --muted: #b4a89a;
    --line: rgba(244, 236, 226, 0.12);
    --accent: #e58a6a;
    --accent-soft: #3a241c;
    --code: #0f0d0b;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(156, 49, 24, 0.08), transparent 55%),
    var(--bg);
  font-family: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Fraunces", serif;
  font-weight: 700;
}
.links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.links a { color: var(--muted); text-decoration: none; }
.links a[aria-current="page"], .links a:hover { color: var(--ink); }

.hero { padding: 72px 0 36px; }
.kicker {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
h1, h2, h3 {
  font-family: "Fraunces", "Songti SC", serif;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
h1 { font-size: clamp(40px, 6vw, 68px); margin: 12px 0 16px; max-width: 16ch; }
h2 { font-size: 30px; margin: 48px 0 12px; }
h3 { font-size: 20px; margin: 28px 0 8px; }
.lede { font-size: 19px; color: var(--muted); max-width: 62ch; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0 56px;
}
.card, .callout, pre, .legal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 22px; }
.card h3 { margin-top: 0; }
.card p { color: var(--muted); margin: 0; }

.callout { padding: 16px 18px; margin: 20px 0; }
.callout.warn { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

ol.steps { padding-left: 20px; }
ol.steps li { margin: 10px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }

pre {
  padding: 16px 18px;
  overflow: auto;
  color: #f6efe6;
  background: var(--code);
}
code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.92em; }
p code, li code, td code {
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 6px;
}

article { padding-bottom: 80px; }
article p, article li { max-width: 72ch; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--muted);
  font-size: 14px;
}
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .links { display: none; }
  h1 { max-width: none; }
}
