/* =====================================================
   CHIPOTLE CALCULATOR — PREMIUM SAAS DESIGN SYSTEM
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ─── */
:root {
  --primary:        hsl(14, 85%, 52%);
  --primary-dark:   hsl(14, 85%, 42%);
  --primary-light:  hsl(14, 85%, 62%);
  --primary-glow:   hsla(14, 85%, 52%, 0.25);
  --accent:         hsl(38, 95%, 56%);
  --accent-dark:    hsl(38, 95%, 46%);
  --success:        hsl(158, 64%, 45%);
  --warning:        hsl(43, 96%, 56%);
  --danger:         hsl(0, 84%, 60%);

  /* Backgrounds */
  --bg-base:        hsl(220, 20%, 7%);
  --bg-surface:     hsl(220, 16%, 11%);
  --bg-elevated:    hsl(220, 14%, 15%);
  --bg-overlay:     hsl(220, 12%, 20%);
  --bg-glass:       hsla(220, 20%, 100%, 0.04);
  --bg-glass-hover: hsla(220, 20%, 100%, 0.08);

  /* Text */
  --text-primary:   hsl(220, 20%, 97%);
  --text-secondary: hsl(220, 12%, 68%);
  --text-muted:     hsl(220, 10%, 45%);
  --text-inverse:   hsl(220, 20%, 8%);

  /* Borders */
  --border:         hsla(220, 20%, 100%, 0.08);
  --border-strong:  hsla(220, 20%, 100%, 0.15);
  --border-focus:   var(--primary);

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:      0 4px 16px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg:      0 16px 48px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
  --shadow-glow:    0 0 40px var(--primary-glow);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;
  --space-8: 32px;  --space-10: 40px; --space-12: 48px;
  --space-16: 64px; --space-20: 80px; --space-24: 96px;

  /* Typography */
  --font-body:    'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.4, 0, 1, 1);
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
}

/* ─── Reset ─── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
select, input { font-family: inherit; }
ul, ol { list-style: none; }

/* ─── Container ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ─── Header / Nav ─── */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: hsla(220, 20%, 7%, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: var(--space-4);
  position: relative;
}

/* ── Brand / Logo ── */
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
  z-index: 2;
}
.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--primary-glow);
  transition: transform var(--duration-base) var(--ease-out);
}
.nav-brand:hover .nav-brand-icon {
  transform: rotate(-5deg) scale(1.08);
}
.nav-brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-brand-text span {
  color: var(--primary);
}

/* ── Desktop nav links (center) ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links li { margin: 0; }
.nav-links a {
  display: block;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}
.nav-links a.active {
  color: var(--primary-light);
}

/* ── Right side CTA + hamburger ── */
.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  z-index: 2;
}

/* ── Hamburger button ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  cursor: pointer;
  padding: 0;
  transition: background var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
  position: relative;
  flex-shrink: 0;
}
.nav-hamburger:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-strong);
}
/* Three bars inside hamburger */
.nav-hamburger .bar {
  position: absolute;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform var(--duration-base) var(--ease-out),
              opacity var(--duration-fast) var(--ease),
              top var(--duration-base) var(--ease-out);
  left: 50%;
  translate: -50% 0;
}
.nav-hamburger .bar:nth-child(1) { top: 27%; }
.nav-hamburger .bar:nth-child(2) { top: 50%; translate: -50% -50%; }
.nav-hamburger .bar:nth-child(3) { bottom: 27%; top: auto; }

/* Hamburger open (X) state */
.nav-hamburger.is-open .bar:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.nav-hamburger.is-open .bar:nth-child(2) {
  opacity: 0;
  transform: translateX(6px);
}
.nav-hamburger.is-open .bar:nth-child(3) {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) rotate(-45deg);
}

