/* Base layout */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #222;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

/* Header */
.site-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
}

.top-nav {
  display: flex;
  gap: 0.75rem;
}

.nav-link {
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
  border-color: rgba(0, 0, 0, 0.16);
  background: white;
}

/* Hero Section */
.hero {
  margin-top: 0.5rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 1.75rem;
  padding: 1.4rem 1.2rem 1.6rem;
  background: linear-gradient(135deg, #eef2ff, #f5f7ff);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.hero-text h1 {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
}

.hero-subtitle {
  margin: 0 0 1.1rem;
  color: #4b5563;
}

/* Search Box */
.search-box {
  margin-bottom: 0.8rem;
}

.search-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
}

/* Smart Mode */
.smart-mode {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e5e7eb;
}

.smart-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

.smart-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.3rem;
}

.smart-input {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
}

.btn-primary {
  border: none;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.smart-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
}

/* Hero Side Card */
.hero-side-card {
  background: white;
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid #e5e7eb;
}

.hero-side-card h2 {
  margin-top: 0;
  font-size: 1rem;
}

.hero-side-card ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

/* Sections */
.section {
  margin-top: 2rem;
}

.section-alt {
  background: #f9fafb;
  margin-left: -1rem;
  margin-right: -1rem;
  padding: 1.6rem 1rem 2rem;
}

.section h2 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.section-subtitle {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}

.category-card {
  background: white;
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: #111827;
}

.category-card.soft {
  background: #fdf2ff;
}

.category-card.pro {
  background: #0f172a;
  border-color: #1f2937;
  color: #f9fafb;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.cat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.45rem;
}

.category-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.category-card p {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  color: inherit;
}

.cat-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  color: #4b5563;
}

/* Popular Calculators */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.calculator-card {
  background: white;
  border-radius: 14px;
  padding: 0.9rem;
  border: 1px solid #e5e7eb;
  color: #111827;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calculator-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
  border-color: #bfdbfe;
}

.calculator-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.calculator-card p {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  color: #4b5563;
}

.calc-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  padding: 1.4rem 1rem 1.8rem;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
  background: #f3f4f6;
}

.footer-links a {
  text-decoration: none;
  color: #4b5563;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .top-nav {
    flex-wrap: wrap;
  }
}
