:root {
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --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: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Contextual theme overrides */
.dark-bg {
  --bg: var(--color-dark);
  --text: var(--color-paper);
  --accent: var(--color-accent);
  --brand: var(--color-accent);
}
.card-on-dark {
  --bg: var(--color-paper);
  --text: var(--color-text);
  --accent: var(--color-accent);
  --brand: var(--color-brand);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
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: 500; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: calc(var(--gap) / 2); }
p { max-width: 38em; margin-bottom: 1em; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.5em;
  color: var(--brand);
}
.hl { color: var(--brand); }

/* Layout Sections */
section { padding: var(--section-y) 0; border-bottom: 1px solid rgba(0,0,0,0.1); }
.dark-bg { background: var(--color-dark); color: var(--color-paper); }
.dark-bg .eyebrow { color: var(--color-accent); }
.dark-bg .hl { color: var(--color-accent); }
.dark-bg section { border-color: rgba(255,255,255,0.1); }

/* Header */
header { position: sticky; top: 0; z-index: 100; background: rgba(247,245,243,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.05); }
.dark-bg header { background: rgba(20,24,56,0.92); border-color: rgba(255,255,255,0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
nav ul { display: flex; gap: var(--gap); }
nav a { font-weight: 500; padding: 0.5em 0; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
nav a:hover, nav a[aria-current="page"] { border-color: var(--brand); }
.dark-bg nav a { color: var(--color-paper); }
.dark-bg nav a:hover, .dark-bg nav a[aria-current="page"] { border-color: var(--color-accent); }

/* Footer */
footer { padding: var(--section-y) 0; border-top: 1px solid rgba(0,0,0,0.1); background: var(--color-dark); color: var(--color-paper); }
.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; transition: opacity 0.2s; }
.footer-grid a:hover { opacity: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.75em 1.5em;
  font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer; transition: transform 0.2s, filter 0.2s, background 0.2s, border-color 0.2s;
  text-align: center; white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); border: none; }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-secondary { background: transparent; color: var(--color-text); border: 2px solid var(--color-text); }
.btn-secondary:hover { background: rgba(0,0,0,0.05); transform: translateY(-1px); }
.dark-bg .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Cards & Panels */
.card {
  background: var(--bg, var(--color-paper));
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.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); }

/* Horizontal Scroll Band */
.scroll-band {
  display: flex; gap: var(--gap); overflow-x: auto; padding-bottom: 1rem;
  scrollbar-width: thin;
}
.scroll-band > * { flex: 0 0 auto; }

/* Table */
table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: var(--gap) 0;
}
th, td {
  padding: 0.75em 1em;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  text-align: left;
}
th { font-weight: 600; }
.dark-bg th, .dark-bg td { border-color: rgba(255,255,255,0.1); }

/* FAQ */
details { margin-bottom: 1em; border: 1px solid rgba(0,0,0,0.1); border-radius: var(--radius-card); overflow: hidden; }
.dark-bg details { border-color: rgba(255,255,255,0.1); }
summary { padding: 1em; 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; font-weight: 400; }
details[open] summary::after { content: "-"; }
details > div { padding: 0 1em 1em; line-height: 1.7; }

/* Timeline/Steps */
.step { display: flex; gap: var(--gap); margin-bottom: var(--gap); align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 48px; height: 48px;
  background: var(--color-accent); color: var(--color-dark);
  font-weight: 700; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-card);
}
.dark-bg .step-num { background: var(--color-accent); color: var(--color-dark); }

/* Feature Pills */
.pill {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.5em 1em; border-radius: 999px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  font-size: 0.9rem; color: var(--color-paper);
}
.pill svg { width: 16px; height: 16px; stroke: var(--color-accent); fill: none; stroke-width: 2; }

/* SVG Animation Classes */
@keyframes starBlink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes lineDash { to { stroke-dashoffset: 0; } }
@keyframes bubbleFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes panelSlide { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.star { animation: starBlink 3.5s infinite ease-in-out; }
.star:nth-child(odd) { animation-delay: 1.2s; }
.line-flow { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: lineDash 4s linear infinite; }
.float-anim { animation: bubbleFloat 4.5s ease-in-out infinite; }
.slide-panel { animation: panelSlide 1.2s ease-out forwards; }

.transform-center { 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) {
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; }
  nav ul { flex-wrap: wrap; justify-content: center; }
  .hero-layout { flex-direction: column; }
  .hero-layout > * { width: 100%; }
  h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); }
}
