/* ==========================================================================
   Feliz Coffee — лендинг приложения
   ========================================================================== */

:root {
  --cream: #f6f3ec;
  --paper: #ffffff;
  --ink: #14201d;
  --ink-2: #4a5855;
  --ink-3: #7b8885;
  --line: rgba(20, 32, 29, 0.1);

  --teal: #1f9088;
  --teal-strong: #157a72;
  --teal-deep: #0e504b;
  --teal-glow: #7fd6c8;
  --mint: #e2f2ee;

  --night: #111514;
  --night-2: #1a201e;

  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 24px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --topbar-h: 64px;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
  overflow-x: hidden;
}
@supports (overflow: clip) { html { overflow-x: clip; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible {
  outline: 3px solid var(--teal-glow);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  width: min(1200px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* --- Типографика -------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-strong);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.eyebrow--light { color: var(--teal-glow); }

.h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section-head { max-width: 760px; margin-bottom: clamp(36px, 6vw, 64px); }
.section-lead {
  margin-top: 18px;
  max-width: 560px;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--ink-2);
}
.section-lead b { color: var(--ink); }

/* --- Кнопки ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  font: 700 16px/1 var(--body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn--teal {
  background: var(--teal-strong);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(21, 122, 114, 0.8);
}
.btn--teal:hover { background: var(--teal-deep); }
.btn--light { background: #fff; color: var(--ink); box-shadow: 0 16px 40px -16px rgba(127, 214, 200, 0.6); }
.btn__arrow { width: 18px; height: 18px; transition: transform 0.25s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* Кнопки сторов */
.stores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 420px;
}
.store {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 16px;
  border-radius: 16px;
  background: #0d1110;
  color: #fff;
  text-decoration: none;
  border: 1.5px solid #0d1110;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s, color 0.25s;
}
.store:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -14px rgba(13, 17, 16, 0.7);
}
.store__icon { flex: none; width: 24px; height: 24px; }
.store__icon--play { width: 21px; height: 21px; }
.store__text {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.store__text small { font-size: 11px; font-weight: 500; opacity: 0.72; letter-spacing: 0; }

@media (max-width: 399px) {
  .store { gap: 8px; padding: 0 12px; }
  .store__icon { width: 21px; height: 21px; }
  .store__icon--play { width: 18px; height: 18px; }
  .store__text { font-size: 15px; }
  .store__text small { font-size: 10px; }
}

/* На iPhone главный — App Store, на Android — Google Play; второй стор становится «тихим» */
.os-ios .stores .store[data-store="android"],
.os-android .stores .store[data-store="ios"] {
  order: 2;
  background: transparent;
  color: var(--ink);
  border-color: rgba(20, 32, 29, 0.18);
  box-shadow: none;
}
.os-ios .stores--light .store[data-store="android"],
.os-android .stores--light .store[data-store="ios"] {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

/* --- Шапка -------------------------------------------------------------- */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  transition: background-color 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.topbar.is-scrolled {
  background: rgba(246, 243, 236, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--topbar-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark { width: 28px; height: 34px; color: var(--teal); }
.brand__word {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand__word span {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.topbar__nav { display: none; gap: 32px; margin-left: auto; }
.topbar__nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s;
}
.topbar__nav a:hover { color: var(--teal-strong); }

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top) + 18px);
  background:
    radial-gradient(60% 50% at 85% 30%, rgba(31, 144, 136, 0.14), transparent 70%),
    radial-gradient(40% 40% at 0% 100%, rgba(122, 74, 42, 0.08), transparent 70%),
    var(--cream);
  overflow: hidden;
}
.hero__inner { display: grid; gap: 8px; }

.gift-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 8px 16px 8px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px -14px rgba(20, 32, 29, 0.9);
}
.gift-pill__gem {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #e9fbf8, #8fd9cd, #ffffff, #6fc3b7, #e9fbf8);
  overflow: hidden;
}
.gift-pill__gem::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.95) 50%, transparent 60%);
  animation: gem-shine 3.2s ease-in-out infinite;
}

