:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-accent-deep: #0f766e;
  --color-accent-green: #15803d;
  --color-accent-lime: #84cc16;
  --gradient-brand: linear-gradient(135deg, #0f766e 0%, #15803d 60%, #84cc16 100%);
  --gradient-subtle: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 100%);
  --font-main: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Courier New', monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.1);
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-sm); }
.section { padding: var(--space-xl) 0; position: relative; }
.section-alt { background: var(--gradient-subtle); }

/* Typography */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: var(--space-sm); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--color-text-secondary); max-width: 65ch; }
.mono { font-family: var(--font-mono); font-size: 0.9em; letter-spacing: 0.05em; }

/* Layout Helpers */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.split-section { display: flex; flex-direction: column; gap: var(--space-md); align-items: center; }
.split-section.reverse { flex-direction: column-reverse; }
@media (min-width: 900px) {
  .split-section, .split-section.reverse { flex-direction: row; align-items: stretch; }
  .split-content { flex: 1; }
  .split-visual { flex: 1; min-width: 0; }
}

/* Header & Footer */
.site-header { background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; padding: var(--space-sm) 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: var(--space-xs); font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav { display: flex; gap: var(--space-md); }
.nav a { font-size: 0.95rem; font-weight: 500; transition: color 0.2s; position: relative; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-accent-green); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 0; bottom: -4px; width: 100%; height: 2px; background: var(--color-accent-green); border-radius: 2px; }
.mobile-toggle { display: block; background: none; border: none; cursor: pointer; padding: 8px; }
@media (min-width: 768px) { .mobile-toggle { display: none; } }

.site-footer { background: #0f172a; color: #cbd5e1; padding: var(--space-lg) 0 var(--space-md); margin-top: var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-col h4 { color: #fff; margin-bottom: var(--space-sm); font-size: 1rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--color-accent-lime); }
.copyright { text-align: center; margin-top: var(--space-lg); font-size: 0.85rem; color: #64748b; border-top: 1px solid #1e293b; padding-top: var(--space-md); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.8rem 1.6rem; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; border: none; outline-offset: 2px; }
.btn:focus-visible { outline: 2px solid var(--color-accent-green); }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(21, 128, 61, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(21, 128, 61, 0.4); }
.btn-secondary { background: transparent; border: 2px solid var(--color-accent-deep); color: var(--color-accent-deep); }
.btn-secondary:hover { background: #f0fdf4; }

/* Cards & Components */
.card { background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-md); box-shadow: var(--shadow-card); transition: box-shadow 0.2s, transform 0.2s; border: 1px solid rgba(0,0,0,0.04); }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.icon-wrap { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: #ecfdf5; border-radius: var(--radius-sm); margin-bottom: var(--space-sm); color: var(--color-accent-green); }
.icon-wrap svg { width: 24px; height: 24px; stroke-width: 1.8; }

/* Tables */
.table-wrap { overflow-x: auto; margin: var(--space-md) 0; border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; background: var(--color-surface); font-size: 0.95rem; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid #e2e8f0; }
th { background: #f1f5f9; font-weight: 600; color: var(--color-text-primary); white-space: nowrap; }
td.mono { font-family: var(--font-mono); color: var(--color-accent-deep); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: var(--space-sm); }
details { background: var(--color-surface); border-radius: var(--radius-md); border: 1px solid #e2e8f0; overflow: hidden; transition: box-shadow 0.2s; }
details[open] { box-shadow: var(--shadow-card); }
summary { padding: 1rem 1.5rem; 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.2rem; color: var(--color-accent-green); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
.details-content { padding: 0 1.5rem 1.5rem; color: var(--color-text-secondary); line-height: 1.7; }

/* SVG Containers */
.svg-container { width: 100%; height: auto; max-width: 100%; overflow: visible; }
.svg-illustration { width: 100%; aspect-ratio: 16/9; }

/* Animations */
@keyframes flow-path {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes pulse-node {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes dash-trace {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.anim-flow { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: flow-path 6s linear infinite alternate; }
.anim-pulse { transform-box: fill-box; transform-origin: center; animation: pulse-node 3s ease-in-out infinite; }
.anim-trace { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash-trace 8s linear infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .anim-flow, .anim-pulse, .anim-trace { animation: none !important; }
}
