/* ============================================================
   coffeeratiocalculatorguru.com — Design System
   Version: 1.0
   Aesthetic: Roastery Dashboard — Dark, warm, utilitarian
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-body:        #0c0c0c;
  --bg-card:        #161616;
  --bg-card-hover:  #1c1c1c;
  --bg-surface:     #222222;
  --bg-input:       #1a1a1a;

  /* Text */
  --text-primary:   #ececec;
  --text-secondary: #8a8a8a;
  --text-muted:     #555555;

  /* Accent — warm copper */
  --accent:         #c8956c;
  --accent-light:   #e0b48a;
  --accent-dark:    #9e6d45;
  --accent-bg:      rgba(200, 149, 108, 0.08);
  --accent-bg-hover:rgba(200, 149, 108, 0.14);

  /* Functional */
  --success:        #5cb85c;
  --error:          #e74c3c;
  --border:         #2a2a2a;
  --border-light:   #333333;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.6);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-pill:999px;

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

  /* Typography */
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;
  --text-4xl:  2.5rem;

  /* Layout */
  --max-width:    1100px;
  --header-height:60px;
}

/* ── Light Mode Override ──────────────────────────────────── */
html.light-mode {
  --bg-body:         #f5f1ec;
  --bg-card:         #ffffff;
  --bg-card-hover:   #faf8f5;
  --bg-surface:      #f0ebe4;
  --bg-input:        #ffffff;
  --text-primary:    #1a1a1a;
  --text-secondary:  #6b6b6b;
  --text-muted:      #aaaaaa;
  --accent:          #9e6d45;
  --accent-light:    #c8956c;
  --accent-dark:     #7a5232;
  --accent-bg:       rgba(158, 109, 69, 0.06);
  --accent-bg-hover: rgba(158, 109, 69, 0.12);
  --border:          #e0dbd4;
  --border-light:    #d5cfc7;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-body);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.25;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--sp-4);
}

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

h4 {
  font-size: var(--text-lg);
  font-weight: 600;
}

p {
  margin-bottom: var(--sp-4);
  color: var(--text-primary);
}

p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--accent-light); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul, ol {
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-4);
}

li { margin-bottom: var(--sp-2); }

strong { font-weight: 700; }
em { font-style: italic; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--accent);
}

/* ── Layout Utilities ─────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

@media (min-width: 768px) {
  .container { padding: 0 var(--sp-8); }
}

.section { margin-bottom: var(--sp-16); }

.section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--sp-8);
  position: relative;
  padding-bottom: var(--sp-3);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: var(--radius-pill);
}

/* ── Header / Navigation ──────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.site-logo:hover { color: var(--accent); }

.site-logo .logo-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.site-logo .logo-text {
  display: none;
}

@media (min-width: 480px) {
  .site-logo .logo-text { display: inline; }
}

/* Desktop Nav */
.site-nav {
  display: none;
  align-items: center;
  gap: var(--sp-1);
  flex: 1;
  justify-content: center;
}

@media (min-width: 900px) {
  .site-nav { display: flex; }
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: var(--accent-bg);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-trigger svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateX(-50%) translateY(-4px);
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-dropdown-item:hover {
  color: var(--accent);
  background: var(--accent-bg);
}

/* Header right controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: var(--accent-dark);
}

.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.light-mode .theme-toggle .icon-sun { display: block; }
html.light-mode .theme-toggle .icon-moon { display: none; }

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.hamburger:hover {
  background: var(--accent-bg);
  border-color: var(--accent-dark);
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s, background 0.2s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--accent);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--accent);
}

@media (min-width: 900px) { .hamburger { display: none; } }

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-6);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99;
}

.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0,0,0,0.6);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.mobile-drawer-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.drawer-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  margin-top: var(--sp-5);
}

.drawer-section-title:first-child { margin-top: 0; }

.drawer-link {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  margin-bottom: var(--sp-1);
}

.drawer-link:hover {
  color: var(--accent);
  background: var(--accent-bg);
}

/* ── Breadcrumbs ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
  padding: var(--sp-3) 0;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--accent); }

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.5;
  font-size: var(--text-xs);
}

.breadcrumb-current { color: var(--text-secondary); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: background 0.2s, border-color 0.2s;
}

@media (min-width: 768px) { .card { padding: var(--sp-8); } }

.card:hover { background: var(--bg-card-hover); }

.card-sm {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  transition: background 0.2s, border-color 0.2s;
}

/* ── Calculator Layout ────────────────────────────────────── */
.calculator-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--sp-8);
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .calculator-grid {
    grid-template-columns: 55% 45%;
  }
}

