:root {
  color-scheme: light;
  --bg: #f5efe4;
  --bg-deep: #ede4d4;
  --paper: #fffaf2;
  --ink: #2d241d;
  --ink-soft: #6b5d50;
  --line: #e4d8c5;
  --seal: #b5432f;

  --white: #b8894a;
  --white-bg: #f5ead6;
  --shen: #5f7f4e;
  --shen-bg: #e5ead8;
  --shu: #8a4a2f;
  --shu-bg: #f1dfd2;

  --radius: 22px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 12px 32px -12px rgba(60, 40, 20, .18);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background-color: var(--bg);
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  overflow-x: hidden;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
h2 { font: 600 clamp(28px, 5vw, 42px)/1.1 var(--serif); letter-spacing: -.01em; }
h3 { font-weight: 700; font-size: 18px; }
p { margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--seal); margin-bottom: 10px;
}
.section { padding-top: 64px; padding-bottom: 24px; }
.section__lead { max-width: 640px; margin-top: 14px; color: var(--ink-soft); font-size: 17px; }

.seal {
  display: inline-grid; place-items: center;
  width: 54px; height: 54px; border-radius: 12px;
  background: var(--seal); color: #fff5e6;
  font: 500 30px/1 var(--serif);
  transform: rotate(-6deg);
  box-shadow: 0 6px 18px -6px rgba(181, 67, 47, .6);
  margin-bottom: 22px;
}
.seal--small { width: 40px; height: 40px; font-size: 22px; margin-bottom: 14px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 56px 0 40px; overflow-x: clip; }
.hero__inner { position: relative; display: grid; gap: 24px; align-items: center; }
@media (min-width: 860px) { .hero__inner { grid-template-columns: 1.25fr 1fr; padding-top: 24px; } }
.hero h1 { font: 500 clamp(40px, 9vw, 76px)/1.02 var(--serif); letter-spacing: -.02em; }
.hero h1 em { font-style: italic; color: var(--seal); }
.hero__lead { margin-top: 22px; max-width: 540px; font-size: 18px; color: var(--ink-soft); }
.hero__sign { margin-top: 16px; font: italic 500 20px var(--serif); }
.hero__stats { display: flex; gap: 28px; margin: 30px 0 0; }
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats dt { font: 600 32px/1 var(--serif); }
.hero__stats dd { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }

