/* BodyCalc Brand Theme — Health Green + Glassmorphism */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0f0d;
  --bg-card: rgba(16, 185, 129, 0.06);
  --bg-input: rgba(16, 185, 129, 0.08);
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.25);
  --accent2: #34d399;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(16, 185, 129, 0.15);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Noise grain overlay */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}

/* Container */
.b-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* Header */
.b-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 15, 13, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.b-header .b-container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.b-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.b-logo-icon { font-size: 1.5rem; }
.b-nav { display: flex; align-items: center; gap: 24px; }
.b-nav a { color: var(--text-dim); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color 0.2s; }
.b-nav a:hover { color: var(--accent); }

/* Main */
.b-main { padding: 40px 0 80px; position: relative; z-index: 1; }

/* Breadcrumb */
.b-bread { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 24px; }
.b-bread a { color: var(--accent); text-decoration: none; }
.b-bread span { color: var(--text-dim); }

/* Hero */
.b-hero { text-align: center; padding: 40px 0 24px; }
.b-hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 12px; }
.b-subtitle { color: var(--text-dim); font-size: 1.0625rem; max-width: 700px; margin: 0 auto; }

/* Tool Tabs — horizontal scroll */
.b-tabs {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 4px; margin-bottom: 32px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.b-tabs::-webkit-scrollbar { height: 4px; }
.b-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.b-tab {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-dim); text-decoration: none;
  font-size: 0.8125rem; font-weight: 500;
  white-space: nowrap; transition: all 0.2s;
}
.b-tab:hover { background: rgba(16, 185, 129, 0.12); color: var(--accent); }
.b-tab-active { background: var(--accent); color: #0a0f0d; border-color: var(--accent); font-weight: 600; }
.b-tab-active:hover { background: var(--accent2); color: #0a0f0d; }
.b-tab-label { display: none; }
@media (min-width: 600px) { .b-tab-label { display: inline; } }

/* Tool Zone */
.b-toolzone {
  background: rgba(16, 185, 129, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow);
}

/* Toggle unit switch */
.b-unit-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px;
  color: var(--accent); cursor: pointer; font-size: 0.8125rem;
  margin-bottom: 16px; transition: all 0.2s;
}
.b-unit-toggle:hover { background: rgba(16, 185, 129, 0.15); }

/* Input group */
.b-input-group { margin-bottom: 16px; }
.b-input-group label {
  display: block; font-size: 0.8125rem; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 500;
}
.b-input-group input, .b-input-group select {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.9375rem; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
}
.b-input-group input:focus, .b-input-group select:focus { border-color: var(--accent); }
.b-input-group select { cursor: pointer; }
.b-input-group select option, select option { background: #111916; color: var(--text); }

/* Row for side-by-side inputs */
.b-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .b-row { grid-template-columns: 1fr; } }

/* Buttons */
.b-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 600; font-family: var(--font);
  border: none; cursor: pointer; transition: all 0.2s;
}
.b-btn-primary { background: var(--accent); color: #0a0f0d; }
.b-btn-primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.b-btn-secondary { background: var(--bg-card); color: var(--accent); border: 1px solid var(--border); }
.b-btn-secondary:hover { background: rgba(16, 185, 129, 0.12); }

/* Result */
.b-result {
  margin-top: 24px; padding: 20px 24px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-md);
}
.b-result-label { font-size: 0.8125rem; color: var(--text-dim); margin-bottom: 4px; }
.b-result-value { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.b-result-desc { font-size: 0.875rem; color: var(--text-dim); margin-top: 4px; }

/* Category badge */
.b-cat { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.b-cat-under { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.b-cat-normal { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.b-cat-over { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.b-cat-obese { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Tool Cards — Bento Grid */
.b-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-top: 40px;
}
.b-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 28px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none; color: var(--text);
  transition: all 0.3s;
}
.b-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px var(--accent-glow);
}
.b-card:nth-child(1) { grid-column: span 2; }
.b-card:nth-child(3) { grid-row: span 2; }
@media (max-width: 768px) {
  .b-card:nth-child(1), .b-card:nth-child(3) { grid-column: span 1; grid-row: span 1; }
}
.b-card-icon { font-size: 2rem; }
.b-card-title { font-size: 1.125rem; font-weight: 700; color: var(--accent); }
.b-card-desc { font-size: 0.8125rem; color: var(--text-dim); line-height: 1.5; }

/* Hero Calc (homepage) */
.b-hero-calc {
  max-width: 500px; margin: 24px auto 0;
}

/* Content/Prose */
.b-content { margin-top: 40px; }
.b-prose { max-width: 100%; }
.b-prose h2 { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin: 32px 0 12px; }
.b-prose h2:first-child { margin-top: 0; }
.b-prose p { margin-bottom: 12px; color: var(--text-dim); font-size: 0.9375rem; line-height: 1.8; }
.b-prose ul { margin: 8px 0 16px 20px; color: var(--text-dim); }
.b-prose li { margin-bottom: 6px; font-size: 0.9375rem; }
.b-prose li::marker { color: var(--accent); }

/* Tips section */
.b-tips { margin-top: 24px; }

/* Language Switcher */
.b-lang-switch {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 6px 10px; font-size: 0.8125rem; font-family: var(--font);
  cursor: pointer; outline: none; transition: border-color 0.2s;
}
.b-lang-switch:focus { border-color: var(--accent); }
.b-lang-switch option {
  background: #111916; color: var(--text);
}

/* Footer */
.b-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0; text-align: center;
  position: relative; z-index: 1;
}
.b-footer-text { color: var(--text-muted); font-size: 0.8125rem; margin-bottom: 12px; }
.b-footer-links { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.b-footer-links a { color: var(--text-dim); text-decoration: none; font-size: 0.8125rem; }
.b-footer-links a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 600px) {
  .b-hero h1 { font-size: 1.75rem; }
  .b-header .b-container { height: 52px; }
  .b-nav { gap: 12px; }
  .b-nav a { font-size: 0.75rem; }
  .b-toolzone { padding: 20px 16px; }
  .b-cards { grid-template-columns: 1fr; gap: 12px; }
}
