/* Нейтральная основа — яркие цвета приходят от сборов (--accent) */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #151412;
  --muted: #6f6a61;
  --line: #e7e3da;
  --ink: #1d1b18;
  --accent: #16a36b;
  --radius: 26px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --rainbow: linear-gradient(120deg, #16a36b, #6d4dff 38%, #e5412f 68%, #ff7a00);
}

:root[data-theme="dark"] {
  --bg: #121110;
  --surface: #1d1c19;
  --text: #f3f0ea;
  --muted: #a19b90;
  --line: #2e2c28;
  --ink: #2a2824;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110;
    --surface: #1d1c19;
    --text: #f3f0ea;
    --muted: #a19b90;
    --line: #2e2c28;
    --ink: #2a2824;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0 0 12px; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

h1, h2 { font-family: var(--serif); font-weight: 800; margin: 0; line-height: 1.02; letter-spacing: -.01em; }

section { margin-top: 44px; scroll-margin-top: 64px; }

.eyebrow {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sec-head { margin-bottom: 18px; }
.sec-head h2 { font-size: 34px; }

/* ---------- Фото с заглушкой ---------- */
/* Картинка лежит поверх подписи; если файла нет, <img> удаляется и видна заглушка */
.ph {
  position: relative;
  overflow: hidden;
  background: var(--line);
  color: var(--muted);
}
.ph.on-color { background: rgba(255, 255, 255, .14); color: #fff; }
/* Пока фото нет — виден силуэт горы сбора */
.ph-mtn { position: absolute; left: 0; right: 0; bottom: -2px; width: 100%; opacity: .3; z-index: 0; }
/* Подписи «Фото: …» и штриховка — только с ?dev в адресе, покупатели их не видят */
.dev .ph { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .06) 0 12px, transparent 12px 24px); }
.dev .ph::after { display: block; }
.ph::after {
  display: none;
  content: "Фото: " attr(data-label);
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  opacity: .85;
}
.ph img, .ph video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.mtn { display: block; fill: #fff; pointer-events: none; }

/* ---------- Главная: первый экран ---------- */
.hero {
  position: relative;
  margin: -16px -16px 0;
  height: min(80vh, 640px);
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: var(--rainbow);
}
.hero > .ph { position: absolute; inset: 0; }
.hero > .ph::after { top: calc(16px + env(safe-area-inset-top)); bottom: auto; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .7));
  pointer-events: none;
}
.hero-mtn { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; opacity: .16; z-index: 1; }
.hero-content { position: relative; z-index: 3; padding: 24px 20px 28px; }
.hero .eyebrow { color: rgba(255, 255, 255, .8); }
.hero h1 { font-size: 64px; }
.hero-lead { margin: 12px 0 18px; font-size: 18px; line-height: 1.4; max-width: 30ch; opacity: .95; }
.hero-dots { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.hero-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }
.hero-dots b { margin-left: 6px; }

/* ---------- Вкладки-якоря ---------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 6px;
  margin: 0 -16px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Видео-истории ---------- */
.stories {
  display: flex;
  gap: 14px;
  margin: 8px -16px 0;
  padding: 10px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-margin-top: 64px;
}
.stories::-webkit-scrollbar { display: none; }
.story-btn {
  flex: none;
  width: 76px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.story-ring {
  display: block;
  width: 76px;
  height: 76px;
  margin-bottom: 6px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--c), #ffd23f, var(--c));
}
.story-ring .ph { display: block; width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--bg); }
.story-ring .ph::after { display: none; }

