/* ---------- tokens ---------- */
:root {
  --white: #fff;
  --stone: #f5f7f4;
  --stone-2: #eaeee8;
  --rule: #e1e6df;
  --rule-2: #c6d0c4;
  --ink: #12130f;
  --ink-2: #3c4339;
  --ink-3: #5c6658;
  --accent: #477661;
  --accent-deep: #355a49;
  --accent-wash: #e6f2e8;
  --warn: #b42318;
  --warn-wash: #fdefed;
  --amber: #8a5300;
  --amber-wash: #fdf3e1;

  --display: "Figtree", system-ui, -apple-system, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, sans-serif;
  /* Figures are set in the text face, with equal-width digits. */
  --mono: "Figtree", system-ui, -apple-system, sans-serif;

  --gutter: clamp(20px, 4.4vw, 64px);
  --max: 1200px;
  --radius: 10px;
  --radius-large: 16px;
  --shadow: 0 1px 2px rgb(18 19 15 / 0.05), 0 18px 48px -12px rgb(18 19 15 / 0.14);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ol, ul, figure, fieldset { margin: 0; padding: 0; }
svg[hidden] { display: none; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--white); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2 {
  font-family: var(--display);
  font-weight: 380;
  letter-spacing: -0.022em;
  font-optical-sizing: auto;
  text-wrap: balance;
}
h2 { font-size: clamp(36px, 4.6vw, 62px); line-height: 1.04; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.num { text-align: right; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 20;
  background: var(--ink); color: var(--white); padding: 10px 16px;
}
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 20px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: transparent;
  font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.button--solid { background: var(--ink); color: var(--white); }
.button--solid:hover { background: var(--accent); border-color: var(--accent); }
.button--light { border-color: rgb(255 255 255 / 0.65); color: var(--white); }
.button--light:hover { background: var(--white); color: var(--accent-deep); }
.button--large { min-height: 54px; padding: 0 30px; font-size: 16px; }
.link {
  border: 0; background: none; padding: 6px 0; cursor: pointer;
  font-size: 13px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule-2);
}
.link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 76px;
}
.mark {
  display: inline-flex; align-items: flex-start; gap: 7px; justify-self: start;
  font: 500 30px/1 var(--display); letter-spacing: -0.02em; text-decoration: none;
}
.mark__zero {
  margin-top: 1px; padding: 2px 4px 1px;
  background: var(--accent); color: var(--white);
  font: 500 9px/1.2 var(--mono); letter-spacing: 0.02em;
}
.nav { display: flex; gap: 36px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 6px 0; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.site-header .button { justify-self: end; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  column-gap: 40px; align-items: end;
  padding-top: clamp(44px, 6vw, 92px); padding-bottom: clamp(30px, 3.4vw, 48px);
}
.hero h1 { font-size: clamp(44px, 7vw, 104px); line-height: 0.96; letter-spacing: -0.032em; }
.hero__side { max-width: 370px; justify-self: end; padding-bottom: 6px; }
.hero__side p { font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.hero__side .hero__hint {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink);
  font-size: 13px; color: var(--ink);
}

/* The measuring-scale motif: a tick every 8 px, a long one every 40. */
.scale {
  height: 18px;
  background-image:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, var(--rule-2) 0 1px, transparent 1px 8px);
  background-size: 100% 18px, 100% 8px;
  background-position: left bottom;
  background-repeat: no-repeat;
  background-origin: content-box;
  background-clip: content-box;
}

/* ---------- the moving field behind the headline (js/shader.js) ---------- */
/* contain: paint keeps the canvas inside, and lets it sit under the content. */
.shader { contain: paint; }
.shader__canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
/* A soft pool of white under the words keeps them readable on any frame. */
/* No isolation on these two: every pool must sit under all the words, not just its own. */
#hero-field .hero h1, #hero-field .hero__side { position: relative; }
#hero-field .hero h1::before, #hero-field .hero__side::before {
  content: ""; position: absolute; inset: -28px -40px; z-index: -1;
  background: rgb(255 255 255 / 0.76); border-radius: 50%; filter: blur(32px);
}

/* ---------- tool ---------- */
.tool { background: var(--stone); padding-block: clamp(20px, 3vw, 44px) clamp(48px, 6vw, 88px); scroll-margin-top: 0; }
.tool .wrap { padding-inline: clamp(10px, 3vw, 44px); max-width: calc(var(--max) + 88px); }
.noscript { padding: 20px 0; }
.panel { background: var(--white); border: 1px solid var(--ink); border-radius: var(--radius); }

