:root {
  color-scheme: dark;
  --ink: #f4f7fb;
  --muted: #aebbd0;
  --surface: #151c2b;
  --surface-raised: #202b3e;
  --line: #34435d;
  --accent: #7fd8ff;
  --warm: #ffb35c;
  --danger: #ff7998;
  --success: #89e2a6;
  background: #0b1020;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at top, #1b2945 0, #0b1020 55%);
}

a {
  color: var(--accent);
}

header {
  border-bottom: 1px solid var(--line);
  background: rgb(11 16 32 / 82%);
  backdrop-filter: blur(14px);
}

.nav,
main {
  width: min(1100px, calc(100% - 32px));
  margin: auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
}

.brand {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
}

main {
  padding: 50px 0 80px;
}

.hero {
  padding: 50px 0;
}

h1,
h2,
h3 {
  line-height: 1.1;
}

h1 {
  margin: 0 0 18px;
  max-width: 850px;
  font-size: clamp(2.3rem, 7vw, 5.2rem);
}

h2 {
  margin-top: 58px;
}

p,
li {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lede {
  max-width: 760px;
  font-size: 1.15rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(155deg, rgb(32 43 62 / 92%), rgb(17 24 39 / 92%));
  padding: 22px;
}

.card h3,
.panel h2,
.panel h3 {
  margin-top: 0;
}

.card a {
  font-weight: 700;
}

.formula,
pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #0a0f1c;
  color: #d5e8ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr);
  gap: 20px;
}

.demo-canvas {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #07101c;
}

.controls {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #111a2c;
  color: var(--ink);
  font: inherit;
}

button {
  cursor: pointer;
  border-color: #4a83a9;
  background: #174568;
  font-weight: 700;
}

button:hover {
  background: #1f5b88;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgb(52 67 93 / 65%);
  color: var(--muted);
}

.metric strong {
  color: var(--ink);
}

.bar {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #0a0f1c;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 120ms linear;
}

.log {
  min-height: 90px;
  margin: 0;
  color: #d5e8ff;
  white-space: pre-wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
}

footer {
  border-top: 1px solid var(--line);
  padding: 30px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .nav {
    padding: 12px 0;
  }

  .demo-layout {
    grid-template-columns: 1fr;
  }

  .demo-canvas {
    min-height: 280px;
  }
}