/* ---------- «Почему пять гор» ---------- */
.five { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
/* «5» — SVG с градиентом: заливка текста градиентом в Telegram на телефонах обрезается */
.five-num { display: block; width: 92px; height: auto; overflow: visible; }
.five h2 { font-size: 24px; margin-bottom: 8px; }
.five p { color: var(--muted); margin: 0; }

.note {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Карточки сборов ---------- */
.grid { display: grid; gap: 12px; }

.tea {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 42%;
  min-height: 196px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  transition: transform .15s ease;
}
.tea:active { transform: scale(.98); }
.tea > .ph { height: 100%; }
.tea-info { position: relative; z-index: 2; display: flex; flex-direction: column; padding: 20px 18px; }
.tea-sub { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.tea-name { font: 800 31px/1.05 var(--serif); margin-top: 4px; }
.tea-taste { margin-top: 6px; font-size: 14px; line-height: 1.35; opacity: .92; }
.tea-price {
  margin-top: auto;
  width: fit-content;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}
.tea-mtn { position: absolute; left: 0; bottom: -2px; width: 58%; opacity: .16; z-index: 1; }

.set { background: var(--ink); }
.set .tea-price { color: #1d1b18; }
.set-dots { display: flex; gap: 5px; margin-top: 10px; }
.set-dots span { width: 12px; height: 12px; border-radius: 50%; }

/* ---------- Горизонтальные ленты ---------- */
.hscroll {
  display: flex;
  gap: 12px;
  margin: 0 -16px;
  padding: 0 16px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

.person, .review {
  flex: none;
  width: 78%;
  max-width: 300px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.person .ph { aspect-ratio: 4 / 3; }
.person-body, .review { padding: 16px 18px 18px; }
.person-name { font: 800 21px/1.2 var(--serif); }
.person-place { font-size: 13px; font-weight: 800; color: var(--accent); margin: 2px 0 8px; }
.person-quote { margin: 0; font-size: 14px; color: var(--muted); font-style: italic; }

.review p { font-size: 15px; }
.review-meta { font-size: 13px; color: var(--muted); font-weight: 700; }

.empty {
  padding: 26px 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.empty p { color: var(--muted); }
.empty .btn { margin-top: 8px; width: auto; display: inline-block; padding: 12px 22px; }

/* ---------- Доставка ---------- */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row-num {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font: 800 18px var(--serif);
}
.row b { display: block; font-size: 16px; margin-bottom: 2px; }
.row span { font-size: 14px; color: var(--muted); }

footer { margin-top: 48px; text-align: center; font-size: 13px; color: var(--muted); }
footer .footer-links { margin-top: 8px; }
footer .footer-links a { text-decoration: underline; }
footer .footer-logo { font: 800 22px var(--serif); color: var(--text); margin-bottom: 4px; }

/* ---------- Страница сбора ---------- */
.p-hero {
  position: relative;
  margin: -16px -16px 0;
  height: min(62vh, 520px);
  min-height: 380px;
  overflow: hidden;
  background: var(--accent);
  color: #fff;
}
.p-hero > .ph { position: absolute; inset: 0; }
.p-hero > .ph::after { top: calc(16px + env(safe-area-inset-top)); bottom: auto; left: auto; right: 16px; width: 55%; text-align: right; }
.p-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55));
  pointer-events: none;
}
.p-hero .hero-mtn { opacity: .2; }
.p-hero-content { position: absolute; left: 20px; right: 20px; bottom: 24px; z-index: 3; }
.p-hero h1 { font-size: 56px; margin-top: 6px; }

.back-fab {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 22px; }
.price-row b { font-size: 32px; font-weight: 800; }
.price-row span { color: var(--muted); font-weight: 700; }

.p-lead { margin: 10px 0 16px; font: italic 600 23px/1.3 var(--serif); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.facts { margin: 22px 0 0; display: grid; gap: 10px; }
.fact { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.fact dt { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.fact dd { margin: 0; }

.story-quote {
  margin: 0;
  padding-left: 16px;
  border-left: 4px solid var(--accent);
  font-size: 17px;
}

.collector-mini {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.collector-mini .ph { width: 64px; height: 64px; border-radius: 50%; }
.collector-mini .ph::after { display: none; }
.collector-mini small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.brew { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.brew div { padding: 14px 10px; border-radius: 18px; background: var(--accent); color: #fff; text-align: center; }
.brew b { display: block; font-size: 17px; font-weight: 800; }
.brew span { font-size: 12px; opacity: .85; }
.storage { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* «Попробуй ещё»: все остальные сборы + набор сеткой 2×2, без прокрутки вбок */
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini {
  position: relative;
  min-width: 0;
  height: 128px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  overflow: hidden;
}
.mini-set { border: 1px solid rgba(255, 255, 255, .12); }
.mini-name { font: 800 22px/1.1 var(--serif); margin-top: 2px; position: relative; z-index: 2; }
.mini-price { margin-top: auto; font-weight: 800; position: relative; z-index: 2; }
.mini .tea-sub { position: relative; z-index: 2; font-size: 10px; }
.mini .tea-mtn { width: 100%; }

.btn {
  display: block;
  width: 100%;
  margin-top: 28px;
  padding: 16px;
  border: 0;
  border-radius: 18px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); /* тёмная кнопка набора не сливается с тёмным фоном */
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

/* Подпись над кружками историй и под названием открытой истории */
.stories-note { margin: 16px 0 0; }
.sv-title small { display: block; margin-top: 6px; font: 600 13px/1.3 var(--sans); opacity: .85; }

/* Фото в истории — целиком, без обрезки (видео, когда появится, — на весь экран) */
.sv-contain, .sv-contain > .ph { background: #000; }
.sv-contain .ph img { object-fit: contain; }

/* ---------- Просмотр истории ---------- */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #fff;
}
.sv-media { position: absolute; inset: 0; background: var(--c); }
.sv-media > .ph { position: absolute; inset: 0; }
.sv-media > .ph::after { display: none; }
.sv-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.sv-bars { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 5; display: flex; gap: 4px; }
.sv-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.sv-bars .done, .sv-bars .on { background: #fff; }
.sv-title {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(32px + env(safe-area-inset-bottom));
  z-index: 5;
  font: 800 30px/1.1 var(--serif);
  text-shadow: 0 2px 16px rgba(0, 0, 0, .4);
}
.sv-prev, .sv-next { position: absolute; top: 0; bottom: 0; z-index: 4; width: 50%; border: 0; background: none; }
.sv-prev { left: 0; }
.sv-next { right: 0; }
.sv-close {
  position: absolute;
  top: calc(22px + env(safe-area-inset-top));
  right: 12px;
  z-index: 6;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
  font-size: 26px;
  line-height: 1;
}
