:root {
  --navy: #0b1c2e;
  --navy-2: #12263a;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --paper: #f8fafc;
  --cream: #faf6ee;
  --white: #ffffff;
  --crimson: #c8102e;
  --crimson-dark: #9f0d24;
  --gold: #c9a227;
  --gold-bg: #f5e7b8;
  --ok: #0f766e;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 28, 46, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
a { color: var(--crimson-dark); }
img { max-width: 100%; }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 72px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800; letter-spacing: -0.04em;
}
.brand-name { font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.brand-sub { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
nav a {
  text-decoration: none; color: #334155; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 999px;
}
nav a:hover, nav a[aria-current="page"] { background: #f1f5f9; color: var(--ink); }
.menu-btn {
  display: none; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 8px 10px; font: inherit;
}

.trust-bar {
  background: var(--cream);
  border-bottom: 1px solid #ead9b2;
  font-size: 0.82rem; color: #5b4a22;
}
.trust-bar .wrap { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 0; }
.trust-bar a { color: inherit; }

.hero {
  background: linear-gradient(180deg, #0b1c2e 0%, #13283f 100%);
  color: #fff; padding: 56px 0 48px;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 32px; align-items: start; }
.kicker { color: #cbd5e1; font-size: 0.95rem; margin: 0 0 10px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.12; margin: 0 0 16px; letter-spacing: -0.03em; }
.lede { color: #dbe4ee; font-size: 1.05rem; max-width: 40rem; }
.meta { display: flex; gap: 10px; align-items: center; color: #94a3b8; font-size: 0.88rem; margin: 16px 0; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #1e3a56;
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; color: #fff;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--crimson); color: #fff; text-decoration: none;
  border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 650;
  font-size: 0.98rem; cursor: pointer;
}
.btn:hover { background: var(--crimson-dark); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid #334155; }
.btn-ghost:hover { background: #1e3348; }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.linkish { color: #fecaca; }

.panel {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius); padding: 20px;
}
.panel h2 { margin: 0 0 8px; font-size: 1.05rem; }
.panel p { margin: 0 0 12px; color: #cbd5e1; font-size: 0.92rem; }
.panel.light { background: #f8fafc; color: var(--ink); border-color: transparent; }
.panel.light p { color: var(--muted); }
.steps { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 28px; color: #cbd5e1; font-size: 0.9rem; }
.steps strong { color: #fff; display: block; }
.num {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: #334155; color: #fff; font-size: 0.75rem; margin-right: 6px;
}

.calc-section { padding: 36px 0 56px; }
.calc-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.calc-head { padding: 20px 24px 0; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.calc-form, .calc-out { padding: 20px 24px 28px; }
.calc-out { background: #f8fafc; border-left: 1px solid var(--line); }
label { display: block; font-size: 0.82rem; font-weight: 650; margin: 12px 0 6px; }
input, select {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1;
  border-radius: 8px; font: inherit; background: #fff;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.result-hero { font-size: 2.1rem; font-weight: 750; letter-spacing: -0.03em; margin: 4px 0 2px; }
.result-sub { color: var(--muted); margin-bottom: 16px; }
.bars { display: grid; gap: 8px; margin: 16px 0; }
.bar-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; font-size: 0.88rem; }
.track { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.fill { height: 100%; border-radius: 99px; }
.fill-keep { background: #0f766e; }
.fill-tax { background: #c8102e; }
.fill-ni { background: #b45309; }
.fill-sl { background: #7c3aed; }
.fill-pen { background: #1d4ed8; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); }
.table td:last-child, .table th:last-child { text-align: right; }
.method { font-size: 0.82rem; color: var(--muted); margin-top: 16px; }
.warn {
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 10px; padding: 10px 12px; font-size: 0.82rem; margin-top: 12px;
}

.example {
  background: var(--cream); border: 1px solid #ead9b2;
  border-radius: var(--radius); padding: 18px 20px; margin: 24px 0;
}
.badge {
  display: inline-block; background: var(--gold-bg); color: #6b5208;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 6px;
}

.section { padding: 28px 0 48px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: inherit; display: block;
}
.card:hover { border-color: #94a3b8; }
.card h3 { margin: 8px 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.prose { max-width: 46rem; }
.prose h1 { font-size: 2rem; letter-spacing: -0.03em; }
.prose h2 { margin-top: 1.6em; }
.prose .src { font-size: 0.88rem; color: var(--muted); }

footer {
  background: var(--navy); color: #cbd5e1; padding: 36px 0 28px; font-size: 0.88rem;
}
footer a { color: #fecaca; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
footer h3 { color: #fff; font-size: 0.95rem; margin: 0 0 8px; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin: 6px 0; }
.legal { border-top: 1px solid #1e3348; margin-top: 24px; padding-top: 16px; color: #94a3b8; }

@media (max-width: 860px) {
  .hero-grid, .calc-grid, .cards, .foot-grid, .row-2 { grid-template-columns: 1fr; }
  .calc-out { border-left: 0; border-top: 1px solid var(--line); }
  nav { display: none; }
  nav.open { display: flex; flex-direction: column; position: absolute; right: 16px; top: 72px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-width: 180px; box-shadow: var(--shadow); }
  nav.open a { color: var(--ink); }
  .menu-btn { display: inline-block; }
  .hero { padding: 36px 0; }
}
