:root {
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-paper-light: #F4F3F5;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  --font-body: 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-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
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: var(--section-y) 0; position: relative; }
.bg-dark { background-color: var(--color-dark); color: var(--color-paper); }
.bg-dark .hl { color: var(--color-accent); }
.bg-dark .tag { color: var(--color-accent); }
.bg-dark .link { color: var(--color-accent); }
.bg-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.bg-dark .card-light { background: var(--color-paper); color: var(--color-text); border: var(--card-border); }
.bg-dark .card-light .hl { color: var(--color-brand); }
.bg-dark .card-light .tag { color: var(--color-brand); }
.bg-dark .card-light .btn-secondary { border-color: var(--color-text); color: var(--color-text); }

h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 2); }
h3 { font-size: 1.25rem; margin-bottom: var(--gap); }
p { max-width: 38em; margin-bottom: var(--gap); }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: var(--gap); color: var(--color-brand); }
.hl { color: var(--color-brand); }

.btn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0 1.25em; height: 48px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.card { border: var(--card-border); border-radius: var(--radius-card); padding: calc(var(--gap) * 2); background: white; }
.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); }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: var(--gap); border-bottom: 1px solid rgba(25, 21, 35, 0.1); text-align: left; }
th { font-weight: 700; }
tr:last-child td { border-bottom: none; }

details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: var(--gap); overflow: hidden; }
summary { padding: calc(var(--gap) * 1.5); 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; }
details[open] summary::after { content: "-"; }
details > div { padding: 0 calc(var(--gap) * 1.5) calc(var(--gap) * 1.5); }

/* SVG Animation Base */
svg { width: 100%; height: auto; overflow: visible; }
svg path, svg circle, svg line, svg polyline {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.anim-flow { animation: flow-line 6s ease-in-out infinite; }
.anim-float { animation: float-bubble 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-pulse { animation: pulse-dot 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-slide { animation: slide-in 1.2s ease-out forwards; }
.anim-draw { animation: draw-path 4s ease-in-out infinite; }

@keyframes flow-line { 0% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes float-bubble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse-dot { 0%, 100% { r: 2; opacity: 0.8; } 50% { r: 3.5; opacity: 1; } }
@keyframes slide-in { 0% { transform: translateX(-12px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes draw-path { 0% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; animation: none !important; }
}

/* Header & Footer */
header { position: sticky; top: 0; background: rgba(233, 232, 234, 0.96); backdrop-filter: blur(8px); z-index: 100; border-bottom: 1px solid rgba(25,21,35,0.08); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5em; font-weight: 800; font-size: 1.1rem; }
.logo img { height: 28px; width: auto; }
nav ul { display: flex; gap: var(--gap); }
nav a { font-weight: 500; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
nav .mobile-hide { display: flex; }

footer { background: var(--color-dark); color: var(--color-paper); padding: calc(var(--section-y) * 1.5) 0; margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: calc(var(--gap) * 3); }
.footer-grid h4 { margin-bottom: var(--gap); color: var(--color-accent); font-size: 1rem; font-weight: 700; }
.footer-grid ul li { margin-bottom: 0.5em; }
.footer-grid a:hover { text-decoration: underline; }
.footer-bottom { margin-top: calc(var(--gap) * 3); padding-top: var(--gap); border-top: 1px solid rgba(233, 232, 234, 0.15); text-align: center; font-size: 0.85rem; opacity: 0.8; }

/* Utility & Responsive */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.timeline-item { position: relative; padding-left: 24px; border-left: 2px solid var(--color-brand); margin-bottom: var(--gap); }
.timeline-item::before { content: ""; position: absolute; left: -6px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--color-brand); }
.bg-dark .timeline-item { border-left-color: var(--color-accent); }
.bg-dark .timeline-item::before { background: var(--color-accent); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--color-accent); color: var(--color-dark); border-radius: 8px; font-weight: 700; font-size: 0.9rem; margin-right: 0.5em; }
.news-date { font-size: 0.85rem; opacity: 0.7; margin-bottom: 0.25em; display: block; }

@media (max-width: 768px) {
  .nav-container { flex-wrap: wrap; height: auto; padding: var(--gap) 0; }
  nav ul { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column; }
}
