:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --text: #18202b;
  --muted: #5f6b7a;
  --line: #d9e2ea;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --accent: #b45309;
  --success: #15803d;
  --danger: #b91c1c;
  --shadow: 0 12px 32px rgba(24, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  background: #102126;
  color: #fff;
  border-bottom: 4px solid var(--primary);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: #fff;
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 20px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 34px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1.06;
  margin: 0 0 18px;
  letter-spacing: 0;
}

.hero p {
  max-width: 760px;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.12rem;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 22px;
}

.hero-panel strong {
  display: block;
  font-size: 2.3rem;
  line-height: 1;
}

.hero-panel span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 6px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}

.button:hover {
  background: var(--primary-dark);
}

.button.secondary {
  background: #fff;
  color: #102126;
  border-color: var(--line);
}

.button.secondary:hover {
  background: var(--surface-soft);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 70px;
}

.section {
  margin-top: 42px;
}

.section:first-child {
  margin-top: 0;
}

.section h2 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.16;
  margin: 0 0 10px;
}

.section-intro {
  max-width: 760px;
  color: var(--muted);
  margin: 0 0 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(24, 32, 43, 0.02);
}

.card:hover {
  border-color: #9bb5c0;
  box-shadow: var(--shadow);
}

.card .tag {
  width: fit-content;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 1.17rem;
  line-height: 1.24;
  margin: 0 0 8px;
}

.card p {
  color: var(--muted);
  margin: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #24404a;
  font-size: 0.82rem;
  font-weight: 750;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.tool h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  margin: 0 0 10px;
}

.tool .lead {
  color: var(--muted);
  margin: 0 0 26px;
  font-size: 1.05rem;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9d5de;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.result {
  display: none;
  margin-top: 20px;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #ecfdf5;
  padding: 18px;
}

.result.show {
  display: block;
}

.result strong.big {
  display: block;
  margin: 4px 0 10px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  color: var(--success);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.metric {
  background: #fff;
  border: 1px solid #c8ead9;
  border-radius: 8px;
  padding: 12px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.metric strong {
  display: block;
  font-size: 1.12rem;
  margin-top: 2px;
}

.content-block {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.content-block h2,
.content-block h3 {
  margin: 0 0 10px;
}

.content-block p,
.content-block li {
  color: var(--muted);
}

.content-block code {
  background: var(--surface-soft);
  border-radius: 6px;
  padding: 2px 6px;
}

.side-list {
  position: sticky;
  top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.side-list h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

.side-list a {
  display: block;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.side-list a:hover {
  color: var(--primary-dark);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 26px 20px;
  text-align: center;
}

.site-footer a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 700;
}

.note {
  border-left: 4px solid var(--accent);
  background: #fff7ed;
  border-radius: 8px;
  padding: 14px 16px;
  color: #6b3b06;
}

@media (max-width: 920px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

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

  .side-list {
    position: static;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-top: 36px;
  }

  .grid,
  .grid.four,
  .form-grid,
  .form-grid.three,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .tool,
  .content-block {
    padding: 18px;
  }
}
