/* Pinch: a field guide to everyday cooking.
   Identity: warm paper, ink, and nine element colours, one per element. */

:root {
  --paper: #f6efe3;
  --paper-2: #efe5d4;
  --paper-3: #e6d9c3;
  --card: #fbf7f0;
  --ink: #1f1a15;
  --ink-2: #5b5047;
  --ink-3: #8a7d70;
  --line: rgba(31, 26, 21, 0.14);
  --line-2: rgba(31, 26, 21, 0.28);
  --shadow: 0 1px 0 rgba(31, 26, 21, 0.06), 0 10px 30px -12px rgba(60, 40, 20, 0.25);

  --salt: #4d7798;
  --fat: #d39b12;
  --acid: #7f9f12;
  --sweet: #c0622a;
  --heat: #d63f27;
  --umami: #7b3a5f;
  --bitter: #4c6a37;
  --aroma: #23877b;
  --texture: #94704a;
  --water: #5a5f9e;
  --starch: #857a63;
  --protein: #b0566c;

  --on-el: #fffaf2;
  --el: var(--heat);

  --f-display: "Fraunces", Georgia, serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --r: 18px;
  --r-sm: 10px;
  --gutter: 16px;
  --rail: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16120e;
    --paper-2: #1e1914;
    --paper-3: #2a231c;
    --card: #211b15;
    --ink: #f3eadc;
    --ink-2: #c7b9a7;
    --ink-3: #94877a;
    --line: rgba(243, 234, 220, 0.13);
    --line-2: rgba(243, 234, 220, 0.26);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
    --salt: #7aa6c8;
    --fat: #e8b53a;
    --acid: #a7c63a;
    --sweet: #e08550;
    --heat: #ef6247;
    --umami: #c27aa3;
    --bitter: #86a86a;
    --aroma: #4bb7a8;
    --texture: #c49b70;
    --water: #9a9fe0;
    --starch: #c2b8a2;
    --protein: #e08ea2;
    --on-el: #16120e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #16120e; --paper-2: #1e1914; --paper-3: #2a231c; --card: #211b15;
  --ink: #f3eadc; --ink-2: #c7b9a7; --ink-3: #94877a;
  --line: rgba(243, 234, 220, 0.13); --line-2: rgba(243, 234, 220, 0.26);
  --salt: #7aa6c8; --fat: #e8b53a; --acid: #a7c63a; --sweet: #e08550; --heat: #ef6247;
  --umami: #c27aa3; --bitter: #86a86a; --aroma: #4bb7a8; --texture: #c49b70;
  --water: #9a9fe0; --starch: #c2b8a2; --protein: #e08ea2;
  --on-el: #16120e; color-scheme: dark;
}

[data-el="salt"] { --el: var(--salt); }
[data-el="fat"] { --el: var(--fat); }
[data-el="acid"] { --el: var(--acid); }
[data-el="sweet"] { --el: var(--sweet); }
[data-el="heat"] { --el: var(--heat); }
[data-el="umami"] { --el: var(--umami); }
[data-el="bitter"] { --el: var(--bitter); }
[data-el="aroma"] { --el: var(--aroma); }
[data-el="texture"] { --el: var(--texture); }
[data-el="water"] { --el: var(--water); }
[data-el="starch"] { --el: var(--starch); }
[data-el="protein"] { --el: var(--protein); }
[data-el="time"] { --el: var(--ink-2); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--el); outline-offset: 2px; border-radius: 6px; }

.mono { font-family: var(--f-mono); font-size: 0.78em; letter-spacing: 0.02em; }
.muted { color: var(--ink-2); }

/* ---------- layout ---------- */
.page { position: relative; z-index: 1; padding-left: var(--rail); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }
@media (min-width: 1180px) { :root { --rail: 216px; } }

