/* PourCount — wedding & party keg calculator
   Fast, self-contained, mobile-first. */

@font-face {
  font-family: "EB Garamond";
  src: url("assets/eb-garamond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/eb-garamond-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/ibm-plex-sans.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #efe6d6;
  --bg-deep: #e7dcc8;
  --paper: #fff8ee;
  --ink: #1a140f;
  --ink-soft: #5c4e42;
  --rule: #d4c4ae;
  --amber: #c45a12;
  --amber-deep: #8b3a0f;
  --amber-soft: #f3e0cc;
  --stout: #2a1c14;
  --foam: #f7efe2;
  --pine: #215744;
  --pine-soft: #e3efe8;
  --warn: #8b2e1a;
  --warn-bg: #f8e7e2;
  --shadow: 0 1px 0 rgba(26, 20, 15, 0.04), 0 18px 40px -24px rgba(42, 28, 20, 0.35);
  --font-serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --max: 68rem;
  --header-h: 3.75rem;
}

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

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

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, #f6efe4 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #ead9c3 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.55;
  font-weight: 430;
}

img { max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--amber-deep); }
a:hover { color: var(--amber); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--stout);
  color: var(--foam);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  z-index: 20;
}
.skip:focus { top: 0.75rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background: color-mix(in srgb, var(--bg) 88%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
  backdrop-filter: blur(10px);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}
.wordmark img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}
.nav {
  display: flex;
  gap: 1.1rem;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav a:hover { color: var(--ink); }

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

/* Hero */
.hero {
  padding: 2.4rem 0 1.4rem;
}
.hero .eyebrow {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.7rem;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.15rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
  max-width: 18ch;
}
.hero .lead {
  margin: 0;
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* Calculator layout */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding-bottom: 2.5rem;
  align-items: start;
}
@media (min-width: 880px) {
  .calc-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1.5rem;
  }
  .results-panel { position: sticky; top: calc(var(--header-h) + 0.9rem); }
}

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-panel { padding: 1.15rem 1.15rem 1.3rem; }
.results-panel { padding: 1.15rem 1.2rem 1.35rem; }

.panel h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.panel .sub {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* Fields */
.field {
  margin-bottom: 1rem;
}
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.field label,
.field .label {
  font-size: 0.92rem;
  font-weight: 550;
}
.field .value {
  font-variant-numeric: tabular-nums;
  color: var(--amber-deep);
  font-weight: 550;
  font-size: 0.92rem;
}
.hint {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

input[type="number"],
input[type="email"],
input[type="text"] {
  width: 100%;
  background: var(--foam);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  min-height: 2.75rem;
}
input[type="number"]:focus,
input[type="email"]:focus,
input[type="text"]:focus,
input[type="range"]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-color: var(--amber);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.5rem;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 99px;
  border: 1px solid var(--rule);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--paper);
  box-shadow: 0 1px 4px rgba(42, 28, 20, 0.25);
  margin-top: -9px;
}
input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 99px;
  border: 1px solid var(--rule);
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--paper);
  box-shadow: 0 1px 4px rgba(42, 28, 20, 0.25);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--rule);
  background: var(--foam);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.88rem;
  cursor: pointer;
  min-height: 2.5rem;
}
.check:has(input:checked) {
  background: var(--amber-soft);
  border-color: color-mix(in srgb, var(--amber) 50%, var(--rule));
}
.check input { accent-color: var(--amber); width: 1rem; height: 1rem; }

.switch {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0 0.2rem;
  cursor: pointer;
}
.switch input { margin-top: 0.25rem; accent-color: var(--amber); width: 1.1rem; height: 1.1rem; }

details.advanced {
  margin-top: 0.5rem;
  border-top: 1px dashed var(--rule);
  padding-top: 0.7rem;
}
details.advanced > summary {
  cursor: pointer;
  font-weight: 550;
  font-size: 0.92rem;
  color: var(--ink-soft);
  list-style: none;
}
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary::before { content: "+ "; color: var(--amber); font-weight: 700; }
details.advanced[open] > summary::before { content: "– "; }

/* Results */
.math-line {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  line-height: 1.45;
}