/* ── Mobile nav drawer ── */
.nav-mobile-menu {
  display: none;
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding: var(--space-4) var(--space-4);
  z-index: 999;
  /* slide-down animation applied via js class */
  transform-origin: top;
  box-shadow: var(--shadow-lg);
}
.nav-mobile-menu.is-open {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  animation: menuSlideDown var(--duration-slow) var(--ease-out) both;
}
@keyframes menuSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-mobile-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease);
}
.nav-mobile-menu a:hover,
.nav-mobile-menu a.active {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}
.nav-mobile-menu a.active { color: var(--primary-light); }
.nav-mobile-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}
.nav-mobile-cta {
  display: flex;
  padding: var(--space-2) 0;
}
.nav-mobile-cta a {
  flex: 1;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
  color: white !important;
  font-weight: 700 !important;
  border-radius: var(--radius-md) !important;
}

/* ── Nav backdrop overlay ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 68px;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.nav-overlay.is-open { display: block; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 6px 24px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.btn-lg {
  padding: 14px var(--space-8);
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-full { width: 100%; }

/* ─── Hero Section ─── */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-20) 0 var(--space-12);
  background: var(--bg-base);
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-gradient {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center,
    hsla(14, 85%, 52%, 0.18) 0%,
    hsla(38, 95%, 56%, 0.08) 40%,
    transparent 70%);
  filter: blur(40px);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}
.hero-orb-1, .hero-orb-2 {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: float 8s ease-in-out infinite;
}
.hero-orb-1 {
  width: 400px; height: 400px;
  background: hsla(14, 85%, 52%, 0.12);
  top: -100px; right: -100px;
}
.hero-orb-2 {
  width: 300px; height: 300px;
  background: hsla(38, 95%, 56%, 0.08);
  bottom: -80px; left: -80px;
  animation-delay: 4s;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-20px) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 740px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: var(--space-6);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero-badge-dot {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--primary) 20%, var(--accent) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-8);
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}
.hero-stat .value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.hero-stat .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-weight: 500;
}
.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ─── Calculator Card ─── */
.calculator-wrapper {
  position: relative;
  max-width: 820px;
  margin: 0 auto var(--space-20);
  padding: 0 var(--space-6);
}

#calculator {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.calc-header {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
}
.calc-header-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.calc-header-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: hsla(158, 64%, 45%, 0.12);
  color: var(--success);
  border: 1px solid hsla(158, 64%, 45%, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.calc-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
}

.calc-body {
  padding: var(--space-8);
}

.calc-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.calc-step {
  position: relative;
}
.calc-step-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.calc-step-num {
  width: 20px; height: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.calc-step-label span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calc-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.calc-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.calc-select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Toppings Section */
.calc-toppings-section {
  margin-bottom: var(--space-6);
}
.calc-toppings-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.calc-toppings-label-step {
  width: 20px; height: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: white; flex-shrink: 0;
}

.toppings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-2);
}

.topping-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  user-select: none;
}
.topping-chip:hover {
  border-color: var(--border-strong);
  background: var(--bg-glass-hover);
}
.topping-chip input[type="checkbox"] {
  display: none;
}
.topping-chip-box {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: transparent;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--duration-fast) var(--ease);
}
.topping-chip-box::after {
  content: '';
  width: 8px; height: 8px;
  background: white;
  border-radius: 2px;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--duration-fast) var(--ease);
}
.topping-chip.selected {
  border-color: var(--primary);
  background: hsla(14, 85%, 52%, 0.1);
}
.topping-chip.selected .topping-chip-box {
  background: var(--primary);
  border-color: var(--primary);
}
.topping-chip.selected .topping-chip-box::after {
  opacity: 1;
  transform: scale(1);
}
.topping-chip-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease);
}
.topping-chip.selected .topping-chip-label {
  color: var(--text-primary);
}
.topping-chip-cal {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.topping-chip.selected .topping-chip-cal {
  color: var(--primary-light);
}

/* Calculate Button */
.calc-action {
  margin-top: var(--space-6);
}
.btn-calculate {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary) 0%, hsl(14, 85%, 56%) 50%, var(--accent) 100%);
  background-size: 200% 100%;
  background-position: 0% 0%;
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-calculate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}
.btn-calculate:hover::before { opacity: 1; }
.btn-calculate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--primary-glow);
  background-position: 100% 0%;
}
.btn-calculate:active { transform: translateY(0); }

