:root {
  --primary: #4338CA;
  --primary-rgb: 67, 56, 202;
  --secondary: #312E81;
  --secondary-rgb: 49, 46, 129;
  --accent: #F97316;
  --accent-rgb: 249, 115, 22;
  --bg: #ffffff;
  --surface: #fafafd;
  --text: #1a1d2e;
  --text-muted: #565b6f;
  --border: rgba(37, 32, 100, .08);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(20, 24, 40, .06), 0 1px 2px rgba(20, 24, 40, .04);
  --shadow-md: 0 8px 20px rgba(20, 24, 40, .08);
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", "Menlo", monospace;
  --font-display: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Lato", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--secondary); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.container-fluid { max-width: 1400px; margin: 0 auto; padding: 0 32px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand-logo { height: 44px; width: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; align-items: center; }
.main-nav a {
  color: var(--text);
  font-size: 15px;
  padding: 8px 4px;
  position: relative;
  font-weight: 500;
  font-family: var(--font-display);
}
.main-nav a[aria-current="page"] {
  color: var(--primary);
}
.main-nav a[aria-current="page"]::after,
.main-nav a:hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}
.nav-toggle-checkbox, .nav-toggle-label { display: none; }

/* hero */
.hero {
  margin: 32px 0 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* typography */
h1 { font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; margin: 24px 0 20px; color: var(--text); }
h2 { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.2; margin: 56px 0 16px; color: var(--secondary); }
h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.3; margin: 32px 0 10px; color: var(--text); }
p { margin: 0 0 18px; }
.lede { font-size: 20px; color: var(--text-muted); font-weight: 400; line-height: 1.55; margin-bottom: 32px; }
.section-intro { color: var(--text-muted); margin-bottom: 24px; }

/* chip row */
.chip-row { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--primary);
  background: rgba(var(--primary-rgb), .08);
  padding: 5px 12px;
  border-radius: 999px;
}

/* byline */
.byline {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.byline-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.byline-meta { display: flex; flex-direction: column; gap: 2px; }
.byline-name { font-size: 15px; }
.byline-date { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }

/* breadcrumbs */
.breadcrumbs { margin: 16px 0 0; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }
.breadcrumbs li + li::before { content: "/ "; margin-right: 6px; color: var(--border); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* toc */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 40px 0 48px;
}
.toc-heading { font-size: 18px; margin: 0 0 12px; color: var(--secondary); }
.toc-list {
  list-style: none; counter-reset: toc-counter;
  margin: 0; padding: 0;
  column-count: 2; column-gap: 32px; column-rule: 1px solid var(--border);
}
.toc-list li {
  counter-increment: toc-counter;
  break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
  padding: 8px 0 8px 40px;
  position: relative;
  font-size: 15px;
}
.toc-list li::before {
  content: counter(toc-counter, decimal-leading-zero);
  position: absolute; left: 0; top: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
}
.toc-list a { color: var(--text); }
.toc-list a:hover { color: var(--primary); }

/* article */
.article h2:first-of-type { margin-top: 40px; }
.article.legal h2 { font-size: 24px; margin: 48px 0 12px; }
.article.legal h3 { font-size: 18px; margin: 24px 0 8px; }

/* faq */
.faq-section { margin: 64px 0 40px; }
.faq-section h2 { margin-bottom: 20px; }
.faq-section details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--surface);
  interpolate-size: allow-keywords;
  transition: box-shadow .2s, border-color .2s;
}
.faq-section details[open] { box-shadow: var(--shadow-sm); border-color: rgba(var(--primary-rgb), .3); }
.faq-section summary {
  padding: 18px 56px 18px 22px;
  position: relative;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--secondary);
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::before,
.faq-section summary::after {
  content: ""; position: absolute; right: 24px; top: 50%;
  width: 14px; height: 2px; background: var(--primary);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.faq-section summary::before { transform: translateY(-50%) rotate(0deg); }
.faq-section summary::after { transform: translateY(-50%) rotate(90deg); }
.faq-section details[open] summary::after { transform: translateY(-50%) rotate(0deg); }
.faq-section details::details-content {
  height: 0; opacity: 0; overflow: clip;
  transition: height .35s cubic-bezier(.4,0,.2,1),
              opacity .3s ease-out,
              content-visibility .35s allow-discrete;
}
.faq-section details[open]::details-content { height: auto; opacity: 1; }
.faq-section details > *:not(summary) { padding: 0 22px 20px; animation: faqSlideDown .32s cubic-bezier(.4,0,.2,1); }
@keyframes faqSlideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* author box */
.author-box {
  display: grid; grid-template-columns: 120px 1fr; gap: 24px;
  padding: 28px;
  margin: 48px 0 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
}
.author-portrait { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.author-name { font-size: 20px; margin: 0 0 4px; color: var(--secondary); font-weight: 700; font-family: var(--font-display); }
.author-role { font-size: 14px; color: var(--text-muted); margin: 0 0 12px; font-family: var(--font-mono); }
.author-bio { font-size: 15px; margin: 0; line-height: 1.6; }

/* footer */
.site-footer { background: var(--secondary); color: rgba(255,255,255,.82); padding: 60px 0 28px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-col h3 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 16px; font-family: var(--font-display); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 8px 0; font-size: 14px; }
.footer-col a { color: rgba(255,255,255,.72); }
.footer-col a:hover { color: #fff; }
.footer-brand .brand-logo-light { height: 44px; margin-bottom: 12px; }
.footer-tagline { font-size: 14px; margin: 0 0 12px; opacity: .8; }
.footer-entity { font-size: 13px; opacity: .7; line-height: 1.6; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.footer-age { font-size: 13px; opacity: .8; max-width: 640px; line-height: 1.6; }
.age-badge { display: inline-block; padding: 3px 10px; background: var(--accent); color: #1a1d2e; font-weight: 800; border-radius: 6px; font-family: var(--font-mono); font-size: 12px; margin-right: 6px; vertical-align: middle; }
.copyright { font-size: 12px; opacity: .6; margin: 0; }

/* mobile */
@media (max-width: 991px) {
  .nav-toggle-label {
    display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px;
  }
  .nav-toggle-label span { display: block; width: 24px; height: 2px; background: var(--secondary); border-radius: 2px; transition: transform .2s; }
  .main-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: #fff;
    box-shadow: var(--shadow-md);
    display: none;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle-checkbox:checked ~ .main-nav { display: block; }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 8px; }
  .main-nav a { font-size: 16px; padding: 12px 0; width: 100%; border-bottom: 1px solid var(--border); }
  h1 { font-size: 34px; }
  h2 { font-size: 24px; }
  h3 { font-size: 19px; }
  .container { padding: 0 16px; }
  .container-fluid { padding: 0 20px; }
  .toc-list { column-count: 1; column-rule: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .author-box { grid-template-columns: 1fr; text-align: center; }
  .author-portrait { margin: 0 auto; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
}

/* 404 */
.page-404 { text-align: center; padding: 100px 20px 120px; }
.page-404 .code { font-family: var(--font-mono); font-size: 80px; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.page-404 .cta { display: inline-block; margin-top: 24px; padding: 14px 24px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border-radius: var(--radius); font-family: var(--font-display); font-weight: 600; }
