*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --fg: #1c1c22;
  --fg-muted: #71717a;
  --border: #e4e4e7;
  --muted: #f4f4f5;
  --bg: #fafafa;
  --primary: #7D32F5;
  --primary-hover: #6B28E0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'DM Mono', monospace; font-variant-numeric: tabular-nums; }

/* ── Layout ─────────────────────────────────────────────── */
.wrap    { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap-md { max-width: 960px;  margin: 0 auto; padding: 0 16px; }
.wrap-sm { max-width: 768px;  margin: 0 auto; padding: 0 16px; }

/* ── Nav ────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--fg);
}
.nav-logo span { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.875rem; font-weight: 500; color: var(--fg-muted);
  text-decoration: none; transition: color 0.15s;
}
.nav-link:hover { color: var(--fg); }
.nav-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 80px 16px;
  background-color: #f3f0ff;
  background-image: url('/images/hero-bg.webp'), linear-gradient(135deg, #f5f3ff 0%, #ede8ff 40%, #f8f5ff 100%);
  background-size: cover; background-position: center;
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 9999px;
  border: 1px solid rgba(125,50,245,0.3);
  background: rgba(125,50,245,0.08);
  color: var(--primary); font-size: 0.875rem; font-weight: 600;
  margin-bottom: 24px;
}
.hero-badge svg { width: 16px; height: 16px; flex-shrink: 0; }
.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 20px; color: var(--fg);
}
.hero h1 span { color: var(--primary); }
.hero p {
  font-size: 1.125rem; color: var(--fg-muted); line-height: 1.6;
  max-width: 580px; margin: 0 auto 32px;
}
.hero-badges {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 20px; font-size: 0.875rem; color: var(--fg-muted);
}
.hero-badges span { display: flex; align-items: center; gap: 6px; }
.hero-badges svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }

/* ── Sections ───────────────────────────────────────────── */
.section-calc { padding: 48px 0; background: #f8f8fc; }
.section-lead { padding: 48px 0; background: white; border-top: 1px solid var(--border); display: none; }
.section-edu  { padding: 48px 0; background: #f8f8fc; border-top: 1px solid var(--border); }
.section-cta  {
  padding: 80px 16px; position: relative; overflow: hidden; text-align: center;
  background-color: #0f0a1e;
  background-image: url('/images/cta-bg.webp'), linear-gradient(135deg, #1a0533 0%, #0f0a1e 100%);
  background-size: cover; background-position: center;
}
footer { background: #1c1c22; padding: 32px 0; }

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: white; border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 24px;
}
.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.card-icon {
  width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-icon svg { width: 20px; height: 20px; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--fg); }
.card-sub    { font-size: 0.75rem; color: var(--fg-muted); margin-top: 1px; }

/* ── Calc grid ──────────────────────────────────────────── */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* ── Mode tabs ──────────────────────────────────────────── */
.mode-tabs {
  display: flex; background: var(--muted); border-radius: 9999px;
  padding: 4px; margin-bottom: 24px; gap: 4px;
}
.mode-tab {
  flex: 1; padding: 8px 6px; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600; border: none;
  cursor: pointer; transition: all 0.2s; background: transparent;
  color: var(--fg-muted); font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  white-space: nowrap;
}
.mode-tab.active { background: white; color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.mode-tab svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── Inputs ─────────────────────────────────────────────── */
.fields  { display: flex; flex-direction: column; gap: 20px; }
.field   { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 0.875rem; font-weight: 600; color: var(--fg);
  display: flex; align-items: center; gap: 6px;
}
.field-label svg { width: 14px; height: 14px; color: var(--fg-muted); flex-shrink: 0; }
.field-wrap { position: relative; }
.field-prefix, .field-suffix {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--fg-muted); font-weight: 500; font-size: 0.875rem;
  pointer-events: none; z-index: 1;
}
.field-prefix { left: 14px; }
.field-suffix { right: 14px; }
.field-hint { font-size: 0.75rem; color: var(--fg-muted); }

input.calc-input {
  width: 100%; height: 48px;
  border: 1px solid var(--border); border-radius: 8px;
  background: transparent; font-size: 1rem;
  font-family: 'DM Mono', monospace;
  color: var(--fg); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  padding: 0 12px;
}
input.calc-input.has-prefix { padding-left: 28px; }
input.calc-input.has-suffix { padding-right: 32px; }
input.calc-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(125,50,245,0.2);
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }

/* ── Quick buttons ──────────────────────────────────────── */
.quick-group { display: flex; flex-direction: column; gap: 8px; }
.quick-label { font-size: 0.75rem; font-weight: 500; color: var(--fg-muted); }
.quick-btns  { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-btn {
  padding: 4px 12px; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600;
  border: 1px solid var(--border);
  background: white; color: var(--fg-muted);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.quick-btn:hover  { border-color: rgba(125,50,245,0.5); color: var(--primary); }
.quick-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Info box ───────────────────────────────────────────── */
.info-box {
  margin-top: 24px; padding: 14px 16px; border-radius: 12px;
  background: rgba(244,244,245,0.6); border: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-start;
}
.info-box svg { width: 16px; height: 16px; color: var(--fg-muted); flex-shrink: 0; margin-top: 2px; }
.info-box-body { font-size: 0.75rem; color: var(--fg-muted); display: flex; flex-direction: column; gap: 4px; }
.info-box-body p { line-height: 1.5; }
.info-box-body strong { color: var(--fg); }
.info-note { font-size: 0.625rem; margin-top: 4px; }

/* ── Results empty ──────────────────────────────────────── */
.r-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 64px 0; text-align: center; opacity: 0.5;
}
.r-empty-icon {
  width: 64px; height: 64px; border-radius: 16px; background: var(--muted);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.r-empty-icon svg { width: 28px; height: 28px; color: #a1a1aa; }
.r-empty p     { font-size: 0.875rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 4px; }
.r-empty small { font-size: 0.75rem; color: #a1a1aa; }

/* ── Results filled ─────────────────────────────────────── */
.r-filled { display: flex; flex-direction: column; gap: 20px; }
.health-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600; border: 1px solid;
}
.health-badge svg { width: 14px; height: 14px; }
.gauge-wrap  { display: flex; justify-content: center; padding: 8px 0; }
.gauge-inner { position: relative; display: flex; flex-direction: column; align-items: center; height: 110px; }
.gauge-arc   { transition: stroke-dashoffset 0.4s ease, stroke 0.3s ease; }
.gauge-value { position: absolute; bottom: 0; text-align: center; width: 100%; }
.gauge-num   { font-family: 'DM Mono', monospace; font-size: 1.875rem; font-weight: 700; }
.gauge-lbl   { font-size: 0.75rem; color: var(--fg-muted); margin-top: 2px; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-card {
  border-radius: 12px; padding: 16px;
  border: 1px solid #f3f4f6; background: rgba(244,244,245,0.4);
}
.result-card.hl { border-color: rgba(125,50,245,0.3); background: rgba(125,50,245,0.05); }
.result-lbl {
  font-size: 0.625rem; font-weight: 500; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px;
}
.result-val { font-family: 'DM Mono', monospace; font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 600; color: var(--fg); }
.result-card.hl .result-val { color: var(--primary); }
.result-sub { font-size: 0.75rem; color: var(--fg-muted); margin-top: 2px; }

.bar-wrap   { display: flex; flex-direction: column; gap: 6px; }
.bar-labels { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 500; color: var(--fg-muted); }
.bar        { height: 12px; border-radius: 9999px; overflow: hidden; background: var(--muted); display: flex; }
.bar-cost   { height: 100%; background: rgba(125,50,245,0.2); transition: width 0.5s ease; }
.bar-profit { height: 100%; transition: width 0.5s ease, background 0.3s ease; }
.bar-pcts   { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--fg-muted); font-family: 'DM Mono', monospace; }

.benchmark {
  padding: 12px; border-radius: 12px;
  background: rgba(125,50,245,0.05); border: 1px solid rgba(125,50,245,0.15);
  font-size: 0.75rem; color: var(--fg-muted); line-height: 1.5;
}
.benchmark strong { color: var(--fg); }

/* ── Lead section ───────────────────────────────────────── */
.lead-box {
  background: linear-gradient(135deg, rgba(125,50,245,0.05), rgba(125,50,245,0.1));
  border-radius: 16px; border: 1px solid rgba(125,50,245,0.2); padding: 40px;
}
.lead-top      { text-align: center; margin-bottom: 32px; }
.lead-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 9999px;
  background: rgba(125,50,245,0.1); color: var(--primary);
  font-size: 0.75rem; font-weight: 600; margin-bottom: 16px;
}
.lead-pill svg { width: 14px; height: 14px; }
.lead-top h2   { font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: 800; margin-bottom: 12px; }
.lead-top p    { font-size: 0.875rem; color: var(--fg-muted); max-width: 480px; margin: 0 auto; line-height: 1.6; }
.lead-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.lead-feature  { display: flex; gap: 12px; padding: 16px; border-radius: 12px; background: white; border: 1px solid rgba(125,50,245,0.15); }
.lead-ficon    { width: 32px; height: 32px; border-radius: 8px; background: rgba(125,50,245,0.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lead-ficon svg  { width: 16px; height: 16px; color: var(--primary); }
.lead-ftitle   { font-size: 0.875rem; font-weight: 600; color: var(--fg); }
.lead-fsub     { font-size: 0.75rem; color: var(--fg-muted); margin-top: 2px; }
.lead-form     { display: flex; flex-direction: column; gap: 16px; }
.lead-row      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lead-field    { display: flex; flex-direction: column; gap: 6px; }
.lead-label    { font-size: 0.875rem; font-weight: 500; color: var(--fg); display: flex; align-items: center; gap: 4px; }
.req           { color: #ef4444; }
.lead-input {
  height: 44px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 12px; font-size: 1rem; font-family: inherit;
  background: white; color: var(--fg); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lead-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(125,50,245,0.2); }
.lead-submit {
  width: 100%; height: 48px; background: #1c1c22; color: white;
  border: none; border-radius: 9999px; font-size: 0.875rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s;
}
.lead-submit:hover { background: #2d2d35; }
.lead-submit svg   { width: 16px; height: 16px; }
.lead-note         { font-size: 0.75rem; text-align: center; color: var(--fg-muted); }

/* ── Education ──────────────────────────────────────────── */
.edu-header    { text-align: center; margin-bottom: 40px; }
.edu-header h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: 800; margin-bottom: 12px; }
.edu-header p  { font-size: 0.9375rem; color: var(--fg-muted); max-width: 560px; margin: 0 auto; line-height: 1.6; }
.edu-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.edu-card      { background: white; border-radius: 16px; border: 1px solid var(--border); padding: 24px 28px; }
.edu-ch        { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.edu-icon      { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.edu-icon svg  { width: 20px; height: 20px; }
.edu-card h3   { font-size: 1.125rem; font-weight: 700; }
.edu-card p    { font-size: 0.875rem; color: var(--fg-muted); line-height: 1.6; margin-bottom: 16px; }
.edu-card strong { color: var(--fg); }
.formula-block { background: var(--muted); border-radius: 12px; padding: 16px; font-family: 'DM Mono', monospace; font-size: 0.875rem; color: var(--fg); line-height: 1.5; }
.edu-ex        { margin-top: 16px; font-size: 0.75rem; color: var(--fg-muted); }
.edu-ex strong { color: var(--fg); }
.insight-box   { margin-top: 24px; padding: 20px; border-radius: 16px; background: #fffbeb; border: 1px solid #fde68a; display: flex; gap: 12px; align-items: flex-start; }
.insight-box svg  { width: 20px; height: 20px; color: #d97706; flex-shrink: 0; margin-top: 2px; }
.insight-title { font-size: 0.875rem; font-weight: 600; color: #78350f; margin-bottom: 4px; }
.insight-text  { font-size: 0.875rem; color: #92400e; line-height: 1.6; }

/* ── CTA ────────────────────────────────────────────────── */
.cta-inner h2 { font-size: clamp(1.875rem, 5vw, 2.5rem); font-weight: 800; color: white; margin-bottom: 16px; letter-spacing: -0.02em; }
.cta-inner p  { font-size: 1rem; color: rgba(255,255,255,0.7); max-width: 480px; margin: 0 auto 32px; line-height: 1.6; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 32px; border-radius: 9999px;
  background: var(--primary); color: white;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: background 0.2s; box-shadow: 0 10px 15px -3px rgba(125,50,245,0.3);
}
.cta-btn:hover { background: var(--primary-hover); }
.cta-btn svg   { width: 16px; height: 16px; }

/* ── Footer ─────────────────────────────────────────────── */
.footer-inner  { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand  { display: flex; align-items: center; gap: 10px; }
.footer-brand span  { color: white; font-weight: 600; font-size: 0.875rem; }
.footer-brand small { color: rgba(255,255,255,0.4); font-size: 0.75rem; margin-left: 4px; }
.footer-copy   { color: rgba(255,255,255,0.4); font-size: 0.75rem; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .calc-grid, .edu-grid            { grid-template-columns: 1fr; }
  .lead-features, .lead-row        { grid-template-columns: 1fr; }
  .hero                            { padding: 60px 16px; }
  .lead-box                        { padding: 24px; }
}
@media (max-width: 480px) {
  .mode-tab { font-size: 0.6875rem; padding: 8px 4px; }
}
