:root {
  color-scheme: light;
  --bg: #f7f1e8;
  --panel: #fff8f0;
  --ink: #1b1b1f;
  --muted: #6b6b70;
  --accent: #f25c54;
  --accent-2: #1e6f5c;
  --accent-3: #f4b860;
  --stroke: #e2d5c4;
  --shadow: 0 25px 60px rgba(21, 20, 20, 0.12);
  --radius: 22px;
  --font-heading: "Fraunces", serif;
  --font-body: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Performance optimizations */
html {
  scroll-behavior: smooth;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at top left, #f7d9c7, transparent 55%),
    radial-gradient(circle at 20% 20%, #fff3e1, transparent 50%),
    radial-gradient(circle at 80% 10%, #f4b86033, transparent 55%), var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 42px 24px 64px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  margin-bottom: 36px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 12px;
}

h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

.subhead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 520px;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(18, 18, 18, 0.12);
}

.primary {
  background: var(--accent);
  color: #fff8f0;
}

.ghost {
  background: #fffaf4;
  color: var(--ink);
  border: 1px solid var(--stroke);
}

.hero-card {
  background: #ffffffd9;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(6px);
}

.hero-card__title {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.hero-card__value {
  font-size: 2.4rem;
  font-family: var(--font-heading);
  margin: 10px 0 6px;
}

.hero-card__label {
  color: var(--muted);
}

.hero-card__meta {
  margin-top: 10px;
  font-size: 0.95rem;
}

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

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--stroke);
  box-shadow: 0 20px 40px rgba(28, 28, 28, 0.08);
}

.panel h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.panel-note {
  color: var(--muted);
  margin-bottom: 22px;
}

.input-group {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #ecdccc;
  background: #fff;
  margin-bottom: 18px;
}

.input-group h3 {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  font-size: 0.92rem;
  color: var(--muted);
}

.field__control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f9efe2;
  border-radius: 10px;
  padding: 6px 10px;
  border: 1px solid #ead6c0;
}

.field__control span {
  color: var(--muted);
  font-size: 0.85rem;
}

input[type="number"] {
  border: none;
  background: transparent;
  width: 90px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
  text-align: right;
}

.results .kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi {
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #ecdccc;
}

.kpi__label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.kpi__value {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  margin: 8px 0 4px;
}

.kpi__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.verdict {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff, #f9e6d3);
  border: 1px solid #f0d6be;
  margin-bottom: 24px;
}

.verdict__label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted);
}

.verdict__score {
  text-align: center;
  background: #1e6f5c;
  color: #fff;
  border-radius: 18px;
  padding: 16px 10px;
}

.verdict__score span {
  font-size: 2.1rem;
  font-family: var(--font-heading);
  display: block;
}

.chart {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #ecdccc;
  margin-bottom: 22px;
}

.chart__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.chart__bars {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar {
  flex: 1;
  background: #f9efe2;
  border-radius: 999px;
  overflow: hidden;
  height: 14px;
  position: relative;
}

.bar__fill {
  height: 100%;
  border-radius: inherit;
}

.chart__legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.insights {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #ecdccc;
  margin-bottom: 20px;
}

.insights__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.insight {
  padding: 14px;
  border-radius: 14px;
  background: #f9efe2;
}

.assumptions {
  padding: 16px 18px;
  background: #fff;
  border-radius: 16px;
  border: 1px dashed #e5cdb5;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer Styles */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--stroke);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

@media (max-width: 760px) {
  .verdict {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  input[type="number"] {
    width: 70px;
  }

  .site-footer {
    margin-top: 2rem;
    padding: 1.5rem 1rem;
  }
}
