:root {
  --bg-dark: #21163C;
  --bg-paper: #F4F3F7;
  --text-body: #191523;
  --brand: #5214EB;
  --accent: #ED926E;
  --text-on-dark: #F4F3F7;
  --text-on-accent: #21163C;

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;

  --font-sans: 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-sans); background: var(--bg-paper); color: var(--text-body); line-height: 1.75; font-size: 16px; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.paper-surface { background: var(--bg-paper); color: var(--text-body); }
.dark-surface { background: var(--bg-dark); color: var(--text-on-dark); }
.dark-surface a { color: var(--accent); }
.dark-surface .hl { color: var(--accent); }
.paper-surface .hl { color: var(--brand); }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.5em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.4em; }
p { margin-bottom: 1em; max-width: 38em; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5em; text-transform: uppercase; }
.paper-surface .badge { color: var(--brand); }
.dark-surface .badge { color: var(--accent); }
.hl { font-weight: 700; }

.btn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.8em 1.6em; border-radius: var(--radius-btn); font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; border: none; font-size: 1rem; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(237, 146, 110, 0.4); }
.btn-secondary { background: transparent; border: 1px solid currentColor; color: inherit; }
.paper-surface .btn-secondary { color: var(--text-body); border-color: var(--text-body); }
.dark-surface .btn-secondary { color: var(--text-on-dark); border-color: var(--text-on-dark); }
.btn-icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

.card { background: var(--bg-paper); border-radius: var(--radius-card); padding: var(--gap); box-shadow: var(--card-shadow); border: var(--card-border) solid transparent; transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }
.dark-surface .card { background: #2A1F4D; color: var(--text-on-dark); }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-card); border: 1px solid rgba(0,0,0,0.1); }
table { width: 100%; border-collapse: collapse; background: var(--bg-paper); }
th, td { padding: 0.8em 1em; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.08); }
th { font-weight: 700; background: rgba(0,0,0,0.03); }
.dark-surface .table-wrap { border-color: rgba(255,255,255,0.15); }
.dark-surface table { background: #2A1F4D; color: var(--text-on-dark); }
.dark-surface th { background: rgba(255,255,255,0.05); border-bottom-color: rgba(255,255,255,0.1); }

.faq-item { margin-bottom: 1em; border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: 1em; }
.dark-surface .faq-item { border-bottom-color: rgba(255,255,255,0.15); }
summary { list-style: none; cursor: pointer; font-weight: 600; padding: 0.5em 0; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2em; font-weight: 400; }
details[open] summary::after { content: "−"; }
details[open] summary { margin-bottom: 0.5em; }

header { position: sticky; top: 0; z-index: 100; background: var(--bg-paper); border-bottom: 1px solid rgba(0,0,0,0.08); backdrop-filter: blur(8px); }
.dark-surface header { background: var(--bg-dark); border-bottom-color: rgba(255,255,255,0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
nav a { margin-left: 1.5em; font-weight: 500; }
nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
footer { padding: var(--section-y) 0; border-top: 1px solid rgba(0,0,0,0.08); }
.dark-surface footer { border-top-color: rgba(255,255,255,0.1); }

.timeline { position: relative; padding-left: 2em; border-left: 2px solid rgba(0,0,0,0.1); margin-left: 1em; }
.dark-surface .timeline { border-left-color: rgba(255,255,255,0.2); }
.timeline-item { position: relative; margin-bottom: 2em; }
.timeline-item::before { content: ""; position: absolute; left: -2.35em; top: 0.4em; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-paper); }
.dark-surface .timeline-item::before { border-color: var(--bg-dark); }

@keyframes draw { 0%, 100% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes slideIn { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes rotateJoin { 0% { transform: rotate(0deg); } 50% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }

.anim-draw { animation: draw 4s ease-in-out infinite; stroke-dasharray: 1; stroke-dashoffset: 0; }
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s ease-out forwards; }
.anim-rotate { animation: rotateJoin 12s linear infinite; transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
