/* =========================================================
   ЧАШКИ К ПЛЮШКАМ — стили
   Палитра взята с ваших фото и лого:
   тёплый уголь, кремовый фарфор, celadon-зелёный, янтарь.
   ========================================================= */

@font-face {
  font-family: 'Marmelad';
  src: url('../assets/fonts/marmelad.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg:        #18120d;   /* тёплый уголь, почти чёрный */
  --bg-soft:   #221a12;   /* чуть светлее, карточки */
  --cream:     #f1e7d3;   /* фарфор, основной текст */
  --cream-dim: #c9bba0;   /* приглушённый текст */
  --green:     #8aa96f;   /* celadon — халат, глазурь */
  --green-dk:  #5d7a4c;
  --amber:     #d99a4e;   /* мёд, чай, ламповый свет */
  --terra:     #b5623f;   /* терракота, кирпич */
  --wood:      #2c2017;   /* тёмное дерево */
  --line:      rgba(241,231,211,0.12);

  --serif: 'Marmelad', 'Segoe UI', system-ui, sans-serif;
  --hand:  'Caveat', cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* убрать синюю вспышку при тапе (везде) и случайное выделение графики/кнопок;
   сцены (.scene/.desk) целиком не выделяются — это интерактивная картинка, не текст */
* { -webkit-tap-highlight-color: transparent; }
img, canvas, button, [role="button"], .scene, .desk {
  -webkit-user-select: none; user-select: none;
}

html { scroll-behavior: smooth; touch-action: manipulation; }

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.hand { font-family: var(--hand); }
.accent { color: var(--green); }
.amber { color: var(--amber); }

/* ====================== ВХОД-РАЗВИЛКА ====================== */

.fork {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.fork__head {
  text-align: center;
  padding: 5vh 1rem 2vh;
  position: relative;
  z-index: 3;
}
.fork__logo {
  width: 120px; height: auto;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,.5));
}
.fork__logo-fallback {
  font-family: var(--hand);
  font-size: 3.5rem;
  color: var(--green);
  line-height: 1;
}
.fork__name {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: .02em;
}
.fork__tagline {
  font-family: var(--hand);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: var(--amber);
  margin-top: .3rem;
}
.fork__question {
  color: var(--cream-dim);
  font-size: 1.1rem;
  margin-top: 1.2rem;
  font-style: italic;
}

.fork__doors {
  flex: 1;
  display: flex;
  min-height: 60vh;
}

.door {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  cursor: pointer;
  transition: flex .6s cubic-bezier(.2,.8,.2,1), background .6s;
  overflow: hidden;
}
.door::before {
  content: "";
  position: absolute; inset: 0;
  opacity: .5;
  transition: opacity .6s, transform .6s;
  z-index: 0;
}
.door--know::before {
  background: radial-gradient(circle at 50% 40%, rgba(217,154,78,.22), transparent 60%);
}
.door--learn::before {
  background: radial-gradient(circle at 50% 40%, rgba(138,169,111,.22), transparent 60%);
}
.door > * { position: relative; z-index: 1; }

.door:hover { flex: 1.4; }
.door:hover::before { opacity: 1; }

.fork__doors:hover .door:not(:hover) { flex: .8; opacity: .65; }

.door__line {
  position: absolute; top: 0; bottom: 0;
}
.door--know { border-right: 1px solid var(--line); }

.door__icon { font-family: var(--hand); font-size: 2rem; color: var(--cream-dim); margin-bottom: .5rem; }
.door__title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 500;
}
.door--know .door__title { color: var(--amber); }
.door--learn .door__title { color: var(--green); }
.door__sub {
  color: var(--cream-dim);
  font-size: 1.05rem;
  max-width: 22ch;
  margin: .8rem 0 1.6rem;
}
.door__cta {
  font-family: var(--hand);
  font-size: 1.4rem;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 2px;
  transition: gap .3s;
}
.door--know .door__cta { color: var(--amber); }
.door--learn .door__cta { color: var(--green); }

.fork__foot {
  text-align: center;
  padding: 1.5rem;
  color: var(--cream-dim);
  font-size: .9rem;
  z-index: 3;
}

/* ====================== ШАПКА (внутренние страницы) ====================== */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1.5rem;
  background: rgba(24,18,13,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; }
.topbar__brand img { width: 40px; }
.topbar__brand .hand { color: var(--green); font-size: 1.6rem; }
.topbar__nav { display: flex; align-items: center; gap: 1.2rem; }
.topbar__nav a { color: var(--cream-dim); font-size: 1rem; transition: color .2s; }
.topbar__nav a:hover { color: var(--cream); }

