:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #172033;
  --muted: #667085;
  --bg: #f7f9fc;
  --card: #ffffff;
  --border: #e5e7eb;
  --success: #15803d;
  --danger: #b91c1c;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

/* Header */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Hero */

.hero {
  padding: 70px 0 55px;
  text-align: center;
  background: linear-gradient(180deg, #eff6ff 0%, #f7f9fc 100%);
}

.hero h1 {
  margin: 0 auto 16px;
  max-width: 850px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.1;
  letter-spacing: -1px;
}

.hero p {
  max-width: 720px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-primary {
  color: #ffffff;
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

/* Sections */

.section {
  padding: 55px 0;
}

.section-title {
  margin: 0 0 10px;
  text-align: center;
  font-size: 32px;
}

.section-subtitle {
  max-width: 700px;
  margin: 0 auto 30px;
  text-align: center;
  color: var(--muted);
}

/* Cards */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card,
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.tool-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
}

.tool-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.tool-card p {
  color: var(--muted);
  margin-top: 0;
}

.tool-card .btn {
  margin-top: 8px;
}

/* Calculator */

.tool {
  max-width: 820px;
  margin: 45px auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.tool h1 {
  margin-top: 0;
  font-size: 34px;
}

.tool-intro {
  color: var(--muted);
}

.formgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 25px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-weight: 700;
  font-size: 14px;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 16px;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--primary);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Results */

.result {
  margin-top: 25px;
  padding: 20px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.result.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.result.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

.result h3 {
  margin-top: 0;
}

.result-value {
  font-size: 30px;
  font-weight: 800;
  margin: 8px 0;
}

.note {
  margin-top: 18px;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 9px;
  color: #713f12;
  font-size: 14px;
}

/* Ad placeholder */

.adbox {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px auto;
  padding: 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #94a3b8;
  background: #ffffff;
  font-size: 13px;
}

/* Footer */

.site-footer {
  margin-top: 50px;
  padding: 35px 0;
  background: #111827;
  color: #d1d5db;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: #ffffff;
}

/* Responsive */

@media (max-width: 850px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    gap: 12px;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 22px, 1120px);
  }

  .nav {
    min-height: 60px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 50px 0 40px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero p {
    font-size: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .formgrid {
    grid-template-columns: 1fr;
  }

  .tool {
    padding: 20px;
    margin: 25px auto;
  }

  .tool h1 {
    font-size: 28px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}