:root {
  --bg: #f6f8fb;
  --bg-alt: #eef2f8;
  --surface: #ffffff;
  --ink: #0d1b2a;
  --ink-2: #40506a;
  --ink-3: #6b7a94;
  --line: #dde4ef;
  --brand: #0b4f9e;
  --brand-2: #1477d8;
  --brand-ink: #073a76;
  --good: #0f8f5e;
  --bad: #c8341f;
  --bad-bg: #fdecea;
  --amber-bg: #fff5e6;
  --amber-line: #f0c987;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.06);
  --shadow: 0 12px 32px rgba(13, 27, 42, 0.1);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1140px, 92vw); margin: 0 auto; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; }
p { margin: 0; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: normal; color: var(--bad); font-weight: 600; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--brand-ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand-2); }
.btn-lg { padding: 0.95rem 1.7rem; font-size: 1.05rem; }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 248, 251, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-ink));
  color: #fff; border-radius: 8px; font-family: var(--mono); font-size: 1.1rem;
}
.brand-name { font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-sub { color: var(--brand-2); }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--brand-ink); text-decoration: none; }
.nav-links .btn { color: var(--brand-ink); }

/* hero */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--brand-ink);
  background: #e3edfb;
  border: 1px solid #cadffb;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 800; }
.lede { margin-top: 1.1rem; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 34ch; }
.hero-copy .lede { max-width: 46ch; }
.hero-cta { display: flex; gap: 0.8rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero-trust {
  margin-top: 1.8rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  color: var(--ink-3); font-size: 0.85rem; align-items: center;
}
.hero-trust .dot { color: var(--line); }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}
.hero-card-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--ink-3); font-family: var(--mono);
}
.tag-live { background: #e3edfb; color: var(--brand-ink); padding: 0.1rem 0.5rem; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.68rem; }
.hero-stat { margin: 1.1rem 0 0.4rem; display: flex; flex-direction: column; }
.hero-stat-label { color: var(--ink-3); font-size: 0.85rem; }
.hero-stat-value { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-mini { display: flex; gap: 1.5rem; margin: 0.4rem 0 1rem; }
.hero-mini div { display: flex; flex-direction: column; }
.hero-mini span { color: var(--ink-3); font-size: 0.78rem; }
.hero-mini strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.hero-alert {
  background: var(--bad-bg);
  border: 1px solid #f4c3bb;
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.hero-alert-title { font-size: 0.8rem; color: var(--bad); font-weight: 600; }
.hero-alert-value { font-size: 1.7rem; font-weight: 800; color: var(--bad); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hero-alert-note { font-size: 0.76rem; color: var(--ink-3); }

/* sections */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { display: block; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 700; color: var(--brand-2); margin-bottom: 0.6rem; }
.section-lede { margin-top: 0.9rem; color: var(--ink-2); font-size: 1.1rem; max-width: 62ch; }

/* problem cards */
.cards { margin-top: 2.2rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.card p { color: var(--ink-2); font-size: 0.98rem; }
.card p + p { margin-top: 0.6rem; }
.card-cite { color: var(--ink-3); font-size: 0.85rem; font-style: italic; }

/* pipeline */
.pipeline { margin-top: 2.2rem; display: flex; align-items: stretch; gap: 0.6rem; flex-wrap: wrap; }
.pipe-step {
  flex: 1 1 180px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow-sm);
  min-width: 170px;
}
.pipe-num {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: #e3edfb; color: var(--brand-ink);
  font-family: var(--mono); font-weight: 600; margin-bottom: 0.7rem;
}
.pipe-step h3 { font-size: 1.02rem; margin-bottom: 0.35rem; }
.pipe-step p { color: var(--ink-2); font-size: 0.9rem; }
.pipe-arrow { align-self: center; color: var(--brand-2); font-size: 1.3rem; font-weight: 700; }

/* demo */
.demo-controls { margin-top: 2rem; display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.control-group { display: flex; gap: 0.7rem; align-items: center; }
.control-inline label { color: var(--ink-2); font-size: 0.92rem; font-weight: 500; }
.upload-btn { cursor: pointer; }
select {
  font-family: var(--sans); font-size: 0.95rem; padding: 0.6rem 0.8rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.csv-hint { margin-top: 0.8rem; color: var(--ink-3); font-size: 0.88rem; }
code { font-family: var(--mono); background: var(--bg-alt); padding: 0.1rem 0.4rem; border-radius: 5px; font-size: 0.85em; }

.demo-status { margin-top: 1rem; min-height: 1.2rem; color: var(--ink-2); font-size: 0.92rem; font-family: var(--mono); }
.demo-status.error { color: var(--bad); }

.demo-output { margin-top: 1.5rem; }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.25rem;
}
.kpi-label { color: var(--ink-3); font-size: 0.82rem; }
.kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--ink-3); font-size: 0.78rem; }
.kpi-alert { background: var(--bad-bg); border-color: #f4c3bb; }
.kpi-alert .kpi-label { color: var(--bad); font-weight: 600; }
.kpi-alert .kpi-value { color: var(--bad); }

.demo-cols { margin-top: 1rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm);
  margin-top: 1rem;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.panel-head h3 { font-size: 1.1rem; }
.panel-tag { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-ink); background: #e3edfb; padding: 0.2rem 0.55rem; border-radius: 6px; }

/* chart */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.bar { fill: var(--brand-2); transition: fill 0.12s; }
.bar:hover { fill: var(--brand-ink); }
.axis-label { fill: var(--ink-3); font-size: 10px; font-family: var(--mono); }
.grid-line { stroke: var(--line); stroke-width: 1; }

/* vat panel */
.panel-vat { display: flex; flex-direction: column; }
.vat-rows { display: flex; flex-direction: column; }
.vat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.7rem 0; border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.vat-row span { color: var(--ink-2); }
.vat-row strong { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.num-bad { color: var(--bad); }
.num-good { color: var(--good); }
.vat-row-gap { border-bottom: none; margin-top: 0.4rem; padding-top: 0.9rem; border-top: 2px solid var(--ink); }
.vat-row-gap span { color: var(--ink); font-weight: 700; }
.vat-row-gap strong { font-size: 1.5rem; color: var(--bad); font-weight: 800; }
.vat-note { margin-top: 0.9rem; font-size: 0.85rem; color: var(--ink-3); background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 8px; padding: 0.7rem 0.8rem; }

/* exports */
.exports-lede { color: var(--ink-2); font-size: 0.95rem; margin-bottom: 1rem; }
.exports { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.export-card {
  text-align: left; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem;
  transition: border-color 0.15s, transform 0.06s, box-shadow 0.15s; font-family: var(--sans);
}
.export-card:hover { border-color: var(--brand-2); box-shadow: var(--shadow-sm); }
.export-card:active { transform: translateY(1px); }
.export-icon { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: #fff; background: var(--brand); align-self: flex-start; padding: 0.15rem 0.5rem; border-radius: 6px; letter-spacing: 0.05em; }
.export-title { font-weight: 700; color: var(--ink); font-size: 1rem; }
.export-desc { color: var(--ink-3); font-size: 0.85rem; }

.preview { margin-top: 1.3rem; }
.preview summary { cursor: pointer; color: var(--brand-2); font-weight: 600; font-size: 0.92rem; }
.table-scroll { overflow-x: auto; margin-top: 0.8rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-family: var(--mono); }
th, td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-3); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
td { color: var(--ink-2); }
.mono-ellipsis { max-width: 180px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

/* pricing */
.tiers { margin-top: 2.2rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.tier {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.tier-featured { border-color: var(--brand-2); box-shadow: var(--shadow); }
.tier-badge { position: absolute; top: -0.7rem; left: 1.6rem; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 999px; letter-spacing: 0.03em; }
.tier h3 { font-size: 1.25rem; }
.tier-price { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.03em; margin: 0.5rem 0 0.2rem; }
.tier-price span { font-size: 1rem; font-weight: 500; color: var(--ink-3); }
.tier-for { color: var(--ink-2); font-size: 0.92rem; min-height: 2.6em; }
.tier ul { list-style: none; padding: 0; margin: 1.1rem 0 1.6rem; display: flex; flex-direction: column; gap: 0.55rem; }
.tier li { position: relative; padding-left: 1.5rem; color: var(--ink-2); font-size: 0.93rem; }
.tier li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
.tier .btn { margin-top: auto; }

/* contact */
.contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; align-items: center; }
.contact-cta { display: flex; flex-direction: column; gap: 0.9rem; align-items: flex-start; }
.contact-note { color: var(--ink-3); font-size: 0.9rem; }

/* footer */
.site-footer { background: var(--ink); color: #c4d0e0; padding: 2.5rem 0; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; }
.site-footer .brand { color: #fff; }
.site-footer .brand-sub { color: #6db0f5; }
.footer-tag { margin-top: 0.6rem; color: #8ea3bd; font-size: 0.92rem; }
.footer-disclaimer { text-align: right; font-size: 0.85rem; color: #8ea3bd; }
.footer-disclaimer p:first-child { color: #f0c987; font-weight: 600; }

/* responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { order: -1; }
  .cards { grid-template-columns: 1fr; }
  .demo-cols { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .exports { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .pipe-arrow { display: none; }
  .footer-disclaimer { text-align: left; }
}
@media (max-width: 560px) {
  .nav-links a:not(.btn) { display: none; }
  .kpis { grid-template-columns: 1fr; }
  .demo-controls { flex-direction: column; align-items: stretch; }
}
