:root {
  color-scheme: light dark;
  --accent: #ff6242;
  --rose: #ff4d6d;
  --amber: #ffb03a;
  --background: #f7f3ee;
  --card: #ffffff;
  --elevated: #efe6da;
  --text: #221310;
  --muted: #77695e;
  --border: rgba(34, 19, 16, 0.10);
  --shadow: 0 18px 60px rgba(75, 41, 27, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000000;
    --card: #1a1411;
    --elevated: #2a1f18;
    --text: #ffffff;
    --muted: #b5aaa1;
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 20px 70px rgba(255, 98, 66, 0.08);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 84% -10%, rgba(255, 98, 66, 0.12), transparent 30rem),
    var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

a:hover { color: var(--rose); }

.shell {
  width: min(100% - 32px, 860px);
  margin: 0 auto;
  padding: 28px 0 80px;
}

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

.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 9px;
  border: 4px solid var(--accent);
  border-radius: 50%;
  vertical-align: -2px;
}

.topnav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

.topnav a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.topnav a[aria-current="page"] { color: var(--accent); }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.65rem, 9vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.lede {
  max-width: 710px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 3vw, 1.34rem);
  line-height: 1.5;
}

.notice {
  margin: 34px 0 18px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 98, 66, 0.38);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 98, 66, 0.12), rgba(255, 176, 58, 0.05));
  box-shadow: var(--shadow);
}

.notice strong { color: var(--accent); }

.toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 42px;
}

.toc a {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.toc a:hover { border-color: var(--accent); }

main { display: grid; gap: 14px; }

section {
  scroll-margin-top: 18px;
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h3 { margin: 24px 0 8px; font-size: 1.05rem; }

p { margin: 0; }

p + p { margin-top: 14px; }

ul { margin: 14px 0 0; padding-left: 1.3rem; }

li + li { margin-top: 9px; }

li::marker { color: var(--accent); }

.links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.links a {
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--elevated);
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

footer {
  margin-top: 26px;
  padding: 22px 4px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

footer a { font-weight: 750; }

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 860px); padding-top: 20px; }
  .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 34px; }
  .toc, .links { grid-template-columns: 1fr; }
  section { border-radius: 20px; }
}

@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  .shell { width: 100%; padding: 0; }
  .topnav, .toc { display: none; }
  section { break-inside: avoid; border-color: #ddd; }
}
