/* Ferment Safe — custom styles */
:root {
  --c-green-900: #1b4332;
  --c-green-700: #2d6a4f;
  --c-green-500: #52b788;
  --c-green-300: #95d5b2;
  --c-green-100: #d8f3dc;
  --c-amber-700: #b35f00;
  --c-amber-100: #fff3d6;
  --c-red-700: #b91c1c;
  --c-red-100: #fee2e2;
  --c-clay: #c67b5c;
  --c-bg: #faf9f6;
  --c-surface: #ffffff;
  --c-text: #1a1a1a;
  --c-text-sub: #555;
  --c-border: #e2e0da;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 1120px;
}

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

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
}

a { color: var(--c-green-700); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--c-green-900); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.skip-link { position: absolute; top: -100%; left: 0; background: var(--c-green-700); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { top: 0; }

/* Header */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; }
.logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--c-green-900); font-weight: 700; font-size: 1.15rem; }
.logo:hover, .logo:focus { color: var(--c-green-700); }
.logo-icon { flex-shrink: 0; }
.site-nav ul { display: flex; gap: .25rem; list-style: none; }
.site-nav a { display: block; padding: .5rem .75rem; text-decoration: none; color: var(--c-text-sub); border-radius: 8px; font-size: .92rem; }
.site-nav a:hover, .site-nav a:focus { background: var(--c-green-100); color: var(--c-green-900); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--c-green-100) 0%, var(--c-bg) 100%); padding: 4.5rem 0 3.5rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; color: var(--c-green-900); max-width: 22ch; }
.hero-sub { font-size: 1.1rem; color: var(--c-text-sub); max-width: 55ch; margin: 1rem 0 1.75rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 2px solid transparent; border-radius: var(--radius); padding: .65rem 1.4rem; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; text-decoration: none; }
.btn-primary { background: var(--c-green-700); color: #fff; border-color: var(--c-green-700); }
.btn-primary:hover, .btn-primary:focus { background: var(--c-green-900); border-color: var(--c-green-900); color: #fff; }
.btn-outline { background: var(--c-surface); color: var(--c-green-700); border-color: var(--c-green-500); }
.btn-outline:hover, .btn-outline:focus { background: var(--c-green-100); }
.btn-text { background: none; border: none; color: var(--c-green-700); text-decoration: underline; padding: .25rem; font-size: .88rem; cursor: pointer; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.08rem; }

/* Calculator section */
.calculator-section { padding: 3rem 0 4rem; }
.calc-layout { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
@media (min-width: 860px) {
  .calc-layout { grid-template-columns: 1fr 1fr; align-items: start; }
  .results-panel { position: sticky; top: 72px; }
}

.calc-panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.calc-panel h2 { font-size: 1.35rem; color: var(--c-green-900); margin-bottom: .25rem; }
.calc-intro { color: var(--c-text-sub); margin-bottom: 1.5rem; font-size: .95rem; }

.field-group { border: none; margin-bottom: 1.5rem; }
.field-group legend { font-weight: 700; font-size: .95rem; margin-bottom: .5rem; color: var(--c-green-900); }

.preset-jars { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.jar-preset { padding: .45rem .85rem; border: 2px solid var(--c-border); border-radius: 8px; background: var(--c-surface); cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--c-text-sub); transition: all .15s; }
.jar-preset:hover, .jar-preset:focus { border-color: var(--c-green-500); color: var(--c-green-700); }
.jar-preset.active { border-color: var(--c-green-700); background: var(--c-green-100); color: var(--c-green-900); }

label { display: block; font-size: .9rem; color: var(--c-text); }
.inline-label { display: flex; flex-direction: column; gap: .3rem; }
.select-label { display: flex; flex-direction: column; gap: .3rem; }
select, input[type="number"] { padding: .55rem .75rem; border: 2px solid var(--c-border); border-radius: 8px; font-size: 1rem; background: var(--c-surface); color: var(--c-text); width: 100%; max-width: 320px; }
select:focus, input[type="number"]:focus { outline: none; border-color: var(--c-green-500); box-shadow: 0 0 0 3px rgba(82,183,136,.25); }

input[type="range"] { width: 100%; max-width: 320px; accent-color: var(--c-green-700); }
.temp-control { margin-bottom: .5rem; }
.range-label { display: flex; flex-direction: column; gap: .25rem; }
#temp-display { font-weight: 700; font-size: 1.05rem; color: var(--c-green-900); }
.temp-ticks { display: flex; justify-content: space-between; max-width: 320px; font-size: .78rem; color: var(--c-text-sub); margin-top: .15rem; }
.temp-alt { margin-top: .5rem; }

.field-help { font-size: .8rem; color: var(--c-text-sub); }

/* Results panel */
.results-panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.results-panel h2 { font-size: 1.25rem; color: var(--c-green-900); margin-bottom: 1rem; }

.jar-visual { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.5rem; }
.jar-svg { width: 160px; height: auto; }
.jar-caption { font-size: .85rem; color: var(--c-text-sub); margin-top: .5rem; text-align: center; }

.result-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-bottom: 1.25rem; }
.result-card { border: 1px solid var(--c-border); border-radius: 10px; padding: .85rem; background: var(--c-bg); }
.result-card h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-sub); margin-bottom: .25rem; }
.big-stat { font-size: 1.35rem; font-weight: 800; color: var(--c-green-900); line-height: 1.2; }
.stat-sub { font-size: .8rem; color: var(--c-text-sub); }