/* Results Panel */
.results-panel {
  margin-top: var(--space-6);
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideIn var(--duration-slow) var(--ease-out);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.results-header {
  padding: var(--space-4) var(--space-6);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.results-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.results-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.results-calories {
  padding: var(--space-6);
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.calories-number {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
}
.calories-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: var(--space-1);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.results-macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: var(--space-4) var(--space-6);
}
.macro-item {
  text-align: center;
  padding: var(--space-3);
  border-right: 1px solid var(--border);
}
.macro-item:last-child { border-right: none; }
.macro-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.macro-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.macro-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.macro-bar {
  height: 3px;
  border-radius: 2px;
  margin-top: var(--space-2);
  background: var(--bg-glass);
}
.macro-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s var(--ease-out);
}
.macro-protein .macro-bar-fill { background: hsl(220, 80%, 60%); }
.macro-carbs .macro-bar-fill   { background: hsl(38, 95%, 56%); }
.macro-fat .macro-bar-fill     { background: hsl(14, 85%, 52%); }
.macro-sodium .macro-bar-fill  { background: hsl(280, 60%, 65%); }

/* ─── Features Bar ─── */
.features-bar {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.feature-icon {
  width: 44px; height: 44px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.feature-text h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.feature-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── Content Sections ─── */
.content {
  padding: var(--space-20) 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 12px;
  background: hsla(14, 85%, 52%, 0.08);
  border: 1px solid hsla(14, 85%, 52%, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
  line-height: 1.2;
}
.content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  margin-top: var(--space-8);
}
.content p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-4);
  font-size: 0.95rem;
}
.content ul, .content ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
}
.content ul { list-style: disc; }
.content ol { list-style: decimal; }
.content li {
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ─── How to Use Steps ─── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin: var(--space-8) 0;
}
.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  transition: all var(--duration-base) var(--ease);
}
.step-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.step-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: hsla(14, 85%, 52%, 0.15);
  line-height: 1;
  margin-bottom: var(--space-3);
}
.step-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  margin-top: 0;
}
.step-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Examples / Testimonials ─── */
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
  margin: var(--space-8) 0;
}

.example {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--duration-base) var(--ease);
  position: relative;
  overflow: hidden;
}
.example::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease);
}
.example:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.example:hover::before { opacity: 1; }
.example h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}
.example p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}
.example-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: var(--space-4);
  background: hsla(14, 85%, 52%, 0.1);
}

/* ─── Tables ─── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: var(--space-6) 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}
thead {
  background: var(--bg-elevated);
}
thead th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast) var(--ease);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-glass); }
tbody td {
  padding: var(--space-4) var(--space-5);
  font-size: 0.875rem;
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ─── FAQ / Details ─── */
.faq-list {
  margin: var(--space-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

details {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease);
}
details[open] {
  border-color: var(--border-strong);
}
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  user-select: none;
  transition: background var(--duration-fast) var(--ease);
}
summary:hover { background: var(--bg-glass); }
summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 400;
  transition: transform var(--duration-base) var(--ease);
  flex-shrink: 0;
}
details[open] summary::after {
  transform: rotate(45deg);
}
details p {
  padding: 0 var(--space-5) var(--space-5);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Related Links / Tool Cards ─── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--duration-base) var(--ease);
  cursor: pointer;
}
.tool-card:hover {
  border-color: var(--primary);
  background: hsla(14, 85%, 52%, 0.04);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--primary);
}
.tool-card h3 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  font-size: 0.95rem;
}
.tool-card h3 a {
  color: var(--text-primary);
  font-weight: 700;
  transition: color var(--duration-fast) var(--ease);
}
.tool-card:hover h3 a { color: var(--primary-light); }
.tool-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
  line-height: 1.55;
}
.tool-card-arrow {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: var(--space-4);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--duration-fast) var(--ease);
}
.tool-card:hover .tool-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ─── Formula block ─── */
.formula-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-4) 0;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--primary-light);
}

