:root {
  --bg-dark: #271231;
  --bg-paper: #F5F0E5;
  --text-body: #1F1523;
  --brand-color: #9B12D8;
  --accent-color: #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(--bg-paper);
  color: var(--text-body);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-block: var(--section-y); position: relative; }
.section.dark-section { background: var(--bg-dark); color: var(--bg-paper); }
.section.dark-section .hl { color: var(--accent-color); }
.section.dark-section a:not(.btn) { color: var(--accent-color); }
.section.paper-section { background: var(--bg-paper); color: var(--text-body); }
.section.paper-section .hl { color: var(--brand-color); }
.section.paper-section a:not(.btn) { color: var(--brand-color); }

.card-light {
  background: var(--bg-paper);
  color: var(--text-body);
  border: var(--card-border) solid var(--text-body);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
}
.card-light .hl { color: var(--brand-color); }
.card-light a:not(.btn) { color: var(--brand-color); }

/* Typography */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; margin-bottom: calc(var(--gap) * 1.5); text-wrap: balance; }
h3 { font-size: 1.25rem; margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
mark, .hl { font-weight: 700; }
.subtitle { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5em; display: block; }
.paper-section .subtitle { color: var(--brand-color); }
.dark-section .subtitle { color: var(--accent-color); }

/* Header & Nav */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 240, 229, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.site-header.scrolled { border-bottom-color: rgba(31, 21, 35, 0.1); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; display: block; }
nav ul { display: flex; gap: var(--gap); list-style: none; }
nav a { text-decoration: none; color: inherit; font-weight: 500; padding: 8px 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--brand-color); }
nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: currentColor; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 24px; height: 48px;
  background: var(--accent-color); color: var(--bg-dark);
  font-weight: 700; text-decoration: none; border: none; cursor: pointer;
  border-radius: var(--radius-btn); transition: transform 0.2s, filter 0.2s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 2px; }
.btn-outline { background: transparent; color: var(--text-body); border: 1px solid var(--text-body); }
.dark-section .btn-outline { color: var(--bg-paper); border-color: var(--bg-paper); }

/* Grid & Lists */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
dl { display: grid; grid-template-columns: 1fr; gap: 12px; }
dt { font-weight: 700; color: var(--brand-color); }
.dark-section dt { color: var(--accent-color); }
dd { margin-left: 0; }
ul.list-disc { list-style: disc; padding-left: 20px; }
ul.list-disc li { margin-bottom: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(31, 21, 35, 0.1); }
.dark-section th, .dark-section td { border-bottom-color: rgba(245, 240, 229, 0.15); }
th { font-weight: 700; }

/* FAQ */
details { border: 1px solid rgba(31, 21, 35, 0.1); margin-bottom: 12px; background: rgba(255,255,255,0.5); }
.dark-section details { background: rgba(245, 240, 229, 0.05); border-color: rgba(245, 240, 229, 0.15); }
summary { padding: 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; }
details[open] summary::after { content: "−"; }
.details-content { padding: 0 16px 16px; }

/* SVG Containers */
.svg-container { width: 100%; height: auto; }
.svg-container svg { width: 100%; height: auto; display: block; }

/* SVG Animations */
@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes geo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 2.5s ease-in-out infinite alternate; }
.float-anim { animation: float-bubble 4s ease-in-out infinite; }
.geo-spin-anim { animation: geo-spin 12s linear infinite; transform-box: fill-box; transform-origin: center; }
.fade-up-anim { animation: fade-in-up 1.5s ease-out forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .draw-path, .float-anim, .geo-spin-anim, .fade-up-anim { animation: none !important; }
}

/* Focus & Accessibility */
:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Footer */
.site-footer { background: var(--bg-dark); color: var(--bg-paper); padding: var(--section-y) 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.footer-grid a { color: var(--accent-color); text-decoration: none; display: block; margin-bottom: 8px; }
.footer-grid a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(245, 240, 229, 0.15); padding-top: var(--gap); font-size: 0.9rem; opacity: 0.8; }