/* ---------- table of contents ---------- */
.toc {
  position: fixed;
  z-index: 20;
  top: 0; left: 0; bottom: 0;
  width: 216px;
  padding: 28px 18px 24px 24px;
  display: none;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
}
@media (min-width: 1180px) { .toc { display: flex; } }
.toc-brand {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.toc-brand span { color: var(--heat); }
.toc-sub { font-size: 12px; color: var(--ink-3); margin: 2px 0 22px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc ol a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14.5px;
  color: var(--ink-2);
  transition: background .2s, color .2s;
}
.toc ol a .n { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); width: 16px; }
.toc ol a .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--el); flex: none; opacity: .55; transition: transform .2s, opacity .2s; }
.toc ol a:hover { color: var(--ink); background: var(--paper-2); }
.toc ol a.active { color: var(--ink); background: var(--paper-2); font-weight: 600; }
.toc ol a.active .dot { opacity: 1; transform: scale(1.25) rotate(45deg); }
.toc-progress { margin-top: auto; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.toc-progress i { display: block; height: 100%; width: 0; background: var(--ink); }
.toc-foot { font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* mobile toc bar */
.tocbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform .3s;
}
.tocbar.show { transform: none; }
@media (min-width: 1180px) { .tocbar { display: none; } }
.tocbar .brand { font-family: var(--f-display); font-weight: 800; font-size: 20px; text-decoration: none; font-variation-settings: "SOFT" 100; }
.tocbar .brand span { color: var(--heat); }
.tocbar button {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--card);
  padding: 6px 12px; border-radius: 999px; font-size: 14px; cursor: pointer;
  max-width: 62vw;
}
.tocbar button .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--el); }
.tocbar button .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tocbar .bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--ink); }
.tocsheet {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20, 14, 8, .35);
  display: none;
}
.tocsheet.open { display: block; }
.tocsheet .sheet {
  position: absolute; left: 8px; right: 8px; top: 8px;
  background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow);
  animation: drop .25s ease-out;
}
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }
.tocsheet ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tocsheet a { display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: 10px; background: var(--paper-2); text-decoration: none; font-size: 15px; }
.tocsheet a .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--el); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; position: relative; }
@media (min-width: 900px) { .hero { padding: 88px 0 56px; } }
.kicker {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 8px;
}
.kicker::before { content: ""; width: 22px; height: 2px; background: var(--heat); }
.hero h1 {
  font-family: var(--f-display);
  font-weight: 850;
  font-size: clamp(76px, 22vw, 150px);
  white-space: nowrap;
  line-height: .86;
  letter-spacing: -0.045em;
  margin: 14px 0 18px;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
}
.hero h1 .dot { color: var(--heat); display: inline-block; transform-origin: 50% 80%; }
.hero h1 .dot:hover { animation: wobble .6s; }
@keyframes wobble { 30% { transform: rotate(-14deg) scale(1.2); } 60% { transform: rotate(9deg); } }
.hero .sub { font-size: clamp(19px, 2.4vw, 23px); line-height: 1.45; max-width: 36em; margin: 0 0 26px; }
.hero .sub strong { font-weight: 650; }
.hero-grid { display: grid; gap: 36px; align-items: start; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 48px; } }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper);
  padding: 12px 18px; border-radius: 999px;
  font-weight: 600; font-size: 15.5px; text-decoration: none;
  transition: transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* periodic table */
