:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-soft: #eef2ff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --card: #131a2e;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #243049;
    --accent: #818cf8;
    --accent-2: #22d3ee;
    --accent-soft: #1e2547;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

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

/* Header */
.hero {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 20px 16px 72px;
}

.nav {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  letter-spacing: 0.3px;
}

.nav-links { display: flex; gap: 6px; }

.nav-links a {
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0.85;
}

.nav-links a:hover { text-decoration: none; opacity: 1; background: rgba(255, 255, 255, 0.15); }
.nav-links a.active { opacity: 1; background: rgba(255, 255, 255, 0.22); }

.hero-inner {
  max-width: 960px;
  margin: 48px auto 0;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.2;
}

.hero p { margin: 0; opacity: 0.9; }

/* Layout */
.layout {
  max-width: 960px;
  margin: -48px auto 0;
  padding: 0 16px 48px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--accent); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  min-width: 0;
}

.card h2 {
  margin: 36px 0 12px;
  font-size: 22px;
  padding-top: 8px;
  scroll-margin-top: 20px;
}

.card h2:first-child { margin-top: 0; }

.card h3 { margin: 20px 0 6px; font-size: 17px; }

.card ul { padding-left: 22px; }
.card li { margin: 4px 0; }

.summary {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 8px;
}

.summary ul { margin: 0; padding-left: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  background: var(--bg);
}

.contact {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}

.btn:hover { text-decoration: none; opacity: 0.9; }

/* Footer */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 0 16px 40px;
}

footer a { margin: 0 6px; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .card { padding: 22px 18px; }
}

/* Typography refinements */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, .brand {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  letter-spacing: -0.02em;
}

.hero h1 { font-weight: 800; letter-spacing: -0.03em; }
.hero p { font-size: 15px; letter-spacing: 0.01em; }

.card { padding: 40px 48px; }

.card p,
.card li {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.card p { margin: 0 0 14px; max-width: 70ch; }
.card ul { margin: 0 0 16px; max-width: 70ch; }
.card li { margin: 6px 0; padding-left: 4px; }
.card li::marker { color: var(--accent); }

.card h2 {
  font-size: 21px;
  font-weight: 700;
  margin: 40px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.card h2:first-of-type { border-top: none; padding-top: 8px; }

.card h3 {
  font-size: 16.5px;
  font-weight: 600;
  margin: 22px 0 6px;
}

.card strong { font-weight: 600; }

.summary li { text-align: left; }

.toc { line-height: 1.5; }
.toc li { margin: 7px 0; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .card { padding: 24px 20px; }
  .card p, .card li { text-align: left; hyphens: manual; }
}

/* Brand large, page title small */
.brand {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.hero-inner { margin-top: 28px; }