.hero__blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.hero__blob--a { width: 420px; height: 420px; background: #f2c9a0; top: -140px; right: -100px; }
.hero__blob--b { width: 360px; height: 360px; background: #cfdcbc; bottom: -160px; left: -140px; }

.hero__art { display: flex; justify-content: center; }
.cup { width: min(320px, 78vw); color: #c9b49a; }
.cup__body { fill: var(--paper); stroke: #d9c7ad; stroke-width: 3; }
.cup__tea { fill: #d8a35a; }
.cup__shadow { fill: rgba(80, 50, 20, .1); }
.cup__shine { stroke: rgba(255, 255, 255, .9); }
.cup__petal { fill: #e9a2a0; }
.cup__petal--b { fill: #f3d36b; }
.steam path { animation: steam 3.6s ease-in-out infinite; opacity: 0; }
.steam path:nth-child(2) { animation-delay: 1.2s; }
.steam path:nth-child(3) { animation-delay: 2.4s; }
@keyframes steam {
  0% { opacity: 0; transform: translateY(14px); }
  40% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-22px); }
}

/* ---------- Basics ---------- */
.steps-grid { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
@media (min-width: 640px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .steps-grid { grid-template-columns: repeat(4, 1fr); } }
.step-card {
  background: var(--paper); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); position: relative;
}
.step-card__num {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-deep); font: 600 18px var(--serif); margin-bottom: 14px;
}
.step-card p { margin-top: 8px; color: var(--ink-soft); font-size: 15px; }

.temp-guide {
  margin-top: 18px; padding: 26px; border-radius: var(--radius);
  background: linear-gradient(135deg, #fff6ea, #f6ebdb);
  border: 1px solid var(--line);
  display: grid; gap: 22px;
}
@media (min-width: 820px) { .temp-guide { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.temp-guide ul { margin: 10px 0 12px; padding-left: 18px; }
.temp-guide li { margin: 4px 0; }
.temp-guide p:first-of-type { margin-top: 8px; }
.thermo { display: grid; gap: 14px; }
.thermo__row { display: grid; grid-template-columns: 82px 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.thermo__row i { height: 10px; border-radius: 10px; background: var(--line); position: relative; overflow: hidden; }
.thermo__row i::after { content: ''; position: absolute; inset: 0; width: var(--w); border-radius: inherit; }
.thermo__row--shu i::after { background: linear-gradient(90deg, #e7b98f, var(--shu)); }
.thermo__row--shen i::after { background: linear-gradient(90deg, #d7e0c3, var(--shen)); }
.thermo__row--white i::after { background: linear-gradient(90deg, #f3e2c2, var(--white)); }
.thermo__row b { font-weight: 700; }

/* ---------- Types & path ---------- */
.types { display: grid; gap: 14px; margin-top: 28px; }
@media (min-width: 820px) { .types { grid-template-columns: repeat(3, 1fr); } }
.type-card {
  position: relative; overflow: hidden; padding: 26px; border-radius: var(--radius);
  min-height: 210px; display: flex; flex-direction: column; gap: 10px;
}
.type-card p { font-size: 15px; color: var(--ink-soft); }
.type-card__hanzi {
  position: absolute; right: -6px; bottom: -22px; font: 500 96px/1 var(--serif);
  opacity: .1; pointer-events: none;
}
.type-card__meta { margin-top: auto; font-weight: 700; font-size: 13px; color: var(--ink) !important; }
.type-card--white { background: var(--white-bg); }
.type-card--white h3 { color: var(--white); }
.type-card--shen { background: var(--shen-bg); }
.type-card--shen h3 { color: var(--shen); }
.type-card--shu { background: var(--shu-bg); }
.type-card--shu h3 { color: var(--shu); }
.type-card h3 { font: 600 24px var(--serif); }

.path { margin-top: 18px; padding: 28px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.path h3 { font: 600 24px var(--serif); }
.path > .muted { margin-top: 6px; }
.path__list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 16px; }
@media (min-width: 820px) { .path__list { grid-template-columns: repeat(3, 1fr); } }
.path__list li { display: flex; gap: 14px; align-items: flex-start; }
.path__list div { display: flex; flex-direction: column; }
.path__list span:not(.dot) { color: var(--ink-soft); font-size: 15px; }
.dot { flex: none; width: 14px; height: 14px; border-radius: 50%; margin-top: 6px; }
.dot--white { background: var(--white); }
.dot--shen { background: var(--shen); }
.dot--shu { background: var(--shu); }
.moods { display: grid; gap: 10px; margin-top: 24px; padding-top: 22px; border-top: 1px dashed var(--line); }
@media (min-width: 820px) { .moods { grid-template-columns: repeat(3, 1fr); } }
.mood { display: flex; flex-direction: column; padding: 14px 16px; border-radius: 16px; background: var(--bg); font-size: 15px; }
.mood__time { font: italic 500 18px var(--serif); color: var(--seal); }

/* ---------- Toolbar ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 10; margin-top: 26px;
  background: rgba(245, 239, 228, .88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar__inner { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--paper);
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink-soft); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip--white.is-active { background: var(--white); border-color: var(--white); }
.chip--shen.is-active { background: var(--shen); border-color: var(--shen); }
.chip--shu.is-active { background: var(--shu); border-color: var(--shu); }
.progress { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.progress__bar { width: 110px; height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--white), var(--shen), var(--shu)); transition: width .5s ease; }

/* ---------- Tea card ---------- */
.catalog { display: grid; gap: 28px; margin-top: 28px; }
.tea {
  --accent: var(--ink); --accent-bg: var(--bg-deep);
  display: grid; background: var(--paper); border-radius: 28px; box-shadow: var(--shadow);
  overflow: hidden; scroll-margin-top: 80px;
}
.tea[hidden] { display: none; }
.tea--white { --accent: var(--white); --accent-bg: var(--white-bg); }
.tea--shen { --accent: var(--shen); --accent-bg: var(--shen-bg); }
.tea--shu { --accent: var(--shu); --accent-bg: var(--shu-bg); }
@media (min-width: 900px) {
  .tea { grid-template-columns: 400px 1fr; background: linear-gradient(90deg, var(--accent-bg) 400px, var(--paper) 400px); }
  .gallery { position: sticky; top: 74px; align-self: start; }
}

.gallery { padding: 14px; background: var(--accent-bg); }
.gallery__main { position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #fff; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__hanzi {
  position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; border-radius: 10px;
  background: rgba(255, 250, 242, .9); font: 500 16px var(--serif); color: var(--accent);
  writing-mode: vertical-rl; letter-spacing: .1em;
}
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.thumb {
  flex: none; width: 58px; height: 58px; padding: 0; border-radius: 12px; overflow: hidden;
  border: 2px solid transparent; background: #fff; opacity: .65; transition: opacity .2s, border-color .2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-active, .thumb:hover { opacity: 1; border-color: var(--accent); }

.tea__body { padding: 22px 18px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 720px) { .tea__body { padding: 30px 32px 32px; } }
.tea__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge--white { background: var(--white-bg); color: var(--white); }
.badge--shen { background: var(--shen-bg); color: var(--shen); }
.badge--shu { background: var(--shu-bg); color: var(--shu); }
.fav {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  font-size: 18px; color: #d8c8b4; transition: transform .2s, color .2s, background .2s;
}
.fav[aria-pressed="true"] { color: #fff; background: var(--seal); border-color: var(--seal); transform: scale(1.06); }
.tea__name { font: 600 clamp(26px, 4.5vw, 34px)/1.1 var(--serif); }
.tea__sub { color: var(--ink-soft); margin-top: -8px; font-size: 15px; }
.notes { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.notes li { font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }
.tea__desc { font-size: 16px; }
.tea__box { font-size: 14px; color: var(--ink-soft); }
.tea__box b { color: var(--ink); }

/* variants */
.variants { padding: 16px; border-radius: 18px; background: var(--bg); }
.variants__label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; }
.variants__list { display: flex; flex-wrap: wrap; gap: 8px; }
.variant {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-size: 14px; font-weight: 600;
  transition: border-color .2s, background .2s;
}
.variant__check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center;
  transition: background .2s, border-color .2s;
}
.variant[aria-pressed="true"] .variant__check { background: var(--accent); border-color: var(--accent); }
.variant[aria-pressed="true"] .variant__check::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 800; }
.variant--shen[aria-pressed="true"] .variant__check { background: var(--shen); border-color: var(--shen); }
.variant--shu[aria-pressed="true"] .variant__check { background: var(--shu); border-color: var(--shu); }
.variant.is-selected { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(45, 36, 29, .08); }
.variant--shen.is-selected { border-color: var(--shen); }
.variant--shu.is-selected { border-color: var(--shu); }
.variant-note { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }

/* brew params */
.brew { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .brew { grid-template-columns: repeat(4, 1fr); } }
.brew__item {
  display: flex; flex-direction: column; padding: 12px 14px; border-radius: 16px; background: var(--accent-bg);
}
.brew__icon { font-size: 16px; }
.brew__item b { font-size: 16px; margin-top: 4px; line-height: 1.25; }
.brew__item span:last-child { font-size: 12px; color: var(--ink-soft); }
.brew__plan { grid-column: 1 / -1; font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.brew__plan b { color: var(--ink); }

/* timer */
.timer { border: 1px solid var(--line); border-radius: 20px; padding: 18px; background: linear-gradient(180deg, var(--paper), #fbf4e9); }
.timer__top { display: flex; justify-content: space-between; align-items: baseline; }
.timer__top h4 { font: 600 20px var(--serif); }
.timer__hint { font-size: 12px; color: var(--ink-soft); }
.timer__steps { display: flex; gap: 6px; overflow-x: auto; margin: 12px -18px 0; padding: 2px 18px 6px; scrollbar-width: thin; }
.step {
  flex: none; display: flex; flex-direction: column; align-items: flex-start; padding: 8px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--paper); font-size: 12px; color: var(--ink-soft); line-height: 1.3;
}
.step b { font-size: 14px; color: var(--ink); }
.step.is-done { opacity: .55; }
.step.is-done b::after { content: ' ✓'; color: var(--accent); }
.step.is-current { border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.timer__panel { display: flex; gap: 18px; align-items: center; margin-top: 14px; }
.timer__ring { position: relative; flex: none; width: 112px; height: 112px; }
.timer__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.timer__time { position: absolute; inset: 0; display: grid; place-items: center; font: 600 28px var(--serif); font-variant-numeric: tabular-nums; }
.timer__controls { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.timer__status { font-size: 14px; color: var(--ink-soft); }
.timer__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 15px; border: 1.5px solid transparent; transition: transform .1s, background .2s; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; min-width: 96px; }
.btn--ghost { background: transparent; border-color: var(--line); }
.tea.is-brewing .timer__time { color: var(--accent); }
.tea.is-brewing .timer__ring { animation: pulse 2s ease-in-out infinite; }
.tea.is-done .timer__ring { animation: pop .5s ease; }
@keyframes pulse { 50% { transform: scale(1.03); } }
@keyframes pop { 40% { transform: scale(1.1); } }

.tea__tip { padding: 14px 16px; border-radius: 16px; background: #fff3d9; font-size: 15px; }
.gongfu { border-top: 1px dashed var(--line); padding-top: 12px; font-size: 14px; }
.gongfu summary { cursor: pointer; font-weight: 700; color: var(--ink-soft); list-style: none; }
.gongfu summary::-webkit-details-marker { display: none; }
.gongfu summary::before { content: '+'; display: inline-block; width: 18px; font-weight: 800; color: var(--accent); }
.gongfu[open] summary::before { content: '−'; }
.gongfu p { margin-top: 8px; color: var(--ink-soft); }

.journal { display: grid; gap: 12px; padding-top: 14px; border-top: 1px dashed var(--line); }
.tried-btn {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 700;
}
.tried-btn__box { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: background .2s; }
.tried-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.tried-btn[aria-pressed="true"] .tried-btn__box { background: var(--accent); border-color: var(--accent); }
.tried-btn[aria-pressed="true"] .tried-btn__box::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 800; }
.journal__note { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.journal__note textarea {
  width: 100%; resize: vertical; min-height: 56px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg); font: 400 16px/1.5 var(--sans); color: var(--ink);
}
.journal__note textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }

.empty { text-align: center; padding: 40px 16px; color: var(--ink-soft); }

/* ---------- Storage ---------- */
.store-grid { display: grid; gap: 12px; margin: 26px 0 16px; }
@media (min-width: 640px) { .store-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .store-grid { grid-template-columns: repeat(4, 1fr); } }
.store { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.store span { font-size: 14px; color: var(--ink-soft); }

/* ---------- Footer & toast ---------- */
.footer { margin-top: 56px; padding: 48px 0 64px; text-align: center; border-top: 1px solid var(--line); }
.footer .wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer p:first-of-type { font: italic 500 22px var(--serif); }

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 50; transform: translate(-50%, 140%);
  max-width: calc(100% - 32px); width: max-content;
  padding: 14px 20px; border-radius: 16px; background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.is-on { transform: translate(-50%, 0); }

button:focus-visible, summary:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }

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