/* Yang Diao — one coffee, one page. */

@font-face { font-family: "Newsreader"; src: url("../assets/fonts/newsreader-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../assets/fonts/newsreader-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../assets/fonts/newsreader-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../assets/fonts/newsreader-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../assets/fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../assets/fonts/jost-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --ivory: #f3f0ea;
  --ivory-2: #e8e3d9;
  --ink: #24201c;
  --muted: #4d453c;
  --rule: #d6cab6;
  --clay: #9c7b55;
  --roast: #5a3a26;
  --cherry: #9e2219;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Gill Sans", "Helvetica Neue", Arial, sans-serif;

  --t-label: 0.875rem;
  --t-body: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --t-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  --t-head: clamp(2.25rem, 1.5rem + 2.8vw, 4rem);
  --t-display: clamp(3.5rem, 1.8rem + 6.5vw, 7.5rem);

  --gutter: clamp(20px, 5.5vw, 96px);
  --wrap: min(1240px, 100% - 2 * var(--gutter));
  --section: clamp(80px, 9vw, 140px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--ivory);
  color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--clay); }
:focus-visible { outline: 2px solid var(--roast); outline-offset: 3px; border-radius: 2px; }
h1, h2 { font-weight: 400; margin: 0; letter-spacing: -0.015em; line-height: 1.08; text-wrap: balance; }
p { margin: 0; }
figure { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 30; background: var(--ink); color: var(--ivory); padding: 10px 16px; font: 500 var(--t-label)/1 var(--sans); }
.skip:focus { top: 12px; }

/* ---------- labels (tracked caps, the reference's voice) ---------- */
.mark, .nav__links a, .meta, .index, .spec dt, .visit dt, .btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: var(--t-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ivory) 94%, transparent);
  border-bottom: 1px solid var(--rule); /* taste-skill-ignore: sticky bar edge, from the client's chosen reference */
}
.nav__in { width: var(--wrap); margin-inline: auto; display: flex; align-items: center; gap: 32px; min-height: 72px; }
.mark { text-decoration: none; font-family: var(--serif); font-weight: 400; font-size: 1.375rem; letter-spacing: 0.32em; white-space: nowrap; }
.nav nav { margin-left: auto; }
.nav__links { display: flex; gap: clamp(20px, 3vw, 48px); list-style: none; margin: 0; padding: 0; }
.nav__links a { text-decoration: none; color: var(--muted); white-space: nowrap; transition: color 0.2s; }
.nav__links a:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  background: var(--ink); color: var(--ivory);
  border: 0; border-radius: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { background: var(--roast); }
.btn:active { transform: translateY(1px); }