.ptable { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 14px;
  background: var(--el);
  color: var(--on-el);
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
  display: flex; flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  transition: transform .25s cubic-bezier(.3,1.6,.5,1), box-shadow .25s;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
}
.tile:hover { transform: translateY(-3px) rotate(-1.5deg); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12), 0 12px 24px -12px var(--el); }
.tile:active { transform: scale(.96); }
.tile .no { font-family: var(--f-mono); font-size: 11px; opacity: .85; }
.tile .sym {
  font-family: var(--f-display); font-weight: 750; line-height: 1;
  font-size: clamp(34px, 9vw, 52px); margin-top: auto; letter-spacing: -0.03em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.tile .nm { font-weight: 650; font-size: 13.5px; margin-top: 4px; }
.tile .vb { font-size: 11.5px; opacity: .85; font-family: var(--f-mono); }
.tile.in { animation: tilein .6s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes tilein { from { opacity: 0; transform: translateY(14px) scale(.9) rotate(-4deg); } }
.ptable-cap { font-size: 13px; color: var(--ink-3); margin-top: 10px; }

/* proof strip */
.proof {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  margin-top: 44px;
}
@media (min-width: 820px) { .proof { grid-template-columns: repeat(4, 1fr); } }
.proof div { background: var(--paper); padding: 16px 16px 18px; }
.proof b { display: block; font-family: var(--f-display); font-size: clamp(28px, 6vw, 40px); font-weight: 750; line-height: 1.05; letter-spacing: -0.02em; font-variation-settings: "SOFT" 100; }
.proof span { font-size: 14px; color: var(--ink-2); line-height: 1.35; display: block; margin-top: 6px; }

/* ---------- sections ---------- */
section.chapter { padding: 64px 0 24px; border-top: 1px solid var(--line); scroll-margin-top: 56px; }
@media (min-width: 1180px) { section.chapter { scroll-margin-top: 8px; } }
.chap-head { display: grid; grid-template-columns: auto 1fr; gap: 16px 20px; align-items: start; margin-bottom: 26px; }
.chap-head .tile { width: 84px; cursor: default; }
.chap-head .tile:hover { transform: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.chap-head .tile .sym { font-size: 36px; }
@media (min-width: 720px) { .chap-head .tile { width: 112px; } .chap-head .tile .sym { font-size: 48px; } }
.chap-head .eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--el); font-weight: 600; }
.chap-head h2 {
  font-family: var(--f-display); font-weight: 720;
  font-size: clamp(32px, 6.4vw, 56px); line-height: 1.02; letter-spacing: -0.03em;
  margin: 6px 0 0;
  font-variation-settings: "SOFT" 50, "opsz" 110;
}
.lede { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.5; max-width: 40em; margin: 0 0 28px; }
.lede em { font-style: normal; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--el) 30%, transparent) 62%); }

h3 { font-family: var(--f-display); font-weight: 680; font-size: 25px; letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 8px; font-variation-settings: "SOFT" 50; }
h4 { font-size: 16px; margin: 0 0 4px; font-weight: 700; }

.principles { display: grid; gap: 12px; margin: 0 0 32px; }
@media (min-width: 760px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principle { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; position: relative; }
.principle .k { font-family: var(--f-mono); font-size: 11px; color: var(--el); font-weight: 600; letter-spacing: .08em; }
.principle h4 { font-family: var(--f-display); font-size: 20px; font-weight: 680; margin: 6px 0 6px; line-height: 1.2; }
.principle p { margin: 0; font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }

/* lab panel */
.lab {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 4px);
  padding: 20px 16px;
  margin: 0 0 28px;
  position: relative;
}
@media (min-width: 720px) { .lab { padding: 26px 28px; } }
.lab-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  background: var(--el); color: var(--on-el); padding: 3px 9px; border-radius: 999px; font-weight: 600;
}
.lab h3 { margin-top: 10px; }
.lab .hint { font-size: 15px; color: var(--ink-2); margin: 0 0 18px; max-width: 46em; }
.lab-grid { display: grid; gap: 22px; }
@media (min-width: 860px) { .lab-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.note { font-size: 13px; color: var(--ink-3); margin: 14px 0 0; }

/* controls */
.field { margin-bottom: 16px; }
.field > label, .field > .lbl { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field output, .field .val { font-family: var(--f-mono); font-weight: 600; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-2); background: var(--card);
  padding: 7px 12px; border-radius: 999px; font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1.2;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.el[aria-pressed="true"], .chip.el[aria-selected="true"] { background: var(--el); border-color: var(--el); color: var(--on-el); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 30px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--el) var(--p, 50%), var(--paper-3) var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 8px; background: var(--paper-3); }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 8px; background: var(--el); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; margin-top: -9px;
  background: var(--card); border: 3px solid var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); }