/* ─── Related links list ─── */
.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.related-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
}
.related-link:hover {
  color: var(--primary-light);
  border-color: hsla(14, 85%, 52%, 0.4);
  background: hsla(14, 85%, 52%, 0.06);
}
.related-link::before {
  content: '→';
  color: var(--primary);
  font-weight: 700;
}

/* ─── External links ─── */
.external-links {
  margin: var(--space-8) 0;
}
.external-links p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}
.external-links ul {
  list-style: none;
  padding: 0;
}
.external-links li {
  margin-bottom: var(--space-2);
}
.external-links a {
  color: var(--primary-light);
  text-decoration: underline;
  text-decoration-color: hsla(14, 85%, 62%, 0.5);
  transition: color var(--duration-fast) var(--ease);
}
.external-links a:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}

/* ─── Benefits list ─── */
.benefits-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
  list-style: none !important;
  padding-left: 0 !important;
}
.benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary) !important;
}
.benefits-list li strong {
  color: var(--text-primary);
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}
.benefit-icon {
  color: var(--success);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Section divider ─── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: var(--space-12) 0;
}

/* ─── Footer ─── */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}
.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-3);
  max-width: 260px;
  line-height: 1.65;
}
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: var(--space-2); }
.footer-col ul li a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease);
}
.footer-col ul li a:hover { color: var(--primary-light); }

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: var(--space-4);
}
.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease);
}
.footer-links a:hover { color: var(--primary-light); }

/* ─── Utility Classes ─── */
.text-center { text-align: center; }
.text-primary-color { color: var(--primary-light); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.hidden { display: none !important; }

/* ─── Tag badge ─── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  background: hsla(14, 85%, 52%, 0.1);
  color: var(--primary-light);
  border: 1px solid hsla(14, 85%, 52%, 0.2);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--bg-overlay);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Selection ─── */
::selection {
  background: hsla(14, 85%, 52%, 0.3);
  color: var(--text-primary);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
  /* Slightly tighter nav links on tablets */
  .nav-links a {
    padding: 7px 9px;
    font-size: 0.82rem;
  }
}

@media (max-width: 900px) {
  /* Hide desktop nav links & "All Tools" btn; show hamburger */
  .nav-links { display: none !important; }
  .nav-btn-desktop { display: none !important; }
  .nav-hamburger { display: flex !important; }
}

@media (min-width: 901px) {
  /* Always show desktop links; never show hamburger or mobile menu */
  .nav-hamburger { display: none !important; }
  .nav-mobile-menu { display: none !important; }
  .nav-overlay { display: none !important; }
  .nav-links { display: flex !important; }
  .nav-btn-desktop { display: inline-flex !important; }
}

@media (max-width: 900px) {
  .hero { padding: var(--space-16) 0 var(--space-10); }
  .hero h1 { font-size: 2.4rem; }
  .hero-stats {
    gap: var(--space-5);
    flex-wrap: wrap;
  }
  .hero-stat-divider { display: none; }

  .calc-steps {
    grid-template-columns: 1fr;
  }
  .results-macros {
    grid-template-columns: 1fr 1fr;
  }
  .macro-item:nth-child(2) { border-right: 1px solid var(--border); }
  .macro-item:nth-child(even) { border-right: none; }
  .macro-item:nth-child(1), .macro-item:nth-child(2) {
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-4);
  }

  .features-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .calc-body { padding: var(--space-5); }
  .calc-header { padding: var(--space-4) var(--space-5); }
  .toppings-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .hero-stats { flex-direction: column; gap: var(--space-4); }
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .results-macros { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.8rem; }
}