/* ================= Design Tokens ================= */
:root {
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  
  --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: 960px;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.75;
}

/* ================= Surface Contexts ================= */
.paper-surface {
  --surface-bg: var(--color-paper);
  --text-color: var(--color-text);
  --heading-color: var(--color-text);
  --link-color: var(--color-brand);
  --icon-color: var(--color-brand);
  --highlight-color: var(--color-brand);
}

.dark-surface {
  --surface-bg: var(--color-dark);
  --text-color: var(--color-paper);
  --heading-color: var(--color-paper);
  --link-color: var(--color-accent);
  --icon-color: var(--color-accent);
  --highlight-color: var(--color-accent);
}

/* ================= Base Reset & Typography ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  line-height: var(--line-height-base);
  color: var(--text-color);
  background: var(--paper-surface, var(--color-paper));
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link-color); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 2px solid var(--link-color); outline-offset: 2px; border-radius: 2px; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

section {
  padding-block: var(--section-y);
  background: var(--surface-bg);
  color: var(--text-color);
}

h1, h2, h3, h4 {
  color: var(--heading-color);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; line-height: 1.3; }
p { margin-bottom: 1rem; max-width: 38em; }

.highlight { color: var(--highlight-color); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  color: var(--highlight-color);
}

/* ================= Components ================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  height: 48px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(237, 146, 110, 0.3); }
.btn-secondary {
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--text-color);
}
.btn-secondary:hover { background: rgba(128,128,128,0.1); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; fill: none; }

.card {
  background: var(--surface-bg);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(128,128,128,0.2);
}
th { font-weight: 700; }
td:first-child { font-weight: 600; color: var(--heading-color); }

dl.feature-list { display: grid; gap: 1.5rem; }
dt { font-weight: 700; color: var(--heading-color); margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem; }
dd { color: var(--text-color); margin-left: 1.5rem; }
dt svg { width: 18px; height: 18px; stroke: var(--icon-color); stroke-width: 1.5; fill: none; flex-shrink: 0; }

ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.25rem;
}
ol.steps li::before {
  content: "0" counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 2rem; height: 2rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

ul.checklist { list-style: none; padding-left: 0; }
ul.checklist li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
}
ul.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.6rem;
  width: 6px; height: 6px;
  background: var(--icon-color);
  border-radius: 50%;
}

details.faq-item {
  border-bottom: 1px solid rgba(128,128,128,0.2);
  padding: 1rem 0;
}
summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform 0.2s;
}
details[open] summary::after { transform: rotate(45deg); }
details[open] summary ~ * { animation: openFade 0.2s ease-out; }
.faq-answer { margin-top: 0.5rem; color: var(--text-color); line-height: 1.7; }

/* ================= Header & Footer ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(128,128,128,0.15);
  padding: 0.75rem 0;
}
.site-header.scrolled { background: rgba(244, 243, 247, 0.95); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.1rem; color: var(--heading-color); }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { font-weight: 500; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--highlight-color); font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0;
  font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-col h4 { color: var(--color-paper); margin-bottom: 1rem; font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--color-accent); }
.copyright { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; opacity: 0.7; }

/* ================= SVG Animation Classes ================= */
.hero-svg { width: 100%; height: auto; max-width: 480px; }
.hero-svg rect, .hero-svg circle, .hero-svg path {
  stroke: var(--icon-color, var(--color-brand));
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-svg .window-bg { fill: var(--surface-bg, var(--color-paper)); opacity: 0.9; }
.hero-svg .node { fill: var(--icon-color, var(--color-brand)); stroke: none; }
.hero-svg .line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }

@keyframes nodePulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes lineDraw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes openFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim-node { animation: nodePulse 4s ease-in-out infinite; }
.anim-line { animation: lineDraw 3s ease-in-out infinite; }
.anim-float { animation: floatSoft 5s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.6s ease-out both; }

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.5s; }
.delay-4 { animation-delay: 0.7s; }
.delay-5 { animation-delay: 0.9s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================= Responsive ================= */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero-layout { flex-direction: column-reverse; }
  h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
}
