
:root {
  color-scheme: light;
  --bg: #f7f8ff;
  --surface: #ffffff;
  --surface-2: #f0f1ff;
  --text: #20213a;
  --muted: #74758d;
  --border: #e5e6f2;
  --primary: #6958e8;
  --primary-hover: #5544d1;
  --shadow: 0 12px 35px rgba(39, 35, 90, 0.08);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141522;
  --surface: #202235;
  --surface-2: #292c43;
  --text: #f4f3ff;
  --muted: #b1b2ca;
  --border: #383b54;
  --primary: #a394ff;
  --primary-hover: #b4a8ff;
  --shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button {
  cursor: pointer;
}

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

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 850;
  letter-spacing: -1px;
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-links a:hover {
  color: var(--primary);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 13px;
}

.hero {
  position: relative;
  overflow: hidden;
  margin: 30px 0 42px;
  padding: 70px 35px;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(125deg, #6958e8, #a15de8 55%, #ee82bd);
  color: white;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.hero::before {
  width: 240px;
  height: 240px;
  top: -120px;
  left: -60px;
}

.hero::after {
  width: 300px;
  height: 300px;
  bottom: -190px;
  right: -70px;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 720px;
  margin: 0 auto 15px;
  font-size: clamp(2.2rem, 6vw, 3.7rem);
  line-height: 1.12;
  letter-spacing: -2px;
}

.hero p {
  max-width: 560px;
  margin: 0 auto 25px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
}

.search-box {
  display: block;
  width: min(470px, 100%);
  margin: 0 auto;
  padding: 15px 19px;
  border: 0;
  border-radius: 14px;
  outline: none;
  background: white;
  color: #20213a;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.section-heading {
  margin: 40px 0 20px;
}

.section-heading h2 {
  margin: 0 0 5px;
  font-size: 1.65rem;
  letter-spacing: -0.6px;
}

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

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

.tool-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.tool-icon {
  display: grid;
  width: 49px;
  height: 49px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 15px;
  background: var(--surface-2);
  font-size: 1.5rem;
}

.tool-card h3 {
  margin: 0 0 7px;
  font-size: 1.12rem;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.tool-layout {
  max-width: 720px;
  margin: 45px auto 70px;
}

.tool-panel {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  letter-spacing: -1px;
}

.tool-description {
  margin: 0 0 25px;
  color: var(--muted);
}

.field {
  display: block;
  margin: 17px 0;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 650;
  font-size: 0.94rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--bg);
  color: var(--text);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(105, 88, 232, 0.12);
}

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

.primary-button {
  width: 100%;
  margin-top: 10px;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-weight: 750;
  transition: background 0.2s;
}

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

.result {
  display: none;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.result.show {
  display: block;
}

.result strong {
  color: var(--primary);
  font-size: 1.35rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.stat {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-2);
}

.stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--primary);
}

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

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--primary);
  font-weight: 650;
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--primary);
}

@media (max-width: 760px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 55px 20px;
  }
}

@media (max-width: 520px) {
  .nav-links {
    gap: 12px;
    font-size: 0.85rem;
  }

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

  .tool-panel {
    padding: 22px 17px;
  }

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