.calc-inputs {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .calc-inputs {
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: var(--sp-8);
  }
}

.calc-results {
  padding: var(--sp-6);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

@media (min-width: 768px) { .calc-results { padding: var(--sp-8); } }

.calc-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

/* ── Brew Method Selector ─────────────────────────────────── */
.method-selector {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--sp-5);
}

.method-selector::-webkit-scrollbar { height: 4px; }
.method-selector::-webkit-scrollbar-track { background: transparent; }
.method-selector::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
}

.method-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-family: var(--font-body);
}

.method-pill:hover {
  border-color: var(--accent-dark);
  color: var(--accent-light);
  background: var(--accent-bg);
}

.method-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c0c0c;
  font-weight: 700;
}

.method-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Strength Selector ────────────────────────────────────── */
.strength-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-1);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--sp-5);
}

.strength-btn {
  padding: var(--sp-2) var(--sp-3);
  border-radius: calc(var(--radius-md) - 2px);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  text-align: center;
}

.strength-btn:hover { color: var(--text-primary); background: var(--bg-surface); }

.strength-btn.active {
  background: var(--accent);
  color: #0c0c0c;
  font-weight: 700;
}

/* ── Mode Toggle ──────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-5);
  cursor: pointer;
}

.mode-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.mode-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.mode-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: background 0.2s, border-color 0.2s;
}

.mode-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.mode-toggle-switch input:checked ~ .mode-toggle-track {
  background: var(--accent-bg);
  border-color: var(--accent-dark);
}

.mode-toggle-switch input:checked ~ .mode-toggle-thumb {
  transform: translateX(20px);
  background: var(--accent);
}

.mode-toggle-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.3;
}

.mode-toggle-label strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Number Input ─────────────────────────────────────────── */
.input-group {
  margin-bottom: var(--sp-5);
}

.input-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.number-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.number-input-wrap:focus-within {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.input-step-btn {
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  font-family: var(--font-body);
}

.input-step-btn:hover { color: var(--accent); background: var(--accent-bg); }
.input-step-btn:active { background: var(--accent-dark); color: #0c0c0c; }

.number-input {
  flex: 1;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  text-align: center;
  min-width: 0;
  padding: 0 var(--sp-2);
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Unit Toggle Pill ─────────────────────────────────────── */
.unit-toggle {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 1px;
  vertical-align: middle;
  margin-left: var(--sp-2);
}

.unit-toggle-btn {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.unit-toggle-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-dark);
}

/* ── Select Input ─────────────────────────────────────────── */
.select-input {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  padding: 0 var(--sp-4);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  transition: border-color 0.2s;
}

.select-input:focus { border-color: var(--accent-dark); }

/* ── Result Cards ─────────────────────────────────────────── */
.result-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  border-left: 3px solid var(--accent);
  transition: border-color 0.2s, background 0.2s;
}

.result-card-full { grid-column: 1 / -1; }

.result-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  display: block;
}

.result-value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: var(--sp-1);
}

.result-unit {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Recipe Summary Card ──────────────────────────────────── */
.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.recipe-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--accent-bg);
}

.recipe-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
}

@media (min-width: 600px) {
  .recipe-grid { grid-template-columns: repeat(3, 1fr); }
}

.recipe-cell {
  background: var(--bg-card);
  padding: var(--sp-4) var(--sp-5);
}

.recipe-cell-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: var(--sp-1);
}

.recipe-cell-value {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.recipe-card-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--accent);
  color: #0c0c0c;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200,149,108,0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-dark);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--accent-bg);
  border-color: var(--accent-dark);
  color: var(--accent);
}

.btn svg { width: 16px; height: 16px; }

.btn-sm { padding: var(--sp-2) var(--sp-3); font-size: var(--text-xs); }

/* Copy success state */
.btn-copy.copied {
  background: var(--success);
  color: #fff;
}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-8);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

caption {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--sp-4) var(--sp-5);
  text-align: left;
  caption-side: top;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--sp-3) var(--sp-5);
  text-align: left;
  white-space: nowrap;
}

td {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

tr:hover td { background: var(--bg-card-hover); }

.td-mono {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

.td-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-dark);
}

/* ── FAQ Accordion ────────────────────────────────────────── */
.faq-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.faq-question:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
}

.faq-question[aria-expanded="true"] {
  color: var(--accent);
  background: var(--accent-bg);
}

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transition: all 0.2s;
}

.faq-question[aria-expanded="true"] .faq-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c0c0c;
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer.open { max-height: 600px; }

.faq-answer-inner {
  padding: var(--sp-5) var(--sp-6);
  padding-top: 0;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ── Tool Cards (Related Tools) ───────────────────────────── */
.tool-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}

