:root {
  --bg-0:#f5f7fc;
  --bg-1:#eaf0fb;
  --aur-1:#2563eb;
  --aur-2:#4f46e5;
  --aur-3:#06b6d4;
  --aur-4:#38bdf8;
  --aur-5:#818cf8;
  --glow-a:rgba(79,70,229,.20);
  --glow-b:rgba(6,182,212,.16);
  --glow-c:rgba(37,99,235,.16);
  --accent:#4f46e5;
  --accent-2:#06b6d4;
  --text-hi:#10162b;
  --text-lo:rgba(16,22,43,.62);
  --card-bg:rgba(255,255,255,.62);
  --card-brd:rgba(16,22,43,.10);
  --card-brd-hi:rgba(79,70,229,.45);
  --on-accent:#fff;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; min-height: 100%; scroll-behavior: smooth; }
body {
  position: relative;
  color: var(--text-hi);
  background: var(--bg-0);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(48% 42% at 16% 10%, var(--glow-b), transparent 60%),
    radial-gradient(50% 44% at 86% 12%, var(--glow-a), transparent 62%),
    radial-gradient(64% 58% at 50% 108%, var(--glow-c), transparent 70%);
}

body::after {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  opacity: .34;
  filter: blur(34px);
  background-image:
    repeating-linear-gradient(100deg, var(--bg-0) 0%, var(--bg-0) 7%, transparent 10%, transparent 12%, var(--bg-0) 16%),
    repeating-linear-gradient(100deg, var(--aur-1) 10%, var(--aur-2) 15%, var(--aur-3) 20%, var(--aur-4) 25%, var(--aur-5) 30%);
  background-size: 300% 200%, 200% 120%;
  animation: aurora 60s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 72% 2%, #000 8%, transparent 70%);
          mask-image: radial-gradient(ellipse 80% 80% at 72% 2%, #000 8%, transparent 70%);
}

@keyframes aurora {
  from { background-position: 50% 50%, 50% 50%; }
  to { background-position: 350% 50%, 350% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

a { color: inherit; }
button, select, input { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(245,247,252,.92), rgba(245,247,252,0));
}

.topbar-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border-radius: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-brd);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 24px 70px -44px rgba(30,27,75,.45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #050507;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 19px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.navlinks {
  display: flex;
  gap: 26px;
  align-items: center;
  color: var(--text-lo);
  font-size: 14px;
}

.navlinks a { text-decoration: none; transition: color .25s ease; white-space: nowrap; }
.navlinks a:hover { color: var(--text-hi); }

.page-head {
  padding: 86px 0 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: .30em;
  font-size: 11px;
  font-weight: 700;
}

h1, h2, h3 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: 0;
}

h1 {
  max-width: 880px;
  font-size: clamp(46px, 7vw, 92px);
  line-height: .88;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255,255,255,.7), 0 6px 26px rgba(255,255,255,.55);
}

h2 { font-size: clamp(32px, 4vw, 52px); line-height: .98; }
h3 { font-size: 26px; line-height: 1.05; font-weight: 600; }

.lead {
  margin: 18px 0 0;
  max-width: 760px;
  color: var(--text-lo);
  font-size: 16px;
  line-height: 1.7;
}

.panel {
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-brd);
  border-radius: 1.5rem;
  box-shadow: 0 24px 70px -44px rgba(30,27,75,.45);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  transition: transform .45s cubic-bezier(.22,1,.36,1), border-color .45s, box-shadow .45s, background .45s;
}

.panel:hover {
  border-color: var(--card-brd-hi);
  box-shadow: 0 26px 76px -38px var(--glow-a);
}

.panel.pad { padding: 24px; }

.toolbar {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.control {
  min-height: 44px;
  border: 1px solid var(--card-brd);
  border-radius: 999px;
  background: rgba(255,255,255,.54);
  color: var(--text-hi);
  padding: 0 16px;
  outline: none;
}

.control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.btn, .chip {
  min-height: 44px;
  border: 1px solid var(--card-brd);
  border-radius: 999px;
  background: rgba(255,255,255,.54);
  color: var(--text-hi);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  transition: transform .25s cubic-bezier(.22,1,.36,1), border-color .25s ease, filter .25s ease;
}

.btn.primary,
.chip.active {
  background-color: var(--accent);
  background-image: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,0) 62%);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 14px 36px -16px var(--glow-a);
}