.cart-btn {
  position: relative;
  background: var(--green-dk); color: var(--cream);
  border: none; cursor: pointer;
  padding: .5rem 1rem; border-radius: 999px;
  font-family: var(--serif); font-size: 1rem;
  display: flex; align-items: center; gap: .4rem;
  transition: background .2s;
}
.cart-btn:hover { background: var(--green); color: var(--bg); }
.cart-btn__count {
  background: var(--amber); color: var(--bg);
  font-size: .8rem; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* ====================== КАТАЛОГ ====================== */

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.page-head { text-align: center; padding: 3rem 1rem 1rem; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 500; }
.page-head p { color: var(--cream-dim); margin-top: .5rem; font-size: 1.1rem; }

.filters {
  display: flex; flex-wrap: wrap; gap: .6rem;
  justify-content: center;
  padding: 1.5rem 1rem;
}
.filter {
  background: transparent; color: var(--cream-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem 1rem; cursor: pointer;
  font-family: var(--serif); font-size: 1rem;
  transition: all .2s;
}
.filter:hover { border-color: var(--green); color: var(--cream); }
.filter.is-active { background: var(--green); color: var(--bg); border-color: var(--green); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 0 4rem;
}

.tea {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, border-color .25s;
}
.tea:hover { transform: translateY(-4px); border-color: var(--green-dk); }
.tea__img {
  aspect-ratio: 4/3;
  background: var(--wood);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.tea__img .cn { font-family: var(--hand); font-size: 3.5rem; color: rgba(241,231,211,.18); }
.tea__img img { width: 100%; height: 100%; object-fit: cover; }
.tea__body { padding: 1.2rem; display: flex; flex-direction: column; flex: 1; }
.tea__type {
  font-family: var(--hand); font-size: 1.2rem; color: var(--amber);
}
.tea__name { font-size: 1.4rem; font-weight: 500; margin: .1rem 0; }
.tea__nick { font-family: var(--hand); font-size: 1.05rem; color: var(--cream-dim); font-weight: 400; }
.tea__note { color: var(--cream-dim); font-size: .98rem; flex: 1; margin: .4rem 0 1rem; }
.tea__foot { display: flex; align-items: center; justify-content: space-between; }
.tea__price { font-size: 1.2rem; }
.tea__price small { color: var(--cream-dim); font-size: .85rem; }
.add-btn {
  background: var(--amber); color: var(--bg);
  border: none; cursor: pointer;
  padding: .45rem 1rem; border-radius: 999px;
  font-family: var(--serif); font-size: 1rem; font-weight: 500;
  transition: transform .15s, background .2s;
}
.add-btn:hover { background: var(--cream); }
.add-btn:active { transform: scale(.94); }

/* плашки-заглушки по цвету категории (пока нет фото) */
.tea__img.cat--hei,    .sib__ph.cat--hei,    .tea-detail__ph.cat--hei    { background: linear-gradient(135deg,#2a1d12,#16100a); }
.tea__img.cat--hong,   .sib__ph.cat--hong,   .tea-detail__ph.cat--hong   { background: linear-gradient(135deg,#5a2418,#2a1109); }
.tea__img.cat--bai,    .sib__ph.cat--bai,    .tea-detail__ph.cat--bai    { background: linear-gradient(135deg,#4a463a,#26241d); }
.tea__img.cat--wulong, .sib__ph.cat--wulong, .tea-detail__ph.cat--wulong { background: linear-gradient(135deg,#3c4a2a,#1c2413); }
.tea__img.cat--gaba,   .sib__ph.cat--gaba,   .tea-detail__ph.cat--gaba   { background: linear-gradient(135deg,#5a3a1c,#2a1c0d); }
.tea__img.cat--lv,     .sib__ph.cat--lv,     .tea-detail__ph.cat--lv     { background: linear-gradient(135deg,#3f5a2c,#1f2d15); }
.tea__img.cat--huang,  .sib__ph.cat--huang,  .tea-detail__ph.cat--huang  { background: linear-gradient(135deg,#6a5418,#2f2609); }
.tea__img.cat--sheng,  .sib__ph.cat--sheng,  .tea-detail__ph.cat--sheng  { background: linear-gradient(135deg,#4a5a2c,#222d14); }

/* ====================== СТРАНИЦА СОРТА ====================== */
.back-link { display: inline-block; color: var(--cream-dim); margin: 1.5rem 0 .5rem; font-size: 1.05rem; }
.back-link:hover { color: var(--cream); }

.tea-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem;
  padding: 1rem 0 3rem; align-items: start;
}
.tea-detail__media { position: sticky; top: 90px; }
.tea-detail__media img,
.tea-detail__ph {
  width: 100%; aspect-ratio: 4/5; border-radius: 18px; object-fit: cover;
  border: 1px solid var(--line);
}
.tea-detail__ph { display: flex; align-items: center; justify-content: center; }
.tea-detail__ph span { font-family: var(--hand); font-size: 6rem; color: rgba(241,231,211,.22); }

.tea-detail__info h1 { font-size: clamp(2rem,4vw,2.8rem); font-weight: 500; margin: .2rem 0; }
.tea-detail__nick { font-size: 1.5rem; color: var(--amber); margin-bottom: .5rem; }
.tea-detail__desc { font-size: 1.25rem; color: var(--cream); margin: .8rem 0 1.4rem; }
.tea-detail__price { font-size: 1.8rem; margin-bottom: 1.2rem; }
.tea-detail__price small { color: var(--cream-dim); font-size: 1rem; }

.tea-detail__buy { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.qty { display: flex; align-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; }
.qty button { width: 30px; height: 30px; border: none; background: transparent; color: var(--cream); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.qty button:hover { color: var(--green); }
.qty span { min-width: 1.5ch; text-align: center; font-size: 1.2rem; }
.add-btn--lg { padding: .7rem 2rem; font-size: 1.15rem; }

.brew {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.3rem 1.5rem; margin-bottom: 1.5rem;
}
.brew h3 { font-weight: 500; font-size: 1.3rem; margin-bottom: .8rem; color: var(--green); }
.brew ul { list-style: none; display: grid; gap: .4rem; }
.brew li { color: var(--cream-dim); }
.brew li b { color: var(--cream); font-weight: 500; }
.brew__tip { margin-top: .9rem; font-style: italic; color: var(--cream-dim); }

.tea-detail__help { color: var(--cream-dim); }
.tea-detail__help a { color: var(--green); border-bottom: 1px dashed currentColor; }

.tea-detail__notfound { text-align: center; padding: 5rem 1rem; }
.tea-detail__notfound .hand { font-size: 2rem; color: var(--green); margin-bottom: 1.5rem; }

.siblings { padding: 1rem 0 4rem; border-top: 1px solid var(--line); }
.siblings h2 { font-weight: 500; font-size: 1.6rem; margin: 1.5rem 0 1.2rem; }
.siblings__row { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 1rem; }
.sib { display: block; transition: transform .2s; }
.sib:hover { transform: translateY(-4px); }
.sib__ph { aspect-ratio: 1/1; border-radius: 12px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.sib__ph span { font-family: var(--hand); font-size: 2.5rem; color: rgba(241,231,211,.2); }
.sib__name { margin-top: .5rem; font-size: 1.05rem; }
.sib__price { color: var(--cream-dim); font-size: .95rem; }

@media (max-width: 720px) {
  .tea-detail { grid-template-columns: 1fr; gap: 1.5rem; }
  .tea-detail__media { position: static; }
  .tea-detail__media img, .tea-detail__ph { aspect-ratio: 16/10; }
}

/* ====================== КОРЗИНА ====================== */

.cart-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.cart-overlay.is-open { opacity: 1; pointer-events: auto; }

.cart {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 101;
  width: min(420px, 100%);
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.cart.is-open { transform: none; }
.cart__head {
  padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.cart__head h2 { font-weight: 500; font-size: 1.5rem; }
.cart__close { background: none; border: none; color: var(--cream-dim); font-size: 1.8rem; cursor: pointer; line-height: 1; }
.cart__items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart__empty { color: var(--cream-dim); text-align: center; padding: 3rem 1rem; font-style: italic; }
.cart__empty .hand { display: block; font-size: 2rem; color: var(--green); margin-bottom: .5rem; }

.ci { display: flex; gap: .8rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.ci__info { flex: 1; }
.ci__name { font-size: 1.1rem; }
.ci__price { color: var(--cream-dim); font-size: .9rem; }
.ci__qty { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; }
.ci__qty button {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent; color: var(--cream);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.ci__qty button:hover { border-color: var(--green); }
.ci__sum { font-size: 1.05rem; white-space: nowrap; }

.cart__foot { padding: 1.3rem 1.5rem; border-top: 1px solid var(--line); }
.cart__total { display: flex; justify-content: space-between; font-size: 1.3rem; margin-bottom: 1rem; }
.cart__hint { color: var(--cream-dim); font-size: .9rem; text-align: center; margin-bottom: 1rem; }
.checkout-btns { display: flex; flex-direction: column; gap: .6rem; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem; border-radius: 12px; border: none; cursor: pointer;
  font-family: var(--serif); font-size: 1.1rem; font-weight: 500;
  transition: transform .15s, filter .2s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn--tg { background: #2aabee; color: #fff; }
.btn--wa { background: #25d366; color: #07371f; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ====================== TOAST ====================== */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--green); color: var(--bg);
  padding: .8rem 1.4rem; border-radius: 999px;
  font-size: 1rem; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .3s;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ====================== СКАЗКА (learn) ====================== */

.story { max-width: 680px; margin: 0 auto; padding: 0 1.5rem; }
.story__hero {
  min-height: 90vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.story__hero img { width: 160px; margin-bottom: 1.5rem; }
.story__hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 500; line-height: 1.2; }
.story__hero p { color: var(--cream-dim); font-size: 1.2rem; margin-top: 1rem; }
.scroll-hint { font-family: var(--hand); color: var(--amber); margin-top: 3rem; font-size: 1.3rem; animation: bob 2s infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

.step {
  min-height: 80vh; display: flex; flex-direction: column; justify-content: center;
  padding: 4rem 0;
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s, transform .8s;
}
.step.is-in { opacity: 1; transform: none; }
.step__num { font-family: var(--hand); font-size: 1.5rem; color: var(--green); }
.step h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 500; margin: .3rem 0 1rem; }
.step p { font-size: 1.2rem; color: var(--cream); margin-bottom: 1rem; }
.step p.dim { color: var(--cream-dim); }
.step__end { text-align: center; }
.big-link {
  display: inline-block; margin-top: 1rem;
  background: var(--green); color: var(--bg);
  padding: .9rem 2rem; border-radius: 999px; font-size: 1.2rem;
  transition: transform .2s, background .2s;
}
.big-link:hover { transform: translateY(-3px); background: var(--cream); }

/* ====================== ПОДВАЛ ====================== */
.footer {
  border-top: 1px solid var(--line);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--cream-dim);
}
.footer__name { font-family: var(--hand); font-size: 2rem; color: var(--green); margin-bottom: .5rem; }
.footer p { margin: .3rem 0; }
.footer__links { display: flex; gap: 1.2rem; justify-content: center; margin-top: 1rem; }
.footer__links a { color: var(--amber); }
.footer__links a:hover { color: var(--cream); }

/* ============ ФОНОВАЯ МУЗЫКА: кнопка + ползунок ============ */
.bgm{position:fixed;right:12px;top:12px;bottom:auto;z-index:9998;display:flex;align-items:center;gap:.5rem}
.bgm-toggle{width:42px;height:42px;border-radius:50%;flex:0 0 auto;opacity:.75;
  border:0;background:none;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center}
.bgm-toggle img{width:100%;height:100%;display:block;border-radius:50%}
.bgm-toggle:hover img{filter:brightness(1.05)}
.bgm-toggle:active img{transform:scale(.94)}
.bgm-slider{width:0;opacity:0;pointer-events:none;height:6px;accent-color:#7fb04a;cursor:pointer;
  transition:width .25s ease,opacity .25s ease}
.bgm.open .bgm-slider{width:110px;opacity:1;pointer-events:auto}

/* ============ ПЛАВНЫЙ БЕЛЫЙ ПЕРЕХОД МЕЖДУ СТРАНИЦАМИ ============ */
/* единый занавес: по умолчанию белый (ослепление), плавно уходит на загрузке;
   при уходе со страницы transition.js снова заливает белым */
/* занавес держится непрозрачным, пока страница не загрузится; съезд запускает JS классом .is-gone */
.fade-cover,.page-enter{position:fixed;inset:0;background:#fff;z-index:99999;pointer-events:none;opacity:1;
  transition:opacity .6s ease}
.fade-cover.is-gone,.page-enter.is-gone{opacity:0;visibility:hidden}

/* ====================== АДАПТИВ ====================== */
@media (max-width: 720px) {
  .fork__doors { flex-direction: column; }
  .door { padding: 2.5rem 1.5rem; }
  .door:hover { flex: 1; }
  .fork__doors:hover .door:not(:hover) { flex: 1; opacity: 1; }
  .door--know { border-right: none; border-bottom: 1px solid var(--line); }
  .topbar__nav a:not(.cart-link) { display: none; }
}

/* логотип в верхнем левом углу (главная) */
.brand-logo{position:fixed;top:10px;left:10px;z-index:60;
  width:clamp(46px,8.5vw,76px);height:auto;pointer-events:none;opacity:.8}

/* ── ОКНО «СКОРО» у телевизора (лента ещё не открыта) ───────────────── */
#tvSoon .tvsoon__card{
  background: linear-gradient(150deg,#f6efdd,#e8d8b8); color: #5a3f1c;
  border-radius: 20px; padding: 22px 44px; cursor: pointer;
  box-shadow: 0 18px 44px rgba(0,0,0,.5);
}
#tvSoon .tvsoon__h{ font-family: var(--hand); font-size: 3.2rem; line-height: 1; }
