/* ==========================================================================
   Cattalleya — стили
   Шрифт Pixels рисуется сеткой: чтобы пиксели были чёткими, все размеры
   шрифта кратны 8px (16 / 24 / 32 / 48 / 64 / 80 / 96).
   ========================================================================== */

:root {
  color-scheme: dark;

  --ink: #fff0fb;
  --ink-soft: #ffdff0;
  --rose: #ffb8da;
  --rose-light: #ffe5f1;
  --plum: #68415d;
  --plum-deep: #3a2040;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: 'Pixels', ui-monospace, monospace;

  /* масштаб типографики и отступов — меняется в медиазапросах ниже */
  --fs-body: 16px;
  --fs-lead: 24px;
  --fs-h1: 80px;
  --fs-brand: 24px;
  --card-w: max(440px, calc(var(--fs-h1) * 6.25 + var(--card-pad-x) * 2 + 16px));  /* заголовок 6.25em шириной */
  --card-pad-y: 48px;
  --card-pad-x: clamp(28px, 3vw, 56px);
  --edge: clamp(24px, 6vw, 112px);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;                 /* страница строго без прокрутки */
  background: #8e6489;
  color: var(--ink);
  font: 400 var(--fs-body)/1.5 var(--font);
  font-synthesis: none;
  font-kerning: none;
  text-rendering: optimizeSpeed;
  -webkit-text-size-adjust: 100%;
}

p, h1, h2, h3 { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--rose-light); outline-offset: 4px; }

/* ---------- Фон ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #8e6489;
}

.backdrop::after {                  /* затемнение: читаемость текста + виньетка */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(36, 14, 35, 0) 40%, rgba(70, 32, 70, .26) 100%),
    linear-gradient(to bottom, rgba(46, 21, 46, .38), transparent 24%, transparent 68%, rgba(45, 22, 44, .34));
}

.scene {
  position: absolute;
  inset: -3%;
  background: url('assets/scene.webp') 49% 52% / cover no-repeat;
  will-change: transform;
  animation: scene-in 1.6s var(--ease) both;
}

.petals { position: absolute; inset: 0; pointer-events: none; }

.petal {
  position: absolute;
  top: 0;
  width: var(--s);
  height: var(--s);
  background: #ffc3df;
  box-shadow: calc(var(--s) / 2) calc(var(--s) / 2) 0 #ffdfec;
  opacity: 0;
  animation: fall var(--t) linear var(--d) infinite;
}

/* ---------- Каркас ---------- */

.app {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px var(--edge);
  animation: fade-in .9s ease backwards;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 7% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 230, 247, .3), transparent);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  font-size: var(--fs-brand);
  line-height: 1;
  white-space: nowrap;
}

.topbar-note {
  font-size: var(--fs-body);
  letter-spacing: 2px;
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 0;
  padding: 0 clamp(22px, 3.4vw, 120px);
}

.footer {
  padding: 0 18px 16px;
  text-align: center;
  text-shadow: 0 2px 8px #633658;
  animation: fade-in 1.2s ease .8s both;
}

.heart { color: var(--rose); }

/* ---------- Стекло ---------- */

.glass {
  position: relative;
  isolation: isolate;
  border-radius: 32px;
  border: 1px solid rgba(255, 235, 247, .5);
  background: linear-gradient(135deg, rgba(255, 215, 239, .22), rgba(175, 106, 157, .27) 30%, rgba(100, 53, 99, .3));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .38),
    inset 0 -1px 0 rgba(255, 224, 246, .1),
    0 30px 80px rgba(53, 24, 48, .24),
    0 6px 24px rgba(62, 24, 58, .12);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.glass::before {                    /* блик следует за курсором */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .18), transparent 62%),
    radial-gradient(ellipse at 52% 105%, rgba(255, 167, 210, .32), transparent 60%);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background: rgba(105, 61, 98, .82); }
}

/* ---------- Главная карточка ---------- */

.card {
  grid-column: 2;
  justify-self: start;                /* левый край карточки — ровно по центру экрана */
  width: min(100%, var(--card-w));
  padding: var(--card-pad-y) var(--card-pad-x);
  text-align: center;
  overflow: hidden;
}

.glass::after {                     /* редкий проблеск по стеклу */
  content: "";
  position: absolute;
  top: -90%;
  left: -80%;
  width: 70%;
  height: 280%;
  z-index: -1;
  pointer-events: none;
  transform: rotate(25deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .16), transparent);
  animation: sheen 11s ease-in-out 2.5s infinite;
}

