/* =========================================================
   Bar Profit Lab — Calculateur de surdosage
   Visual layer only. Every id / class used by js/app.js is kept.
   Palette: forest, deep forest, orange, cream (+ chart red in app.js).
   ========================================================= */

:root {
  --forest: #164B3C;
  --forest-deep: #0E3329;
  --orange: #F28A35;
  --cream: #F4EBDD;

  --ink: var(--forest-deep);
  --muted: rgba(14, 51, 41, .72);
  --rule: rgba(22, 75, 60, .28);
  --rule-strong: rgba(22, 75, 60, .6);
  --cream-muted: rgba(244, 235, 221, .72);
  --cream-rule: rgba(244, 235, 221, .26);

  --display: 'Archivo', 'Arial Narrow', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --gutter: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 800; font-stretch: 72%; letter-spacing: -.025em; line-height: .92; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
strong { font-weight: 700; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.page {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--orange);
  transform: rotate(45deg);
}

/* Art Deco frieze: double rule + diamonds */
.frieze {
  height: 18px;
  background-color: var(--forest);
  -webkit-mask: url('../img/frieze.svg') repeat-x center / 48px 18px;
  mask: url('../img/frieze.svg') repeat-x center / 48px 18px;
}
.frieze-light { background-color: var(--cream); opacity: .55; }

/* ---------- Masthead ---------- */
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px 16px;
}
.masthead { position: sticky; top: 0; z-index: 30; background: var(--cream); }
.masthead-inner { transition: padding .35s var(--ease); }
.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 56px;
  padding-left: 152px;
  transition: padding-left .35s var(--ease);
}
.brand-mark {
  position: absolute;
  z-index: 1;
  left: 0;
  top: -10px;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--cream), 0 0 0 6px var(--forest);
  transition: width .35s var(--ease), height .35s var(--ease), top .35s var(--ease), box-shadow .35s var(--ease);
}
.brand-mark .bm { display: block; width: 100%; height: 100%; border-radius: 50%; }
.masthead.is-compact .masthead-inner { padding-block: 10px; }
.masthead.is-compact .brand { padding-left: 68px; }
.masthead.is-compact .brand-mark { top: 0; width: 56px; height: 56px; box-shadow: 0 0 0 2px var(--cream), 0 0 0 3px var(--forest); }
html { scroll-padding-top: 120px; }
.brand-name {
  font-weight: 800;
  font-stretch: 72%;
  font-size: 1.25rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.brand-sep { color: var(--orange); font-weight: 700; }
.brand-tag, .masthead-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-block: clamp(48px, 8vw, 112px) clamp(56px, 8vw, 104px);
}
.hero-kicker { color: var(--forest); }
.tool-id { display: flex; flex-direction: column; gap: 6px; }
.tool-id .kicker { color: var(--forest); }
.tool-name { font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--forest); }
.tool-meta { font-family: var(--mono); font-size: 12px; line-height: 1.5; letter-spacing: .04em; color: var(--muted); }
.hero h1 {
  font-size: clamp(3.4rem, 10.5vw, 9.25rem);
  line-height: .86;
  letter-spacing: -.045em;
  word-spacing: .08em;
  color: var(--forest);
}
.hero .hl { color: var(--orange); }
.hero-sub { display: flex; }
.lede {
  max-width: 36ch;
  padding-top: 18px;
  border-top: 1px solid var(--rule-strong);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.5;
}
.hero-art {
  margin: 0;
  justify-self: center;
  width: min(100%, 340px);
  padding: 64px 30px 18px;
  background: var(--forest);
  border-radius: 999px 999px 0 0;
  box-shadow: 0 0 0 7px var(--cream), 0 0 0 8px var(--forest);
}
.jigger { display: block; width: 100%; height: auto; overflow: visible; }
.hero-art .ill-line { fill: none; stroke: var(--cream); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .ill-thin { stroke-width: 1; opacity: .55; }
.hero-art .ill-liquid { fill: rgba(244, 235, 221, .2); }
.hero-art .ill-surplus { fill: var(--orange); }
.hero-art .ill-pour { fill: none; stroke: var(--orange); stroke-width: 5; stroke-linecap: round; }
.hero-art .ill-ruler path { fill: none; stroke: var(--cream); stroke-width: 1; opacity: .5; }
.hero-art .ill-lead path { fill: none; stroke: var(--cream); stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.hero-art .ill-small { fill: var(--cream); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.hero-art .ill-tiny { fill: var(--cream-muted); font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; }
.hero-art .ill-accent { fill: var(--orange); }

@media (min-width: 900px) {
  .hero {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 32px;
    align-items: end;
  }
  .hero-kicker { grid-column: 1 / -1; }
  .hero h1 { grid-column: 1 / 9; }
  .hero-sub { grid-column: 2 / 7; }
  .hero-art { grid-column: 9 / 13; grid-row: 2 / span 2; justify-self: end; }
}

/* entrance sequence */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero > * { animation: rise .9s var(--ease) both; }
.hero > :nth-child(2) { animation-delay: .08s; }
.hero > :nth-child(3) { animation-delay: .2s; }
.hero > :nth-child(4) { animation-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .hero > * { animation: none; }
}

/* ---------- Workbench ---------- */
.workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding-bottom: clamp(64px, 9vw, 120px);
}
@media (min-width: 1000px) {
  .workbench {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
    align-items: start;
  }
  .results { position: sticky; top: 112px; }
}

.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.section-head .kicker { color: var(--forest); }
.section-title { font-size: clamp(2.2rem, 4.5vw, 3.6rem); color: var(--forest); }

.presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 28px;
}
.presets > span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  margin-right: 6px;
}
.preset {
  border: 1px solid var(--forest);
  border-radius: 0;
  background: transparent;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--forest);
  transition: background-color .2s, color .2s;
}
.preset:hover { background: var(--forest); color: var(--cream); }

