/* CalcHub — Clean, Minimal, Fast */
:root {
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.08);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Top Bar */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: 1.4rem; font-weight: 700; color: var(--text); text-decoration: none;
}
.logo span { color: var(--accent); }
.topbar-nav { display: flex; gap: 24px; }
.topbar-nav a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.9rem; font-weight: 500; transition: color .2s;
}
.topbar-nav a:hover { color: var(--text); }

/* Hero */
.hero {
  text-align: center; padding: 60px 24px 40px;
  max-width: 700px; margin: 0 auto;
}
.hero h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; }
.hero p { color: var(--text-secondary); font-size: 1.15rem; }

/* Calculator Grid */
.calc-grid {
  max-width: 1200px; margin: 0 auto; padding: 0 24px 40px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

/* Card */
.calc-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); transition: box-shadow .2s;
}
.calc-card:hover { box-shadow: var(--shadow-lg); }
.calc-icon { font-size: 2rem; margin-bottom: 12px; }
.calc-card h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.calc-card > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 18px; }

/* Form */
.calc-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.field input, .field select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; font-family: inherit; transition: border-color .2s;
  background: #fff;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.dual-input { display: flex; gap: 8px; }
.dual-input input, .dual-input select { flex: 1; }
.unit-toggle {
  font-size: 0.75rem; color: var(--accent); cursor: pointer; user-select: none;
  align-self: center; white-space: nowrap;
}
.unit-toggle:hover { text-decoration: underline; }

button {
  padding: 12px 20px; background: var(--accent); color: #fff;
  border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: background .2s; margin-top: 4px;
}
button:hover { background: var(--accent-hover); }

/* Result */
.result {
  margin-top: 8px; padding: 16px; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; font-size: 0.9rem; line-height: 1.7; display: none;
}
.result.show { display: block; }
.result .big { font-size: 1.6rem; font-weight: 800; color: #166534; }
.result .sub { color: #4b5563; font-size: 0.85rem; }

/* Ad Section */
.ad-section { max-width: 1200px; margin: 0 auto 40px; padding: 0 24px; text-align: center; }
.ad-label { font-size: 0.7rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }

/* About */
.about { max-width: 700px; margin: 0 auto 40px; padding: 0 24px; text-align: center; }
.about h2 { font-size: 1.5rem; margin-bottom: 12px; }
.about p { color: var(--text-secondary); }

/* Footer */
footer { text-align: center; padding: 24px; color: var(--text-secondary); font-size: 0.8rem; }
footer a { color: var(--text-secondary); }

/* Responsive */
@media (max-width: 768px) {
  .calc-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
}