.card > * { animation: rise .9s var(--ease) calc(var(--i, 0) * 80ms + 150ms) backwards; }
.card > .btn, .card > .socials, .card > .ornament { animation-name: fade-in; }

.eyebrow {
  font-size: var(--fs-body);
  letter-spacing: 1px;
  text-transform: uppercase;
}

h1 {
  margin: 16px 0 4px;
  font-size: var(--fs-h1);
  line-height: 1.1;
  color: var(--ink);
  text-shadow: 4px 4px 0 rgba(136, 67, 119, .45);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 16px;
}

.ornament i {
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffdbea);
}
.ornament i:last-child { transform: scaleX(-1); }

.ornament img {
  width: 36px;
  height: 26px;
  image-rendering: pixelated;
  animation: bob 1.6s steps(1) infinite;
}

.subtitle {
  font-size: var(--fs-body);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.intro {
  max-width: 20em;
  margin: 24px auto 28px;
  font-size: var(--fs-lead);
  line-height: 1.5;
  text-wrap: balance;
}

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

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 16px;
  line-height: 1.1;
  overflow: hidden;
  transition: box-shadow .18s var(--ease), background .25s, border-color .25s;
}

.btn-primary {
  min-height: 64px;
  padding: 12px 20px;
  font-size: var(--fs-lead);
  color: var(--plum);
  border-color: rgba(255, 255, 255, .8);
  background: linear-gradient(135deg, #ffe5f1 0%, #f9b5d7 58%, #f5a5cb 100%);
  box-shadow: 0 4px 0 #c46f9d, 0 14px 30px rgba(76, 27, 70, .26);
}

.btn-primary .heart { color: inherit; animation: beat 1.6s steps(1) infinite; }

.btn-primary::after {               /* блеск при наведении */
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 40%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  transition: left .7s var(--ease);
}


.socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.btn-ghost {
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 18px;
  font-size: var(--fs-body);
  border-color: rgba(255, 231, 247, .42);
  background: rgba(73, 33, 70, .22);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}


.arrow { opacity: .8; transition: transform .25s var(--ease), opacity .25s; }

/* ---------- Окно поддержки ---------- */

.modal {
  width: min(740px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: inherit;

  opacity: 0;
  transition: opacity .25s ease, display .4s allow-discrete, overlay .4s allow-discrete;
}

.modal[open] { opacity: 1; }

@starting-style {
  .modal[open] { opacity: 0; }
}

.modal::backdrop {
  background: rgba(36, 21, 40, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background .3s ease, backdrop-filter .3s ease, -webkit-backdrop-filter .3s ease, display .3s allow-discrete, overlay .3s allow-discrete;
}

.modal[open]::backdrop {
  background: rgba(36, 21, 40, .56);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@starting-style {
  .modal[open]::backdrop { background: rgba(36, 21, 40, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
}

.sheet {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 28px 30px 26px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-head h2 { margin: 0 0 4px; font-size: 32px; line-height: 1.2; }
.modal-sub { opacity: .88; }

.icon-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 235, 248, .38);
  border-radius: 13px;
  background: rgba(255, 242, 249, .1);
  transition: background .2s;
}
.icon-btn svg { width: 16px; height: 16px; }

.view {
  flex: 1;
  min-height: 0;
  margin: -2px -4px;
  padding: 2px 4px;
  overflow: auto;                   /* запасной вариант для очень низких экранов */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 189, 215, .65) transparent;
  animation: fade-in .3s ease backwards;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #ffe7f4;
  font-size: var(--fs-body);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 227, 243, .45), transparent); }
.grid + .section-title { margin-top: 22px; }

.grid { display: grid; gap: 10px; }
.grid-fiat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-crypto { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.method {
  min-width: 0;
  min-height: 72px;
  padding: 12px 10px;
  text-align: center;
  text-wrap: balance;
  border: 1px solid rgba(255, 225, 243, .3);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 227, 245, .15), rgba(119, 62, 110, .18));
  animation: fade-in .45s ease calc(var(--i, 0) * 30ms) backwards;
  transition: background .22s, border-color .22s, box-shadow .22s;
}

.method-fiat { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-inline: 18px; text-align: left; }
.method-fiat small { display: block; margin-top: 4px; font-size: var(--fs-body); opacity: .75; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  transition: color .2s;
}

.wallet-top { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.wallet-coin { font-size: 24px; line-height: 1; }
.chip { padding: 4px 12px; border: 1px solid rgba(255, 230, 246, .4); border-radius: 99px; background: rgba(255, 227, 245, .16); }

.wallet { text-align: center; }

.qr {
  --qr: clamp(120px, 22dvh, 192px);
  width: var(--qr);
  height: var(--qr);
  margin: 0 auto 12px;
  padding: 4px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff;
  color: var(--plum-deep);
  box-shadow: 0 8px 28px rgba(53, 28, 52, .28);
  animation: fade-in .4s ease backwards;
}
.qr svg { display: block; width: 100%; height: 100%; }

.qr-caption { margin-bottom: 16px; color: #ffe5f4; }

.field-label { margin-bottom: 8px; text-align: left; color: var(--ink-soft); }

.address {
  display: block;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  line-height: 1.4;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
  border: 1px solid rgba(255, 230, 245, .36);
  border-radius: 13px;
  background: rgba(48, 22, 49, .32);
}

.btn-copy { min-height: 52px; margin-top: 10px; font-size: var(--fs-body); }
.btn-copy svg { width: 14px; height: 14px; }

.empty {
  padding: 28px 8px;
  text-align: center;
  border: 1px dashed rgba(255, 225, 245, .32);
  border-radius: 18px;
  background: rgba(255, 230, 248, .07);
}
.empty-heart { display: block; font-size: 32px; line-height: 1; color: var(--rose); animation: beat 1.6s steps(1) infinite; }
.empty p { margin: 12px 0 4px; font-size: var(--fs-lead); }

.warning {
  margin-top: 16px;
  padding: 12px 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  border: 1px solid rgba(255, 211, 233, .2);
  border-radius: 13px;
  background: rgba(255, 191, 218, .1);
}

.toast {
  position: fixed;
  z-index: 40;
  bottom: 24px;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: max-content;
  max-width: calc(100vw - 36px);
  padding: 12px 20px;
  text-align: center;
  border: 1px solid rgba(255, 228, 245, .72);
  border-radius: 16px;
  background: rgba(91, 51, 83, .92);
  box-shadow: 0 16px 30px rgba(60, 27, 58, .3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.toast.visible { opacity: 1; }

/* ---------- Анимации ---------- */

/* Сдвиг нужен только тексту без тонких линий (плавно, 60 fps).
   Всё, что с рамками и линиями, появляется через fade-in: на дробных пикселях 1px-линии размываются. */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scene-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheen    { 0%, 62%, 100% { left: -80%; } 80% { left: 140%; } }
@keyframes beat     { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes bob      { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes fall {
  0%   { opacity: 0; transform: translate3d(0, -24px, 0) rotate(0); }
  8%   { opacity: .75; }
  88%  { opacity: .6; }
  100% { opacity: 0; transform: translate3d(var(--dx), calc(100dvh + 24px), 0) rotate(300deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .petals { display: none; }
}

/* ---------- Адаптивность (всё помещается без прокрутки) ---------- */

@media (max-height: 760px) {
  .qr { --qr: clamp(112px, 20dvh, 160px); }
}

@media (min-width: 1800px) {
  :root { --fs-h1: 96px; --card-pad-y: 56px; }
}

@media (min-width: 901px) and (max-width: 1399px) {
  :root { --fs-h1: 64px; --fs-brand: 16px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  :root { --fs-lead: 16px; --fs-h1: 48px; }
  .hero { padding-inline: 24px; }
}

@media (min-width: 901px) and (max-height: 780px) {
  :root { --fs-h1: 64px; --card-pad-y: 36px; --fs-lead: 24px; }
  .intro { margin: 16px auto 20px; }
  h1 { margin-top: 8px; }
}

@media (min-width: 901px) and (max-height: 640px) {
  :root { --fs-h1: 48px; --card-pad-y: 24px; --fs-lead: 16px; }
  .topbar { padding-block: 14px; }
  .footer { display: none; }
}

/* Планшет и телефон: одна колонка, карточка по центру */
@media (max-width: 900px) {
  :root { --fs-h1: 48px; --fs-lead: 16px; --fs-brand: 16px; --card-w: 480px; --card-pad-y: 28px; --card-pad-x: 24px; --edge: 22px; }
  .scene { background-size: auto 125%; background-position: 24% 100%; }
  .topbar { padding-block: 18px; }
  .hero { grid-template-columns: 1fr; align-items: start; padding: clamp(8px, 4dvh, 40px) 16px 12px; }
  .card { grid-column: 1; }
  .intro { max-width: 17em; margin: 20px auto 24px; }
  .btn-primary { font-size: 24px; min-height: 56px; }
  .btn-ghost { min-height: 48px; }
  .topbar-note { font-size: 16px; letter-spacing: 0; }
  .sheet { padding: 22px 18px 18px; }
  .modal-head { margin-bottom: 16px; }
  .modal-head h2 { font-size: 24px; }
  .grid-crypto { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid-fiat { gap: 8px; }
  .method { min-height: 48px; padding: 6px; }
  .method-fiat { min-height: 64px; }
  .qr-caption { margin-bottom: 12px; }
  .wallet-top { margin-bottom: 12px; }
  .back-btn { margin-bottom: 8px; }
  .warning { margin-top: 12px; padding: 10px 12px; }
  .btn-copy { min-height: 44px; font-size: 16px; }
  .method-fiat { padding-inline: 12px; }
  .grid + .section-title { margin-top: 16px; }
}

@media (max-width: 900px) and (max-height: 760px) {
  .grid-crypto { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .method { min-height: 56px; }
}

@media (max-width: 900px) and (max-height: 700px) {
  :root { --card-pad-y: 20px; }
  .sheet { padding-block: 14px; }
  .modal-head { margin-bottom: 10px; }
  .method { min-height: 48px; }
  .method-fiat { min-height: 56px; }
  .section-title { margin-bottom: 8px; }
  .grid + .section-title { margin-top: 12px; }
    .qr { --qr: 112px; margin-bottom: 8px; }
  .qr-caption, .wallet-top { margin-bottom: 8px; }
  .warning { margin-top: 8px; }
  .topbar { padding-block: 12px; }
  .hero { padding-top: 6px; }
  h1 { margin-top: 8px; }
  .intro { margin: 14px auto 16px; }
  .ornament { margin: 4px 0 10px; }
  .footer { display: none; }
}

@media (max-width: 400px) {
  :root { --fs-h1: 40px; --card-pad-x: 18px; --edge: 16px; }
  .topbar { gap: 12px; }
  .socials { gap: 8px; }
  .btn-ghost { padding-inline: 12px; }
  .sheet { padding: 18px 14px 14px; }
}

/* На узких смартфонах не сокращаем криптовалюты до трёх колонок,
   даже когда высота телефона меньше 760px. */
@media (max-width: 430px) {
  .grid-crypto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 340px) {
  .topbar-note { font-size: 8px; letter-spacing: 1px; }
}

/* Телефон в горизонтальном положении */
@media (max-height: 500px) {
  :root { --fs-h1: 40px; --card-pad-y: 14px; }
  .topbar { padding-block: 8px; }
  .topbar-note, .footer, .eyebrow, .topbar::after { display: none; }
  .hero { padding-top: 0; padding-bottom: 8px; }
  .intro { margin: 8px auto 12px; }
  .ornament { margin: 2px 0 6px; }
  .btn-primary { min-height: 48px; }
  .btn-ghost { min-height: 40px; }
  .socials { margin-top: 10px; }
  .modal-head { margin-bottom: 10px; }
  .sheet { padding-block: 14px; }
}

/* Эффекты наведения — только там, где есть мышь (на тач-экранах hover «залипает») */
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #c46f9d, 0 18px 34px rgba(76, 27, 70, .3), 0 0 34px rgba(255, 186, 222, .3); }
  .btn-primary:hover::after { left: 130%; }
  .btn-ghost:hover { transform: translateY(-2px); background: rgba(244, 191, 228, .24); border-color: rgba(255, 255, 255, .75); }
  .btn:hover .arrow { transform: translateX(4px); opacity: 1; }
  .icon-btn:hover { background: rgba(255, 235, 248, .26); transform: rotate(90deg); }
  .method:hover { transform: translateY(-3px); background: rgba(255, 210, 237, .26); border-color: rgba(255, 242, 250, .75); box-shadow: 0 10px 22px rgba(54, 22, 52, .18); }
  .back-btn:hover { color: #fff; transform: translateX(-3px); }
}

/* Нажатие — после hover, чтобы перебивать его */
.btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 #c46f9d, 0 6px 14px rgba(76, 27, 70, .25); }
.btn-ghost:active { transform: translateY(0); }
.method:active { transform: translateY(0); }
