:root {
  --bg: #f6f8fb;
  --bg-soft: #ffffff;
  --text: #172033;
  --muted: #657087;
  --primary: #2b67f6;
  --primary-dark: #174bd6;
  --accent: #13bfa6;
  --line: #dfe6f3;
  --shadow: 0 20px 50px rgba(24, 39, 75, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Noto Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(43, 103, 246, 0.14), transparent 32rem),
    radial-gradient(circle at top right, rgba(19, 191, 166, 0.13), transparent 30rem),
    var(--bg);
}

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

button, input, textarea, select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(223, 230, 243, 0.78);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 25px rgba(43, 103, 246, 0.24);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--text);
  background: #eef3ff;
}

.nav-toggle {
  display: none;
  border: 0;
  background: #eef3ff;
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 34px;
  align-items: center;
  padding: 72px 0 48px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

h1, h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(2.45rem, 6vw, 5rem);
  max-width: 900px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.hero-subtitle, .section-title p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.05rem;
}

.hero-subtitle {
  max-width: 680px;
  margin: 24px 0 0;
}

.hero-actions, .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 30px rgba(43, 103, 246, 0.28);
}

.btn.secondary {
  color: var(--primary-dark);
  background: #eaf0ff;
}

.btn.ghost {
  color: var(--muted);
  background: #f1f4f9;
}

.hero-card {
  display: grid;
  gap: 16px;
}

.mini-stat, .app-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(223, 230, 243, 0.92);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.mini-stat {
  position: relative;
  overflow: hidden;
  padding: 26px;
}

.mini-stat::before {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -60px;
  top: -60px;
  border-radius: 50%;
  background: rgba(43, 103, 246, 0.09);
}

.mini-stat span {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--primary-dark);
  background: #eaf0ff;
  border-radius: 16px;
  font-weight: 900;
}

.mini-stat strong {
  display: block;
  margin: 16px 0 8px;
  font-size: 1.3rem;
}

.mini-stat p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tool-section {
  padding: 70px 0;
}

.section-title {
  max-width: 760px;
  margin: 0 0 24px;
}

.app-card {
  padding: 26px;
}

.calculator {
  max-width: 470px;
}

.calc-screen {
  padding: 18px;
  border: 1px solid var(--line);
  background: #101827;
  border-radius: 20px;
  margin-bottom: 14px;
}

.calc-history {
  min-height: 24px;
  color: #94a3b8;
  text-align: right;
  overflow-wrap: anywhere;
}

.calc-display {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  font-weight: 900;
  text-align: right;
}

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

.calc-btn {
  min-height: 68px;
  border: 0;
  border-radius: 18px;
  color: var(--text);
  background: #f1f4f9;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

.calc-btn:hover {
  background: #e8eef8;
}

.calc-btn.utility {
  color: #42526d;
  background: #e5ebf5;
}

.calc-btn.operator {
  color: var(--primary-dark);
  background: #eaf0ff;
}

.calc-btn.equals {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.calc-btn.wide {
  grid-column: span 2;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 9px;
  color: var(--text);
  font-weight: 850;
}

select, .text-input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 14px 15px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

select:focus, .text-input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(43, 103, 246, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

.textarea-label {
  margin-top: 16px;
}

.swap-btn {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 18px;
  background: #eaf0ff;
  color: var(--primary-dark);
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
}

.note {
  color: var(--muted);
  line-height: 1.65;
  margin: 16px 0 0;
  font-size: 0.95rem;
}

.result-box {
  min-height: 120px;
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  background: #101827;
  color: #fff;
  overflow-wrap: anywhere;
}

.result-label {
  margin: 0 0 8px;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#wordResult {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.35;
  font-weight: 900;
}

.site-footer {
  margin-top: 50px;
  background: #101827;
  color: #fff;
}

.footer-inner {
  min-height: 96px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.footer-inner p {
  margin: 0;
  color: #cbd5e1;
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
    border-radius: 20px;
  }

  .nav-links.open {
    display: flex;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

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

  .swap-btn {
    width: 100%;
  }

  .footer-inner {
    padding: 24px 0;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(100% - 22px, 1120px);
  }

  .app-card {
    padding: 18px;
  }

  .calc-btn {
    min-height: 58px;
    border-radius: 15px;
  }

  .tool-section {
    padding: 48px 0;
  }
}