.control {
  padding-block: 28px 30px;
  border-top: 1px solid var(--rule);
}
.control:last-child { border-bottom: 1px solid var(--rule); }
.control-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.control label {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}
.label-row { display: flex; align-items: center; gap: 10px; }
.info-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1.5px solid var(--forest);
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.info-btn::before { content: ""; position: absolute; inset: -10px; }
.info-btn { position: relative; }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--forest); color: var(--cream); }
.info-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.hint[hidden] { display: none; }
.hint {
  display: block;
  margin-top: 6px;
  max-width: 42ch;
  font-size: .925rem;
  line-height: 1.45;
  color: var(--muted);
}
.value-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: none;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--forest);
  transition: border-color .2s;
}
.value-box:focus-within { border-color: var(--orange); }
.value-box input {
  width: 5.2ch;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: right;
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  font-weight: 800;
  font-stretch: 72%;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
}
.value-box input:focus { outline: none; }
.unit {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.equiv {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.equiv:empty { display: none; }

/* ---------- Range sliders ---------- */
input[type="range"] {
  --track: var(--rule);
  --thumb-ring: var(--forest);
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 36px;
  margin: 18px 0 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(to right, var(--orange) var(--fill, 50%), var(--track) var(--fill, 50%));
}
input[type="range"] {
  --drop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 28'%3E%3Cpath d='M11 1.5S2.5 12 2.5 18a8.5 8.5 0 0 0 17 0C19.5 12 11 1.5 11 1.5Z' fill='%23F28A35' stroke='%23164B3C' stroke-width='2'/%3E%3Cpath d='M7 18.5a4 4 0 0 0 3 3.6' fill='none' stroke='%23F4EBDD' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 28px;
  margin-top: -14px;
  border: 0;
  border-radius: 0;
  background: var(--drop) center / contain no-repeat;
  transform-origin: 50% 70%;
  transition: transform .15s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--orange); outline-offset: 3px; }
input[type="range"]::-moz-range-track { height: 3px; background: var(--track); }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--orange); }
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: var(--drop) center / contain no-repeat;
}
input[type="range"]:focus-visible::-moz-range-thumb { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- Results ---------- */
.results {
  position: relative;
  container-type: inline-size;
  padding: clamp(30px, 4vw, 44px);
  background: var(--forest);
  color: var(--cream);
}
.results::before,
.results::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--cream-rule);
}
.results::before { inset: 10px; }
.results::after { inset: 14px; opacity: .55; }
.results > * { position: relative; }

