/* =====================================================================
   Kape — styles
   Palette from the AAWU(M) reference: warm grey paper, black ink,
   coffee #987654 and crema yellow #ECD06F. One typeface: Inter Tight.
   ===================================================================== */

:root {
  --paper: #dfddd7;
  --paper-hi: #e8e6e1;
  --paper-lo: #d6d4cd;
  --ink: #0e0c0a;
  --ink-2: #4a453f;
  --ink-3: #7b756c;
  --line: #2a2622;
  --coffee: #987654;
  --coffee-dk: #6f5338;
  --crema: #ecd06f;
  --frame: #161311;

  --frame-w: clamp(0px, 2.4vw, 44px);
  --pad: clamp(14px, 1.6vw, 24px);
  --nav-h: 52px;

  --f-sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --t-xs: 12px;
  --t-sm: 14px;
  --t-md: 17px;
  --t-lg: clamp(20px, 1.7vw, 26px);
  --t-xl: clamp(34px, 5vw, 76px);

  --ease: cubic-bezier(.7, 0, .2, 1);
  --ease-out: cubic-bezier(.2, .7, .1, 1);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); }

body {
  margin: 0;
  background: var(--frame);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--t-md);
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-feature-settings: "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--coffee); outline-offset: 2px; }
::selection { background: var(--crema); color: var(--ink); }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { top: 8px; }

/* ---------- sheet & grid lines ---------- */
.sheet {
  margin-inline: var(--frame-w);
  background: var(--paper);
  min-height: 100vh;
  border-inline: 1px solid var(--line);
}
.cell { padding: var(--pad); }
.paren { font-feature-settings: "tnum"; font-weight: 400; }
.eyebrow { font-size: var(--t-sm); color: var(--ink-3); margin-bottom: 14px; font-feature-settings: "tnum"; }

.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink); flex: none;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 2fr 1fr;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
}
.nav .cell { display: flex; align-items: center; padding-block: 0; }
.nav .cell + .cell { border-left: 1px solid var(--line); }
.nav__brand { font-weight: 500; gap: 4px; }
.nav__links { gap: clamp(14px, 2.4vw, 36px); }
.nav__links a, .link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .35s var(--ease);
}
.nav__links a:hover, .link-btn:hover { background-size: 100% 1px; }
.nav__meta { justify-content: flex-end; gap: 10px; color: var(--ink-2); }

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero__word {
  display: flex; align-items: flex-start;
  padding: clamp(12px, 3vw, 36px) var(--pad) 0;
  font-size: clamp(96px, 27vw, 440px);
  line-height: .8;
  letter-spacing: -0.075em;
  font-weight: 500;
  overflow: hidden;
  padding-bottom: .19em;
  border-bottom: 1px solid var(--line);
}
.hero__letters { display: inline-flex; margin-left: -0.05em; }
.hero__letters .ch { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.hero__word sup {
  font-size: clamp(16px, 2.2vw, 34px); letter-spacing: -0.02em; line-height: 1;
  margin-left: .5em; margin-top: .55em; vertical-align: top;
  opacity: 0; animation: fade .8s .9s ease forwards;
}
@keyframes rise { to { transform: translateY(0); } }
@keyframes fade { to { opacity: 1; } }

.hero__row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; }
.hero__row .cell + .cell { border-left: 1px solid var(--line); }
.hero__intro { font-size: var(--t-lg); line-height: 1.25; letter-spacing: -0.02em; max-width: 34ch; min-height: 150px; }
.spec { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.spec__label { font-size: var(--t-sm); color: var(--ink-3); }
.spec__value { font-size: var(--t-lg); letter-spacing: -0.02em; font-feature-settings: "tnum"; }

/* ---------- section heads ---------- */
.section-head {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  align-items: end;
}
.section-head > .cell + .cell { border-left: 1px solid var(--line); }
.section-head h2 { font-size: var(--t-xl); line-height: .95; letter-spacing: -0.05em; padding-top: clamp(40px, 7vw, 110px); }
.section-head h2 .paren { font-size: .36em; letter-spacing: -0.02em; vertical-align: top; margin-left: .2em; }
.section-head h3 { font-size: var(--t-lg); letter-spacing: -0.02em; }
.section-head__note { color: var(--ink-2); font-size: var(--t-md); max-width: 42ch; }
.section-head--sub { border-top: 1px solid var(--line); }
.section-head--sub .cell { padding-top: calc(var(--pad) * 2); }

/* ---------- filters ---------- */
.filters { border-bottom: 1px solid var(--line); position: sticky; top: var(--nav-h); z-index: 15; background: var(--paper); }
.filters__row { display: flex; }
.filters__tabs { border-bottom: 1px solid var(--line); }
.tab {
  flex: 1 1 0; display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 14px var(--pad); border: 0; background: none; cursor: pointer; text-align: left;
  font-size: var(--t-md); transition: background-color .25s ease, color .25s ease;
}
.tab + .tab { border-left: 1px solid var(--line); }
.tab .paren { color: var(--ink-3); font-size: var(--t-sm); transition: color .25s ease; }
.tab:hover { background: var(--paper-hi); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tab[aria-selected="true"] .paren { color: var(--crema); }
.tab .tab__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crema); box-shadow: 0 0 0 1px var(--ink); margin-right: 8px; display: inline-block; vertical-align: 1px; }