/* ---------- hero: the cup ---------- */
.hero {
  width: var(--wrap); margin-inline: auto;
  padding: clamp(36px, 5vw, 64px) 0 var(--section);
  display: grid; justify-items: center; text-align: center;
}
.meta { color: var(--muted); }
.pour { margin-top: clamp(20px, 3vw, 32px); width: min(440px, 82vw, 44vh); display: grid; justify-items: center; }
.pour__svg { width: 100%; }
.pour__fill { transform-origin: 300px 300px; transform: scale(0.02); }
.pour__stripes { transform-origin: 300px 300px; animation: swirl 40s linear infinite; }
@keyframes swirl { to { transform: rotate(360deg); } }
.pour__stream { transition: opacity 0.6s var(--ease); }
.pour__read { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 28px; margin-top: 14px; min-height: 52px; }
.pour__num { font-size: var(--t-lead); font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }
.pour__num span { display: inline-block; min-width: 3.2ch; text-align: right; }
.pour__note { flex-basis: 100%; color: var(--muted); font-style: italic; font-size: var(--t-body); }
.pour__again { font: 500 var(--t-body)/1 var(--sans); background: var(--ivory-2); border: 0; padding: 0 20px; color: var(--ink); cursor: pointer; min-height: 44px; transition: background-color 0.2s; }
.pour__again:hover { background: var(--rule); }
.hero__title { font-size: var(--t-display); margin-top: clamp(12px, 2vw, 28px); }
.hero__line { font-size: var(--t-lead); color: var(--muted); max-width: 30ch; margin-top: 14px; line-height: 1.35; }
.hero__status { margin-top: 22px; font-size: var(--t-body); max-width: 34ch; }
.hero__status::before { content: ""; display: inline-block; vertical-align: 0.12em; margin-right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--clay); }
.hero__status.is-open::before { background: var(--cherry); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- section index line ---------- */
.index { display: flex; align-items: center; gap: 24px; color: var(--muted); margin-bottom: clamp(40px, 5vw, 72px); }
.index::after { content: ""; height: 1px; background: var(--rule); flex: 1; } /* taste-skill-ignore: the reference's catalogue index line */

/* ---------- split sections ---------- */
.split { width: var(--wrap); margin-inline: auto; padding-top: var(--section); }
.split--flip { padding-top: clamp(56px, 7vw, 112px); padding-bottom: var(--section); }
.split__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: center; }
.split__text { display: grid; gap: 22px; max-width: 34rem; }
.split__text h2 { font-size: var(--t-head); margin-bottom: 8px; }
.split__text p:not(.caption) { color: var(--muted); max-width: 60ch; }
.caption { color: var(--ink); margin-top: 6px; font-style: italic; }
.split__pic img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* ---------- recipe ---------- */
.recipe { background: var(--ivory-2); padding: var(--section) var(--gutter); }
.recipe > * { max-width: 1240px; margin-inline: auto; }
.recipe__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 clamp(40px, 6vw, 110px); }
.spec, .visit { margin: 0; }
.spec div, .visit div { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; border-top: 1px solid var(--rule); padding: 20px 0; } /* taste-skill-ignore: rows of a real key/value table */
.spec div:last-child { border-bottom: 1px solid var(--rule); } /* taste-skill-ignore: table end */
.spec dt, .visit dt { color: var(--muted); flex: none; }
.spec dd, .visit dd { margin: 0; font-size: var(--t-lead); line-height: 1.3; text-align: right; }
.spec dd { font-variant-numeric: lining-nums; }

/* ---------- details ---------- */
.detail { width: var(--wrap); margin-inline: auto; padding: var(--section) 0; }
.detail__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px); }
.tile img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.tile figcaption { padding-top: 16px; color: var(--ink); font-style: italic; }

/* ---------- counter notes ---------- */
.counter { background: var(--ivory-2); padding: var(--section) var(--gutter); }
.counter > * { max-width: 1240px; margin-inline: auto; }
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 64px); }
.note { margin: 0; display: grid; gap: 20px; align-content: start; }
.note p { font-size: var(--t-lead); font-style: italic; line-height: 1.4; }
.note footer { color: var(--muted); font-family: var(--sans); font-size: var(--t-body); }

/* ---------- bag ---------- */
.bag { width: var(--wrap); margin-inline: auto; padding: var(--section) 0; }
.bag__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.bag__intro { display: grid; gap: 22px; }
.bag__intro h2 { font-size: var(--t-head); }
.bag__intro > p:not(.bag__price) { color: var(--muted); max-width: 46ch; }
.bag__price { font-size: var(--t-lead); display: grid; gap: 4px; }
.bag__price span { font-size: var(--t-body); color: var(--muted); font-style: italic; }
.visit { margin-top: 12px; }
.visit div:last-child { border-bottom: 1px solid var(--rule); } /* taste-skill-ignore: table end */
.visit dd { font-size: var(--t-body); }