.results-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sim-badge {
  padding: 6px 14px;
  background: var(--orange);
  color: var(--forest-deep);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.cap-sim { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sim-tag {
  padding: 2px 7px;
  border: 1px solid var(--orange);
  color: var(--orange);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
}
.sim-note { font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--cream-muted); }
.results-disclaimer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--cream-rule);
  font-size: .9rem;
  line-height: 1.55;
  color: var(--cream-muted);
  text-wrap: pretty;
}

.cap {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream-muted);
}
.big-loss { margin-top: 36px; }
.amount {
  margin-block: 10px 12px;
  font-size: clamp(3.5rem, 9vw, 6.5rem);
  font-size: min(7rem, 19cqi);
  font-weight: 800;
  font-stretch: 68%;
  line-height: .84;
  letter-spacing: -.045em;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.per { max-width: 30ch; font-size: .975rem; color: var(--cream-muted); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 32px;
  border-top: 1px solid var(--cream-rule);
}
.stat {
  position: relative;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--cream-rule);
}
.stat:nth-child(odd) { padding-right: 16px; border-right: 1px solid var(--cream-rule); }
.stat:nth-child(even) { padding-left: 18px; }
.stat .val {
  margin-block: 6px 4px;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 800;
  font-stretch: 72%;
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-month .val { color: var(--orange); }
.stat .sub { font-family: var(--mono); font-size: 11.5px; color: var(--cream-muted); }
.stat-ill {
  position: absolute;
  right: 4px;
  bottom: 16px;
  height: 54px;
  width: auto;
  fill: none;
  stroke: var(--cream);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .6;
}

/* ---------- Chart panel ---------- */
.chart-panel {
  position: relative;
  background: var(--forest-deep);
  color: var(--cream);
  padding-bottom: clamp(56px, 8vw, 96px);
}
.chart-inner { padding-top: clamp(44px, 6vw, 72px); }
.chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cream-rule);
}
.chart-brand {
  font-weight: 800;
  font-stretch: 72%;
  font-size: 1rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--orange);
}
.chart-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cream-muted);
}
.chart-title {
  max-width: 15ch;
  margin-block: 28px 36px;
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 40px;
}
.chart-group-label {
  display: block;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream-muted);
}
.seg { display: inline-flex; border: 1px solid var(--cream); }
.seg button {
  padding: 11px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background-color .2s, color .2s;
}
.seg button + button { border-left: 1px solid var(--cream); }
.seg button[aria-pressed="true"] { background: var(--orange); color: var(--forest-deep); }
.seg button:not([aria-pressed="true"]):hover { background: rgba(244, 235, 221, .1); }

.band-sliders { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.band-slider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.band-slider input[type="range"] {
  --track: var(--cream-rule);
  --thumb-ring: var(--cream);
  width: 150px;
  margin: 0;
}
.band-slider input[type="range"] {
  --drop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 28'%3E%3Cpath d='M11 1.5S2.5 12 2.5 18a8.5 8.5 0 0 0 17 0C19.5 12 11 1.5 11 1.5Z' fill='%23F28A35' stroke='%23F4EBDD' stroke-width='2'/%3E%3C/svg%3E");
}
.band-out { min-width: 5ch; font-variant-numeric: tabular-nums; color: var(--cream); }

.chart-frame {
  margin-top: 28px;
  padding-block: 8px;
  border-block: 1px solid var(--cream-rule);
}
#chart { display: block; width: 100%; height: auto; touch-action: pan-y; cursor: crosshair; }
#chart:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
#chart .tick { fill: var(--cream-muted); font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
#chart .axis-title { fill: var(--cream); font-family: var(--display); font-size: 12.5px; font-weight: 600; }
#chart .grid-line { stroke: rgba(244, 235, 221, .13); stroke-width: 1; }
#chart .curve-name { font-family: var(--display); font-size: 12.5px; font-weight: 700; }
#marker-label {
  fill: var(--cream);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--forest-deep);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.chart-notes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 28px;
}
@media (min-width: 860px) {
  .chart-notes { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; }
}
.probe-readout {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--cream-muted);
}
.probe-readout strong {
  display: inline-block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--cream);
}
.legend { display: flex; flex-direction: column; gap: 9px; font-size: .9rem; line-height: 1.4; }
.legend span { display: flex; align-items: center; gap: 12px; }
.legend .sw { display: inline-block; flex: none; width: 22px; height: 8px; }
.legend .legend-cur { color: var(--orange); font-weight: 600; }
.sensitivity {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--cream-rule);
  max-width: 72ch;
  font-size: 1.05rem;
  line-height: 1.55;
}
.sensitivity:empty { display: none; }

