@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600&display=swap');

:root {
  --bg-1: #12343b;
  --bg-2: #1d4754;
  --bg-3: #2d545e;
  --accent: #c89666;
  --accent-soft: rgba(200, 150, 102, 0.18);
  --accent-edge: rgba(200, 150, 102, 0.35);
  --text: #f0e9df;
  --text-dim: rgba(240, 233, 223, 0.7);
  --text-muted: rgba(240, 233, 223, 0.5);
  --grid: rgba(240, 233, 223, 0.08);
  --panel: rgba(0, 0, 0, 0.22);
  --panel-edge: rgba(255, 255, 255, 0.06);
  --alert: #d96f5b;
  --cool: #6fb1bc;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Source Sans Pro', Helvetica, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(200,150,102,0.10), transparent),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 60%, var(--bg-3) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: color .2s ease, border-bottom-color .2s ease;
}
a:hover { color: #fff; border-bottom-color: transparent; }
strong, b { color: #fff; font-weight: 400; }

h1, h2, h3, h4 {
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 0.7em;
  line-height: 1.2;
}
h1 { font-size: 2.3rem; }
h2 { font-size: 1.45rem; margin-top: 2.2rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em 1.2em; padding: 0; }
li { margin-bottom: 0.3em; }

code, kbd {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.08em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}

/* ===== Layout ===== */
.shell { max-width: 1180px; margin: 0 auto; padding: 0 1.6rem; }

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(18, 52, 59, 0.78);
  border-bottom: 1px solid var(--panel-edge);
}
header.site .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 1.5rem;
}
.brand {
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #fff;
  border-bottom: none;
}
.brand .dot { color: var(--accent); margin: 0 0.35em; }
nav.primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.1rem;
  font-size: 0.92rem;
}
nav.primary a {
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  padding: 0.2rem 0;
}
nav.primary a:hover { color: #fff; }
nav.primary a.current {
  color: #fff;
  border-bottom-color: var(--accent);
}

footer.site {
  margin-top: 5rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--panel-edge);
  font-size: 0.85rem;
  color: var(--text-muted);
}
footer.site .row { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }

/* ===== Hero ===== */
.hero { padding: 4rem 0 2.5rem; }
.hero .eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  margin-bottom: 0.6rem;
}
.hero h1 { font-size: 3rem; max-width: 18ch; }
.hero .lede {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0.5rem 0 1.6rem;
}
.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.55rem 1.05rem;
  font-size: 0.92rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: #fff;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent);
  letter-spacing: 0.02em;
}
.btn:hover { background: var(--accent); color: var(--bg-1); border-bottom-color: var(--accent); }
.btn.ghost { background: transparent; }

/* ===== Section / cards ===== */
.page-head {
  padding: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--panel-edge);
  margin-bottom: 2rem;
}
.page-head .eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
}
.page-head h1 { font-size: 2.1rem; margin: 0.3rem 0 0.5rem; }
.page-head .lede { color: var(--text-dim); max-width: 70ch; }

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.6rem;
}
@media (max-width: 880px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 1.1rem 1.2rem;
}
.panel .label {
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}
.panel.note .next { margin-top: 0.6rem; font-size: 0.95rem; }
.panel.note em { color: var(--text-dim); }

/* KPI tiles */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin: 0 0 1.4rem;
}
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-left: 2px solid var(--accent);
  padding: 0.7rem 0.9rem;
  border-radius: 2px;
}
.kpi .l {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.kpi .v {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 300;
  margin-top: 0.18rem;
  line-height: 1.1;
}

/* ===== Controls (native HTML, restyled) ===== */
.controls {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 0.4rem 0 1.2rem;
  align-items: flex-end;
}
.field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 150px; }
.field label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field select, .field input[type="number"], .field input[type="text"] {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 300;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border: 1px solid var(--accent-edge);
  border-radius: 2px;
  padding: 0.45rem 0.6rem;
  min-width: 9rem;
}
.field select:focus, .field input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
}
.field .seg {
  display: inline-flex;
  border: 1px solid var(--accent-edge);
  border-radius: 2px;
  overflow: hidden;
}
.field .seg button {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 300;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-dim);
  border: 0;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}
.field .seg button + button { border-left: 1px solid var(--panel-edge); }
.field .seg button.on { background: var(--accent); color: var(--bg-1); }

/* Range slider, native restyled */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--accent-soft);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 0.6rem 0 0.2rem;
  width: 220px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2px solid var(--bg-1);
  border-radius: 50%;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2px solid var(--bg-1);
  border-radius: 50%;
  cursor: pointer;
}
.range-row { display: flex; align-items: center; gap: 0.8rem; }
.range-row .val {
  font-variant-numeric: tabular-nums;
  color: #fff;
  font-size: 0.95rem;
  min-width: 3ch;
  text-align: right;
}

/* ===== Charts ===== */
.chart {
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 0.8rem;
  min-height: 360px;
}
.chart .vega-embed { width: 100%; }
.chart .vega-embed canvas, .chart .vega-embed svg { max-width: 100%; }

/* ===== Methods strip ===== */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 1.5rem 0 2rem;
}
@media (max-width: 800px) { .method-grid { grid-template-columns: 1fr; } }
.method-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  padding: 1rem 1.1rem;
  border-radius: 3px;
}
.method-card .num {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.method-card h3 { margin: 0.2rem 0 0.4rem; font-size: 1.05rem; }
.method-card p { color: var(--text-dim); font-size: 0.93rem; margin: 0; }
.method-card a.more { font-size: 0.85rem; display: inline-block; margin-top: 0.6rem; }

/* ===== Table ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--panel-edge);
}
th {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
tbody tr:hover { background: rgba(0, 0, 0, 0.18); }

/* ===== Assistant widget ===== */
.assistant {
  margin: 2.5rem 0 1.5rem;
}
.assistant-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.assistant-head h2 { margin: 0; font-size: 1.35rem; }
.demo-badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(217, 111, 91, 0.15);
  color: var(--alert);
  border: 1px solid rgba(217, 111, 91, 0.45);
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
}
.assistant-body {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 1.1rem 1.2rem;
}
.assistant-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.prompt-chip {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 300;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  border: 1px solid var(--accent-edge);
  border-radius: 18px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.prompt-chip:hover {
  background: var(--accent);
  color: var(--bg-1);
  border-color: var(--accent);
}
.prompt-chip.on {
  background: var(--accent);
  color: var(--bg-1);
  border-color: var(--accent);
}
.assistant-conv { display: flex; flex-direction: column; gap: 0.7rem; }
.bubble {
  padding: 0.7rem 0.95rem;
  border-radius: 6px;
  max-width: 92%;
  line-height: 1.55;
  font-size: 0.94rem;
}
.bubble.user {
  align-self: flex-end;
  background: rgba(200, 150, 102, 0.18);
  border: 1px solid var(--accent-edge);
  color: #fff;
}
.bubble.assistant {
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--panel-edge);
  color: var(--text);
  white-space: pre-wrap;
}
.bubble.assistant .who {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.bubble.assistant .cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 1px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { to { opacity: 0; } }
.assistant-footnote {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* tag pills */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--panel-edge);
  border-radius: 2px;
  padding: 0.12rem 0.5rem;
  margin-right: 0.3rem;
}
.tag.alert { color: var(--alert); border-color: rgba(217, 111, 91, 0.45); }