.hero__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.3rem, 9.4vw, 5.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.hero__accent {
  position: relative;
  display: inline-block;
  color: var(--teal);
  white-space: nowrap;
}
.squiggle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.2em;
  width: 100%;
  height: 0.3em;
  overflow: visible;
}
.squiggle path {
  fill: none;
  stroke: var(--teal-glow);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: draw 1.1s 0.7s var(--ease) forwards;
}

.hero__lead {
  margin: 28px 0 28px;
  max-width: 34ch;
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
  color: var(--ink-2);
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px clamp(22px, 3vw, 40px);
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero__facts li { display: flex; flex-direction: column; }
.hero__facts b {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(0.88rem, 1.6vw, 1.05rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.hero__facts span { font-size: 12.5px; color: var(--ink-3); }

/* Визуал: телефон + стакан + зёрна */
.hero__visual {
  position: relative;
  height: 470px;
  margin-top: 24px;
  -webkit-mask-image: linear-gradient(#000 82%, transparent);
  mask-image: linear-gradient(#000 82%, transparent);
}
.hero__disc {
  position: absolute;
  left: 50%;
  top: 34px;
  width: min(400px, 96%);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.28), transparent 46%),
    radial-gradient(circle at 50% 50%, #26a294, #1f9088 52%, #126a62);
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.08), 0 40px 80px -40px rgba(14, 80, 75, 0.7);
}
/* Телефон в стиле iPhone 15/16 Pro: титановый корпус, узкий бортик, Dynamic Island.
   Все размеры — в долях ширины телефона (cqw), поэтому пропорции не плывут на любом размере. */
.phone { container-type: inline-size; }
.phone__body {
  position: relative;
  padding: 0.9cqw;
  border-radius: 16cqw;
  background: linear-gradient(135deg, #e4e6e7 0%, #9aa0a4 16%, #f1f2f3 36%, #8f9599 60%, #d6d9db 82%, #a2a7aa 100%);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.25),
    0 30px 50px -24px rgba(10, 40, 36, 0.5),
    0 70px 110px -50px rgba(10, 40, 36, 0.45);
}
/* Кнопки громкости (слева) и питания (справа) */
.phone__body::before,
.phone__body::after {
  content: "";
  position: absolute;
  width: 1.1cqw;
  border-radius: 1cqw;
  background: linear-gradient(90deg, #8f9599, #dcdfe1);
}
.phone__body::before { left: -0.7cqw; top: 36cqw; height: 13cqw; box-shadow: 0 17cqw 0 0 #b9bdc0; }
.phone__body::after { right: -0.7cqw; top: 46cqw; height: 22cqw; }

.phone__screen {
  position: relative;
  padding: 2.4cqw;
  border-radius: 15.1cqw;
  background: #050606;
  box-shadow: inset 0 0 0 0.3cqw rgba(255, 255, 255, 0.07);
}
.phone__screen > img,
.lock {
  display: block;
  width: 100%;
  aspect-ratio: 600 / 1299;
  border-radius: 12.7cqw;
  background: #f1f4f9;
  object-fit: cover;
}
/* Dynamic Island */
.phone__screen::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 4.6cqw;
  left: 50%;
  width: 29cqw;
  height: 8.6cqw;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #000;
}
/* Блик на стекле */
.phone__screen::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 2.4cqw;
  border-radius: 12.7cqw;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.05) 26%, transparent 40%);
  pointer-events: none;
}
/* Строка состояния */
.phone__bar {
  position: absolute;
  z-index: 3;
  top: 5.6cqw;
  left: 2.4cqw;
  right: 2.4cqw;
  height: 6.6cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8.5cqw 0 11cqw;
  color: #0b0d0d;
  font: 700 4.6cqw/1 var(--body);
  letter-spacing: -0.02em;
}
.phone__bar i {
  width: 17cqw;
  height: 3cqw;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 12'%3E%3Cg fill='%23000'%3E%3Crect x='0' y='8' width='3' height='4' rx='.8'/%3E%3Crect x='4.6' y='6' width='3' height='6' rx='.8'/%3E%3Crect x='9.2' y='3.5' width='3' height='8.5' rx='.8'/%3E%3Crect x='13.8' y='1' width='3' height='11' rx='.8'/%3E%3Cpath d='M29 11.6 26.3 8.9a3.8 3.8 0 0 1 5.4 0z'/%3E%3C/g%3E%3Cg fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M24.3 6.8a6.6 6.6 0 0 1 9.4 0'/%3E%3Cpath d='M22.2 4.7a9.6 9.6 0 0 1 13.6 0'/%3E%3C/g%3E%3Crect x='43.5' y='1.5' width='21' height='9' rx='2.6' fill='none' stroke='%23000' stroke-opacity='.4'/%3E%3Crect x='45.5' y='3.5' width='17' height='5' rx='1.3'/%3E%3Crect x='65.6' y='4.3' width='1.6' height='3.4' rx='.8' fill-opacity='.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 12'%3E%3Cg fill='%23000'%3E%3Crect x='0' y='8' width='3' height='4' rx='.8'/%3E%3Crect x='4.6' y='6' width='3' height='6' rx='.8'/%3E%3Crect x='9.2' y='3.5' width='3' height='8.5' rx='.8'/%3E%3Crect x='13.8' y='1' width='3' height='11' rx='.8'/%3E%3Cpath d='M29 11.6 26.3 8.9a3.8 3.8 0 0 1 5.4 0z'/%3E%3C/g%3E%3Cg fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M24.3 6.8a6.6 6.6 0 0 1 9.4 0'/%3E%3Cpath d='M22.2 4.7a9.6 9.6 0 0 1 13.6 0'/%3E%3C/g%3E%3Crect x='43.5' y='1.5' width='21' height='9' rx='2.6' fill='none' stroke='%23000' stroke-opacity='.4'/%3E%3Crect x='45.5' y='3.5' width='17' height='5' rx='1.3'/%3E%3Crect x='65.6' y='4.3' width='1.6' height='3.4' rx='.8' fill-opacity='.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.phone--lock .phone__bar { color: #fff; }
.phone--hero {
  position: absolute;
  left: 50%;
  top: 0;
  width: 232px;
  transform: translateX(-46%) rotate(-6deg);
  animation: phone-in 1.1s 0.25s var(--ease) both;
}
.hero__cup {
  position: absolute;
  left: -14px;
  bottom: 24px;
  width: 178px;
  filter: drop-shadow(0 30px 30px rgba(60, 35, 15, 0.35));
  animation: cup-in 1.1s 0.45s var(--ease) both;
}
.bean {
  position: absolute;
  filter: drop-shadow(0 14px 14px rgba(60, 35, 15, 0.3));
  animation: float 6s ease-in-out infinite;
}
.bean--a { width: 54px; top: 18px; right: 6%; }
.bean--b { width: 58px; bottom: 120px; right: 2%; animation-delay: -2.5s; animation-duration: 7s; }

.push {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 18px 40px -18px rgba(20, 32, 29, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  color: var(--ink);
  text-align: left;
}
.push__icon {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 6px 7px;
  border-radius: 9px;
  background: var(--teal);
  color: #fff;
}
.push__body { min-width: 0; }
.push__head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; line-height: 1.3; }
.push__head span { color: var(--ink-3); }
.push p { font-size: 13px; line-height: 1.35; color: var(--ink); }
.push--hero {
  position: absolute;
  z-index: 3;
  top: 132px;
  right: 0;
  width: 236px;
  animation: push-in 0.8s 1.3s var(--ease) both;
}

/* --- Бегущая строка меню ----------------------------------------------- */

.ticker-clip {
  position: relative;
  z-index: 2;
  margin: -30px 0 -24px;
  padding: 24px 0;
  overflow: hidden;
}
.ticker {
  position: relative;
  width: 112%;
  margin: 0 -6%;
  padding: 16px 0;
  background: var(--teal);
  color: #fff;
  transform: rotate(-1.6deg);
  overflow: hidden;
  box-shadow: 0 20px 40px -24px rgba(14, 80, 75, 0.6);
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.ticker__track span {
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(15px, 2vw, 20px);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.ticker__track span::after {
  content: "";
  width: 9px;
  height: 9px;
  margin: 0 26px;
  border-radius: 2px;
  background: var(--teal-glow);
  transform: rotate(45deg);
}

/* --- Подарок: Diamond --------------------------------------------------- */

.gift {
  position: relative;
  margin-top: -28px;
  padding: clamp(110px, 14vw, 170px) 0 clamp(80px, 10vw, 130px);
  background:
    radial-gradient(50% 60% at 20% 45%, rgba(31, 144, 136, 0.28), transparent 70%),
    radial-gradient(40% 40% at 90% 10%, rgba(127, 214, 200, 0.1), transparent 70%),
    var(--night);
  color: #eef4f2;
  overflow: hidden;
  isolation: isolate;
}
.gift::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.gift__inner { position: relative; display: grid; gap: clamp(40px, 6vw, 72px); align-items: center; }
.gift__num {
  position: absolute;
  z-index: -1;
  top: -0.42em;
  right: -0.06em;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(9rem, 36vw, 27rem);
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(127, 214, 200, 0.16);
  pointer-events: none;
  user-select: none;
}
.gift__visual { position: relative; perspective: 1200px; }
.gift__glow {
  position: absolute;
  inset: 10% 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(170, 236, 226, 0.45), rgba(31, 144, 136, 0.25) 60%, transparent);
  filter: blur(30px);
}
.gift__card {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  border-radius: 3.4% / 7.4%;
  overflow: hidden;
  /* Наклон меняется от прокрутки: --rx / --ry выставляет motion.js */
  transform: rotateY(var(--ry, -16deg)) rotateX(var(--rx, 9deg)) rotate(-4deg);
  filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.55));
  transition: transform 0.3s linear;
}
.gift__card img { width: 100%; }
/* Блик пробегает по карте */
.gift__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.34) 47%, rgba(255, 255, 255, 0.06) 54%, transparent 64%);
  transform: translateX(-120%);
  animation: sweep 4.8s 1.2s ease-in-out infinite;
  pointer-events: none;
}
.gift .h2 span {
  display: block;
  background: linear-gradient(100deg, #f2fffc 0%, #9fe3d8 35%, #ffffff 55%, #74cbbd 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gift__text {
  margin-top: 20px;
  max-width: 470px;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: rgba(238, 244, 242, 0.72);
}
.gift__text b { color: #fff; }
.gift__steps {
  display: grid;
  gap: 12px;
  margin: 28px 0 34px;
}
.gift__steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
}
.gift__steps span {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(127, 214, 200, 0.45);
  color: var(--teal-glow);
  font-family: var(--display);
  font-size: 13px;
}

/* --- Как заказать: сцена закрепляется, шаги меняются от прокрутки ------ */

.how { padding-top: clamp(84px, 11vw, 140px); }
.how .section-head { margin-bottom: 0; }

/* Высота трека: экран + по 70% экрана на каждый следующий шаг */
.story {
  position: relative;
  height: calc(100vh + 3 * 70vh);
  height: calc(100svh + 3 * 70svh);
}
.story__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.story__inner {
  display: grid;
  grid-template-areas: "bars" "device" "text";
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  height: 100%;
  padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 14px) 0 calc(22px + env(safe-area-inset-bottom));
}