select {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
}
.toggle { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; padding: 4px 0; }
.toggle input { width: 20px; height: 20px; accent-color: var(--el); }

/* result + calc table */
.result { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); padding: 18px; }
.big { font-family: var(--f-display); font-weight: 760; font-size: clamp(44px, 10vw, 64px); line-height: 1; letter-spacing: -0.03em; font-variation-settings: "SOFT" 100; }
.big small { font-size: .42em; font-weight: 600; letter-spacing: 0; margin-left: 4px; }
.calc { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 14px; }
.calc td { padding: 6px 0; border-top: 1px dashed var(--line-2); }
.calc td:last-child { text-align: right; font-family: var(--f-mono); font-size: 13.5px; }
.calc tr.total td { font-weight: 700; border-top: 1px solid var(--ink); }
.calc caption { text-align: left; font-size: 12px; font-family: var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 2px; }

.spoons { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 4px; min-height: 26px; }
.spoon { width: 24px; height: 24px; position: relative; }
.spoon svg { width: 100%; height: 100%; }

.cmp { margin-top: 16px; display: grid; gap: 6px; }
.cmp-row { display: grid; grid-template-columns: 9.5em 1fr 4.6em; align-items: center; gap: 8px; font-size: 13.5px; }
.cmp-row .b { height: 10px; border-radius: 5px; background: var(--el); transition: width .35s; min-width: 2px; }
.cmp-row .v { font-family: var(--f-mono); font-size: 12.5px; text-align: right; }
.cmp-row.sel { font-weight: 700; }
@media (max-width: 420px) { .cmp-row { grid-template-columns: 7.6em 1fr 4.2em; font-size: 12.5px; } }

/* two-column timing cards */
.duo { display: grid; gap: 12px; margin-bottom: 28px; }
@media (min-width: 760px) { .duo { grid-template-columns: 1fr 1fr; } }
.duo .col { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.duo .col h4 { font-family: var(--f-display); font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.duo .col h4 .pill { font-family: var(--f-mono); font-size: 11px; background: var(--el); color: var(--on-el); padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.duo ul { list-style: none; margin: 0; padding: 0; }
.duo li { padding: 9px 0; border-top: 1px dashed var(--line-2); font-size: 15.5px; line-height: 1.45; }
.duo li:first-child { border-top: 0; }
.duo li b { font-weight: 650; }
.duo li span { color: var(--ink-2); }

/* flip cards */
.flips { display: grid; gap: 12px; margin: 0 0 28px; }
@media (min-width: 760px) { .flips { grid-template-columns: 1fr 1fr; } }
.flip { perspective: 1200px; min-height: 196px; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; width: 100%; }
.flip-in { position: relative; width: 100%; height: 100%; min-height: inherit; transition: transform .6s cubic-bezier(.4,1.4,.5,1); transform-style: preserve-3d; display: grid; }
.flip[aria-pressed="true"] .flip-in { transform: rotateY(180deg); }
.flip .face {
  grid-area: 1 / 1;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--r); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.flip .front { background: var(--ink); color: var(--paper); }
.flip .front .q { font-family: var(--f-display); font-size: 23px; line-height: 1.2; font-weight: 650; font-variation-settings: "SOFT" 100; }
.flip .front .t { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--el); filter: brightness(1.25); }
.flip .front .go { margin-top: auto; font-size: 13px; opacity: .7; }
.flip .back { background: var(--el); color: var(--on-el); transform: rotateY(180deg); font-size: 16px; line-height: 1.5; }
.flip .back b { font-family: var(--f-display); font-size: 22px; font-weight: 750; }
@media (prefers-reduced-motion: reduce) { .flip-in { transition: none; } }

/* ---------- fat: smoke points ---------- */
.smoke { position: relative; }
.smoke-scale { position: relative; height: 20px; margin: 0 0 6px calc(10.5em + 6px); font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.smoke-scale span { position: absolute; transform: translateX(-50%); }
.smoke-rows { position: relative; display: grid; gap: 5px; }
.smoke-row { display: grid; grid-template-columns: 10.5em 1fr; gap: 6px; align-items: center; font-size: 13.5px; white-space: nowrap; }
@media (max-width: 520px) { .smoke-row { grid-template-columns: 8.4em 1fr; font-size: 12px; } .smoke-scale { margin-left: calc(8.4em + 6px); font-size: 10px; } }
.smoke-row .track { position: relative; height: 22px; border-radius: 6px; background: var(--paper-3); overflow: hidden; }
.smoke-row .fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--fat); transition: background .2s; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--on-el); }
.smoke-row.smoking .fill {
  background: repeating-linear-gradient(-45deg, var(--ink-3) 0 6px, color-mix(in srgb, var(--ink-3) 60%, transparent) 6px 12px);
  color: var(--paper);
}
.smoke-row.smoking .nm { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--heat); }
.smoke-line { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--heat); pointer-events: none; transition: left .1s; }
.smoke-line::after { content: attr(data-t); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-family: var(--f-mono); font-size: 11px; color: var(--heat); font-weight: 700; white-space: nowrap; }
.smoke-verdict { margin-top: 14px; font-size: 15px; }
.smoke-verdict b { color: var(--heat); }
.method-tag { display: inline-block; font-family: var(--f-mono); font-size: 12px; padding: 2px 8px; background: var(--card); border: 1px solid var(--line-2); border-radius: 99px; }