@media (min-width: 480px) {
  .tool-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .tool-cards { grid-template-columns: repeat(3, 1fr); }
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-bg);
  opacity: 0;
  transition: opacity 0.2s;
}

.tool-card:hover {
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.tool-card:hover::before { opacity: 1; }

.tool-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: var(--sp-1);
}

.tool-card-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  transition: color 0.2s;
}

.tool-card:hover .tool-card-name { color: var(--accent); }

.tool-card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  position: relative;
  margin-bottom: 0;
}

/* ── Blog Post Grid ───────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}

@media (min-width: 600px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.blog-card:hover {
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
  color: inherit;
}

.blog-card-category {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

.blog-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color 0.2s;
}

.blog-card:hover .blog-card-title { color: var(--accent); }

.blog-card-excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0;
}

/* ── CTA Section ──────────────────────────────────────────── */
.cta-block {
  background: var(--accent-bg);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  text-align: center;
  margin-bottom: var(--sp-8);
}

.cta-block h2 {
  margin-bottom: var(--sp-3);
  color: var(--text-primary);
}

.cta-block p {
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Tips Section ─────────────────────────────────────────── */
.tips-list {
  counter-reset: tips;
  list-style: none;
  padding: 0;
}

.tips-list li {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-3);
  counter-increment: tips;
  transition: background 0.2s;
}

.tips-list li:hover { background: var(--bg-card-hover); }

.tips-list li::before {
  content: counter(tips);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: var(--accent);
  color: #0c0c0c;
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero {
  padding: var(--sp-12) 0 var(--sp-10);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--accent-bg);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}

.hero h1 {
  margin-bottom: var(--sp-4);
  max-width: 750px;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: var(--sp-8);
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
}

.hero-stat {}

.hero-stat-number {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 2px;
}

.hero-stat-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Inline Input Row ─────────────────────────────────────── */
.input-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.input-row .input-label {
  flex-shrink: 0;
  margin-bottom: 0;
}

/* ── Cups Input ───────────────────────────────────────────── */
.cups-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--sp-12) 0 var(--sp-6);
  margin-top: var(--sp-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
  margin-bottom: var(--sp-10);
}

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr 1.5fr; }
}

.footer-col-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  display: block;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li { margin-bottom: var(--sp-2); }

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.footer-about { max-width: 280px; }

.footer-about-logo {
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  text-decoration: none;
}

.footer-about-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.footer-copyright {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: var(--sp-4);
}

.footer-bottom-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

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

/* ── Back to Top ──────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #0c0c0c;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.back-to-top svg { width: 18px; height: 18px; }

/* ── Blog Post Layout ─────────────────────────────────────── */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  padding-top: var(--sp-8);
}

@media (min-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr 300px;
  }
}

.blog-content h2 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
}

.blog-content h3 {
  margin-top: var(--sp-8);
}

.blog-sidebar {}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}

.sidebar-widget-title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  display: block;
}

.sidebar-links { list-style: none; padding: 0; }

.sidebar-links li { margin-bottom: var(--sp-2); }

.sidebar-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  transition: color 0.2s;
}

.sidebar-links a:hover { color: var(--accent); }

.sidebar-links a::before {
  content: '→';
  color: var(--accent);
  font-size: var(--text-xs);
}

/* ── Table of Contents ────────────────────────────────────── */
.toc {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  margin-bottom: var(--sp-8);
}

.toc-title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  display: block;
}

.toc-list {
  list-style: none;
  padding: 0;
  counter-reset: toc;
}

.toc-list li {
  counter-increment: toc;
  margin-bottom: var(--sp-2);
}

.toc-list a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  transition: color 0.2s;
}

.toc-list a::before {
  content: counter(toc) ".";
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-xs);
  flex-shrink: 0;
  margin-top: 3px;
}

.toc-list a:hover { color: var(--accent); }

/* ── Key Takeaways ────────────────────────────────────────── */
.takeaways {
  background: var(--accent-bg);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-8) 0;
}

.takeaways-title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.takeaways ul {
  padding-left: var(--sp-5);
  margin-bottom: 0;
}

.takeaways li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.takeaways li:last-child { margin-bottom: 0; }

/* ── Info Box ─────────────────────────────────────────────── */
.info-box {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-6) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

.info-box strong {
  color: var(--accent);
  font-weight: 700;
}

/* ── 404 Page ─────────────────────────────────────────────── */
.error-page {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-8);
}

.error-page-inner { max-width: 520px; }

.error-code {
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: var(--sp-4);
  opacity: 0.8;
}