/* ---------- Email ---------- */
.email-box { padding-block: clamp(24px, 4vw, 48px) clamp(64px, 9vw, 128px); }
.email-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: clamp(28px, 5vw, 56px);
  background: rgba(22, 75, 60, .06);
  border: 1.5px solid var(--forest);
  outline: 1px solid var(--rule);
  outline-offset: 6px;
}
@media (min-width: 860px) {
  .email-card { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 56px; align-items: start; }
  .email-ill { justify-self: end; }
}
.email-ill {
  width: clamp(88px, 14vw, 170px);
  height: auto;
  fill: none;
  stroke: var(--forest);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.email-ill .ill-fill { fill: var(--orange); stroke: none; }
.email-body { display: flex; flex-direction: column; gap: 18px; max-width: 680px; }
.email-body .kicker { color: var(--forest); }
.email-body h2 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); color: var(--forest); }
.email-body > p { max-width: 58ch; font-size: 1.05rem; color: var(--muted); }
.email-row { display: flex; flex-wrap: wrap; gap: 14px 18px; margin-top: 10px; }
.email-row input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  border-bottom: 2px solid var(--forest);
  border-radius: 0;
  background: transparent;
  font-size: 1.125rem;
  transition: border-color .2s;
}
.email-row input::placeholder { color: rgba(14, 51, 41, .45); }
.email-row input:focus { outline: none; border-color: var(--orange); }
.email-msg { min-height: 1.5em; font-family: var(--mono); font-size: 13px; color: var(--forest); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 17px 26px;
  border: 0;
  border-radius: 0;
  background: var(--forest);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  transition: background-color .2s, color .2s;
}
.btn:hover { background: var(--orange); color: var(--forest-deep); }

/* ---------- CTA ---------- */
.cta { background: var(--orange); color: var(--forest-deep); }
.cta-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding-block: clamp(64px, 9vw, 120px);
}
@media (min-width: 960px) {
  .cta-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 72px; }
}
.cta-body { display: flex; flex-direction: column; gap: 22px; }
.cta-body .kicker::before { background: var(--forest-deep); }
.cta h2 { max-width: 13ch; font-size: clamp(2.6rem, 6.5vw, 5.75rem); }
.cta p { max-width: 54ch; font-size: 1.075rem; }
.cta ul { margin: 6px 0 10px; padding: 0; list-style: none; }
.cta li {
  position: relative;
  padding: 14px 0 14px 30px;
  border-top: 1px solid rgba(14, 51, 41, .3);
  line-height: 1.45;
}
.cta li:last-child { border-bottom: 1px solid rgba(14, 51, 41, .3); }
.cta li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 21px;
  width: 8px;
  height: 8px;
  background: var(--forest-deep);
  transform: rotate(45deg);
}
.btn-light { align-self: flex-start; background: var(--forest-deep); color: var(--cream); }
.btn-light:hover { background: var(--cream); color: var(--forest-deep); }

.cta-pattern {
  position: relative;
  min-height: 260px;
  background: var(--forest);
  overflow: hidden;
  -webkit-mask: url('../img/backbar.svg') no-repeat center bottom / contain;
  mask: url('../img/backbar.svg') no-repeat center bottom / contain;
}
.cta-pattern::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--cream);
  opacity: .5;
  -webkit-mask: url('../img/lattice.svg') repeat center / 44px 44px;
  mask: url('../img/lattice.svg') repeat center / 44px 44px;
}

@media (min-width: 960px) { .cta-pattern { min-height: 0; } }

