/* ===========================================================
   Grams to Cups — Main Stylesheet
   =========================================================== */

nav { display: none; }

:root {
  --bg: #0a0f0d;
  --surface: #111917;
  --surface2: #172019;
  --border: #1e2d22;
  --accent: #25D366;
  --accent2: #128C7E;
  --accent3: #075E54;
  --glow: rgba(37,211,102,0.18);
  --text: #e8f5ec;
  --muted: #7aaa88;
  --white: #ffffff;
  --card: rgba(17,25,23,0.92);
  --radius: 20px;
  --radius-sm: 12px;

  --danger: #ff6b6b;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --shadow-sm: 0 4px 14px rgba(0,0,0,0.25);
  --transition: all 0.2s ease;
}

[data-theme="light"] {
  --bg: #f0f7f1;
  --surface: #ffffff;
  --surface2: #e8f5ec;
  --border: #c8e6cf;
  --glow: rgba(37,211,102,0.12);
  --text: #0d2b17;
  --muted: #3a7d4f;
  --card: rgba(255,255,255,0.95);
  --shadow: 0 10px 30px rgba(13,43,23,0.10);
  --shadow-sm: 0 4px 14px rgba(13,43,23,0.08);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

section { padding: 64px 0; }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* ---------- Background glow ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 10% 0%, var(--glow), transparent 60%),
    radial-gradient(500px circle at 90% 20%, var(--glow), transparent 55%);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--glow);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  transition: var(--transition);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

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

.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.mobile-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04150c;
  box-shadow: 0 8px 22px var(--glow);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--glow); }

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

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: start;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  margin-bottom: 16px;
}

.hero-title .accent-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 22px;
  max-width: 54ch;
}

.hero-quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.quick-fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
}

.quick-fact strong { color: var(--accent); }

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-trust span { display: flex; align-items: center; gap: 6px; }

/* ---------- Tool Card (hero right side) ---------- */
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px;
  background: var(--surface2);
}

.tool-tab {
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tool-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04150c;
}

.tool-body { padding: 22px; }

.tool-body h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.tool-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.field-group { margin-bottom: 14px; }

.field-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  transition: var(--transition);
}

.field-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.field-control[readonly] {
  color: var(--accent);
  font-weight: 700;
  background: var(--surface2);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
}

.swap-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.swap-btn:hover { border-color: var(--accent); transform: rotate(180deg); }

.result-box {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  margin-top: 6px;
}

.result-box .result-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
}

.result-box .result-caption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* batch rows */
.batch-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.batch-remove {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
}

.batch-actions { display: flex; gap: 10px; margin-top: 4px; }

/* recipe parser */
.recipe-textarea {
  width: 100%;
  min-height: 130px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 12px;
}

.recipe-output {
  min-height: 130px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.recipe-output .converted-line { color: var(--accent); font-weight: 600; }

/* ---------- Section headings ---------- */
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

.section-tag {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 10px; }
.section-head p { color: var(--muted); font-size: 1rem; }

/* ---------- Quick answer table ---------- */
.quick-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data-table th {
  text-align: left;
  padding: 14px 16px;
  background: var(--surface2);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
table.data-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

table.data-table td {
  padding: 13px 16px;
  border-top: 1px solid var(--border);
}

table.data-table tr:hover td { background: var(--surface2); }

/* ---------- Ingredient cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.ingredient-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: var(--transition);
}

.ingredient-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.ingredient-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.ingredient-card h3 { font-size: 1.05rem; margin-bottom: 4px; }

.ingredient-density {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.1rem;
  margin: 6px 0 4px;
}

.ingredient-note { color: var(--muted); font-size: 0.85rem; }

/* ---------- Amount pill grid (links to amount pages) ---------- */
.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}

.pill:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04150c;
  border-color: transparent;
}

/* ---------- Steps ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04150c;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.step-card h4 { font-size: 1rem; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: 0.9rem; }

/* ---------- Comparison (us vs them) ---------- */
.compare-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table.compare-table { width: 100%; border-collapse: collapse; }

table.compare-table th, table.compare-table td {
  padding: 16px 18px;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}

table.compare-table th:first-child, table.compare-table td:first-child {
  text-align: left;
  font-weight: 600;
}

table.compare-table thead th {
  border-top: none;
  background: var(--surface2);
  font-weight: 800;
}

table.compare-table thead th.us-col {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04150c;
}

.check-yes { color: var(--accent); font-weight: 800; }
.check-no { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  font-weight: 700;
  font-size: 0.98rem;
  text-align: left;
}

.faq-question .faq-icon {
  transition: transform 0.25s ease;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.faq-answer p {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Newsletter / CTA banner ---------- */
.cta-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.cta-banner h2 { font-size: 1.5rem; margin-bottom: 10px; }
.cta-banner p { color: var(--muted); margin-bottom: 22px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 16px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 10px; }

.footer-col a, .footer-col p {
  color: var(--muted);
  font-size: 0.9rem;
  transition: var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Ad slot ---------- */
.ad-slot {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .mobile-toggle { display: flex; }
  section { padding: 44px 0; }
  .hero { padding: 32px 0 24px; }
  .batch-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  table.compare-table { font-size: 0.82rem; }
}