/* ── Utility Classes ──────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.gap-2 { gap: var(--sp-2); }

/* ── Transitions for theme ────────────────────────────────── */
.site-header,
.site-footer,
.card,
.calculator-wrapper,
.faq-question,
.tool-card,
.blog-card {
  transition: background 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.result-update {
  animation: fadeIn 0.25s ease forwards;
}

/* ── Focus Styles (accessibility) ────────────────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Print Styles ─────────────────────────────────────────── */
@media print {
  .site-header,
  .back-to-top,
  .mobile-drawer,
  .mobile-drawer-overlay,
  .btn-copy,
  .hamburger,
  .theme-toggle { display: none !important; }

  body {
    background: #fff;
    color: #000;
  }

  .calculator-wrapper,
  .card,
  .recipe-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }

  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }

  h1, h2, h3 { color: #000; page-break-after: avoid; }

  .recipe-grid { grid-template-columns: repeat(3, 1fr); }

  @page {
    margin: 1.5cm;
  }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 374px) {
  :root {
    --text-4xl: 1.875rem;
    --text-3xl: 1.625rem;
    --text-2xl: 1.25rem;
  }

  .strength-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .result-cards { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: var(--sp-4); }
}

/* ── Grind size visual bars ───────────────────────────────── */
.grind-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.grind-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
  max-width: 120px;
}

.grind-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

/* ── Temperature gauge ────────────────────────────────────── */
.temp-gauge {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.temp-gauge-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, #4a90d9, #e89c45, #e74c3c);
  position: relative;
}

.temp-gauge-marker {
  position: absolute;
  top: -3px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.3s ease;
}

/* ── Slider ───────────────────────────────────────────────── */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  outline: none;
  border: 1px solid var(--border);
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* ── Mode Tabs (replaces broken toggle) ──────────────────── */
.mode-tabs {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: calc(var(--radius-md) - 2px);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  text-align: center;
  line-height: 1.3;
}

.mode-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.mode-tab.active {
  background: var(--accent);
  color: #0c0c0c;
  font-weight: 700;
}

.mode-tab svg {
  flex-shrink: 0;
}

/* ── Unit toggles row ────────────────────────────────────── */
.unit-toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

/* ── Recipe summary wrapper ──────────────────────────────── */
.recipe-summary-wrap {
  padding: var(--sp-4) var(--sp-6) var(--sp-6);
  border-top: 1px solid var(--border);
  background: var(--bg-body);
}

@media (min-width: 768px) {
  .recipe-summary-wrap {
    padding: var(--sp-5) var(--sp-8) var(--sp-8);
  }
}

/* ── Nav dropdown — click-open JS version ────────────────── */
.nav-dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive Calculator Fixes ─────────────────────────── */
/* Ensure calculators are fully responsive at 375px */
@media (max-width: 600px) {
  .calculator-grid {
    grid-template-columns: 1fr !important;
  }

  .calc-inputs,
  .calc-results {
    padding: var(--sp-4) !important;
  }

  .recipe-summary-wrap {
    padding: var(--sp-4) !important;
  }

  .method-selector {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .method-pill {
    font-size: 0.75rem;
    padding: var(--sp-1) var(--sp-2);
  }

  .strength-selector {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .strength-btn {
    font-size: var(--text-xs);
    padding: var(--sp-2) var(--sp-1);
  }

  .result-cards {
    grid-template-columns: 1fr 1fr;
  }

  .result-value {
    font-size: var(--text-2xl) !important;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .cups-row {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }

  .mode-tabs {
    flex-direction: column;
  }

  .mode-tab {
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }

  .hero-stats {
    gap: var(--sp-5);
  }

  .tool-cards {
    grid-template-columns: 1fr !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-xl); }

  .table-wrap {
    font-size: var(--text-xs);
  }

  td, th {
    padding: var(--sp-2) var(--sp-3);
  }
}

@media (max-width: 400px) {
  .strength-selector {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .result-cards {
    grid-template-columns: 1fr !important;
  }

  .hero h1 {
    font-size: var(--text-2xl);
  }
}

/* Ensure calc panels display correctly in all screen sizes */
#water-panel,
#coffee-panel {
  width: 100%;
}

.calc-inputs,
.calc-results {
  min-width: 0;
  width: 100%;
}

/* Fix recipe grid on small screens */
@media (max-width: 480px) {
  .recipe-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Blog layout responsive */
@media (max-width: 768px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-content h1 {
    font-size: var(--text-2xl);
  }
}

/* Fix container padding on small screens */
@media (max-width: 375px) {
  .container {
    padding: 0 var(--sp-4);
  }

  .header-inner {
    padding: 0 var(--sp-4);
  }
}