/* vinaigrette jar */
.jar-wrap { display: flex; gap: 18px; align-items: flex-end; }
.jar { width: 120px; flex: none; }
.jar svg { width: 100%; height: auto; overflow: visible; }
.jar.shake { animation: shake .7s; }
@keyframes shake { 15% { transform: rotate(-12deg) translateY(-6px); } 35% { transform: rotate(10deg); } 55% { transform: rotate(-8deg) translateY(-4px); } 75% { transform: rotate(6deg); } }
.jar .layer { transition: y .9s ease, height .9s ease, opacity .9s ease; }
.meter { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--acid), var(--fat) 50%, color-mix(in srgb, var(--fat) 50%, var(--ink-3))); margin: 26px 0 6px; }
.meter i { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); transform: translate(-50%, -50%); transition: left .35s cubic-bezier(.3,1.4,.5,1); }
.meter-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); font-family: var(--f-mono); }

/* ---------- acid: pH ---------- */
.ph { position: relative; padding-top: 74px; }
.ph-strip { height: 22px; border-radius: 11px; background: linear-gradient(90deg, #d8322a, #ea7a1f 14%, #e9c31f 30%, #b8c92a 43%, #61a845 50%, #2f9b8d 60%, #2f6fb0 75%, #5a3e9e 100%); position: relative; }
.ph-ticks { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.ph-dot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); transform: translate(-50%, -50%); cursor: pointer; padding: 0; transition: transform .2s; }
.ph-dot.sel { transform: translate(-50%, -50%) scale(1.5); background: var(--ink); }
.ph-call {
  position: absolute; top: 0; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); border-radius: 12px; padding: 7px 12px; font-size: 13.5px; white-space: nowrap;
  transition: left .35s cubic-bezier(.3,1.3,.5,1);
}
.ph-call b { font-family: var(--f-mono); }
.ph-call::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ink); transform: translateX(-50%); }
.ph-stem { position: absolute; top: 40px; width: 2px; height: 38px; background: var(--ink); transition: left .35s cubic-bezier(.3,1.3,.5,1); }
.ph-note { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; font-size: 15.5px; min-height: 76px; }
.ph-note b { font-family: var(--f-display); font-size: 19px; }
.ph-sides { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; font-weight: 600; }

/* ---------- sweet sources ---------- */
.hide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 28px; }
@media (min-width: 760px) { .hide-grid { grid-template-columns: repeat(4, 1fr); } }
.hide { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.hide b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 4px; }
.hide .lv { display: flex; gap: 3px; margin-top: 8px; }
.hide .lv i { width: 14px; height: 6px; border-radius: 3px; background: var(--paper-3); }
.hide .lv i.on { background: var(--sweet); }