/* Прогресс как в сторис */
.story__bars {
  grid-area: bars;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.story__bars i {
  position: relative;
  height: 4px;
  border-radius: 4px;
  background: rgba(20, 32, 29, 0.12);
  overflow: hidden;
}
.story__bars i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--teal);
  transform: scaleX(var(--f, 0));
  transform-origin: left;
}

.story__device {
  position: relative;
  grid-area: device;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
/* Бирюзовый круг за телефоном, как на первом экране */
.story__device::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(130%, 92vw);
  max-width: 560px;
  aspect-ratio: 1;
  transform: translate(-50%, -46%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.28), transparent 46%),
    radial-gradient(circle at 50% 50%, #26a294, #1f9088 52%, #126a62);
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.08);
  opacity: 0.9;
}
.story__device .phone { position: relative; }
/* 2.09 — высота телефона к ширине; 250px — шапка, прогресс и текст шага */
.phone--story {
  width: min(270px, calc((100vh - var(--topbar-h) - 250px) / 2.09));
  width: min(270px, calc((100svh - var(--topbar-h) - 250px) / 2.09));
}

.story__steps { grid-area: text; display: grid; }
.story__step {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s ease, transform 0.55s var(--ease);
  pointer-events: none;
}
.story__step.is-past { transform: translateY(-18px); }
.story__step.is-active { opacity: 1; transform: none; pointer-events: auto; }
.story__num {
  display: block;
  margin-bottom: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: var(--teal);
}
.story__step h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.story__step p { margin-top: 8px; max-width: 40ch; font-size: 15px; color: var(--ink-2); }

