:root {
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Layout Utilities */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); position: relative; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: 240px 1fr; }
@media (max-width: 768px) { .grid-sidebar { grid-template-columns: 1fr; } }

/* Surface Themes */
.dark-surface { background: var(--color-dark); color: var(--color-paper); }
.paper-surface { background: var(--color-paper); color: var(--color-text); }
.paper-card-in-dark { background: var(--color-paper); color: var(--color-text); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: var(--gap); }

/* Typography */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); letter-spacing: -0.02em; margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: calc(var(--gap) / 2); display: inline-block; }
.dark-surface .eyebrow { color: var(--color-accent); }
.paper-surface .eyebrow { color: var(--color-brand); }
.hl { font-weight: 700; }
.paper-surface .hl { color: var(--color-brand); }
.dark-surface .hl { color: var(--color-accent); }

/* Components */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; height: 52px; padding: 0 24px; font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); transition: transform 0.2s ease, opacity 0.2s ease; cursor: pointer; border: none; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 2px solid currentColor; color: inherit; }
.btn:hover { transform: translateY(-2px); opacity: 0.9; }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.icon-svg { width: 20px; height: 20px; stroke-width: 1.5; fill: none; stroke: currentColor; transform-box: fill-box; transform-origin: center; }

/* Cards & Panels */
.card { border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: var(--gap); background: var(--color-paper); }
.dark-surface .card { background: var(--color-dark); border-color: var(--color-paper); box-shadow: 4px 4px 0 var(--color-paper); }
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.feature-row.reverse { direction: rtl; }
.feature-row.reverse > * { direction: ltr; }
@media (max-width: 768px) { .feature-row { grid-template-columns: 1fr; } .feature-row.reverse { direction: ltr; } }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: 12px 16px; border-bottom: 1px solid rgba(128,128,128,0.3); text-align: left; vertical-align: top; }
th { font-weight: 600; white-space: nowrap; }
td { max-width: 100%; overflow-wrap: anywhere; }

/* Details/Summary (FAQ) */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: var(--gap); background: var(--color-paper); }
.dark-surface details { background: var(--color-dark); border-color: var(--color-paper); }
summary { padding: var(--gap); cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; line-height: 1; }
details[open] summary::after { content: "-"; }
details[open] summary { border-bottom: 1px solid rgba(128,128,128,0.3); }
.faq-answer { padding: var(--gap); line-height: 1.7; }

/* Header/Footer */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(0,0,0,0.1); padding: 16px 0; }
.dark-surface header { background: var(--color-dark); border-bottom-color: rgba(255,255,255,0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.2rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: var(--gap); }
nav a { font-weight: 500; padding: 8px 12px; border-radius: var(--radius-btn); transition: background 0.2s; }
nav a:hover { background: rgba(0,0,0,0.05); }
.dark-surface nav a:hover { background: rgba(255,255,255,0.1); }
nav a[aria-current="page"] { font-weight: 700; background: var(--color-accent); color: var(--color-dark); }
footer { padding: 48px 0; border-top: 1px solid rgba(0,0,0,0.1); margin-top: var(--section-y); }
.dark-surface footer { border-top-color: rgba(255,255,255,0.1); }

/* SVG Visuals & Animations */
.svg-visual { width: 100%; height: auto; max-width: 100%; }
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine 3s ease-out forwards; }
.node-light { animation: nodeLight 4s ease-in-out infinite; }
.float-anim { animation: float 6s ease-in-out infinite; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes nodeLight { 0%, 100% { fill: var(--color-text); opacity: 0.3; } 50% { fill: var(--color-accent); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.d-1 { animation-delay: 0s; } .d-2 { animation-delay: 0.4s; } .d-3 { animation-delay: 0.8s; } .d-4 { animation-delay: 1.2s; } .d-5 { animation-delay: 1.6s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
