* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f9fc;
  color: #142033;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: min(1120px, 92%);
  margin: auto;
}

/* ===============================
   HEADER
   =============================== */

.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8edf4;
  z-index: 10;
}

.nav {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 21px;
  font-weight: 800;
}

.brand span {
  font-weight: 500;
}

.nav nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: #526174;
}

/* ===============================
   HERO
   =============================== */

.hero {
  padding: 80px 0 45px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #54708e;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 70px);
  line-height: 1.02;
  margin: 12px 0 20px;
  letter-spacing: -0.04em;
}

.hero p {
  font-size: 18px;
  color: #64748b;
}

.search {
  margin-top: 20px;
  width: min(620px, 100%);
  padding: 16px 18px;
  border: 1px solid #dce4ef;
  border-radius: 14px;
  font-size: 16px;
  outline: none;
  background: #fff;
}

.search:focus {
  border-color: #9db2ca;
}

/* ===============================
   TOOLS
   =============================== */

.tools-section {
  padding: 28px 0;
}

.tools-section h2 {
  font-size: 25px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tool-card {
  display: block;
  background: #fff;
  border: 1px solid #e5eaf1;
  border-radius: 18px;
  padding: 22px;
  min-height: 130px;
  box-shadow: 0 6px 24px rgba(30, 50, 80, 0.04);
  transition: 0.18s;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #b9c8da;
}

.tool-card b {
  display: block;
  font-size: 17px;
  margin-bottom: 9px;
}

.tool-card span {
  display: block;
  color: #6b7a8c;
  font-size: 14px;
  line-height: 1.5;
}

.tool-card input,
.tool-card textarea {
  font: inherit;
}

.tool-card button {
  padding: 10px 15px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

/* ===============================
   TOOL PAGE
   =============================== */

.back-link {
  display: inline-block;
  margin-top: 45px;
  margin-bottom: 20px;
  color: #142033;
  font-size: 15px;
}

.tool-header {
  margin-bottom: 25px;
}

.tool-header h1 {
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.02;
  margin: 12px 0 18px;
  letter-spacing: -0.04em;
}

.tool-header p {
  margin: 0;
  font-size: 18px;
  color: #64748b;
}

/* ===============================
   TOOL FORM
   =============================== */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: #142033;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #8da4bf;
  box-shadow: 0 0 0 3px rgba(84, 112, 142, 0.08);
}

/* ===============================
   BUTTON
   =============================== */

.tool-card button {
  background: #142033;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  border: 0;
  transition: 0.18s;
}

.tool-card button:hover {
  opacity: 0.9;
}

.tool-card button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===============================
   AGE CALCULATOR
   =============================== */

.age-calculator-card {
  max-width: 850px;
}

.date-section {
  margin-bottom: 22px;
}

.date-section > label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.date-selects {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 10px;
}

.date-selects select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #142033;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  outline: none;
}

.date-selects select:focus {
  border-color: #8da4bf;
  box-shadow: 0 0 0 3px rgba(84, 112, 142, 0.08);
}

.age-result {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.age-number {
  flex: 1;
  min-width: 110px;
  padding: 20px 14px;
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
  border: 1px solid #dbe3ee;
}

.age-number span {
  display: block;
  font-size: 34px;
  font-weight: 750;
  line-height: 1.1;
}

.age-number small {
  display: block;
  margin-top: 7px;
  font-size: 14px;
  color: #64748b;
}

.result-box {
  margin-top: 25px;
  padding: 24px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #f8fafc;
}

.result-box h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.result-box p {
  margin-bottom: 0;
  color: #526174;
  line-height: 1.6;
}

/* ===============================
   ERROR
   =============================== */

.error-message {
  margin-top: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 14px;
}

/* ===============================
   FOOTER
   =============================== */

footer {
  margin-top: 50px;
  padding: 30px 0;
  border-top: 1px solid #e5eaf1;
  color: #718096;
  font-size: 13px;
}

/* ===============================
   TABLET
   =============================== */

@media (max-width: 800px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav nav {
    display: none;
  }

  .hero {
    padding-top: 60px;
  }
}

/* ===============================
   MOBILE
   =============================== */

@media (max-width: 480px) {
  .container {
    width: 90%;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 50px;
  }

  .hero h1,
  .tool-header h1 {
    font-size: 42px;
  }

  .age-result {
    flex-direction: column;
  }

  .age-number {
    min-width: 100%;
  }

  .result-box {
    padding: 18px;
  }
}
@media (max-width: 600px) {

  .date-selects {
    grid-template-columns: 1fr;
  }

  .age-result {
    flex-direction: column;
  }

  .age-number {
    min-width: 100%;
  }

}