/* ---------- Fine print ---------- */
.fine-print { padding-block: clamp(64px, 9vw, 112px); }
.fine-print .kicker { color: var(--forest); }
.fine-print-title { margin-top: 14px; font-size: clamp(2rem, 4vw, 3rem); color: var(--forest); }
.spoon {
  display: block;
  width: min(420px, 100%);
  height: auto;
  margin-block: 24px 40px;
  fill: none;
  stroke: var(--forest);
  stroke-width: 1.4;
  stroke-linecap: round;
}
.spoon .ill-thin { stroke-width: 1; opacity: .55; }
.method-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 860px) { .method-grid { grid-template-columns: 1fr 1fr; gap: 56px; } }
.method-col { display: flex; flex-direction: column; gap: 20px; }
.disclaimer {
  padding: 20px 22px;
  border: 1px solid var(--forest);
  outline: 1px solid var(--rule);
  outline-offset: 5px;
  font-size: .975rem;
  line-height: 1.55;
}
.disclaimer strong { display: block; margin-bottom: 4px; }
.chart-note, .formula, .fine { font-size: .95rem; line-height: 1.6; color: var(--muted); }
.formula { color: var(--ink); }
.formula code { display: inline-block; max-width: 100%; white-space: normal; line-height: 1.55; }
.method-block { display: flex; flex-direction: column; gap: 10px; }
.method-h {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--forest);
}
.vars { margin: 0; display: flex; flex-direction: column; }
.vars > div { padding: 10px 0; border-top: 1px solid var(--rule); }
.vars > div:last-child { border-bottom: 1px solid var(--rule); }
.vars dt { font-weight: 700; color: var(--ink); }
.vars dd { margin: 2px 0 0; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.fine-print { scroll-margin-top: 96px; }
.method-summary { display: flex; flex-direction: column; gap: 16px; max-width: 68ch; }
.method-key { font-size: 1rem; line-height: 1.55; font-weight: 700; color: var(--ink); }
.method-more { margin-top: 28px; border-top: 1px solid var(--rule); }
.method-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 0;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--forest);
  cursor: pointer;
  list-style: none;
}
.method-more > summary::-webkit-details-marker { display: none; }
.method-more > summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--forest);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0;
  transition: transform .25s var(--ease), background-color .2s, color .2s;
}
.method-more[open] > summary::after { transform: rotate(45deg); background: var(--forest); color: var(--cream); }
.method-more > summary:hover { color: var(--forest-deep); }
.method-more > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.method-more > .method-grid { margin-top: 20px; }
.results-disclaimer a { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--orange); white-space: nowrap; }
.results-disclaimer a:hover { color: var(--orange); }
.limits { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2px 6px;
  background: rgba(22, 75, 60, .09);
  color: var(--forest-deep);
}

/* ---------- Footer ---------- */
footer { background: var(--forest); color: var(--cream); }
footer > .frieze { margin-top: 0; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px 40px;
  padding-block: 48px 52px;
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.footer-logo {
  display: block;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--forest), 0 0 0 6px var(--cream-rule);
  transition: transform .5s var(--ease);
}
.footer-logo:hover { transform: rotate(-6deg); }
.sig { font-weight: 800; font-stretch: 72%; font-size: 2rem; letter-spacing: -.01em; text-transform: uppercase; }
.manifesto { display: flex; flex-direction: column; gap: 14px; max-width: 58ch; }
.manifesto p { font-size: 1rem; line-height: 1.6; color: var(--cream-muted); text-wrap: pretty; }
.manifesto .manifesto-lead { font-size: 1.35rem; line-height: 1.35; font-weight: 600; color: var(--cream); text-wrap: balance; }
.manifesto .manifesto-values {
  margin-top: 6px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
}
.manifesto .manifesto-close { font-weight: 600; color: var(--orange); }
.manifesto .footer-note {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 232, 209, .18);
  font-size: .85rem;
}
footer::after {
  content: "";
  display: block;
  height: 56px;
  background-color: var(--orange);
  -webkit-mask: url('../img/jiggers.svg') repeat-x 0 center / 64px 56px;
  mask: url('../img/jiggers.svg') repeat-x 0 center / 64px 56px;
  animation: drift-x 14s linear infinite;
}
@keyframes drift-x { to { -webkit-mask-position: 64px center; mask-position: 64px center; } }

/* ---------- Living layer ---------- */
.cta-pattern::before { animation: drift 48s linear infinite; }
@keyframes drift { to { -webkit-mask-position: 44px 44px; mask-position: 44px 44px; } }