/* ---------- heat: ladder ---------- */
.ladder { display: grid; gap: 18px; }
@media (min-width: 860px) { .ladder { grid-template-columns: 1fr 1.2fr; gap: 28px; } }
.thermo-read { display: flex; align-items: baseline; gap: 12px; }
.thermo-read .big { color: var(--tcol, var(--heat)); transition: color .2s; }
.thermo-read .f { font-family: var(--f-mono); color: var(--ink-3); font-size: 14px; }
.tgrad { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #6aa5d8 0%, #9cc6c9 8%, #e8d9a8 22%, #f0b86a 40%, #e8873b 56%, #d65a2a 72%, #a8301c 88%, #4a1d14 100%); position: relative; margin: 10px 0 2px; }
.tmarks { position: relative; height: 100px; margin-top: 4px; }
.tmark { position: absolute; transform: translateX(-50%); font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); background: none; border: 0; cursor: pointer; padding: 2px; text-align: center; line-height: 1.1; }
.tmark::before { content: ""; display: block; width: 1px; height: 8px; background: var(--ink-3); margin: 0 auto 2px; }
.tmark:hover { color: var(--ink); }
.tmark.r1 { top: 33px; }
.tmark.r2 { top: 66px; }
.stage { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-height: 230px; border-left: 6px solid var(--tcol, var(--heat)); transition: border-color .2s; }
.stage .range { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }
.stage h4 { font-family: var(--f-display); font-size: 26px; font-weight: 720; margin: 4px 0 8px; line-height: 1.1; }
.stage p { margin: 0 0 10px; font-size: 15.5px; }
.stage ul { margin: 0; padding-left: 18px; font-size: 15px; color: var(--ink-2); }
.stage ul li { margin: 3px 0; }

/* thickness */
.slab-wrap { display: flex; align-items: center; justify-content: center; min-height: 150px; }
.slab { width: 78%; max-width: 300px; border-radius: 12px; position: relative; transition: height .3s; background: radial-gradient(ellipse 60% 50% at 50% 50%, #e9797d 0%, #d65a5e 40%, #b8653e 75%, #6e3a1d 100%); box-shadow: inset 0 0 0 4px #5a2e16; }
.slab span { position: absolute; right: -8px; top: 50%; transform: translate(100%, -50%); font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.methods { display: grid; gap: 10px; margin-bottom: 28px; }
@media (min-width: 760px) { .methods { grid-template-columns: 1fr 1fr 1fr; } }
.method { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.method h4 { font-family: var(--f-display); font-size: 21px; font-weight: 700; }
.method .tag { font-family: var(--f-mono); font-size: 11.5px; color: var(--el); font-weight: 600; letter-spacing: .06em; }
.method p { font-size: 15px; color: var(--ink-2); margin: 6px 0 10px; }
.method .ex { display: flex; flex-wrap: wrap; gap: 5px; }
.method .ex span { font-size: 12.5px; background: var(--paper-2); padding: 3px 9px; border-radius: 99px; }

/* ---------- depth cards ---------- */
.depth { display: grid; gap: 12px; margin-bottom: 28px; }
@media (min-width: 760px) { .depth { grid-template-columns: 1fr 1fr; } }
.dcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; scroll-margin-top: 70px; }
.dcard .top { display: flex; gap: 14px; align-items: center; padding: 16px 18px 0; }
.dcard .top .tile { width: 64px; flex: none; cursor: default; padding: 7px 8px; border-radius: 11px; }
.dcard .top .tile .sym { font-size: 28px; }
.dcard .top .tile .nm, .dcard .top .tile .vb { display: none; }
.dcard h3 { margin: 0; font-size: 24px; }
.dcard .top p { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.35; }
.dcard .body { padding: 12px 18px 16px; font-size: 15.5px; }
.dcard .body p { margin: 0 0 10px; }
.dcard .src { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 12px; }
.dcard .src span { font-size: 13px; padding: 3px 9px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--el) 45%, transparent); color: var(--ink); background: color-mix(in srgb, var(--el) 10%, transparent); }
.dcard .wow { margin-top: auto; background: color-mix(in srgb, var(--el) 14%, var(--card)); padding: 12px 18px; font-size: 14.5px; border-top: 1px solid var(--line); }
.dcard .wow b { color: var(--el); font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 2px; filter: saturate(1.2); }

/* ---------- balance: seesaw ---------- */
.seesaw-stage { position: relative; }
.seesaw-svg { width: 100%; height: auto; display: block; max-width: 520px; margin: 0 auto; }
.seesaw-svg .beam-g { transition: transform .45s cubic-bezier(.3,1.6,.5,1); transform-origin: 260px 150px; }
.seesaw-svg text { font-family: var(--f-body); font-weight: 700; font-size: 15px; }
.verdict { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; font-size: 15.5px; min-height: 80px; margin-top: 8px; }
.verdict b { font-family: var(--f-display); font-size: 19px; display: block; margin-bottom: 2px; }
.pair-ends { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); font-family: var(--f-mono); }

