:root {
  color-scheme: light;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: #f6f0e7;
  color: #1f1b16;
  --ink: #1f1b16;
  --muted: #5b554b;
  --accent: #f97316;
  --accent-2: #0ea5a4;
  --accent-3: #f59e0b;
  --card: #fffdfa;
  --stroke: rgba(31, 27, 22, 0.08);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.12), transparent 45%),
    radial-gradient(circle at top right, rgba(14, 165, 164, 0.12), transparent 50%),
    linear-gradient(180deg, #f6f0e7 0%, #fdfbf7 70%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: -10% -5%;
  background: radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.08), transparent 35%),
    radial-gradient(circle at 80% 15%, rgba(14, 165, 164, 0.08), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(245, 158, 11, 0.08), transparent 45%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.4rem, 3.4vw, 3.4rem);
  line-height: 1.1;
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.subtitle {
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 520px;
}

.hero-meta {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 560px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.range-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--card);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.range-form label {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.range-form input {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  background: #fff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(249, 115, 22, 0.25);
}

.button.secondary {
  background: rgba(31, 27, 22, 0.06);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--stroke);
}

.button.secondary:hover {
  transform: translateY(-1px);
}

.button:hover {
  transform: translateY(-1px);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 8px;
}

.card span {
  font-size: 0.85rem;
  color: var(--muted);
}

.card small {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.card.accent::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), transparent 55%);
  pointer-events: none;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.chart-card {
  grid-column: span 3;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  padding: 16px 18px 22px;
  box-shadow: var(--shadow);
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.chart-card.wide {
  grid-column: span 4;
}

.chart-card.tall {
  grid-column: span 2;
}

.chart-card.full {
  grid-column: span 6;
}

.chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
}

.title-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(31, 27, 22, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  user-select: none;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 27, 22, 0.92);
  color: #fffdfa;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.tooltip:hover::after,
.tooltip:focus::after,
.tooltip:focus-visible::after {
  opacity: 1;
}

.chart-title span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chart-area {
  position: relative;
  width: 100%;
  height: 220px;
}

.chart-card.wide .chart-area {
  height: 260px;
}

.chart-card.tall .chart-area {
  height: 240px;
}

.chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.list-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.list-card ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.list-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(31, 27, 22, 0.04);
}

.list-card strong {
  font-size: 0.95rem;
}

.list-card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.table {
  overflow-x: auto;
}

.table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 27, 22, 0.08);
  font-size: 0.92rem;
}

.table th {
  background: rgba(31, 27, 22, 0.04);
  font-weight: 600;
  color: #352f27;
}

.table a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.table a:hover {
  text-decoration: underline;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr:nth-child(even) td {
  background: rgba(31, 27, 22, 0.015);
}

.table tbody tr:hover td {
  background: rgba(31, 27, 22, 0.03);
}

.mono {
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  font-size: 0.85rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 164, 0.12);
  color: var(--accent-2);
  font-weight: 600;
  font-size: 0.75rem;
}

[data-animate] {
  opacity: 0;
  animation: rise 0.6s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(14, 165, 164, 0.55);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    animation: none;
    opacity: 1;
  }

  .button {
    transition: none;
  }
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    align-items: flex-start;
  }

  .hero-links {
    justify-content: flex-start;
  }

  .chart-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .chart-card,
  .chart-card.wide,
  .chart-card.tall,
  .chart-card.full {
    grid-column: span 1;
  }
}

@media (max-width: 680px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
