:root {
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31,21,35,0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-sans: 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-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: 0.02em; margin-bottom: var(--gap); }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); text-wrap: balance; }
h3 { font-size: 1.25rem; }
p { margin-bottom: var(--gap); max-width: 38em; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.section-dark { background: var(--color-dark); color: var(--color-paper); }
.section-dark .hl { color: var(--color-accent); }
.section-paper { background: var(--color-paper); color: var(--color-text); }
.hl { color: var(--color-brand); }

.label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.5rem; display: block; }
.section-dark .label { color: var(--color-accent); }
.section-paper .label { color: var(--color-brand); }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; font-weight: 600; font-size: 1rem;
  border-radius: var(--radius-btn); cursor: pointer; transition: transform 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(0.95); }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.section-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { background: rgba(0,0,0,0.05); }
.section-dark .btn-secondary:hover { background: rgba(255,255,255,0.05); }

.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)); }
.card {
  background: var(--color-paper); border: var(--card-border);
  box-shadow: var(--card-shadow); padding: var(--gap);
  border-radius: var(--radius-card); position: relative;
}
.section-dark .card { background: var(--color-dark); color: var(--color-paper); }

table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { text-align: left; padding: 0.75rem 0; border-bottom: 1px solid rgba(0,0,0,0.1); }
.section-dark th, .section-dark td { border-bottom-color: rgba(255,255,255,0.1); }
th { font-weight: 700; }

details { margin-bottom: var(--gap); border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: var(--gap); }
.section-dark details { border-bottom-color: rgba(255,255,255,0.1); }
summary { cursor: pointer; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; }

header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(0,0,0,0.1); padding: 1rem 0; }
.section-dark header { background: var(--color-dark); border-bottom-color: rgba(255,255,255,0.1); }
.nav-wrap { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.25rem; color: inherit; text-decoration: none; }
.logo img { width: 32px; height: 32px; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { font-weight: 500; color: inherit; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.section-dark nav a[aria-current="page"] { color: var(--color-accent); }

footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; margin-top: auto; }
footer a { color: var(--color-accent); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { margin-bottom: 0.75rem; color: var(--color-paper); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }

/* SVG Utilities */
.svg-icon { width: 24px; height: 24px; stroke-width: 1.5; fill: none; stroke: currentColor; transform-box: fill-box; transform-origin: center; }
.svg-panel { width: 100%; height: auto; overflow: visible; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.anim-float { animation: float 5s ease-in-out infinite; }
.anim-blink { animation: blink 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s ease-out forwards; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes drawPath { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .anim-draw, .anim-float, .anim-blink, .anim-slide { animation: none !important; }
}