/* Экраны в телефоне уезжают в сторону, обратную прокрутке */
.demo__slide.is-past { opacity: 0; transform: translateX(-12%) scale(0.98); }

/* Пуш на экране блокировки падает, когда доходим до последнего шага */
.story .push--lock {
  opacity: 0;
  transform: translateY(-24px) scale(0.92);
  transition: opacity 0.4s ease 0.25s, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s;
}
.story .lock.is-active .push--lock { opacity: 1; transform: none; }

.lock {
  position: relative;
  padding: 26% 6% 0;
  overflow: hidden;
  background:
    radial-gradient(70% 45% at 70% 80%, rgba(127, 214, 200, 0.55), transparent 70%),
    radial-gradient(60% 50% at 10% 20%, rgba(255, 255, 255, 0.18), transparent 70%),
    linear-gradient(165deg, #23a092, #0e504b 80%);
  color: #fff;
  text-align: center;
}
.lock__time {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.2rem, 11vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.lock__date { margin-top: 8px; font-size: 12px; font-weight: 600; opacity: 0.85; }
.push--lock { margin-top: 28%; padding: 9px 10px; border-radius: 15px; }
.push--lock .push__icon { width: 28px; height: 28px; padding: 5px 6px; border-radius: 8px; }
.push--lock p { font-size: 11.5px; }
.push--lock .push__head { font-size: 11px; }

/* --- Кэшбэк ------------------------------------------------------------- */

.cashback {
  padding: clamp(84px, 11vw, 140px) 0;
  background: var(--paper);
  border-radius: clamp(28px, 4vw, 48px) clamp(28px, 4vw, 48px) 0 0;
}
.tiers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 14px;
}
.tier { position: relative; }
.tier img {
  width: 100%;
  border-radius: 3.4% / 7.4%;
  box-shadow: 0 22px 40px -24px rgba(17, 21, 20, 0.7);
  transition: transform 0.45s var(--ease);
}
.tier:hover img { transform: translateY(-6px) rotate(-1.2deg); }
.tier__meta {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--line);
}
.tier__meta b {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(0.92rem, 1.6vw, 1.08rem);
  letter-spacing: -0.02em;
}
.tier__meta span { font-size: 13.5px; color: var(--ink-3); line-height: 1.4; }
.tier--top .tier__meta { border-top-color: var(--teal); }
.tier--top .tier__meta b { color: var(--teal-strong); }

