:root {
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23,21,35,0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --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-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }

/* Typography */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: calc(var(--gap) / 2); }
p { margin-bottom: var(--gap); max-width: 38em; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
span.hl { font-weight: 700; }

/* Surface Classes */
.paper-section { background-color: var(--color-paper); color: var(--color-text); }
.paper-section h1, .paper-section h2, .paper-section h3, .paper-section p, .paper-section li { color: var(--color-text); }
.paper-section span.hl { color: var(--color-brand); }
.paper-section .eyebrow { color: var(--color-brand); }

.dark-section { background-color: var(--color-dark); color: var(--color-paper); }
.dark-section h1, .dark-section h2, .dark-section h3, .dark-section p, .dark-section li { color: var(--color-paper); }
.dark-section span.hl { color: var(--color-accent); }
.dark-section .eyebrow { color: var(--color-accent); }
.dark-section .card { background: var(--color-paper); color: var(--color-text); }
.dark-section .card h3, .dark-section .card p { color: var(--color-text); }
.dark-section .card span.hl { color: var(--color-brand); }
.dark-section .card .eyebrow { color: var(--color-brand); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 2rem; height: 52px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: 2px solid transparent; white-space: nowrap;
}
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(137,237,110,0.4); }
.btn-secondary { background: transparent; color: var(--color-text); border-color: currentColor; }
.dark-section .btn-secondary { color: var(--color-paper); }
.btn-secondary:hover { opacity: 0.85; transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 4px; }

/* Cards & Panels */
.card {
  background: var(--color-paper);
  border: var(--card-border) solid var(--color-text);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(23,21,35,0.35); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.dark-section .panel { background: var(--color-dark); }
.paper-section .panel { background: var(--color-paper); }

/* Layout Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.text-center { text-align: center; }

/* Sections */
section { padding-top: var(--section-y); padding-bottom: var(--section-y); border-bottom: 1px solid rgba(23,21,35,0.1); }
.dark-section section { border-bottom-color: rgba(214,212,237,0.15); }
section:last-of-type { border-bottom: none; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(23,21,35,0.15); vertical-align: top; }
th { font-weight: 700; }
.dark-section th, .dark-section td { border-bottom-color: rgba(214,212,237,0.2); }
td a { color: var(--color-brand); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; }
.dark-section td a { color: var(--color-accent); }

/* FAQ */
details { margin-bottom: var(--gap); border: 1px solid rgba(23,21,35,0.1); border-radius: var(--radius-card); overflow: hidden; }
.dark-section details { border-color: rgba(214,212,237,0.2); }
summary { padding: 1rem 1.5rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; font-weight: 300; transition: transform 0.2s; }
details[open] summary::after { content: "−"; }
details > div { padding: 0 1.5rem 1.5rem; }

/* Header & Footer */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(23,21,35,0.1); padding: 1rem 0; backdrop-filter: blur(8px); }
.dark-section header { background: var(--color-dark); border-bottom-color: rgba(214,212,237,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo img { height: 32px; width: auto; }
nav { display: flex; align-items: center; gap: 1rem; }
nav a { margin-left: 1.5rem; font-weight: 500; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.dark-section nav a[aria-current="page"] { color: var(--color-accent); }
footer { padding: 3rem 0; border-top: 1px solid rgba(23,21,35,0.1); margin-top: var(--section-y); text-align: center; font-size: 0.9rem; opacity: 0.8; }
.dark-section footer { border-top-color: rgba(214,212,237,0.1); }

/* SVG & Animations */
svg { width: 100%; height: auto; max-width: 100%; }
.anim-svg-container { width: 100%; height: auto; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes slideIn { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes rotateMerge { 0% { transform: rotate(0deg) scale(0.9); } 50% { transform: rotate(180deg) scale(1.05); } 100% { transform: rotate(360deg) scale(0.9); } }

.anim-float { animation: float 6s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 4s ease forwards; }
.anim-slide { animation: slideIn 0.8s ease-out forwards; }
.anim-rotate { transform-box: fill-box; transform-origin: center; animation: rotateMerge 12s linear infinite; }

@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; }
  .anim-float, .anim-breathe, .anim-draw, .anim-slide, .anim-rotate { animation: none !important; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  header { padding: 0.75rem 0; }
  nav a { margin-left: 0.75rem; font-size: 0.85rem; }
  .btn { padding: 0 1.5rem; height: 48px; font-size: 0.95rem; }
}
