:root {
  /* Brand palette */
  --bg: #FFFBF4;          /* Off-White */
  --surface: #F6F1E7;     /* Flour Cream */
  --card: #FFF7EE;        /* Warm card */
  --ink: #1F2328;         /* Oven Charcoal */
  --muted: #6B6259;       /* Warm muted */
  --border: rgba(31, 35, 40, 0.10);
  --divider: rgba(31, 35, 40, 0.12);

  --gold: #D9A441;        /* Crust Gold (primary) */
  --basil: #2F6B4F;       /* Success */
  --tomato: #C64B3B;      /* Warning/attention (sparingly) */

  /* UI tokens */
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 14px 34px rgba(31, 35, 40, 0.10);
  --shadow-soft: 0 10px 24px rgba(31, 35, 40, 0.08);

  --focus: 0 0 0 3px rgba(217, 164, 65, 0.22);

  /* Spacing (8pt-ish) */
  --s-1: 8px;
  --s-2: 12px;
  --s-3: 16px;
  --s-4: 20px;
  --s-5: 24px;
  --s-6: 32px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    /* subtle fermentation "bubbles" */
    radial-gradient(18px 18px at 12% 18%, rgba(31, 35, 40, 0.04), transparent 60%),
    radial-gradient(14px 14px at 22% 46%, rgba(31, 35, 40, 0.035), transparent 60%),
    radial-gradient(22px 22px at 78% 24%, rgba(31, 35, 40, 0.035), transparent 60%),
    radial-gradient(16px 16px at 86% 58%, rgba(31, 35, 40, 0.03), transparent 60%),
    /* warm glow */
    radial-gradient(900px 520px at 10% -10%, rgba(217, 164, 65, 0.22), transparent 60%),
    radial-gradient(820px 560px at 100% 10%, rgba(198, 75, 59, 0.14), transparent 60%),
    linear-gradient(140deg, var(--bg), var(--surface));
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.45;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: nowrap;
  padding: var(--s-6);
  border-radius: var(--radius);
  background: radial-gradient(circle at 5% 90%, rgba(47, 107, 79, 0.12), transparent 30%),
              radial-gradient(circle at 90% 6%, rgba(217, 116, 65, 0.18), transparent 30%),
              linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(246, 241, 231, 0.82));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

h1 {
  margin: 0;
  font-family: Fraunces, ui-serif, Georgia, serif;
  letter-spacing: 0.2px;
  font-size: clamp(2.1rem, 3vw, 3.2rem);
  line-height: 1.06;
}

.tagline {
  color: var(--muted);
  max-width: 695px;
  margin: 0;
  font-size: 1.02rem;
}

.header-main {
  flex: 1;
  min-width: 240px;
}

.hero-illustration {
  width: 190px;
  min-width: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  max-height: 100%;
  max-width: 100%;
}

@media (max-width: 720px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-illustration {
    width: 140px;
    min-width: 140px;
    align-self: center;
    order: -1;
  }
}

.grid {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}

@media (min-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

.card {
  background: rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  padding: var(--s-5);
  position: relative;
  backdrop-filter: blur(6px);
}

.card h2 {
  margin: 0 0 var(--s-3);
  font-size: 1.5rem;
  font-family: Fraunces, ui-serif, Georgia, serif;
  letter-spacing: 0.15px;
}

.card h3 {
  margin: var(--s-4) 0 var(--s-2);
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 700;
}

.subtle {
  color: var(--muted);
  font-size: 0.95rem;
}

.inputs {
  display: grid;
  gap: var(--s-4);
}

.field {
  display: grid;
  gap: var(--s-1);
}

.field-grid {
  display: grid;
  gap: var(--s-3);
}

@media (min-width: 720px) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

label {
  font-weight: 650;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  letter-spacing: 0.1px;
}

label span {
  color: var(--muted);
  font-weight: 550;
  font-size: 0.9rem;
}

.label-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.label-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(217, 164, 65, 0.16);
  color: var(--ink);
  border: 1px solid rgba(217, 164, 65, 0.35);
  flex-shrink: 0;
}

