:root {
  --bg: #f8fafc;
  --bg-alt: #eef2ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #dbe2ea;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --good-bg: #dcfce7;
  --good-text: #166534;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --bad-bg: #fee2e2;
  --bad-text: #991b1b;
  --neutral-bg: #e2e8f0;
  --neutral-text: #334155;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(219, 226, 234, 0.7);
}

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

.brand {
  font-weight: 800;
  letter-spacing: -0.02em;
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  font-weight: 600;
}

.hero {
  padding: 3.5rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2rem;
  align-items: start;
}

.eyebrow,
.small-label {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.78rem;
}

.hero h1,
.section h2,
.card h2,
.card h3 {
  margin-top: 0;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 58ch;
}

.hero-points {
  padding-left: 1.1rem;
  color: var(--muted);
}

.primary-btn,
.secondary-btn,
.unit-btn {
  appearance: none;
  border: none;
  font: inherit;
  cursor: pointer;
  border-radius: 14px;
  transition: 0.2s ease;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0.95rem 1.2rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.primary-btn:hover { background: var(--accent-dark); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calculator-card {
  padding: 1.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.unit-toggle {
  background: #e2e8f0;
  padding: 0.25rem;
  border-radius: 16px;
  display: inline-flex;
  gap: 0.2rem;
}

.unit-btn {
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
}
.unit-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

label span {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
}

input {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

input:focus {
  outline: 2px solid rgba(37,99,235,0.18);
  border-color: var(--accent);
}

.feedback {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  font-weight: 700;
}
.feedback.good { background: var(--good-bg); color: var(--good-text); }
.feedback.warn { background: var(--warn-bg); color: var(--warn-text); }
.feedback.bad { background: var(--bad-bg); color: var(--bad-text); }
.feedback.neutral { background: var(--neutral-bg); color: var(--neutral-text); }

.results-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: #fbfdff;
}

.result-card p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.result-card strong {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
}

.result-card.emphasis {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.secondary-btn {
  padding: 0.8rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}
.secondary-btn:hover { border-color: #94a3b8; }

.privacy-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.section {
  padding: 1.25rem 0 3rem;
}
.section-light { background: linear-gradient(180deg, #ffffff 0%, var(--bg-alt) 100%); }

.info-grid,
.feature-grid {
  display: grid;
  gap: 1rem;
}

.info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.info-card,
.feature-card,
.faq-item {
  padding: 1.25rem;
}

.narrow { width: min(860px, calc(100% - 2rem)); }

.faq-list {
  display: grid;
  gap: 1rem;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 0 2rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero-grid,
  .info-grid,
  .feature-grid,
  .form-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2rem;
  }
}

@media (max-width: 640px) {
  .nav {
    align-items: start;
    padding: 0.8rem 0;
    flex-direction: column;
  }

  .card-header,
  .actions,
  .footer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn,
  .secondary-btn,
  .unit-toggle {
    width: 100%;
  }

  .unit-toggle {
    justify-content: stretch;
  }

  .unit-btn {
    flex: 1;
  }
}
