:root {
  --bg-1: #e9f2f8;
  --bg-2: #f9f4eb;
  --ink: #12223a;
  --muted: #42556f;
  --accent: #067a9b;
  --accent-soft: #d6eef4;
  --line: #d2dce6;
  --card: rgba(255, 255, 255, 0.86);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(6, 122, 155, 0.12), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(226, 96, 24, 0.12), transparent 35%),
    linear-gradient(130deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

.app {
  width: min(1120px, 94vw);
  margin: 26px auto 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(3px);
  box-shadow: 0 12px 28px rgba(18, 34, 58, 0.08);
}

.intro {
  padding: 24px 24px 20px;
}

.kicker {
  margin: 0;
  color: #ab2a1e;
  letter-spacing: 0.06em;
  font-weight: 700;
}

h1,
h2 {
  margin: 8px 0 10px;
  font-family: "Noto Serif SC", serif;
}

h1 {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.equations {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #8bb8c8;
  border-radius: 12px;
  background: linear-gradient(180deg, #f2fbfe, #eef8fc);
  font-family: "Noto Serif SC", serif;
}

.chart-wrap {
  grid-row: span 2;
  padding: 14px 14px 10px;
}

#chart {
  width: 100%;
  height: 360px;
}

.metrics {
  margin-top: 8px;
  color: var(--muted);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-weight: 600;
}

.behavior-hint {
  margin: 8px 2px 2px;
  color: #2f5873;
  font-size: 0.95rem;
}

.controls {
  padding: 18px 22px 22px;
}

.controls label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-weight: 600;
}

.controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.buttons {
  margin-top: 16px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, #0a8fb1, #066d8b);
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    grid-row: auto;
  }

  #chart {
    height: 300px;
  }
}