.risk-card { grid-column: 1 / -1; }
.risk-bar { height: 10px; background: var(--c-border); border-radius: 5px; overflow: hidden; margin: .35rem 0 .2rem; }
.risk-fill { height: 100%; border-radius: 5px; width: 0; transition: width .3s, background .3s; }
.risk-label { font-size: .85rem; font-weight: 700; }

.result-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }

.saved-batches { border-top: 1px solid var(--c-border); padding-top: 1rem; }
.saved-batches h3 { font-size: .95rem; margin-bottom: .5rem; }
.saved-batches ul { list-style: none; }
.saved-batches li { padding: .4rem 0; border-bottom: 1px solid var(--c-border); font-size: .85rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }

/* Guide section */
.guide-section { padding: 3rem 0 4rem; border-top: 1px solid var(--c-border); }
.guide-section h2 { font-size: 1.5rem; color: var(--c-green-900); margin-bottom: .75rem; }
.guide-section h3 { font-size: 1.15rem; color: var(--c-green-900); margin: 2rem 0 .5rem; }
.guide-section p { max-width: 70ch; margin-bottom: .85rem; }

.table-wrap { overflow-x: auto; margin: 1rem 0 2rem; }
.ref-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.ref-table th { background: var(--c-green-100); color: var(--c-green-900); text-align: left; padding: .6rem .75rem; font-weight: 700; }
.ref-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--c-border); }
.ref-table tr:nth-child(even) td { background: var(--c-bg); }

.mistake-list { list-style: none; margin: 1rem 0 2rem; }
.mistake-list li { padding: .65rem 0; border-bottom: 1px solid var(--c-border); max-width: 70ch; }
.mistake-list li strong { color: var(--c-green-900); }

.faq-list dt { font-weight: 700; color: var(--c-green-900); margin-top: 1.25rem; }
.faq-list dd { margin: .35rem 0 0; max-width: 68ch; }

/* CTA section */
.cta-section { background: var(--c-green-100); padding: 3.5rem 0; text-align: center; }
.cta-section h2 { font-size: 1.5rem; color: var(--c-green-900); margin-bottom: .5rem; }
.cta-section p { color: var(--c-text-sub); margin-bottom: 1.25rem; }

/* Footer */
.site-footer { background: var(--c-green-900); color: #fff; padding: 2.5rem 0 1.5rem; font-size: .88rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 600px) { .footer-grid { grid-template-columns: 1.5fr 1fr; } }
.footer-brand { font-size: 1.1rem; display: block; margin-bottom: .35rem; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: var(--c-green-300); text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-small { color: rgba(255,255,255,.6); font-size: .8rem; border-top: 1px solid rgba(255,255,255,.15); padding-top: 1rem; margin-top: 1rem; }
.footer-small a { color: var(--c-green-300); }

/* Toast */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--c-green-900); color: #fff; padding: .75rem 1.25rem; border-radius: 10px; font-size: .9rem; box-shadow: 0 4px 16px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Print */
@media print {
  .site-header, .site-footer, .calc-panel, .result-actions, .cta-section, .saved-batches { display: none !important; }
  .results-panel { box-shadow: none; border: none; }
  body { background: #fff; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