/* fixer */
.fixer-out { margin-top: 16px; display: grid; gap: 8px; }
.fix { display: grid; grid-template-columns: 30px 1fr; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; animation: fadeup .35s both; }
.fix .i { width: 30px; height: 30px; border-radius: 8px; background: var(--el); color: var(--on-el); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 15px; }
.fix p { margin: 0; font-size: 15.5px; line-height: 1.45; }
.fix p b { font-weight: 650; }
.fix .tags { margin-top: 5px; display: flex; gap: 4px; flex-wrap: wrap; }
.etag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-mono); font-size: 11px; padding: 2px 8px 2px 6px; border-radius: 99px; background: color-mix(in srgb, var(--el) 16%, transparent); color: var(--ink); font-weight: 600; }
.etag::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--el); }
.myth { border-style: dashed; background: transparent; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }

/* ---------- everyday ---------- */
.moves { counter-reset: mv; display: grid; gap: 10px; margin: 0 0 32px; padding: 0; list-style: none; }
@media (min-width: 900px) { .moves { grid-template-columns: repeat(5, 1fr); } }
.moves li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; position: relative; }
.moves li::before { counter-increment: mv; content: counter(mv); font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; color: var(--el); display: block; margin-bottom: 4px; }
.moves li b { display: block; font-size: 16px; margin-bottom: 3px; }
.moves li span { font-size: 14.5px; color: var(--ink-2); line-height: 1.4; display: block; }

.dish-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
.dish-tabs::-webkit-scrollbar { display: none; }
.dish-tabs .chip { white-space: nowrap; flex: none; }
.dish { margin-top: 16px; }
.dish-head { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 860px) { .dish-head { grid-template-columns: 1fr auto; align-items: end; } }
.dish-head h3 { font-size: 30px; margin: 0; }
.dish-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 15.5px; }
.minitable { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; max-width: 420px; }
.mini { aspect-ratio: 1; border-radius: 7px; background: var(--el); color: var(--on-el); display: grid; place-items: center; font-family: var(--f-display); font-weight: 750; font-size: 14px; opacity: .15; transition: opacity .25s, transform .3s cubic-bezier(.3,1.6,.5,1); font-variation-settings: "SOFT" 100; }
.mini.used { opacity: .45; }
.mini.hot { opacity: 1; transform: translateY(-4px) scale(1.08); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: border-color .2s, box-shadow .2s; text-align: left; width: 100%; }
.step:hover { border-color: var(--line-2); }
.step.on { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--ink); }
.step .n { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.step.on .n { background: var(--ink); color: var(--paper); }
.step .what { font-size: 16px; font-weight: 600; line-height: 1.4; }
.step .why { font-size: 14.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.45; }
.step .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }

