:root {
  color-scheme: light;
  --bg: #eef6f4;
  --bg-2: #f7fbff;
  --text: #102433;
  --muted: #5b7283;
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(92, 123, 147, 0.18);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --accent: #1f6f8b;
  --accent-2: #159a7a;
  --accent-soft: rgba(31, 111, 139, 0.12);
  --success: #0f766e;
  --success-soft: rgba(15, 118, 110, 0.12);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.1);
  --surface: #ffffff;
  --surface-2: #f4f8fb;
  --ring: rgba(31, 111, 139, 0.22);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 139, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(21, 154, 122, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

.page-noise,
.decorative-orb {
  position: fixed;
  pointer-events: none;
}

.page-noise {
  inset: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 92%);
}

.decorative-orb {
  z-index: -1;
  border-radius: 9999px;
  filter: blur(28px);
  opacity: 0.22;
}

.orb-one {
  top: 6rem;
  right: -4rem;
  width: 18rem;
  height: 18rem;
  background: rgba(31, 111, 139, 0.12);
}

.orb-two {
  bottom: 8rem;
  left: -5rem;
  width: 20rem;
  height: 20rem;
  background: rgba(21, 154, 122, 0.11);
}

.glass-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-kicker,
.metric-card,
.field-block,
.unit-toggle,
.distance-pill,
.chart-shell,
.field-input,
.age-input,
.distance-input {
  background: var(--surface);
}

.hero-kicker {
  border: 1px solid rgba(92, 123, 147, 0.18);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.hero-kicker span {
  box-shadow: 0 0 0 5px rgba(31, 111, 139, 0.08);
}

.nav-pill {
  border-radius: 9999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #66798a;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav-pill:hover {
  transform: translateY(-1px);
  background: rgba(31, 111, 139, 0.08);
  color: var(--accent);
}

.nav-pill-active {
  background: linear-gradient(135deg, rgba(31, 111, 139, 0.12), rgba(21, 154, 122, 0.12));
  color: #134e61;
}

.metric-card {
  border-radius: 1.5rem;
  border: 1px solid rgba(92, 123, 147, 0.16);
  padding: 1rem;
}

.metric-label,
.field-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #66798a;
}

.metric-value {
  margin-top: 0.45rem;
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #102433;
}

.field-block {
  display: grid;
  gap: 0.7rem;
  padding: 1.05rem;
  border: 1px solid rgba(92, 123, 147, 0.18);
  border-radius: 1.5rem;
}

.field-input,
.age-input,
.distance-input {
  width: 100%;
  border: 1px solid rgba(92, 123, 147, 0.22);
  border-radius: 1rem;
  padding: 1rem 1.05rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #102433;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field-input::placeholder,
.age-input::placeholder,
.distance-input::placeholder {
  color: #97a9b7;
}

.field-input:focus,
.age-input:focus,
.distance-input:focus {
  border-color: rgba(31, 111, 139, 0.44);
  box-shadow: 0 0 0 4px var(--ring);
}

.field-help {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.unit-toggle {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid rgba(92, 123, 147, 0.2);
  border-radius: 9999px;
}

.unit-button {
  border-radius: 9999px;
  padding: 0.78rem 1rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: #66798a;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.unit-button:hover {
  transform: translateY(-1px);
}

.unit-button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 111, 139, 0.18);
}

.distance-pill {
  border: 1px solid rgba(92, 123, 147, 0.2);
  border-radius: 9999px;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 800;
  color: #5f7384;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.distance-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 139, 0.26);
  color: #102433;
}

.distance-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 111, 139, 0.18);
}

.primary-button,
.secondary-button {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 14px 26px rgba(31, 111, 139, 0.18);
}

.secondary-button {
  background: rgba(31, 111, 139, 0.06);
  border: 1px solid rgba(31, 111, 139, 0.18);
  color: #134e61;
}

.secondary-button:hover {
  border-color: rgba(31, 111, 139, 0.3);
  background: rgba(31, 111, 139, 0.1);
}

.heuristic-badge {
  border: 1px solid rgba(92, 123, 147, 0.2);
  background: #edf5f3;
  color: #4d6575;
}

.chart-shell {
  border: 1px solid rgba(92, 123, 147, 0.18);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(31, 111, 139, 0.1), transparent 28%),
    linear-gradient(180deg, #ffffff, #f7fbff);
}

.chart-shell canvas {
  display: block;
  width: 100% !important;
}

#messageBox {
  border: 1px solid rgba(92, 123, 147, 0.18);
  background: #f7fbff;
  color: #42596a;
}

.message-info {
  border-color: rgba(92, 123, 147, 0.18) !important;
  background: #f7fbff !important;
  color: #42596a !important;
}

.message-success {
  border-color: rgba(15, 118, 110, 0.22) !important;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.1), rgba(21, 154, 122, 0.06)) !important;
  color: #0f5f59 !important;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.08);
}

.message-error {
  border-color: rgba(180, 35, 24, 0.18) !important;
  background: linear-gradient(180deg, rgba(180, 35, 24, 0.08), rgba(180, 35, 24, 0.04)) !important;
  color: #8f2418 !important;
}

::selection {
  background: rgba(31, 111, 139, 0.16);
}

@media (max-width: 640px) {
  .field-block {
    padding: 0.95rem;
  }

  .metric-card {
    padding: 0.95rem;
  }
}
