:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5b6070;
  --line: #e3e6ee;
  --brand: #2f5fd6;
  --brand-strong: #224bb4;
  --brand-soft: #e8eefc;
  --teal: #13a3a0;
  --amber: #f0a020;
  --wf-up: #f4a5a5;
  --wf-up-stroke: #d77474;
  --wf-down: #a6dcb1;
  --wf-down-stroke: #5fae6e;
  --wf-total: #9db4ec;
  --wf-total-stroke: #2f5fd6;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 8px 24px rgba(20, 30, 60, .08);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --bg-alt: #151a23;
    --surface: #1a202b;
    --text: #eceef3;
    --muted: #a3a9b8;
    --line: #2a3140;
    --brand: #7fa2ff;
    --brand-strong: #a3bcff;
    --brand-soft: #1e2a47;
    --teal: #3cc8c4;
    --wf-up: #e99a9a;
    --wf-up-stroke: #f2b8b8;
    --wf-down: #94cfa0;
    --wf-down-stroke: #b5e2bf;
    --wf-total: #3d5aa8;
    --wf-total-stroke: #7fa2ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); letter-spacing: -.02em; max-width: 24ch; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; }
.brand-small { font-size: 1rem; gap: 8px; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--text); }
@media (max-width: 720px) { .nav a:not(.btn) { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px; border-radius: 10px;
  background: var(--brand); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 1rem; border: 1px solid transparent;
  transition: background .15s ease, transform .15s ease;
}
@media (prefers-color-scheme: dark) { .btn { color: #0f1218; } }
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.btn-small { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-light { background: #fff; color: #1d3f9a; }
.btn-light:hover { background: #e8eefc; }

/* Hero */
.hero { padding: 64px 0 72px; background: radial-gradient(1200px 500px at 85% -10%, var(--brand-soft), transparent 70%); }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 56px; } .hero { padding: 96px 0 104px; } }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-card {
  margin: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px 16px;
}
.card-head { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.hero-card figcaption { color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.hero-card figcaption strong { color: var(--text); }

.waterfall { width: 100%; height: auto; }
.wf-grid line { stroke: var(--line); stroke-width: 1.5; }
.wf-link line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.wf-total { fill: var(--wf-total); stroke: var(--wf-total-stroke); stroke-width: 1.2; }
.wf-up { fill: var(--wf-up); stroke: var(--wf-up-stroke); stroke-width: 1.2; }
.wf-down { fill: var(--wf-down); stroke: var(--wf-down-stroke); stroke-width: 1.2; }
.wf-val text { fill: var(--text); font: 600 12px var(--font); text-anchor: middle; }
.wf-lab text { fill: var(--muted); font: 500 11.5px var(--font); text-anchor: middle; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (min-width: 960px) { .section { padding: 96px 0; } }
.section-lede { color: var(--muted); font-size: 1.08rem; max-width: 68ch; margin-bottom: 40px; }

.cards { display: grid; gap: 20px; }
@media (min-width: 760px) { .cards.three { grid-template-columns: repeat(3, 1fr); } .cards.two { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards.two { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card p, .feature p, .step p { color: var(--muted); margin: 0; font-size: .98rem; }
.card-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; margin-bottom: 16px; }
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cards.two { margin-top: 32px; }
.feature { padding: 4px 0 4px 18px; border-left: 3px solid var(--teal); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: none; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 14px; }
@media (prefers-color-scheme: dark) { .step-num { color: #0f1218; } }

/* Modules */
.modules { display: grid; gap: 32px; margin-top: 32px; }
@media (min-width: 860px) { .modules { grid-template-columns: 1fr 1fr; gap: 48px; } }
.mod-head { margin-bottom: 16px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }
.tag-now { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.tag-next { background: color-mix(in srgb, var(--amber) 18%, transparent); color: #a86a00; }
@media (prefers-color-scheme: dark) { .tag-next { color: var(--amber); } }
.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-list li { padding: 16px 0; border-top: 1px solid var(--line); }
.mod-list li:last-child { border-bottom: 1px solid var(--line); }
.mod-list strong { display: block; margin-bottom: 2px; }
.mod-list span { color: var(--muted); font-size: .96rem; }

/* CTA */
.cta-band {
  background: linear-gradient(135deg, #2f5fd6, #1d3f9a); color: #fff;
  border-radius: 20px; padding: 40px 24px; display: grid; gap: 28px; align-items: center;
}
@media (min-width: 860px) { .cta-band { grid-template-columns: 1.6fr 1fr; padding: 56px; } }
.cta-band h2 { max-width: 26ch; }
.cta-band p { color: rgba(255, 255, 255, .82); margin: 0; max-width: 56ch; }
.cta-side { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
@media (min-width: 860px) { .cta-side { align-items: flex-end; } }
.cta-mail { color: #fff; opacity: .85; font-size: .95rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-row p { margin: 0; }
.footer-row a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