/* ---------- palate ---------- */
.quiz { background: var(--ink); color: var(--paper); border-radius: calc(var(--r) + 4px); padding: 22px 18px; margin-bottom: 28px; }
@media (min-width: 720px) { .quiz { padding: 28px 32px; } }
.quiz .lab-tag { background: var(--paper); color: var(--ink); }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.quiz-dots { display: flex; gap: 5px; }
.quiz-dots i { width: 10px; height: 10px; border-radius: 3px; background: color-mix(in srgb, currentColor 22%, transparent); }
.quiz-dots i.ok { background: var(--acid); }
.quiz-dots i.no { background: var(--heat); }
.quiz-dots i.cur { outline: 2px solid currentColor; outline-offset: 1px; }
.quiz .q { font-family: var(--f-display); font-size: clamp(23px, 4vw, 30px); line-height: 1.2; font-weight: 600; margin: 18px 0 18px; font-variation-settings: "SOFT" 100; min-height: 2.4em; }
.quiz .opts { display: grid; gap: 8px; }
@media (min-width: 720px) { .quiz .opts { grid-template-columns: repeat(3, 1fr); } }
.quiz .opt { text-align: left; border: 1.5px solid color-mix(in srgb, var(--paper) 30%, transparent); background: transparent; color: var(--paper); padding: 12px 14px; border-radius: 14px; cursor: pointer; font-size: 15.5px; display: flex; gap: 10px; align-items: center; transition: background .15s, border-color .15s; }
.quiz .opt:hover:not([disabled]) { border-color: var(--paper); }
.quiz .opt .sw { width: 14px; height: 14px; border-radius: 4px; background: var(--el); flex: none; }
.quiz .opt.right { background: var(--acid); border-color: var(--acid); color: #16120e; }
.quiz .opt.wrong { background: color-mix(in srgb, var(--heat) 70%, transparent); border-color: var(--heat); color: #fff; }
.quiz .opt[disabled] { cursor: default; }
.quiz .why { margin-top: 14px; font-size: 15.5px; line-height: 1.5; min-height: 1px; }
.quiz .why b { color: var(--acid); }
.quiz .btn { background: var(--paper); color: var(--ink); margin-top: 14px; }
.quiz .final { font-family: var(--f-display); font-size: 64px; font-weight: 800; line-height: 1; }

.habits { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
@media (min-width: 760px) { .habits { grid-template-columns: 1fr 1fr; } }
.habit label { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: background .2s; }
.habit input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); margin: 0; display: grid; place-items: center; cursor: pointer; transition: background .2s, border-color .2s; }
.habit input::after { content: ""; width: 7px; height: 13px; border: solid var(--paper); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px) scale(0); transition: transform .25s cubic-bezier(.3,1.8,.5,1); }
.habit input:checked { background: var(--el); border-color: var(--el); }
.habit input:checked::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.habit b { display: block; font-size: 15.5px; }
.habit span { font-size: 14px; color: var(--ink-2); line-height: 1.4; display: block; }
.habit input:checked ~ div b { text-decoration: line-through; text-decoration-color: var(--el); text-decoration-thickness: 2px; }
.habit-prog { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.habit-prog .ring { width: 54px; height: 54px; }
.habit-prog .ring circle { fill: none; stroke-width: 6; }
.habit-prog .ring .bg { stroke: var(--paper-3); }
.habit-prog .ring .fg { stroke: var(--el); stroke-linecap: round; transition: stroke-dashoffset .5s; transform: rotate(-90deg); transform-origin: 50% 50%; }

/* ---------- footer ---------- */
.colophon { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 80px; font-size: 14px; color: var(--ink-2); }
.colophon p { margin: 0 0 6px; max-width: 46em; }
.colophon .brand { font-family: var(--f-display); font-weight: 800; font-size: 26px; color: var(--ink); font-variation-settings: "SOFT" 100; }
.colophon .brand span { color: var(--heat); }

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.rv.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } .tile.in { animation: none; } }

/* sprinkle canvas */
#sprinkle { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