.rules {
  display: grid;
  gap: 14px;
  margin-top: clamp(48px, 7vw, 80px);
}
.rules li {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  background: var(--cream);
}
.rules svg {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 14px;
  background: var(--mint);
  color: var(--teal-strong);
}
.rules b { display: block; font-size: 16px; line-height: 1.3; }
.rules span { display: block; margin-top: 4px; font-size: 14.5px; color: var(--ink-2); }

.cashback__note { margin-top: 26px; font-size: 14.5px; color: var(--ink-3); }
.cashback__note a {
  color: var(--teal-strong);
  font-weight: 700;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

/* --- Кофейни ------------------------------------------------------------ */

.places { padding: clamp(84px, 11vw, 140px) 0; }
.places__grid { display: grid; gap: 20px; }
.place {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -44px rgba(20, 32, 29, 0.45);
}
.place__photo { aspect-ratio: 16 / 10; overflow: hidden; background: var(--mint); }
.place__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.place:first-child .place__photo img { object-position: 50% 30%; }
.place:last-child .place__photo img { object-position: 50% 12%; }
.place:hover .place__photo img { transform: scale(1.04); }
.place__body { padding: 22px 22px 24px; }
.place h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.place__addr, .place__hours {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
}
.place__addr svg { width: 18px; height: 18px; color: var(--teal); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: #eef1f0;
  color: var(--ink-3);
}
.status:empty { display: none; }
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status.is-open { background: #e1f5ea; color: #13804a; }
.place__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--teal); color: var(--teal-strong); background: var(--mint); }