.results > .results-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: var(--cream);
  opacity: calc(.03 + var(--heat, .5) * .11);
  -webkit-mask: url('../img/lattice.svg') repeat 0 0 / 44px 44px;
  mask: url('../img/lattice.svg') repeat 0 0 / 44px 44px;
  transition: opacity .8s var(--ease);
  animation: drift 60s linear infinite;
}

/* header logo: a live gauge of the surplus slider */
.bm-bg, .bm-bgfill { fill: var(--forest-deep); }
.bm-rim { fill: none; stroke: var(--cream); stroke-opacity: .38; }
.bm-rim-thin { stroke-opacity: .2; }
.bm-cream { fill: var(--cream); }
.bm-orange { fill: var(--orange); }
.bm-lip { stroke: var(--cream); stroke-width: 12; stroke-linecap: round; }
.bm-o { fill: none; stroke: var(--orange); stroke-linecap: round; }
.bm-jigger { transform-box: view-box; transform-origin: 540px 470px; transition: transform .5s var(--ease); }
.brand-mark:hover .bm-jigger { transform: rotate(-7deg); }
.brand-mark { --bm-rest: 0px; --bm-men: 1; }
.brand-mark[data-level="0"] { --bm-rest: 16px; --bm-men: 0; }
.brand-mark[data-level="1"] { --bm-men: .55; }
.brand-mark[data-level="3"] { --bm-men: 1.5; }
.brand-mark[data-level="0"] :is(.bm-drop, .bm-splash) { display: none; }
.brand-mark:not([data-level="3"]) .bm-drop2 { display: none; }
.bm-stream { stroke-dasharray: 124 400; animation: bm-stream 7s cubic-bezier(.4,0,.2,1) infinite both; }
.bm-liquid { animation: bm-liquid 7s infinite both; }
.bm-meniscus { transform-box: fill-box; transform-origin: 50% 100%; animation: bm-meniscus 7s infinite both; }
.bm-drop { transform-box: fill-box; transform-origin: 50% 50%; animation: bm-drop 7s infinite both; }
.bm-drop2 { animation-delay: .45s; }
.bm-splash { transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; animation: bm-splash 7s infinite both; }
.bm-dip { transform-box: fill-box; animation: bm-dip 7s infinite both; }
.brand-mark[data-level="0"] .bm-dip { animation: none; }
.bm-spin { transform-box: fill-box; transform-origin: 50% 50%; animation: bm-spin 1s ease-in-out infinite alternate; }
.bm-twist { animation: bm-twist 2s linear infinite; }
@keyframes bm-stream { 0% { stroke-dashoffset: 124; } 8%, 46% { stroke-dashoffset: 0; } 54%, 100% { stroke-dashoffset: -124; } }
@keyframes bm-liquid {
  0% { transform: translateY(262px); opacity: 1; }
  6% { transform: translateY(262px); animation-timing-function: cubic-bezier(.3,.6,.4,1); }
  46%, 88% { transform: translateY(var(--bm-rest)); opacity: 1; }
  96% { transform: translateY(var(--bm-rest)); opacity: 0; }
  100% { transform: translateY(262px); opacity: 0; }
}
@keyframes bm-meniscus {
  0%, 40% { transform: scaleY(0); opacity: 1; }
  49%, 88% { transform: scaleY(var(--bm-men)); opacity: 1; }
  96%, 100% { transform: scaleY(var(--bm-men)); opacity: 0; }
}
@keyframes bm-drop {
  0%, 49% { transform: translateY(0) scale(0); opacity: 1; }
  55% { transform: translateY(0) scale(1); }
  58% { transform: translateY(6px) scale(.95, 1.1); animation-timing-function: cubic-bezier(.55,0,1,.6); }
  66% { transform: translateY(596px) scale(.8, 1.25); opacity: 1; }
  66.5%, 100% { transform: translateY(596px) scale(0); opacity: 0; }
}
@keyframes bm-splash { 0%, 66% { transform: scale(.2); opacity: 0; } 67% { transform: scale(.4); opacity: 1; } 76%, 100% { transform: scale(1.6); opacity: 0; } }
@keyframes bm-dip { 0%, 66% { transform: translateY(0); } 69% { transform: translateY(7px); } 74% { transform: translateY(-2px); } 78%, 100% { transform: translateY(0); } }
@keyframes bm-spin { from { transform: scaleY(1); } to { transform: scaleY(.22); } }
@keyframes bm-twist { to { transform: translateX(14px); } }

