/* ───────── Tokens ───────── */
:root {
  --primary: #D9465F;          /* перезаписывается из config.js */
  --primary-ink: #FFFFFF;      /* цвет текста на основном цвете (вычисляется) */
  --primary-soft: rgba(217, 70, 95, .14);

  --bg: #F7F4F0;
  --bg-glow-2: rgba(255, 204, 0, .16);
  --surface: #FFFFFF;
  --ink: #17161A;
  --ink-2: #5E5A63;
  --ink-3: #8F8A94;
  --line: rgba(23, 22, 26, .08);
  --shadow-lg: 0 1px 2px rgba(23, 22, 26, .04), 0 12px 32px -8px rgba(23, 22, 26, .14);

  --yellow: #FFD43B;
  --yellow-2: #FFC400;
  --yellow-ink: #1D1A10;

  --radius-btn: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111013;
    --bg-glow-2: rgba(255, 204, 0, .07);
    --surface: #1C1B1F;
    --ink: #F4F2F5;
    --ink-2: #B3AEB8;
    --ink-3: #807A86;
    --line: rgba(255, 255, 255, .09);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px -10px rgba(0, 0, 0, .6);
  }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
p, h1 { margin: 0; }
svg { display: block; flex-shrink: 0; }

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(80% 50% at 100% 105%, var(--bg-glow-2), transparent 70%);
}

/* ───────── Layout ───────── */
.page {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(28px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
}

.preview-pill {
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: -16px;
}
.preview-pill[hidden] { display: none; }

/* ───────── Hero ───────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 20px;
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo__mono {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--primary-ink);
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(255, 255, 255, .28), transparent 55%),
    var(--primary);
}

.venue {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--ink-2);
  max-width: 100%;
  overflow-wrap: anywhere;
  hyphens: auto;
  margin-bottom: 10px;
}

.title {
  font-size: clamp(26px, 8.2vw, 34px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.025em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.subtitle {
  margin-top: 12px;
  font-size: clamp(15px, 4.4vw, 17px);
  color: var(--ink-2);
  max-width: 32ch;
  text-wrap: balance;
}

/* ───────── Buttons ───────── */
.actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 18px 14px 14px;
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  isolation: isolate;
  overflow: hidden;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, filter .2s ease;
}
.btn:active { transform: scale(.975); }
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

.btn__icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.btn__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.btn__label {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.btn__hint {
  font-size: 13.5px;
  line-height: 1.3;
  opacity: .72;
  margin-top: 2px;
}
.btn__chev { opacity: .55; transition: transform .2s ease; }
.btn__badge { display: none; }

/* Review — Яндекс-жёлтый */
.btn--review {
  color: var(--yellow-ink);
  background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow-2) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 10px 24px -10px rgba(230, 170, 0, .75);
}
.btn--review .btn__icon { background: rgba(29, 26, 16, .9); color: var(--yellow); }
/* мягкий блик */
.btn--review::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: sheen 5.5s ease-in-out 1.4s infinite;
}

/* Tips — основной цвет */
.btn--tips {
  color: var(--primary-ink);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, .22), transparent 55%),
    var(--primary);
  box-shadow: 0 10px 24px -10px var(--primary);
}
.btn--tips .btn__icon { background: rgba(255, 255, 255, .2); }
.btn--tips .heart { animation: beat 2.6s ease-in-out 1.2s infinite; transform-origin: center; }

@media (hover: hover) {
  .btn:hover { filter: brightness(1.03); }
  .btn:hover .btn__chev { transform: translateX(3px); }
}

/* Режим предпросмотра — ссылка ещё не настроена */
.btn.is-preview { cursor: default; filter: saturate(.55); opacity: .82; box-shadow: none; }
.btn.is-preview::after,
.btn.is-preview .heart { animation: none; }
.btn.is-preview .btn__chev { display: none; }
.btn.is-preview .btn__badge {
  display: block;
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .12);
}
.btn.is-preview { padding-right: 56px; }
.btn--tips.is-preview .btn__badge { background: rgba(255, 255, 255, .22); }

/* ───────── Footer ───────── */
.footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer__text {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 30ch;
  text-wrap: balance;
}
.footer__meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ───────── Toast ───────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  width: max-content;
  max-width: calc(100% - 40px);
  transform: translate(-50%, 16px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.noscript { text-align: center; padding: 12px; color: var(--ink-2); }

/* ───────── Motion ───────── */
.anim { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero .anim:nth-child(1) { animation-delay: .02s; }
.hero .anim:nth-child(2) { animation-delay: .08s; }
.hero .anim:nth-child(3) { animation-delay: .14s; }
.hero .anim:nth-child(4) { animation-delay: .2s; }
.actions .anim:nth-child(1) { animation-delay: .28s; }
.actions .anim:nth-child(2) { animation-delay: .36s; }
.footer.anim { animation-delay: .46s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes sheen {
  0%, 70% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes beat {
  0%, 60%, 100% { transform: scale(1); }
  66% { transform: scale(1.16); }
  74% { transform: scale(.96); }
  82% { transform: scale(1.08); }
}

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

/* Узкие экраны (320px) */
@media (max-width: 350px) {
  .page { gap: 28px; padding-left: 16px; padding-right: 16px; }
  .btn { gap: 12px; padding: 12px 14px 12px 12px; min-height: 70px; }
  .btn__icon { width: 44px; height: 44px; border-radius: 13px; }
  .btn__label { font-size: 17px; }
  .logo { width: 80px; height: 80px; border-radius: 24px; }
}

/* Низкие экраны / альбомная ориентация */
@media (max-height: 620px) {
  .page { justify-content: flex-start; gap: 26px; }
}