/* ---------- client sheet ---------- */
.client { background: var(--accent-deep); color: var(--white); padding-block: clamp(64px, 9vw, 136px); }
.client__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: start; }
.client__copy { position: sticky; top: 56px; max-width: 460px; }
.client__copy p { margin-top: 20px; font-size: 18px; color: rgb(255 255 255 / 0.82); }
.client__copy p + p { margin-top: 10px; }
.client__copy .button { margin-top: 32px; }

.sheet {
  width: 100%; max-width: 640px; justify-self: end;
  padding: clamp(24px, 4vw, 52px);
  background: var(--white); color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 30px 70px -20px rgb(0 0 0 / 0.55);
}
.sheet__head { padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.sheet__brand { font: 500 15px var(--display); color: var(--accent); }
.sheet__head h3 { margin-top: 18px; font: 400 40px/1.05 var(--display); letter-spacing: -0.025em; }
.sheet__for { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.sheet__totals { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 14px; font: 400 12px/1.7 var(--mono); }
.sheet__totals span { white-space: nowrap; }
.sheet__meal { padding-top: 20px; break-inside: avoid; }
.sheet__meal h4 { display: flex; justify-content: space-between; align-items: baseline; font: 500 18px var(--display); }
.sheet__meal h4 span { font: 400 11px var(--mono); color: var(--ink-3); }
.sheet__meal ul { margin-top: 6px; }
.sheet__meal li {
  display: grid; grid-template-columns: 164px minmax(16px, 1fr) 52px 118px; align-items: baseline; column-gap: 8px;
  padding-block: 4px; font-size: 14px;
}
.sheet__food small { display: block; font-size: 11px; color: var(--ink-3); line-height: 1.3; }
.sheet__lead { border-bottom: 1px dotted var(--rule-2); transform: translateY(-3px); }
.sheet__grams { text-align: right; font: 500 14px var(--mono); }
.sheet__measure { font-size: 12px; color: var(--ink-2); }
.sheet__foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ink); font-size: 11px; color: var(--ink-3); }
.sheet__sign { margin-top: 34px; padding-top: 6px; width: 220px; border-top: 1px solid var(--rule-2); }

/* ---------- method ---------- */
.method { padding-block: clamp(72px, 9vw, 136px); }
.method h2 { max-width: 14ch; }
.steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  margin-top: 56px; counter-reset: step;
}
.steps li { counter-increment: step; padding-top: 16px; border-top: 1px solid var(--ink); }
.steps li::before { content: counter(step, decimal-leading-zero); font: 500 12px var(--mono); color: var(--accent); }
.steps h3 { margin-top: 30px; font: 500 22px/1.2 var(--display); }
.steps p { margin-top: 10px; font-size: 15px; color: var(--ink-2); }

/* ---------- closing and footer ---------- */
.closing { background: var(--stone); padding-bottom: clamp(72px, 9vw, 128px); }
.closing .scale { margin-bottom: clamp(56px, 7vw, 100px); transform: scaleY(-1); }
.closing__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; }
.closing h2 { font-size: clamp(44px, 7vw, 104px); letter-spacing: -0.032em; line-height: 0.96; max-width: 12.6ch; }
.case { width: 100%; max-width: 420px; justify-self: end; }
.case p { font-size: 18px; }
.case dl { margin: 16px 0 28px; border-top: 1px solid var(--ink); }
.case dl div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--rule-2); }
.case dt { font-size: 13px; color: var(--ink-2); }
.case dd { margin: 0; text-align: right; font: 500 14px var(--mono); }
.case .button { width: 100%; }

.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 40px;
  padding-block: 32px 44px; font-size: 13px; color: var(--ink-3);
}
.site-footer strong { color: var(--ink); font-weight: 500; }

/* ---------- narrower screens ---------- */

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .hero__side { justify-self: start; max-width: 520px; }
  
  
  
  .client__grid, .closing__grid { grid-template-columns: minmax(0, 1fr); }
  .case { justify-self: start; }
  .client__copy { position: static; }
  .sheet { justify-self: start; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .site-header { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  
  
  
  
  
  
  

  
  
  
  
  
  
  
  
  
  
  
  

  
  
  
  
  
  
  

  .sheet__meal li { grid-template-columns: minmax(0, 1fr) 52px; }
  .sheet__lead { display: none; }
  .sheet__measure { grid-column: 1 / -1; }
  .sheet__food small { display: inline; margin-left: 6px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- print: the client sheet only ---------- */
@media print {
  .skip, .site-header, #hero-field, .hero, .scale, .tool, .method, .closing, .site-footer, .client__copy { display: none !important; }
  .client { background: none; padding: 0; }
  .client__grid { display: block; padding: 0; }
  .sheet { max-width: none; padding: 0; box-shadow: none; }
  .sheet__brand { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 16mm; }
}