.label-icon svg {
  width: 13px;
  height: 13px;
  display: block;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-button {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(31, 35, 40, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  cursor: help;
  padding: 0;
}

.info-button svg {
  width: 12px;
  height: 12px;
}

.tooltip {
  position: absolute;
  right: 0;
  top: 140%;
  background: var(--ink);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 2;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: -5px;
  right: 8px;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent var(--ink) transparent;
}

.info:hover .tooltip,
.info-button:focus + .tooltip {
  opacity: 1;
  transform: translateY(0);
}

input, select {
  width: 100%;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(31, 35, 40, 0.14);
  background: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  color: var(--ink);
}

input:focus, select:focus {
  outline: none;
  border-color: rgba(217, 164, 65, 0.55);
  box-shadow: var(--focus);
}

input:hover, select:hover {
  border-color: rgba(31, 35, 40, 0.22);
}

.input-combo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.unit-toggle { min-width: 150px; }

details.more-options {
  border: 1px dashed rgba(31, 35, 40, 0.14);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.55);
}

details.more-options summary {
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

details.more-options summary::-webkit-details-marker {
  display: none;
}

details.more-options summary::after {
  content: "Show";
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid rgba(31, 35, 40, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

details.more-options[open] summary::after {
  content: "Hide";
}

.more-options-body {
  margin-top: 14px;
  display: grid;
  gap: var(--s-4);
}

@media (max-width: 720px) {
  details.more-options {
    display: block;
  }
}

/* Primary pills (golden) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(217, 164, 65, 0.16);
  color: var(--ink);
  border: 1px solid rgba(217, 164, 65, 0.34);
  font-weight: 650;
  font-size: 0.95rem;
  margin-right: 8px;
}

.values {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.value-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dashed rgba(31, 35, 40, 0.18);
  padding-bottom: 8px;
  gap: 16px;
}

.value-row strong { font-weight: 750; }

.value-row strong {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.measure {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  display: none;
}

.note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Accent box: warm gold rule + readable text */
.accent-box {
  border-left: 4px solid rgba(217, 164, 65, 0.9);
  padding-left: 12px;
  margin-top: 10px;
  color: var(--muted);
}
.accent-box strong { color: var(--ink); }

.timeline {
  --line-x: 10px;
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: var(--line-x);
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, rgba(217, 164, 65, 0.6), rgba(47, 107, 79, 0.35));
  border-radius: 999px;
}

.timeline-item {
  position: relative;
  padding: 2px 0 8px 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 9px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.18);
  transform: translateX(-50%);
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 6px;
  font-family: Fraunces, ui-serif, Georgia, serif;
}

.timeline-body {
  color: var(--muted);
  font-size: 0.96rem;
  padding-bottom: 2px;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s ease forwards;
}

.reveal.delay-1 { animation-delay: 0.08s; }
.reveal.delay-2 { animation-delay: 0.16s; }
.reveal.delay-3 { animation-delay: 0.24s; }
.reveal.delay-4 { animation-delay: 0.32s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
}

.footer {
  margin-top: 22px;
  font-size: 0.92rem;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.chip {
  background: rgba(31, 35, 40, 0.06);
  color: var(--ink);
  font-weight: 650;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid rgba(31, 35, 40, 0.10);
}

.range-output {
  font-weight: 800;
  color: var(--basil);
  letter-spacing: 0.1px;
}

/* Small helper badge (optional) */
.badge-warn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(198, 75, 59, 0.10);
  color: var(--ink);
  border: 1px solid rgba(198, 75, 59, 0.28);
  font-weight: 650;
  font-size: 0.92rem;
}

.percentage {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1rem;
  color: var(--muted);
  margin-left: 7px;

  background: rgba(31, 35, 40, 0.06);
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(31, 35, 40, 0.10);
}