/* --- Финальный CTA ------------------------------------------------------ */

.final {
  position: relative;
  padding: clamp(84px, 11vw, 130px) 0 0;
  background:
    radial-gradient(60% 60% at 80% 60%, rgba(127, 214, 200, 0.35), transparent 70%),
    linear-gradient(160deg, #1f9088, #0f5a54);
  color: #fff;
  overflow: hidden;
  border-radius: clamp(28px, 4vw, 48px) clamp(28px, 4vw, 48px) 0 0;
}
.final__pattern {
  position: absolute;
  right: -18%;
  top: -8%;
  width: 78%;
  height: 120%;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.final__inner { position: relative; display: grid; gap: 32px; }
.final .h2 { max-width: 14ch; }
.final__text {
  margin: 20px 0 30px;
  max-width: 440px;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: rgba(255, 255, 255, 0.82);
}
.qr { display: none; }
.final__visual {
  position: relative;
  height: 300px;
}
.phone--final { display: none; }
.final__cup {
  position: absolute;
  left: 50%;
  bottom: -40px;
  width: 260px;
  transform: translateX(-50%) rotate(8deg);
  filter: drop-shadow(0 40px 40px rgba(5, 40, 36, 0.45));
}

/* --- Подвал ------------------------------------------------------------- */

.footer {
  padding: 48px 0 calc(40px + env(safe-area-inset-bottom));
  background: var(--night);
  color: rgba(238, 244, 242, 0.7);
}
.footer__inner { display: grid; gap: 18px; }
.brand--footer { color: #fff; }
.brand--footer .brand__mark { color: var(--teal-glow); }
.brand--footer .brand__word span { color: rgba(238, 244, 242, 0.5); }
.footer__tag { font-family: var(--display); font-weight: 500; color: #fff; }
.footer__links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--teal-glow); }
.footer__links svg { width: 18px; height: 18px; }
.footer__copy { font-size: 13px; color: rgba(238, 244, 242, 0.45); }

/* --- Липкая кнопка (мобильные) ----------------------------------------- */

.dock {
  position: fixed;
  z-index: 60;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateY(calc(100% + 30px));
  transition: transform 0.45s var(--ease);
  pointer-events: none;
}
.dock.is-visible { transform: none; pointer-events: auto; }
.dock__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 9px 9px 14px;
  border-radius: 22px;
  background: rgba(17, 21, 20, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.5);
}
.dock__mark { flex: none; width: 26px; height: 32px; color: var(--teal-glow); }
.dock__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dock__text b { font-size: 14.5px; }
.dock__text span { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.dock .btn { margin-left: auto; flex: none; }

/* --- Появление ---------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

[data-anim] { animation: rise 0.9s var(--ease) both; }
[data-anim="1"] { animation-delay: 0.05s; }
[data-anim="2"] { animation-delay: 0.15s; }
[data-anim="3"] { animation-delay: 0.27s; }
[data-anim="4"] { animation-delay: 0.39s; }
[data-anim="5"] { animation-delay: 0.51s; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes phone-in { from { opacity: 0; transform: translateX(-46%) translateY(60px) rotate(2deg); } }
@keyframes cup-in { from { opacity: 0; transform: translate(-40px, 40px) rotate(-12deg); } }
@keyframes push-in { from { opacity: 0; transform: translateY(-16px) scale(0.94); } }
@keyframes float { 50% { transform: translateY(-14px) rotate(8deg); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes gem-shine { 0%, 55% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

/* --- Планшет ------------------------------------------------------------ */

@media (min-width: 640px) {
  .hero__visual { height: 540px; }
  .phone--hero { width: 262px; }
  .hero__cup { width: 220px; left: 4%; }
  .push--hero { right: 4%; width: 260px; top: 150px; }
  .gift__steps { grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px 26px; }
  .tiers { gap: 32px 20px; }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .places__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Десктоп ------------------------------------------------------------ */

@media (min-width: 960px) {
  :root { --topbar-h: 76px; }
  .topbar__nav { display: flex; }
  .topbar .btn { margin-left: 8px; }

  .hero { padding-top: calc(var(--topbar-h) + 40px); }
  .hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    min-height: min(760px, 100svh - var(--topbar-h));
  }
  .hero__copy { padding-bottom: 80px; }
  .hero__title { font-size: clamp(3rem, 4.8vw, 4.4rem); }
  .hero__visual {
    height: 680px;
    margin-top: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .hero__disc { top: 90px; width: 500px; }
  .phone--hero { width: 300px; top: 20px; }
  .hero__cup { width: 270px; left: -6%; bottom: 40px; }
  .push--hero { top: 200px; right: -4%; width: 290px; }
  .push--hero p { font-size: 14px; }
  .bean--a { width: 78px; top: 40px; right: 4%; }
  .bean--b { width: 74px; bottom: 150px; right: -2%; }

  .gift__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .gift__steps { grid-template-columns: 1fr; }

  /* Слева список шагов (активный подсвечен), справа большой телефон */
  .story__inner {
    grid-template-areas: ". device" "bars device" "text device" ". device";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: clamp(40px, 8vw, 120px);
    row-gap: 0;
    padding: calc(var(--topbar-h) + 28px) 0 28px;
  }
  .story__bars { max-width: 460px; }
  .story__steps { gap: 4px; margin-top: 22px; max-width: 480px; }
  .story__step {
    grid-area: auto;
    padding: 16px 0 16px 22px;
    border-left: 2px solid var(--line);
    opacity: 0.38;
    transform: none;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.35s ease, border-color 0.35s ease;
  }
  .story__step:hover { opacity: 0.7; }
  .story__step.is-past { transform: none; }
  .story__step.is-active { opacity: 1; border-left-color: var(--teal); }
  .story__step h3 { font-size: 1.5rem; }
  .story__step p { font-size: 16px; }
  .story__device::before { width: 500px; }
  .story__step p {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--ease), opacity 0.4s ease, margin-top 0.5s var(--ease);
  }
  .story__step.is-active p { max-height: 6em; margin-top: 8px; opacity: 1; }
  .phone--story { width: min(330px, calc((100vh - var(--topbar-h) - 90px) / 2.09)); }

  .tiers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tier:nth-child(2) { margin-top: 18px; }
  .tier:nth-child(3) { margin-top: 36px; }
  .tier:nth-child(4) { margin-top: 54px; }
  .rules { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rules li { flex-direction: column; }

  .place { flex-direction: row; min-height: 300px; }
  .place__photo { aspect-ratio: auto; flex: 0 0 46%; }
  .place__body { display: flex; flex-direction: column; justify-content: center; padding: 28px; }
  .place__links { margin-top: auto; padding-top: 20px; }

  .final { padding-bottom: 0; }
  .final__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: end; }
  .final__copy { padding-bottom: 110px; }
  .final__visual { height: 560px; }
  .phone--final {
    display: block;
    position: absolute;
    left: 18%;
    bottom: -120px;
    width: 290px;
    transform: rotate(6deg);
  }
  .final__cup { left: 8%; bottom: 10px; width: 250px; transform: rotate(-10deg); }

  .os-desktop .qr {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 30px;
  }
  .qr figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 10px;
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
  }
  .qr img { width: 112px; height: 112px; }
  .qr figcaption { font-size: 12.5px; font-weight: 700; }
  .qr p { max-width: 130px; font-size: 14px; color: rgba(255, 255, 255, 0.8); }

  .footer { padding-bottom: 48px; }
  .footer__inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px 40px;
  }
  .footer__tag { grid-column: 1; }
  .footer__links { grid-column: 2 / 4; grid-row: 1; justify-content: flex-end; }
  .footer__copy { grid-column: 2 / 4; grid-row: 2; text-align: right; }

  .dock { display: none; }
}


