:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --surface-bg: var(--color-paper);
  --text-color: var(--color-text);
  --accent-color: var(--color-brand);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--surface-bg);
  color: var(--text-color);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
}

.surface-dark {
  --surface-bg: var(--color-dark);
  --text-color: var(--color-paper);
  --accent-color: var(--color-accent);
  background: var(--surface-bg);
  color: var(--text-color);
}

.surface-card {
  --surface-bg: var(--color-paper);
  --text-color: var(--color-text);
  --accent-color: var(--color-brand);
  background: var(--surface-bg);
  color: var(--text-color);
}

/* Typography */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; letter-spacing: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.75em; }
p { margin-bottom: 1em; max-width: 38em; }

.label-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
.surface-dark .label-tag { color: var(--color-accent); }
.surface-paper .label-tag { color: var(--color-brand); }

.hl { color: var(--accent-color); }

/* Buttons */
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  min-height: 48px;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.surface-dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

/* Cards & Panels */
.card {
  background: var(--surface-bg);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(25, 21, 35, 0.4); }

.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* 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-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }

/* Lists & Definition */
dl { display: grid; grid-template-columns: 1fr 2fr; gap: 0.75rem 1.5rem; margin-bottom: 1.5rem; }
dt { font-weight: 700; position: relative; padding-left: 1.5rem; }
dt::before {
  content: ""; position: absolute; left: 0; top: 0.35em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--accent-color);
}
dd { margin: 0; line-height: 1.6; }

/* Steps */
.step-flow { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.step-item {
  flex: 1; min-width: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  position: relative;
}
.surface-paper .step-item { background: rgba(0,0,0,0.03); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent-color); color: var(--color-dark);
  font-weight: 800; font-size: 0.85rem; margin-bottom: 0.75rem;
}
.step-arrow {
  position: absolute; right: -14px; top: 1.5rem;
  color: var(--accent-color); opacity: 0.6;
}

/* Table */
.data-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; table-layout: fixed; }
.data-table th, .data-table td {
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.surface-dark .data-table th, .surface-dark .data-table td { border-bottom-color: rgba(255,255,255,0.1); }
.data-table th { font-weight: 700; width: 40%; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
details {
  border: 1px solid rgba(0,0,0,0.08); border-radius: var(--radius-card);
  padding: 1rem 1.25rem; transition: background 0.2s;
}
.surface-dark details { border-color: rgba(255,255,255,0.1); }
summary { cursor: pointer; font-weight: 600; 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; font-weight: 400; }
details[open] summary::after { content: "−"; }
details p { margin-top: 0.75rem; font-size: 0.95rem; line-height: 1.6; }

/* News */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.news-card { display: flex; flex-direction: column; gap: 0.5rem; }
.news-date { font-size: 0.8rem; color: var(--accent-color); font-weight: 600; }

/* Header & Footer */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 245, 243, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0.75rem 0;
}
.surface-dark.site-header { background: rgba(20, 14, 37, 0.9); border-bottom-color: rgba(255,255,255,0.08); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo-img { height: 32px; width: auto; vertical-align: middle; }
.nav-link {
  text-decoration: none; color: inherit; font-weight: 500; padding: 0.5rem 0.75rem;
  border-radius: 4px; transition: background 0.2s;
}
.nav-link:hover, .nav-link[aria-current="page"] { background: rgba(0,0,0,0.05); }
.surface-dark .nav-link:hover, .surface-dark .nav-link[aria-current="page"] { background: rgba(255,255,255,0.1); }

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.9rem;
}
.surface-dark .site-footer { border-top-color: rgba(255,255,255,0.08); }
.footer-links { display: flex; gap: 1.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* SVG Base Rules */
.svg-wrapper { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-wrapper svg { width: 100%; height: auto; display: block; }

/* SVG Animations */
@keyframes drawPath { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes floatBubble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulseDot { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes slideInCard { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes rotateGeo { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawPath 3s ease forwards; }
.anim-float { animation: floatBubble 4s ease-in-out infinite; }
.anim-dot { animation: pulseDot 1.5s ease-in-out infinite; }
.anim-slide { animation: slideInCard 2.5s ease forwards; }
.anim-geo { animation: rotateGeo 12s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-geo-slow { animation: rotateGeo 18s linear reverse infinite; transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Responsive Tweaks */
@media (max-width: 768px) {
  dl { grid-template-columns: 1fr; }
  dt { padding-left: 0; margin-bottom: 0.25rem; }
  .step-flow { flex-direction: column; }
  .step-arrow { display: none; }
}
