:root {
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  --color-light-paper: #F4F3F5;

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-body: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  color: var(--color-text);
  background-color: var(--color-paper);
  line-height: var(--line-height-body);
  font-size: 16px;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1em; max-width: 38em; }
.hl { color: var(--color-brand); }
.dark-surface .hl { color: var(--color-accent); }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; position: relative; }
.section.dark { background-color: var(--color-dark); color: var(--color-paper); }
.section.light { background-color: var(--color-light-paper); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  height: 52px; padding: 0 24px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s, background 0.2s;
  border: none; outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--color-accent); }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { background: #8dd65f; }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }

.card {
  background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card);
  padding: var(--gap); box-shadow: var(--card-shadow);
}
.dark-surface .card { background: var(--color-paper); color: var(--color-text); }

.badge {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em;
  margin-bottom: 0.5em; color: var(--color-brand);
}
.dark-surface .badge { color: var(--color-accent); }

.table-wrap { overflow-x: auto; border: var(--card-border); border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.1); }
th { font-weight: 600; background: rgba(0,0,0,0.05); }
.dark-surface th { background: rgba(255,255,255,0.1); }

details { margin-bottom: 1em; border: var(--card-border); border-radius: var(--radius-card); padding: 16px; background: var(--color-paper); }
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.2em; }
details[open] summary::after { content: "-"; }
details > div { margin-top: 1em; line-height: 1.6; }
.dark-surface details { background: rgba(255,255,255,0.1); color: var(--color-paper); }

header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(0,0,0,0.1); padding: 16px 0; }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 24px; }
nav a { font-weight: 500; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.dark-surface nav a[aria-current="page"] { color: var(--color-accent); }
.dark-surface header { background: var(--color-dark); border-bottom-color: rgba(255,255,255,0.1); }

footer { background: var(--color-dark); color: var(--color-paper); padding: 48px 0; margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-grid a { color: var(--color-paper); opacity: 0.8; }
.footer-grid a:hover { opacity: 1; color: var(--color-accent); }

.svg-animated { width: 100%; height: auto; max-width: 100%; }
@keyframes rotate-pair { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(180deg); } }
@keyframes dash-flow { to { stroke-dashoffset: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.anim-rotate { animation: rotate-pair 12s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash-flow 3s ease-in-out infinite alternate; }
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-slide { animation: slide-in 1.5s ease-out forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