.filters__secondary { align-items: stretch; min-height: 48px; }
.chips { display: flex; align-items: center; gap: 6px; padding: 8px var(--pad); }
.chips + .chips, .chips + .search { border-left: 1px solid var(--line); }
.chips--scroll { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 5px 12px 6px; font-size: var(--t-sm); cursor: pointer; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.chip:hover { background: var(--paper-hi); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.search { display: flex; align-items: center; flex: 0 1 300px; padding: 0 var(--pad); }
.search input {
  width: 100%; border: 0; background: transparent; padding: 12px 0; font-size: var(--t-md); outline: none;
  border-bottom: 1px solid transparent;
}
.search input::placeholder { color: var(--ink-3); }
.search:focus-within { background: var(--paper-hi); }

.results-line { padding: 10px var(--pad); font-size: var(--t-sm); color: var(--ink-3); border-bottom: 1px solid var(--line); font-feature-settings: "tnum"; }

/* ---------- grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.card { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.grid > .card:nth-child(4n) { border-right: 0; }
.card__link {
  display: flex; flex-direction: column; height: 100%;
  aspect-ratio: 1 / 1.02; padding: var(--pad);
  transition: background-color .35s ease;
}
.card__top { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--ink-3); min-height: 16px; }
.card__flag { display: inline-flex; align-items: center; gap: 6px; }
.card__flag--try { color: var(--ink); }
.card__flag--try::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--crema); box-shadow: 0 0 0 1px var(--ink); }
.card__flag--tried::before { background: var(--coffee); box-shadow: none; }
.card__media { flex: 1; display: grid; place-items: center; padding: 6% 0 10%; }
.card__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.card__num { display: block; font-size: var(--t-md); font-feature-settings: "tnum"; }
.card__name { display: block; font-size: var(--t-md); line-height: 1.2; }
.card__foot .dot { margin-bottom: 6px; transition: transform .35s var(--ease), background-color .35s ease; }
.card__link:hover, .card__link:focus-visible { background: var(--paper-hi); }
.card__link:hover .dot, .card__link:focus-visible .dot { transform: scale(1.8); background: var(--coffee); }

/* photo frame: duotone on top, colour underneath, revealed on hover */
.ph {
  position: relative; width: 48%; aspect-ratio: 1; overflow: hidden;
  background: var(--paper-lo);
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph .ph__duo { filter: url(#duotone); transition: opacity .5s ease; }
.ph .ph__color { opacity: 0; transform: scale(1.06); transition: transform .8s var(--ease-out), opacity .5s ease; }
.card__link:hover .ph__duo, .card__link:focus-visible .ph__duo { opacity: 0; }
.card__link:hover .ph__color, .card__link:focus-visible .ph__color { opacity: 1; transform: scale(1); }
.ph--empty::after {
  content: ""; position: absolute; inset: 30%; border-radius: 50%; border: 1px solid var(--ink-3);
}
.ph img[data-loading] { opacity: 0; }
.ph img { transition: opacity .5s ease; }

/* reveal */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .9s var(--ease-out); transition-delay: var(--d, 0ms); }

.empty { padding: 60px var(--pad); border-bottom: 1px solid var(--line); text-align: center; color: var(--ink-2); display: grid; gap: 10px; justify-items: center; }

/* ---------- must try ---------- */
.must { border-top: 0; }
.progress { display: grid; gap: 10px; align-self: stretch; align-content: end; }
.progress__text { font-size: var(--t-lg); letter-spacing: -0.02em; font-feature-settings: "tnum"; }
.progress__bar { height: 6px; background: var(--paper-lo); border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; background: var(--coffee); transition: width .6s var(--ease); }
.must__intro { color: var(--ink-2); border-bottom: 1px solid var(--line); max-width: none; }
.must__intro { padding-right: 40%; }

.rounds { display: grid; grid-template-columns: repeat(4, 1fr); }
.round { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.round:nth-child(4n) { border-right: 0; }
.round--later { grid-column: 1 / -1; border-right: 0; }
.round__head { padding: var(--pad); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.round__title { font-size: var(--t-lg); letter-spacing: -0.02em; }
.round__sub { display: block; font-size: var(--t-sm); color: var(--ink-3); margin-top: 4px; }
.round__count { font-size: var(--t-sm); color: var(--ink-3); font-feature-settings: "tnum"; }
.round__list { padding: 6px 0; }
.round--later .round__list { display: grid; grid-template-columns: repeat(4, 1fr); }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 9px var(--pad); }
.check:hover { background: var(--paper-hi); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  flex: none; width: 16px; height: 16px; margin-top: 2px; border: 1px solid var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease;
}
.check__box::after { content: ""; width: 8px; height: 4px; border-left: 1.5px solid var(--paper); border-bottom: 1.5px solid var(--paper); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked + .check__box { background: var(--coffee); border-color: var(--coffee); }
.check input:checked + .check__box::after { opacity: 1; }
.check input:focus-visible + .check__box { outline: 2px solid var(--coffee); outline-offset: 2px; }
.check__text { font-size: var(--t-md); line-height: 1.25; }
.check__text a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.check__note { display: block; font-size: var(--t-sm); color: var(--ink-3); }
.check.is-done .check__text > a, .check.is-done .check__text > span:first-child { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---------- basics ---------- */
.basics__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; }
.basics__grid > .cell { border-right: 1px solid var(--line); }
.basics__grid > .cell:last-child { border-right: 0; }
.prose { font-size: var(--t-md); color: var(--ink-2); }
.steps-plain { counter-reset: s; display: grid; gap: 12px; }
.steps-plain li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; }
.steps-plain li::before { content: "(" counter(s, decimal-leading-zero) ")"; color: var(--ink-3); font-size: var(--t-sm); padding-top: 2px; font-feature-settings: "tnum"; }
.list-plain { display: grid; gap: 12px; }
.list-plain li { position: relative; padding-left: 18px; }
.list-plain li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }

.tool { background: var(--ink); color: var(--paper); }
.tool .eyebrow { color: #a49d92; }
.tool__title { font-size: var(--t-lg); letter-spacing: -0.02em; margin-bottom: 18px; }
.calc { display: grid; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid #3a352f; }
.calc__field { display: grid; grid-template-columns: 70px 1fr 64px; gap: 12px; align-items: center; font-size: var(--t-sm); }
.calc__field output { text-align: right; font-feature-settings: "tnum"; }
.calc__result { font-size: var(--t-md); }
.calc__result strong { font-weight: 500; color: var(--crema); font-feature-settings: "tnum"; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: #6b645b; }
input[type="range"]::-moz-range-track { height: 1px; background: #6b645b; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--crema); margin-top: -6.5px; border: 0; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--crema); border: 0; }

.timer { padding-top: 18px; display: grid; gap: 16px; }
.timer__read { font-size: clamp(64px, 7vw, 104px); line-height: .9; letter-spacing: -0.05em; font-feature-settings: "tnum"; }
.timer__read small { font-size: .3em; letter-spacing: 0; margin-left: 6px; color: #a49d92; }
.timer__track { position: relative; height: 34px; border-top: 1px solid #6b645b; }
.timer__zone { position: absolute; top: 0; left: 62.5%; width: 12.5%; height: 10px; background: color-mix(in srgb, var(--crema) 35%, transparent); }
.timer__fill { position: absolute; top: -1px; left: 0; height: 3px; width: 0; background: var(--crema); }
.timer__tick { position: absolute; top: 14px; left: calc(var(--at) * 100%); transform: translateX(-50%); font-size: var(--t-xs); color: #a49d92; font-feature-settings: "tnum"; }
.timer__tick:first-of-type { transform: none; }
.timer__tick:last-of-type { transform: translateX(-100%); }
.timer__btns { display: flex; gap: 8px; }
.timer__verdict { font-size: var(--t-sm); color: #cfc8bc; min-height: 3.6em; }
.timer__verdict strong { color: var(--crema); font-weight: 500; }

.btn {
  border: 1px solid currentColor; background: transparent; padding: 9px 18px 10px; border-radius: 999px;
  cursor: pointer; font-size: var(--t-sm); transition: background-color .2s ease, color .2s ease;
}
.btn--solid { background: var(--crema); color: var(--ink); border-color: var(--crema); }
.btn--solid:hover { background: #f3dc8c; }
.tool .btn:not(.btn--solid):hover { background: #2a2622; }

.syrups { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.syrup { padding: var(--pad); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.syrup:nth-child(3n) { border-right: 0; }
.syrup__head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.syrup__name { font-size: var(--t-lg); letter-spacing: -0.02em; }
.syrup__yield { font-size: var(--t-sm); color: var(--ink-3); white-space: nowrap; }
.syrup__items { font-size: var(--t-md); }
.syrup__method { color: var(--ink-2); font-size: var(--t-sm); }
.syrup__used { font-size: var(--t-sm); color: var(--ink-3); }
.syrup__used a { color: var(--ink); }
.syrup__used a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer__word {
  font-size: clamp(96px, 27vw, 440px); line-height: .8; letter-spacing: -0.075em; font-weight: 500;
  padding: var(--pad); padding-bottom: .19em; color: var(--coffee); overflow: hidden; border-bottom: 1px solid var(--line);
}
.footer__row { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr; font-size: var(--t-sm); color: var(--ink-2); }
.footer__row .cell + .cell { border-left: 1px solid var(--line); }
.footer__row a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.footer__row .link-btn { text-decoration: none; }
.footer__end { display: flex; align-items: flex-end; justify-content: flex-end; }

/* =====================================================================
   Recipe detail
   ===================================================================== */
.detail {
  position: fixed; inset: 0; z-index: 50; background: var(--frame);
  overflow: hidden;
}
.detail[hidden] { display: none; }
.detail__sheet {
  position: absolute; inset: 0 var(--frame-w); background: var(--paper);
  border-inline: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform .75s var(--ease);
}
.detail.is-open .detail__sheet { transform: none; }
.detail.is-swapping .d-body { opacity: 0; transition: opacity .18s ease; }

.d-bar {
  position: sticky; top: 0; z-index: 2; height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto auto;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: var(--t-sm);
}
.d-bar > * { display: flex; align-items: center; padding: 0 var(--pad); }
.d-bar > * + * { border-left: 1px solid var(--line); }
.d-bar__crumb { gap: 10px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.d-bar__crumb b { font-weight: 400; color: var(--ink); }
.d-bar button { border: 0; background: none; cursor: pointer; gap: 10px; }
.d-bar button:hover { background: var(--paper-hi); }
.d-bar__nav { padding: 0 !important; }
.d-bar__nav button { height: 100%; padding: 0 var(--pad); }
.d-bar__nav button + button { border-left: 1px solid var(--line); }
.kbd { font-size: var(--t-xs); color: var(--ink-3); border: 1px solid var(--ink-3); border-radius: 4px; padding: 0 5px; line-height: 16px; }

.d-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); transition: opacity .3s ease; }
.d-media { border-right: 1px solid var(--line); }
.d-media__inner { position: sticky; top: var(--nav-h); padding: var(--pad); display: grid; gap: 12px; }
.d-media .ph { width: 100%; background: var(--paper-lo); }
.d-media .ph__color { opacity: 1; transform: none; }
.d-media .ph__duo { transition: opacity 1.1s ease .25s; }
.detail.is-open .d-media .ph__duo { opacity: 0; }
.d-credit { font-size: var(--t-xs); color: var(--ink-3); display: flex; justify-content: space-between; gap: 12px; }
.d-credit a { text-decoration: underline; text-underline-offset: 2px; }

.d-main > section { border-bottom: 1px solid var(--line); }
.d-head { padding: var(--pad); padding-top: clamp(28px, 4vw, 56px); display: grid; gap: 18px; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: var(--t-xs); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 4px; display: inline-flex; align-items: center; gap: 6px; }
.tag--try { background: var(--crema); border-color: var(--crema); }
.tag--tried { background: var(--coffee); border-color: var(--coffee); color: var(--paper); }
.d-name { font-size: clamp(40px, 5.4vw, 92px); line-height: .92; letter-spacing: -0.055em; font-weight: 500; text-wrap: balance; }
.d-name .paren { font-size: .3em; letter-spacing: -0.02em; vertical-align: top; color: var(--ink-3); margin-right: .3em; }
.d-desc { font-size: var(--t-lg); line-height: 1.3; letter-spacing: -0.02em; max-width: 36ch; color: var(--ink); text-wrap: pretty; }

.d-facts { display: grid; grid-template-columns: repeat(4, 1fr); }
.d-fact { padding: 14px var(--pad); display: grid; gap: 6px; align-content: start; }
.d-fact + .d-fact { border-left: 1px solid var(--line); }
.d-fact span { font-size: var(--t-xs); color: var(--ink-3); }
.d-fact b { font-weight: 400; font-size: var(--t-md); line-height: 1.25; }

.d-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px var(--pad); border-bottom: 1px solid var(--line); }
.d-sec-head h3 { font-size: var(--t-lg); letter-spacing: -0.02em; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: var(--t-sm); }
.stepper button { width: 34px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; }
.stepper button:hover:not(:disabled) { background: var(--paper-hi); }
.stepper button:disabled { color: var(--ink-3); cursor: default; }
.stepper output { min-width: 78px; text-align: center; font-feature-settings: "tnum"; border-inline: 1px solid var(--line); line-height: 32px; }

.parts { display: grid; grid-template-columns: repeat(2, 1fr); }
.part { padding: var(--pad); border-bottom: 1px solid var(--line); }
.part:nth-child(odd) { border-right: 1px solid var(--line); }
.parts .part:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.parts .part:nth-last-child(-n+2):nth-child(odd):not(:last-child), .parts .part:last-child { border-bottom: 0; }
.part__title { font-size: var(--t-sm); color: var(--ink-3); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.part__batch { color: var(--coffee-dk); }
.ing { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--line) 18%, transparent); }
.ing:first-of-type { border-top: 0; }
.ing__amt { font-feature-settings: "tnum"; white-space: nowrap; }
.ing__amt.is-sugg::after { content: "*"; color: var(--coffee); margin-left: 2px; }
.ing__amt.is-bump { animation: bump .35s ease; }
@keyframes bump { 40% { color: var(--coffee); } }
.ing__note { display: block; font-size: var(--t-sm); color: var(--ink-3); }
.parts-foot { padding: 10px var(--pad); font-size: var(--t-xs); color: var(--ink-3); border-top: 1px solid var(--line); }
.parts-foot b { color: var(--coffee); font-weight: 400; }

.method li { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: start; padding: 14px var(--pad); border-bottom: 1px solid color-mix(in srgb, var(--line) 18%, transparent); cursor: pointer; transition: background-color .2s ease; }
.method li:last-child { border-bottom: 0; }
.method li:hover { background: var(--paper-hi); }
.method__n { font-size: var(--t-sm); color: var(--ink-3); font-feature-settings: "tnum"; padding-top: 3px; }
.method__t { font-size: var(--t-md); line-height: 1.35; }
.method li.is-done .method__t { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.method li.is-done .method__n { color: var(--coffee); }
.method__timer {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; cursor: pointer;
  font-size: var(--t-xs); padding: 4px 10px 5px; white-space: nowrap; font-feature-settings: "tnum";
  display: inline-flex; gap: 6px; align-items: center; min-width: 74px; justify-content: center;
}
.method__timer::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.method__timer:hover { background: var(--paper-hi); }
.method__timer.is-running { background: var(--ink); color: var(--crema); border-color: var(--ink); }
.method__timer.is-running::before { animation: blink 1s steps(2) infinite; }
.method__timer.is-done { background: var(--crema); border-color: var(--crema); }
@keyframes blink { 50% { opacity: 0; } }
.method-foot { padding: 10px var(--pad); font-size: var(--t-xs); color: var(--ink-3); border-top: 1px solid var(--line); }

.d-notes { padding: var(--pad); display: grid; gap: 10px; }
.d-notes .list-plain { color: var(--ink-2); }

.d-source { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: var(--pad); }
.d-source p { font-size: var(--t-sm); color: var(--ink-2); }
.d-source a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.btn-try { border: 1px solid var(--ink); background: transparent; border-radius: 999px; cursor: pointer; padding: 9px 16px 10px; font-size: var(--t-sm); display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.btn-try::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--crema); box-shadow: 0 0 0 1px var(--ink); }
.btn-try:hover { background: var(--paper-hi); }
.btn-try[aria-pressed="true"] { background: var(--coffee); border-color: var(--coffee); color: var(--paper); }
.btn-try[aria-pressed="true"]::before { background: var(--paper); box-shadow: none; }

.d-next { display: grid; grid-template-columns: 1fr 1fr; }
.d-next a { padding: var(--pad); display: grid; gap: 6px; min-height: 120px; align-content: space-between; transition: background-color .25s ease; }
.d-next a + a { border-left: 1px solid var(--line); text-align: right; }
.d-next a:hover { background: var(--paper-hi); }
.d-next span { font-size: var(--t-sm); color: var(--ink-3); }
.d-next b { font-weight: 500; font-size: var(--t-lg); letter-spacing: -0.02em; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 140%);
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-size: var(--t-sm);
  transition: transform .45s var(--ease), visibility 0s .45s; pointer-events: none; white-space: nowrap;
  visibility: hidden;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .45s var(--ease); }
.toast b { color: var(--crema); font-weight: 500; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid > .card:nth-child(4n) { border-right: 1px solid var(--line); }
  .grid > .card:nth-child(3n) { border-right: 0; }
  .basics__grid { grid-template-columns: 1fr 1fr; }
  .basics__grid > .cell { border-bottom: 1px solid var(--line); }
  .basics__grid > .cell:nth-child(2n) { border-right: 0; }
  .basics__grid > .cell:nth-last-child(-n+2) { border-bottom: 0; }
  .rounds { grid-template-columns: repeat(2, 1fr); }
  .round:nth-child(4n) { border-right: 1px solid var(--line); }
  .round:nth-child(2n) { border-right: 0; }
  .round--later .round__list { grid-template-columns: repeat(3, 1fr); }
  .d-facts { grid-template-columns: repeat(2, 1fr); }
  .d-fact:nth-child(3) { border-left: 0; }
  .d-fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .parts { grid-template-columns: 1fr; }
  .part:nth-child(odd) { border-right: 0; }
  .parts .part { border-bottom: 1px solid var(--line) !important; }
  .parts .part:last-child { border-bottom: 0 !important; }
  .filters__secondary { flex-wrap: wrap; }
  .search { flex: 1 1 100%; border-left: 0 !important; border-top: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .hero__row { grid-template-columns: 1fr 1fr; }
  .hero__intro { grid-column: 1 / -1; min-height: 0; padding-bottom: calc(var(--pad) * 2); }
  .hero__row .cell:nth-child(2) { border-left: 0; border-top: 1px solid var(--line); }
  .hero__row .cell:nth-child(3) { border-top: 1px solid var(--line); }
  .spec--wide-hide { display: none !important; }
  .d-body { grid-template-columns: 1fr; }
  .d-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .d-media__inner { position: static; }
  .d-media .ph { width: min(100%, 520px); margin-inline: auto; }
  .syrups { grid-template-columns: 1fr 1fr; }
  .syrup:nth-child(3n) { border-right: 1px solid var(--line); }
  .syrup:nth-child(2n) { border-right: 0; }
  .footer__row { grid-template-columns: 1fr 1fr; }
  .footer__end { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--line); justify-content: flex-start; }
  .must__intro { padding-right: var(--pad); }
}

@media (max-width: 720px) {
  :root { --nav-h: 48px; }
  .nav { grid-template-columns: auto 1fr; }
  .nav__meta { display: none !important; }
  .nav__links { justify-content: flex-end; gap: 16px; }
  .nav__links a[href="#shot"] { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid > .card:nth-child(3n) { border-right: 1px solid var(--line); }
  .grid > .card:nth-child(2n) { border-right: 0; }
  .card__link { aspect-ratio: auto; min-height: 0; }
  .card__media { padding: 18px 0 22px; }
  .ph { width: 70%; }
  .card__top { font-size: 11px; }
  .card__num, .card__name { font-size: var(--t-sm); }
  .tab { padding: 12px 12px; font-size: var(--t-sm); flex-direction: column; gap: 2px; }
  .filters { position: static; }
  .chips { flex-wrap: nowrap; }
  .section-head { grid-template-columns: 1fr; }
  .section-head > .cell + .cell { border-left: 0; border-top: 1px solid var(--line); }
  .rounds, .round--later .round__list { grid-template-columns: 1fr; }
  .round { border-right: 0 !important; }
  .basics__grid { grid-template-columns: 1fr; }
  .basics__grid > .cell { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .basics__grid > .cell:last-child { border-bottom: 0 !important; }
  .syrups { grid-template-columns: 1fr; }
  .syrup { border-right: 0 !important; }
  .footer__row { grid-template-columns: 1fr; }
  .footer__row .cell + .cell { border-left: 0; border-top: 1px solid var(--line); }
  .d-bar { grid-template-columns: 1fr auto; }
  .d-bar__crumb { display: none !important; }
  .d-bar__nav { justify-content: flex-start; border-left: 0 !important; }
  .d-source { grid-template-columns: 1fr; }
  .d-source .btn-try { justify-self: start; }
  .d-next b { font-size: var(--t-md); }
  .method li { grid-template-columns: 36px 1fr; }
  .method__timer { grid-column: 2; justify-self: start; }
  .ing { grid-template-columns: 74px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