.hero-mix {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.hero-mix-note {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.keg-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.keg-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  background: var(--foam);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--rule);
}
.keg-list .count {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  min-width: 2.2rem;
}
.keg-list .meta { color: var(--ink-soft); font-size: 0.85rem; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.stat {
  background: var(--foam);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
}
.stat .k {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 550;
}
.stat .n {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.15;
  margin: 0.15rem 0 0.1rem;
  font-variant-numeric: tabular-nums;
}
.stat .d { font-size: 0.8rem; color: var(--ink-soft); }

.also {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.warn-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.warn-list li {
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.checklist li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
}
.checklist h3 {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 600;
}
.checklist p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.tag {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--pine);
  background: var(--pine-soft);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-right: 0.35rem;
  vertical-align: 1px;
}
.tag.rec { color: var(--amber-deep); background: var(--amber-soft); }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--foam);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 550;
}
.btn:hover { border-color: var(--ink-soft); }
.btn.primary {
  background: var(--stout);
  color: var(--foam);
  border-color: var(--stout);
}
.btn.primary:hover { background: var(--ink); color: var(--foam); }

/* Sticky mobile summary */
.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
  background: var(--stout);
  color: var(--foam);
  font-size: 0.88rem;
  text-decoration: none;
  box-shadow: 0 -8px 24px rgba(42, 28, 20, 0.2);
}
.mobile-bar strong { font-weight: 600; }
.mobile-bar span.more { color: #e0c4a4; white-space: nowrap; }
@media (min-width: 880px) {
  .mobile-bar { display: none; }
}
@media (max-width: 879px) {
  body { padding-bottom: 4.25rem; }
}

/* Content sections */
.section {
  padding: 0.5rem 0 2.6rem;
}
.section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 600;
  margin: 0 0 0.6rem;
}
.section > .lede {
  color: var(--ink-soft);
  max-width: 42rem;
  margin: 0 0 1.2rem;
}

.formula-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}
@media (min-width: 700px) {
  .formula-grid { grid-template-columns: 1fr 1fr; }
}
.formula-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
}
.formula-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.formula-card p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }
.formula-card code, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.84em;
  background: var(--foam);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

/* Gear / affiliates */
.gear-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}
@media (min-width: 640px) {
  .gear-grid { grid-template-columns: 1fr 1fr; }
}
.gear-card {
  background: var(--paper);
  border: 1px dashed #c4a27a;
  border-radius: var(--radius);
  padding: 1rem 1.05rem 1.1rem;
  position: relative;
}
.gear-card h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.gear-card p { margin: 0 0 0.7rem; color: var(--ink-soft); font-size: 0.92rem; }
.aff-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber-deep);
  background: var(--amber-soft);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
}
.aff-note {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* Notify form */
.notify-panel {
  background: var(--stout);
  color: var(--foam);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.4rem 1.25rem 1.5rem;
}
.notify-panel h2 { color: var(--foam); margin-bottom: 0.4rem; }
.notify-panel .lede { color: #d9cbb8; }
.notify-panel label { display: block; font-size: 0.88rem; margin-bottom: 0.3rem; font-weight: 550; }
.notify-panel input {
  background: #3a2a20;
  border-color: #5a4538;
  color: var(--foam);
}
.notify-panel .privacy {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #cbb9a4;
}
.honeypot {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}
.notify-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}
@media (min-width: 640px) {
  .notify-fields { grid-template-columns: 1.3fr 0.7fr auto; align-items: end; }
}

/* FAQ */
.faq-list { margin: 0; padding: 0; }
.faq-list details {
  border-top: 1px solid var(--rule);
  padding: 0.15rem 0;
}
.faq-list details:last-child { border-bottom: 1px solid var(--rule); }
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.9rem 1.6rem 0.9rem 0;
  position: relative;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0.85rem;
  color: var(--amber);
  font-weight: 600;
  font-size: 1.2rem;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list .answer {
  margin: 0 0 1.05rem;
  color: var(--ink-soft);
  max-width: 48rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.2rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 0.6rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer p { margin: 0.25rem 0; }

/* Thanks page */
.thanks {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}
.thanks h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .mobile-bar, .notify-panel, .gear-grid, .result-actions, .nav { display: none !important; }
  body { background: white; padding: 0; color: black; }
  .panel { box-shadow: none; break-inside: avoid; }
}
