/* BakeCost — warm, restrained bakery palette. Mobile-first, no frameworks. */
:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --ink: #3a2b20;
  --muted: #8a7460;
  --line: #e9dcc9;
  --accent: #b4632a;
  --accent-dark: #8e4c1d;
  --accent-soft: #f6e9d8;
  --sage: #5f7a5e;
  --danger: #a03a2c;
  --radius: 12px;
  --shadow: 0 2px 14px rgba(90, 58, 30, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

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

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.4rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 0.5rem; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 18px; }
.wrap-narrow { max-width: 720px; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.nav a:hover { background: var(--accent-soft); }
.nav a.btn { margin-left: 6px; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--accent-soft); color: var(--ink); }
.btn-small { padding: 8px 14px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
label { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 4px; }
.hint { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- hero ---------- */
.hero { padding: 44px 0 30px; text-align: center; }
.hero p.lede { font-size: 1.1rem; color: var(--muted); max-width: 620px; margin: 0 auto 22px; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 18px 0;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ---------- calculator ---------- */
.calc-grid { display: grid; gap: 18px; }
@media (min-width: 820px) {
  .calc-grid { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .results { position: sticky; top: 76px; }
}

.ing-table { width: 100%; border-collapse: collapse; }
.ing-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
}
.ing-table td { padding: 6px; vertical-align: middle; border-bottom: 1px dashed var(--line); }
.ing-table input, .ing-table select { padding: 8px 8px; font-size: 0.95rem; }
.ing-row-remove {
  background: none; border: none; color: var(--danger);
  font-size: 1.2rem; cursor: pointer; padding: 4px 8px; line-height: 1;
}
.ing-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 6px 0; font-weight: 700;
}
.ing-total .amount { color: var(--accent-dark); font-size: 1.15rem; }

.results { background: #fffdf9; }
.result-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.result-row:last-child { border-bottom: none; }
.result-row .k { font-size: 0.95rem; }
.result-row .v { font-weight: 800; font-size: 1.15rem; color: var(--accent-dark); }
.result-row.hero-result .v { font-size: 1.7rem; }
.result-row.hero-result { background: var(--accent-soft); margin: 0 -22px; padding: 14px 22px; border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.formula-note { font-size: 0.85rem; color: var(--muted); margin-top: 12px; }

/* ---------- quote sheet ---------- */
.tier-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: end; }
.quote-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-top: 14px;
  background: #fff;
}
.quote-preview h3 { margin-top: 0; }
.quote-preview table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.quote-preview td, .quote-preview th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.quote-preview .q-price { text-align: right; font-weight: 700; }
.quote-brand { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(40, 26, 15, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 18px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  position: relative;
}
.modal h2 { margin-top: 0; }
.modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted);
}
.modal ul { padding-left: 20px; }
.modal ul li { margin-bottom: 8px; }
.pro-note { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }

/* ---------- pricing page ---------- */
.plan-grid { display: grid; gap: 18px; margin: 24px 0; }
@media (min-width: 720px) { .plan-grid { grid-template-columns: 1fr 1fr; } }
.plan { border: 2px solid var(--line); border-radius: var(--radius); padding: 26px; background: var(--surface); }
.plan.pro { border-color: var(--accent); box-shadow: var(--shadow); position: relative; }
.plan .tag {
  position: absolute; top: -14px; left: 22px;
  background: var(--accent); color: #fff;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 12px; border-radius: 20px;
}
.plan h3 { margin-top: 0; font-size: 1.3rem; }
.plan .price { font-size: 2rem; font-weight: 800; margin: 6px 0; }
.plan .price small { font-size: 0.95rem; font-weight: 400; color: var(--muted); }
.plan ul { padding-left: 20px; margin: 14px 0; }
.plan ul li { margin-bottom: 8px; }
.check { color: var(--sage); font-weight: 700; }

/* ---------- blog ---------- */
.blog-grid { display: grid; gap: 16px; margin: 20px 0; }
@media (min-width: 720px) { .blog-grid { grid-template-columns: 1fr 1fr; } }
.post-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: var(--ink); display: block;
}
.post-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.post-card h3 { margin: 0 0 8px; color: var(--ink); }
.post-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; margin: 24px 0; }
.article-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 8px; }
.cta-box {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 30px 0;
  text-align: center;
}
.cta-box h3 { margin-top: 0; }
.example {
  background: #fbf8f3;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.96rem;
}
.example strong { display: block; margin-bottom: 6px; }

/* ---------- recipe library ---------- */
.recipe-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.recipe-item:last-child { border-bottom: none; }
.recipe-item .rname { font-weight: 600; }
.recipe-item .ractions { display: flex; gap: 8px; }

/* ---------- misc ---------- */
.faq details { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); }
.faq summary { font-weight: 700; cursor: pointer; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; padding: 12px 0 12px 52px; position: relative; border-bottom: 1px dashed var(--line); }
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  font-weight: 800; display: flex; align-items: center; justify-content: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; margin-right: 14px; }
.site-footer a:hover { color: var(--accent); }

.badge-pro {
  display: inline-block; background: var(--sage); color: #fff;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 12px; vertical-align: middle; margin-left: 8px;
}

/* ---------- print: quote sheet only ---------- */
@media print {
  body * { visibility: hidden; }
  #quote-print, #quote-print * { visibility: visible; }
  #quote-print {
    position: absolute; left: 0; top: 0; width: 100%;
    border: none; box-shadow: none; margin: 0; padding: 24px;
  }
  .no-print { display: none !important; }
}