/* hero jigger reacts to the surplus slider */
.hero-art .ill-dome { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(var(--surplus, 1)); transition: transform .5s var(--ease); }
.hero-art .ill-pour { stroke-dasharray: .1 9; animation: pour .7s linear infinite; }
.hero-art .ill-drop { transform-box: fill-box; transform-origin: 50% 0; animation: hero-drip 2.8s ease-in infinite; }
.hero-art.is-dry .ill-drop { visibility: hidden; }
@keyframes pour { to { stroke-dashoffset: -9.1; } }
@keyframes hero-drip {
  0%, 30% { transform: translateY(-3px) scale(.3); opacity: 0; }
  50%, 70% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(120px) scale(.85); opacity: 0; }
}

/* email glass fills when you start typing */
.email-ill .ill-fill { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(.35); transition: transform .9s var(--ease); }
.email-box:focus-within .email-ill .ill-fill { transform: scaleY(1); }

/* figures flash when a slider moves them */
.stat .val.is-bump { animation: flash-orange .8s ease-out; }
.amount.is-bump, .stat-month .val.is-bump { animation: flash-cream .8s ease-out; }
@keyframes flash-orange { 0%, 25% { color: var(--orange); } }
@keyframes flash-cream { 0%, 25% { color: var(--cream); } }
.stat-bottles.is-tip .stat-ill { transform-origin: 50% 100%; animation: tip .8s var(--ease); }
@keyframes tip { 30% { transform: rotate(-16deg); } 60% { transform: rotate(6deg); } 100% { transform: none; } }

/* slider value bubble */
.range-wrap { position: relative; --p: .5; }
.range-bubble {
  position: absolute;
  top: 14px;
  left: calc(11px + (100% - 22px) * var(--p));
  padding: 3px 8px;
  background: var(--forest);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%) translateY(6px);
  transition: opacity .15s, transform .15s;
}
.range-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}
.range-wrap.is-dragging .range-bubble,
.range-wrap:has(input:focus-visible) .range-bubble { opacity: 1; transform: translate(-50%, -100%); }

/* scroll reveals (classes are added by ui.js only when motion is allowed) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal-line { clip-path: inset(0 100% 0 0); transition: clip-path 1.4s var(--ease) var(--d, 0s); }
.reveal-line.is-in { clip-path: inset(0); }
.chart-frame.is-pending :is(#chart-curves, #marker-dot, #marker-label) { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  footer::after, .cta-pattern::before, .results > .results-texture,
  .hero-art .ill-pour, .hero-art .ill-drop,
  .bm-stream, .bm-liquid, .bm-meniscus, .bm-drop, .bm-splash, .bm-dip, .bm-spin, .bm-twist { animation: none; }
  .bm-stream { stroke-dashoffset: 0; }
  .bm-liquid { transform: translateY(var(--bm-rest)); }
  .bm-meniscus { transform: scaleY(var(--bm-men)); }
  .bm-drop2, .bm-splash { display: none; }
  .masthead-inner, .brand, .brand-mark, .bm-jigger, .hero-art .ill-dome, .email-ill .ill-fill { transition: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .masthead-meta { display: none; }
  .brand { padding-left: 106px; }
  .brand-mark { top: -6px; width: 92px; height: 92px; }
  .footer-logo { width: 104px; height: 104px; }
  .control-head { flex-wrap: wrap; }
  .value-box { margin-left: auto; }
  .stat:nth-child(even) { padding-left: 14px; }
  .chart-frame { margin-inline: calc(var(--gutter) * -0.5); }
  .band-slider input[type="range"] { width: 120px; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .btn, .btn-light { width: 100%; }
}

/* ---------- Print ---------- */
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .email-box, #cta-btn, .presets, .frieze, footer::after, .hero-art { display: none !important; }
  .results { position: static; }
  .masthead { position: static; }
  .hero > * { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
