:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #edf3f8;
  --text: #17202a;
  --muted: #5f6f82;
  --line: #d8e0ea;
  --brand: #0f7b8f;
  --brand-2: #2f8f5b;
  --accent: #d94627;
  --code-bg: #111827;
  --code-text: #e6edf3;
  --shadow: 0 18px 45px rgba(20, 35, 52, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.modern-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
}

.modern-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.modern-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 248, 251, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.modern-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 70px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.modern-brand {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.modern-brand span {
  color: var(--brand);
}

.modern-links {
  display: none !important;
}

.modern-links a,
.modern-button {
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
  text-decoration: none;
}

.modern-links a:hover,
.modern-button:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.modern-hero {
  padding: 56px 0 34px;
  display: grid;
  gap: 24px;
}

.modern-kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modern-hero h1 {
  font-size: clamp(2.3rem, 7vw, 5.2rem);
  line-height: 0.98;
  margin: 0;
  max-width: 920px;
}

.modern-lede {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 820px;
  margin: 0;
}

.modern-actions,
.modern-card-grid,
.modern-pill-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.modern-button {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.modern-button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.modern-section {
  padding: 34px 0;
}

.modern-section h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 10px;
}

.modern-section > p,
.modern-section .section-note {
  color: var(--muted);
  max-width: 780px;
  margin: 0 0 22px;
}

.modern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.modern-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.modern-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.modern-card p {
  color: var(--muted);
  margin: 0 0 14px;
}

.modern-card a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.modern-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 24px;
  align-items: start;
}

.modern-article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 36px);
}

.modern-article h2,
.modern-article h3 {
  scroll-margin-top: 90px;
}

.modern-article h2 {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 26px;
}

.modern-article h2:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.modern-article a {
  color: var(--brand);
}

.modern-toc {
  position: sticky;
  top: 78px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.modern-toc strong {
  display: block;
  margin-bottom: 10px;
}

.modern-toc a {
  color: var(--muted);
  display: block;
  font-size: 14px;
  padding: 5px 0;
  text-decoration: none;
}

.modern-toc a:hover {
  color: var(--text);
}

.modern-pill {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.modern-callout {
  background: #e8f5f3;
  border: 1px solid #b9dcd6;
  border-radius: 8px;
  margin: 20px 0;
  padding: 16px;
}

pre {
  background: var(--code-bg);
  border-radius: 8px;
  color: var(--code-text);
  overflow: auto;
  padding: 16px;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

th {
  background: var(--surface-2);
}

.modern-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 40px;
  padding: 24px 0;
}

@media (max-width: 820px) {
  .modern-nav-inner,
  .modern-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modern-content {
    grid-template-columns: 1fr;
  }

  .modern-toc {
    position: static;
  }
}
