:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.82);
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #0071e3;
  --code: rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(0, 113, 227, 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover { text-decoration-thickness: 0.12em; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.header-inner {
  width: min(100% - 2rem, 920px);
  min-height: 3.5rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

nav { display: flex; gap: 1.1rem; }
nav a { font-size: 0.92rem; text-decoration: none; }

main {
  width: min(100% - 2rem, 920px);
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
}

.hero {
  padding: 2.5rem 0 4rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.hero > p:last-child { color: var(--secondary); }

article {
  padding: clamp(1.4rem, 4vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
}

h2 {
  margin: 0 0 2rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  margin: 2.4rem 0 0.7rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

p { margin: 0.7rem 0; }
ul { margin: 0.7rem 0; padding-left: 1.35rem; }
li + li { margin-top: 0.45rem; }

code {
  padding: 0.12rem 0.35rem;
  border-radius: 0.4rem;
  background: var(--code);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

hr {
  width: 4rem;
  margin: 4rem auto;
  border: 0;
  border-top: 2px solid var(--line);
}

.external-links { list-style: none; padding-left: 0; }

footer {
  padding: 0 1rem 3rem;
  color: var(--secondary);
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding-top: 2.5rem; }
  .hero { padding: 2rem 0 3rem; }
  article { border-radius: 22px; }
  h1 span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --surface: rgba(28, 28, 30, 0.82);
    --text: #f5f5f7;
    --secondary: #a1a1a6;
    --line: rgba(255, 255, 255, 0.14);
    --accent: #2997ff;
    --code: rgba(255, 255, 255, 0.1);
  }

  article { box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34); }
}

@media print {
  .site-header { position: static; backdrop-filter: none; }
  body { background: #fff; color: #000; }
  main { width: 100%; padding: 1rem; }
  article { border: 0; box-shadow: none; padding: 0; break-after: page; }
  a { color: #000; }
}