.btn:hover, .chip:hover {
  transform: translateY(-2px);
  border-color: var(--card-brd-hi);
  filter: brightness(1.03);
}

.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }

.kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0 18px;
}

.kpi {
  padding: 26px;
  min-height: 144px;
}

.kpi small {
  display: block;
  color: var(--text-lo);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-weight: 700;
}

.kpi strong {
  display: block;
  margin-top: 15px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 600;
  line-height: .94;
  color: var(--accent);
}

.kpi span {
  display: block;
  margin-top: 10px;
  color: var(--text-lo);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  align-items: start;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.chart-head > * { min-width: 0; }

.chart-head p {
  color: var(--text-lo);
  line-height: 1.6;
  margin: 10px 0 0;
}

.chart-box {
  width: 100%;
  min-height: 330px;
  border-radius: 1.25rem;
  overflow: hidden;
  background: rgba(255,255,255,.30);
  border: 1px solid rgba(16,22,43,.07);
}

.chart-box svg {
  width: 100%;
  height: 330px;
  overflow: visible;
}

.source-note {
  margin-top: 14px;
  color: var(--text-lo);
  font-size: 12px;
  line-height: 1.55;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--card-brd);
  border-radius: 1rem;
  background: rgba(255,255,255,.28);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 13px 15px;
  text-align: left;
  border-bottom: 1px solid var(--card-brd);
  white-space: nowrap;
}

th {
  color: var(--text-lo);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  background: rgba(255,255,255,.26);
}

tr:last-child td { border-bottom: 0; }

.service-strip {
  margin-top: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-card,
.flow-card {
  padding: 24px;
}

.mini-card p,
.flow-meta {
  color: var(--text-lo);
  line-height: 1.6;
  margin: 12px 0 0;
  font-size: 14px;
}

.steps {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.step-num {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 12px;
  box-shadow: 0 14px 32px -18px var(--glow-a);
}

.step p { margin: 7px 0 0; color: var(--text-lo); line-height: 1.48; }

.bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  height: 260px;
  padding: 18px 4px 0;
}

.bar {
  min-width: 0;
  display: grid;
  align-items: end;
  gap: 8px;
}

.bar-fill {
  min-height: 12px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(79,70,229,.10));
}

.bar label {
  color: var(--text-lo);
  text-align: center;
  font-size: 12px;
}

.sim-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field label {
  display: block;
  color: var(--text-lo);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 700;
  margin-bottom: 9px;
}

.field input,
.field select {
  width: 100%;
}

.flow-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.flow-pill {
  min-height: 62px;
  border-radius: 1rem;
  padding: 11px;
  display: grid;
  align-items: center;
  color: var(--text-hi);
  background: rgba(255,255,255,.38);
  border: 1px solid var(--card-brd);
  font-size: 13px;
  line-height: 1.25;
}

.flow-pill strong { color: var(--accent); }

.article {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.article .panel {
  padding: clamp(26px, 5vw, 54px);
}

.article p,
.article li {
  color: var(--text-lo);
  line-height: 1.75;
  font-size: 17px;
}

.article h2 { margin-top: 36px; }

.footer {
  padding: 34px 0 52px;
  color: var(--text-lo);
  font-size: 13px;
}

@media (max-width: 900px) {
  .page-head,
  .dashboard-grid,
  .service-strip,
  .flow-list,
  .sim-controls {
    grid-template-columns: 1fr;
  }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); }
  .topbar { padding-top: 10px; }
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
    border-radius: 1rem;
  }
  .navlinks {
    width: 100%;
    overflow: auto;
    gap: 18px;
    padding-bottom: 2px;
  }
  .page-head { padding-top: 58px; }
  h1 { font-size: clamp(42px, 13vw, 58px); }
  .kpis { grid-template-columns: 1fr; }
  .flow-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-head { flex-direction: column; }
  .panel.pad { padding: 20px; }
  th, td { padding: 9px 8px; white-space: normal; font-size: 12px; }
  th { letter-spacing: .08em; }
}
