:root {
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --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;
  --lh-body: 1.75;
}

*, *::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(--lh-body);
  font-size: 16px;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.section-divider { border-top: 1px solid rgba(25,21,35,0.1); margin: 0; }

/* Typography */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; color: var(--color-text); }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 2rem 0 1rem; }
h3 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; }
p { max-width: 38em; margin-bottom: 1rem; }
.eyebrow { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-brand); margin-bottom: 0.5rem; }
.dark-mode .eyebrow { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.dark-mode .hl { color: var(--color-accent); }

/* Components */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0 1.5rem; height: 48px; min-height: 48px;
  border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary { background: transparent; color: var(--color-text); border: 2px solid var(--color-text); }
.dark-mode .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

.card {
  border: var(--card-border); border-radius: var(--radius-card);
  box-shadow: var(--card-shadow); background: var(--color-paper);
  padding: 1.5rem; margin-bottom: var(--gap);
}
.dark-mode .card { background: var(--color-paper); border-color: var(--color-text); color: var(--color-text); box-shadow: var(--card-shadow); }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(25,21,35,0.1); }
th { font-weight: 700; }

.faq details { margin-bottom: 1rem; border-bottom: 1px solid rgba(25,21,35,0.1); padding-bottom: 1rem; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.5rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; position: absolute; left: 0; color: var(--color-brand); }
.faq details[open] summary::before { content: "-"; }
.faq p { margin-top: 0.5rem; }

/* Header/Footer */
header { position: sticky; top: 0; z-index: 100; background: rgba(252,252,253,0.9); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(25,21,35,0.05); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { text-decoration: none; color: var(--color-text); font-weight: 500; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; }
footer a { color: var(--color-paper); text-decoration: none; }
footer a:hover { color: var(--color-accent); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }

/* SVG Graphics */
.svg-graphic { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-panel { background: var(--color-dark); border-radius: 12px; padding: 1rem; border: 1px solid rgba(252,252,253,0.1); }
.dark-mode .svg-panel { background: var(--color-dark); }

/* SVG Animations */
@keyframes dashFlow {
  0% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 1; }
  100% { 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 { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }

.anim-flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashFlow 2s linear infinite;
}
.anim-float { animation: float 4s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.6s ease-out forwards; }

svg { 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;
  }
}

@media (max-width: 768px) {
  .nav-inner { flex-direction: column; height: auto; padding: 1rem 0; gap: 1rem; }
  nav ul { flex-wrap: wrap; justify-content: center; }
  .grid-alt { grid-template-columns: 1fr !important; }
}