.order { display: grid; gap: 22px; background: var(--ivory-2); padding: clamp(24px, 4vw, 48px); }
.grind { border: 0; padding: 0; margin: 0; }
.grind legend { padding: 0; margin-bottom: 12px; }
.grind__opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grind label { position: relative; }
.grind input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.grind span { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border: 1px solid var(--rule); /* taste-skill-ignore: radio control */ background: var(--ivory); transition: border-color 0.2s, background-color 0.2s, color 0.2s; }
.grind input:hover + span { border-color: var(--clay); }
.grind input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--ivory); }
.grind input:focus-visible + span { outline: 2px solid var(--roast); outline-offset: 3px; }
.order__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.field { display: grid; gap: 8px; }
.field > span, .grind legend { font-family: var(--sans); font-weight: 500; color: var(--ink); }
.field input, .field select {
  font: inherit; color: var(--ink); background: var(--ivory);
  border: 1px solid var(--rule); border-radius: 0; min-height: 52px; padding: 0 14px; width: 100%;
  transition: border-color 0.2s;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2324201c' stroke-width='1.6'/%3E%3C/svg%3E"); background-position: calc(100% - 16px) 50%; background-size: 12px 8px; background-repeat: no-repeat; padding-right: 44px; }
.field input:hover, .field select:hover { border-color: var(--clay); }
.field input:focus-visible, .field select:focus-visible { border-color: var(--ink); outline-offset: 2px; }
.field input[aria-invalid="true"] { border-color: var(--cherry); }
.order__error { color: var(--cherry); }
.btn--big { min-height: 60px; width: 100%; white-space: normal; text-align: center; line-height: 1.3; padding: 12px 20px; text-transform: none; letter-spacing: 0.02em; font-size: var(--t-body); }
.btn--big.is-sent { background: var(--roast); }
.fine { color: var(--muted); font-size: var(--t-body); font-style: italic; }

/* ---------- footer ---------- */
.foot { background: var(--ivory-2); padding: 40px var(--gutter) 48px; }
.foot__in { max-width: 1240px; margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.foot p { color: var(--muted); font-family: var(--sans); }
.foot__top { text-decoration: none; font-family: var(--sans); font-weight: 500; font-size: var(--t-label); letter-spacing: 0.22em; text-transform: uppercase; display: inline-flex; align-items: center; min-height: 44px; }
.foot__imprint { max-width: 1240px; margin: 24px auto 0; color: var(--muted); font-size: var(--t-body); font-style: italic; }

/* ---------- reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js .split__grid [data-reveal]:nth-child(2), .js .detail__row .tile:nth-child(2), .js .notes .note:nth-child(2) { transition-delay: 0.12s; }
.js .detail__row .tile:nth-child(3), .js .notes .note:nth-child(3) { transition-delay: 0.24s; }

/* index lines draw in; spec rows and the hero arrive in order */
.js .index::after { transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease); }
.js .index.is-in::after { transform: scaleX(1); }
.js .spec div { opacity: 0; transform: translateY(10px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .spec.is-in div { opacity: 1; transform: none; }
.js .spec.is-in div:nth-child(2) { transition-delay: 0.06s; } .js .spec.is-in div:nth-child(3) { transition-delay: 0.12s; }
.js .spec.is-in div:nth-child(4) { transition-delay: 0.18s; } .js .spec.is-in div:nth-child(5) { transition-delay: 0.24s; }
.js .spec.is-in div:nth-child(6) { transition-delay: 0.3s; }
.js .hero > * { animation: rise 1.1s var(--ease) both; }
.js .hero > :nth-child(2) { animation-delay: 0.1s; } .js .hero > :nth-child(3) { animation-delay: 0.35s; }
.js .hero > :nth-child(4) { animation-delay: 0.45s; } .js .hero > :nth-child(5) { animation-delay: 0.55s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
/* the pictures drift very slowly while they are on screen */
.split__pic { overflow: hidden; }
.split__pic img { transform: scale(1.06) translateY(var(--drift, 0px)); will-change: transform; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav .btn--nav { margin-left: auto; }
  .split__grid, .bag__grid, .recipe__cols { grid-template-columns: minmax(0, 1fr); }
  .split--flip .split__pic { order: 2; }
  .split__text { max-width: none; }
  .split__pic img { aspect-ratio: 5 / 4; }
  .recipe__cols .spec:first-child div:last-child { border-bottom: 0; }
  .notes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .detail__row { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .tile img { aspect-ratio: 5 / 4; }
  .nav__in { gap: 16px; min-height: 64px; }
  .mark { font-size: 1.125rem; letter-spacing: 0.24em; }
  .btn--nav { padding: 0 16px; min-height: 44px; }
  .btn--nav { font-size: var(--t-label); letter-spacing: 0.12em; }
  .spec div, .visit div { flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 0; }
  .spec dd, .visit dd { text-align: left; }
  .order__row { grid-template-columns: minmax(0, 1fr); }
  .foot__in { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
  .btn--nav .long { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js .spec div { opacity: 1; transform: none; }
  .js .index::after { transform: none; }
  .split__pic img { transform: none; }
}
