:root {
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  --color-white: #FFFFFF;
  --color-border-light: rgba(31, 21, 35, 0.16);

  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid var(--color-border-light);
  --card-shadow: none;

  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height-body: 1.55;
  --content-max: 1280px;

  --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);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Typography */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: calc(var(--gap) * 0.5); }
p { margin-bottom: var(--gap); max-width: 38em; }

.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: calc(var(--gap) * 0.25);
}
.dark-section .label { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.dark-section .hl { color: var(--color-accent); }

/* Layout */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }
.dark-section { background-color: var(--color-dark); color: var(--color-paper); }
.dark-section h1, .dark-section h2, .dark-section h3 { color: var(--color-paper); }
.dark-section p { color: var(--color-paper); }

/* Header / Nav */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: var(--card-border); backdrop-filter: blur(8px); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; }
.logo img { width: 32px; height: 32px; }
nav ul { display: flex; gap: var(--gap); }
nav a { font-weight: 500; padding: 8px 12px; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.dark-section header { background: var(--color-dark); border-color: rgba(255,255,255,0.1); }
.dark-section nav a:hover, .dark-section nav a[aria-current="page"] { color: var(--color-accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 24px; height: 48px; font-weight: 600; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; transition: transform 0.2s, opacity 0.2s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border-color: var(--color-text); color: var(--color-text); }
.dark-section .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* Cards */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
.dark-section .card { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-block: var(--gap); }
th, td { padding: 12px 16px; border-bottom: var(--card-border); text-align: left; vertical-align: top; }
th { font-weight: 600; color: var(--color-brand); }
.dark-section th { color: var(--color-accent); }
.dark-section td { border-bottom-color: rgba(255,255,255,0.1); }
td a { color: var(--color-brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.dark-section td a { color: var(--color-accent); }

/* Lists & Definition */
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
dt { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
dd { margin-left: 0; color: var(--color-text); line-height: var(--line-height-body); }
.dark-section dd { color: var(--color-paper); }
.icon-svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); counter-reset: step; }
.step-item { position: relative; padding: var(--gap); border: var(--card-border); background: var(--color-paper); }
.dark-section .step-item { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--color-accent); color: var(--color-dark);
  font-weight: 800; margin-bottom: 12px;
}

/* FAQ */
details { border-bottom: var(--card-border); padding: 16px 0; }
summary { 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.25rem; font-weight: 300; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 12px; line-height: var(--line-height-body); }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.hero-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }

/* SVG Visual Container */
.svg-visual { width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 4/3; }

/* SVG Animations */
@keyframes draw-line {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes node-glow {
  0%, 100% { opacity: 0.25; r: 2; }
  50% { opacity: 1; r: 3.5; }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.draw-line { animation: draw-line 4s ease-in-out infinite; }
.node-glow { animation: node-glow 5s ease-in-out infinite; }
.float-slow { animation: float-slow 7s ease-in-out infinite; }
.breathe { animation: breathe 2.5s ease-in-out infinite; }

/* Staggered delays for grid nodes */
.node-1 { animation-delay: 0s; }
.node-2 { animation-delay: 0.8s; }
.node-3 { animation-delay: 1.6s; }
.node-4 { animation-delay: 2.4s; }
.node-5 { animation-delay: 3.2s; }
.node-6 { animation-delay: 4.0s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 768px) {
  .hero-layout { grid-template-columns: 1fr; }
  .svg-visual { order: -1; max-width: 100%; }
  .nav-inner { flex-direction: column; height: auto; padding: 12px 0; }
  nav ul { flex-wrap: wrap; justify-content: center; }
  dl { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
}
