:root {
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;
  --color-dark-text: #F6F3F7;
  --color-dark-accent: #6EEDA8;

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-body: 1.75;
  --line-height-heading: 1.2;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
section { padding-block: var(--section-y); }
.section-dark { background: var(--color-dark); color: var(--color-dark-text); }
.section-paper { background: var(--color-paper); color: var(--color-text); }

/* Typography */
h1, h2, h3, h4 { line-height: var(--line-height-heading); letter-spacing: 0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; margin-bottom: calc(var(--gap) * 0.8); }
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5em; }
p { max-width: 38em; margin-bottom: 1em; }
.hl { color: var(--color-brand); }
.section-dark .hl { color: var(--color-dark-accent); }
.macro-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5em;
}
.section-dark .macro-label { color: var(--color-dark-accent); }

/* Header / Footer */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(246, 243, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}
.section-dark .site-header { background: rgba(45, 20, 56, 0.9); border-bottom-color: rgba(246, 243, 247, 0.1); }
.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; }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { text-decoration: none; color: inherit; font-weight: 500; transition: color 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-brand); }
.section-dark .nav a { color: var(--color-dark-text); }
.section-dark .nav a:hover, .section-dark .nav a[aria-current="page"] { color: var(--color-dark-accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 24px;
  font-size: 1rem; font-weight: 600; text-decoration: none;
  border-radius: var(--radius-btn); cursor: pointer; border: none;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); background: #5bd695; }
.btn-secondary { background: transparent; color: var(--color-text); border: 1px solid var(--color-text); }
.btn-secondary:hover { background: rgba(31, 21, 35, 0.05); }
.section-dark .btn-secondary { color: var(--color-dark-text); border-color: var(--color-dark-text); }
.section-dark .btn-secondary:hover { background: rgba(246, 243, 247, 0.1); }

/* Cards & Panels */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
}
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.section-dark .panel { background: rgba(246, 243, 247, 0.05); border: 1px solid rgba(246, 243, 247, 0.1); }

/* Grid & Flex */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 900px) {
  .flex-row.reverse { flex-direction: row-reverse; }
  .feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
}

/* 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 var(--card-border); }
th { font-weight: 600; background: rgba(31, 21, 35, 0.04); }
.section-dark th, .section-dark td { border-color: rgba(246, 243, 247, 0.1); background: transparent; color: inherit; }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: 12px; padding: 16px 20px; background: var(--color-paper); }
.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.2em; transition: transform 0.2s; }
details[open] .summary::after { transform: rotate(45deg); }
.summary p { margin: 0; }

/* Timeline */
.timeline { position: relative; padding-left: 24px; border-left: 2px solid var(--color-brand); }
.timeline-item { position: relative; margin-bottom: 24px; padding-left: 16px; }
.timeline-item::before { content: ""; position: absolute; left: -30px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-brand); border: 2px solid var(--color-paper); }
.section-dark .timeline { border-color: var(--color-dark-accent); }
.section-dark .timeline-item::before { background: var(--color-dark-accent); border-color: var(--color-dark); }
.time-badge { display: inline-block; font-size: 0.85rem; font-weight: 700; color: var(--color-brand); margin-bottom: 4px; }
.section-dark .time-badge { color: var(--color-dark-accent); }

/* Steps */
.step-list { counter-reset: step; list-style: none; }
.step-list li { position: relative; padding-left: 48px; margin-bottom: 20px; }
.step-list li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px;
  background: var(--color-accent); color: var(--color-dark);
  font-weight: 700; font-size: 0.9rem;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

/* SVG Containers */
.svg-anim { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-anim path, .svg-anim circle, .svg-anim rect, .svg-anim line { vector-effect: non-scaling-stroke; }

/* SVG Animations */
@keyframes floatCard { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes dashDraw { to { stroke-dashoffset: 0; } }
@keyframes pulseDot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes flowLine { to { stroke-dashoffset: -24; } }

.anim-float { animation: floatCard 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-slide { animation: slideInRight 4s ease-out forwards; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: dashDraw 6s linear infinite; }
.anim-pulse { animation: pulseDot 2.5s ease-in-out infinite; }
.anim-flow { stroke-dasharray: 8 16; animation: flowLine 3s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .anim-float, .anim-slide, .anim-draw, .anim-pulse, .anim-flow { animation: none !important; }
}

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1em; }
.max-w-prose { max-width: 38em; margin-inline: auto; }
.grid-news { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.article-card { display: flex; flex-direction: column; gap: 12px; }
.article-card time { font-size: 0.85rem; color: var(--color-brand); font-weight: 600; }
.section-dark .article-card time { color: var(--color-dark-accent); }
ul.check-list { list-style: none; padding-left: 0; }
ul.check-list li { position: relative; padding-left: 28px; margin-bottom: 12px; }
ul.check-list li::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border: 2px solid var(--color-brand); border-radius: 4px; }
.section-dark ul.check-list li::before { border-color: var(--color-dark-accent); }
