:root {
  --dark: #19102D;
  --paper: #F4F3F7;
  --body: #191523;
  --brand: #5214EB;
  --accent: #D66EED;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--body);
  --card-shadow: 4px 4px 0 var(--body);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --lh-body: 1.55;
  --lh-title: 1.25;
  --content-max: 960px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif; background: var(--paper); color: var(--body); line-height: var(--lh-body); font-size: 16px; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }
.surface-dark { background: var(--dark); color: var(--paper); }
.surface-dark .hl { color: var(--accent); }
.surface-paper { background: var(--paper); color: var(--body); }
.surface-paper .hl { color: var(--brand); }

h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: var(--lh-title); letter-spacing: 0; text-wrap: balance; margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: var(--lh-title); margin-bottom: var(--gap); }
h3 { font-size: 1.125rem; font-weight: 600; line-height: var(--lh-title); margin-bottom: 0.5rem; }
p { margin-bottom: var(--gap); max-width: 38em; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.5rem; display: inline-block; }
.surface-paper .eyebrow { color: var(--brand); }
.surface-dark .eyebrow { color: var(--accent); }

header { position: sticky; top: 0; z-index: 100; background: rgba(244,243,247,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(25,21,35,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; }
.logo img { width: 32px; height: 32px; }
nav { display: flex; gap: var(--gap); }
nav a { font-weight: 500; padding: 8px 12px; border-radius: var(--radius-btn); transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--brand); }
.surface-dark nav a { color: var(--paper); }
.surface-dark nav a:hover, .surface-dark nav a[aria-current="page"] { color: var(--accent); }
footer { border-top: 1px solid rgba(25,21,35,0.1); padding: 48px 0; text-align: center; font-size: 0.875rem; color: rgba(25,21,35,0.6); }
.surface-dark footer { border-color: rgba(244,243,247,0.1); color: rgba(244,243,247,0.6); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; font-weight: 600; font-size: 1rem; cursor: pointer; border: 2px solid transparent; transition: transform 0.2s, background 0.2s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--dark); border-color: var(--accent); }
.btn-primary:hover { transform: translateY(-2px); background: #c95ce0; }
.btn-secondary { background: transparent; color: var(--body); border-color: var(--body); }
.surface-dark .btn-secondary { color: var(--paper); border-color: var(--paper); }
.btn-secondary:hover { background: rgba(25,21,35,0.05); }
.surface-dark .btn-secondary:hover { background: rgba(244,243,247,0.1); }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.card { border: var(--card-border); box-shadow: var(--card-shadow); background: var(--paper); padding: var(--gap); min-width: 0; }
.surface-dark .card { background: var(--dark); border-color: var(--paper); box-shadow: 4px 4px 0 var(--paper); }
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); min-width: 0; }
th, td { border: 1px solid var(--body); padding: 12px; text-align: left; min-width: 0; }
th { background: rgba(82,20,235,0.05); font-weight: 600; }
.surface-dark th { border-color: var(--paper); background: rgba(214,110,237,0.1); }
.surface-dark td { border-color: var(--paper); }
details { border: var(--card-border); margin-bottom: var(--gap); min-width: 0; }
summary { padding: 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: "+"; font-size: 1.25rem; }
details[open] summary::after { content: "-"; }
details p { padding: 0 16px 16px; }

.svg-canvas { width: 100%; height: auto; max-width: 100%; }
.grid-node { animation: node-glow 6s infinite ease-in-out; transform-origin: center; }
@keyframes node-glow {
  0%, 100% { opacity: 0.15; transform: scale(0.8); fill: var(--accent); }
  30% { opacity: 1; transform: scale(1.15); fill: var(--accent); }
  60% { opacity: 0.15; transform: scale(0.8); fill: var(--accent); }
}
.bubble { animation: float-bubble 4s infinite ease-in-out; }
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line 2s ease forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.breathe-dot { animation: breathe-dots 1.5s infinite ease-in-out; }
@keyframes breathe-dots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.breathe-dot:nth-child(2) { animation-delay: 0.3s; }
.breathe-dot:nth-child(3) { animation-delay: 0.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; }
}

.flex-row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.min-w-0 { min-width: 0; }