/* ==========================================================================
   Анимации. Классы и переменные выставляет js/motion.js
   ========================================================================== */

/* Живое демо в телефоне: меню → настройка → корзина → пуш */
.demo {
  position: relative;
  aspect-ratio: 600 / 1299;
  border-radius: 12.7cqw;
  overflow: hidden;
  background: #f1f4f9;
}
.demo__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(16%) scale(0.98);
  transition: opacity 0.45s ease, transform 0.65s var(--ease);
}
.demo__slide.is-active { z-index: 1; opacity: 1; transform: none; }
.demo__slide.is-leaving { opacity: 0; transform: translateX(-12%) scale(0.98); }
.tap {
  position: absolute;
  z-index: 2;
  left: var(--tx, 50%);
  top: var(--ty, 50%);
  width: 13cqw;
  height: 13cqw;
  margin: -6.5cqw 0 0 -6.5cqw;
  border-radius: 50%;
  background: rgba(20, 32, 29, 0.26);
  box-shadow: 0 0 0 0.5cqw rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: none;
}
.tap.is-tapping { animation: tap 0.75s var(--ease); }

.push--hero.is-ready { animation: none; }
.push--hero { transition: opacity 0.4s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
.push--hero.is-hidden { opacity: 0; transform: translateY(-22px) scale(0.9); }

/* Главная кнопка стора под платформу — с бликом */
.store { position: relative; overflow: hidden; }
.os-ios .stores .store[data-store="ios"]::after,
.os-android .stores .store[data-store="android"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sweep 3.8s 1.8s ease-in-out infinite;
  pointer-events: none;
}

/* Пульс на липкой кнопке */
.btn--pulse { position: relative; }
.btn--pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: pulse 2.6s 1s infinite;
  pointer-events: none;
}

/* Заголовки появляются по словам */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.08em 0 0.16em;
  margin: -0.08em 0 -0.16em;
}
.w__i {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0ms) + var(--i, 0) * 60ms);
}
.w-el {
  opacity: 0;
  transform: translateY(40%);
  transition: opacity 0.8s ease, transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0ms) + var(--i, 0) * 60ms + 80ms);
}
[data-reveal].is-in .w__i,
[data-reveal].is-in .w-el { opacity: 1; transform: none; }

/* Карты уровней «раздаются» */
.js .tier[data-reveal] {
  transform: perspective(900px) rotateX(50deg) translateY(40px);
  transform-origin: 50% 100%;
}
.js .tier[data-reveal].is-in { transform: none; }

@keyframes sweep { 0%, 58% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes tap {
  0% { opacity: 0; transform: scale(1.7); }
  35% { opacity: 1; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.3); }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(127, 214, 200, 0.65); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(127, 214, 200, 0); }
}

/* --- Меньше движения ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .squiggle path { stroke-dashoffset: 0; }
}
