/* ============================================================
   С Днём Рождения — розово-чёрная тема
   ============================================================ */

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

:root {
  --bg:        #07050a;
  --ink:       #fff5fa;
  --muted:     rgba(255, 225, 240, .60);
  --pink:      #ff2e88;
  --pink-2:    #ff77bb;
  --pink-3:    #ffd3e8;
  --line:      rgba(255, 120, 180, .22);
  --card:      rgba(22, 9, 20, .55);

  --font-d: 'Unbounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-b: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(.22, .8, .2, 1);
}

@property --a {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

html, body { height: 100%; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------
   ФОН
   ------------------------------------------------------------ */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  will-change: transform;
}

.blob--1 {
  width: 52vmax; height: 52vmax;
  top: -18vmax; left: -12vmax;
  background: radial-gradient(circle at 30% 30%, #ff2e88, transparent 70%);
  animation: drift1 22s var(--ease) infinite alternate;
}

.blob--2 {
  width: 44vmax; height: 44vmax;
  bottom: -16vmax; right: -10vmax;
  background: radial-gradient(circle at 60% 40%, #b026ff, transparent 70%);
  opacity: .45;
  animation: drift2 26s var(--ease) infinite alternate;
}

.blob--3 {
  width: 30vmax; height: 30vmax;
  top: 45%; left: 55%;
  background: radial-gradient(circle at 50% 50%, #ff77bb, transparent 70%);
  opacity: .35;
  animation: drift3 19s var(--ease) infinite alternate;
}

@keyframes drift1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(8vmax, 6vmax, 0) scale(1.15); }
}
@keyframes drift2 {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-7vmax, -5vmax, 0) scale(.95); }
}
@keyframes drift3 {
  from { transform: translate3d(-4vmax, 0, 0) scale(.9); }
  to   { transform: translate3d(4vmax, -6vmax, 0) scale(1.2); }
}

/* ------------------------------------------------------------
   ФИАЛКИ НА ФОНЕ
   ------------------------------------------------------------ */
.violets {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.violet {
  position: absolute;
  height: auto;
  will-change: transform;
}

.violet--1 {
  width: clamp(76px, 10vw, 150px);
  top: 6%; left: 3%;
  color: #8b5cf6;
  opacity: .26;
  transform: rotate(-14deg);
  filter: drop-shadow(0 0 22px rgba(139, 92, 246, .55));
  animation: violetFloat 17s var(--ease) infinite alternate;
}

.violet--2 {
  width: clamp(58px, 7.5vw, 112px);
  top: 58%; right: 5%;
  color: #c084fc;
  opacity: .22;
  transform: rotate(16deg);
  filter: drop-shadow(0 0 20px rgba(192, 132, 252, .5));
  animation: violetFloat 21s var(--ease) infinite alternate-reverse;
}

.violet--3 {
  width: clamp(50px, 6.5vw, 96px);
  bottom: 7%; left: 9%;
  color: #a78bfa;
  opacity: .18;
  transform: rotate(7deg);
  filter: drop-shadow(0 0 18px rgba(167, 139, 250, .45));
  animation: violetFloat 24s var(--ease) infinite alternate;
}

@keyframes violetFloat {
  from { translate: 0 0; }
  to   { translate: 0 -22px; }
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(0, 0, 0, .72) 100%);
}

/* ------------------------------------------------------------
   ПАДАЮЩИЕ СЕРДЕЧКИ
   ------------------------------------------------------------ */
.hearts {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hearts.is-on { opacity: 1; }

.heart {
  position: absolute;
  top: -12vh;
  font-size: 18px;
  line-height: 1;
  color: var(--pink-2);
  text-shadow: 0 0 18px rgba(255, 46, 136, .9);
  animation: fall linear infinite;
  will-change: transform;
}

@keyframes fall {
  0%   { transform: translate3d(0, -12vh, 0) rotate(0deg) scale(.8); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translate3d(var(--sway, 40px), 118vh, 0) rotate(var(--rot, 320deg)) scale(1); opacity: 0; }
}

/* ------------------------------------------------------------
   КАРКАС ЭКРАНОВ
   ------------------------------------------------------------ */
.stage {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100dvh;
}

.screen {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: clamp(18px, 4vw, 48px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.96) translateY(16px);
  transition:
    opacity .8s var(--ease),
    transform .8s var(--ease),
    visibility .8s;
}

.screen--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

/* ------------------------------------------------------------
   ОБЩИЕ ЭЛЕМЕНТЫ
   ------------------------------------------------------------ */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--pink-2);
  margin-bottom: 22px;
}

.grad {
  background: linear-gradient(100deg, #fff 0%, var(--pink-2) 35%, var(--pink) 65%, #ff9ecb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------
   ЭКРАН 1 — КАРТОЧКА С ВОПРОСОМ
   ------------------------------------------------------------ */
.card {
  position: relative;
  width: min(560px, 100%);
  padding: clamp(28px, 5vw, 54px) clamp(22px, 5vw, 48px);
  text-align: center;
  border-radius: 34px;
  background:
    linear-gradient(165deg, rgba(255, 46, 136, .12), rgba(255, 255, 255, .015) 42%),
    var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    0 50px 130px -40px rgba(255, 46, 136, .75),
    inset 0 1px 0 rgba(255, 255, 255, .09);
  animation: cardIn 1s var(--ease) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(26px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* светящаяся бегущая рамка */
.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--a),
    transparent 0deg,
    var(--pink) 55deg,
    var(--pink-2) 115deg,
    transparent 190deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: .8;
  animation: spin 7s linear infinite;
  pointer-events: none;
}

@keyframes spin { to { --a: 360deg; } }

.question {
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(24px, 5.4vw, 36px);
  line-height: 1.28;
  letter-spacing: -.01em;
  margin-bottom: 34px;
}

/* подзаголовок под вопросом (экран с датой) */
.question-sub {
  margin: -20px 0 30px;
  font-size: clamp(14px, 3.4vw, 16px);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- поле ввода --- */
.age-form { display: block; }

.field {
  position: relative;
  display: block;
  margin-bottom: 16px;
}

.field input {
  width: 100%;
  padding: 24px 70px 24px 24px;
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(26px, 7vw, 38px);
  letter-spacing: .06em;
  text-align: center;
  color: #fff;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
  border-radius: 22px;
  outline: none;
  transition: border-color .3s, box-shadow .3s, background .3s;
}

.field input::placeholder {
  color: transparent;
}

.field input:focus {
  background: rgba(255, 46, 136, .07);
  border-color: rgba(255, 120, 180, .7);
  box-shadow:
    0 0 0 4px rgba(255, 46, 136, .14),
    0 0 55px -6px rgba(255, 46, 136, .65);
}

.field__hint {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

/* --- кнопка --- */
.btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 21px 28px;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  border-radius: 22px;
  font-family: var(--font-d);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #1e0412;
  background: linear-gradient(100deg, var(--pink) 0%, #ff9ecb 48%, var(--pink) 100%);
  background-size: 220% 100%;
  background-position: 0 0;
  box-shadow: 0 20px 50px -16px rgba(255, 46, 136, .95);
  transition: transform .25s var(--ease), box-shadow .3s, background-position .7s var(--ease);
}

.btn span { position: relative; z-index: 2; }

.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent);
  transform: skewX(-18deg);
  transition: left .7s var(--ease);
}

.btn:hover {
  transform: translateY(-3px);
  background-position: 100% 0;
  box-shadow: 0 28px 65px -16px rgba(255, 46, 136, 1);
}
.btn:hover::after { left: 120%; }
.btn:active { transform: translateY(-1px) scale(.99); }
.btn:focus-visible { outline: 2px solid var(--pink-3); outline-offset: 4px; }

/* ------------------------------------------------------------
   ОШИБКА
   ------------------------------------------------------------ */
.field.is-error input {
  border-color: rgba(255, 120, 180, .85);
  box-shadow: 0 0 0 4px rgba(255, 46, 136, .16);
}

.error {
  min-height: 20px;
  margin-top: 16px;
  font-size: 14px;
  color: #ff9dc4;
  opacity: 0;
  transition: opacity .3s;
}
.error.is-on { opacity: 1; }

.shake { animation: shake .45s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-9px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

/* ------------------------------------------------------------
   ЭКРАН 3 — ПРИЗНАНИЕ
   ------------------------------------------------------------ */
.love__text {
  letter-spacing: -.01em;
}

/* ------------------------------------------------------------
   ЭКРАН 4 — ГАЛЕРЕЯ
   ------------------------------------------------------------ */
.gallery {
  width: min(860px, 100%);
  text-align: center;
  padding: clamp(6px, 2vw, 20px) 0;
}

.gallery .eyebrow { margin-bottom: 16px; }

/* Рамка всегда одного формата (4:5) и одного размера.
   Фото вписывается целиком, а поля по краям заполняет
   размытая копия этого же фото. */
.gallery__frame {
  position: relative;
  width: min(560px, 100%, 54dvh);      /* 4:5, но не выше ~68% экрана */
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  border-radius: clamp(20px, 2vw, 28px);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow:
    0 50px 130px -45px rgba(255, 46, 136, .8),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  touch-action: pan-y;                 /* свайп по горизонтали — наш */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
}

.gallery__frame:active { cursor: grabbing; }

/* размытая копия фото на весь кадр — заполняет поля по краям */
.gallery__bg {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  z-index: 0;
  object-fit: cover;
  filter: blur(34px) saturate(135%) brightness(.5);
  pointer-events: none;
}

.gallery__img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;                 /* формат у всех фото один — вписываем целиком */
  opacity: 0;
  transform: scale(.98);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  will-change: transform, opacity;
  -webkit-user-drag: none;
}

.gallery__img.is-in {
  opacity: 1;
  transform: none;
}

/* --- стрелки --- */
.gallery__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(38px, 5vw, 50px);
  height: clamp(38px, 5vw, 50px);
  padding: 0 0 4px;
  font-family: var(--font-d);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1;
  color: #fff;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(12, 4, 12, .5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(-50%);
  transition: background .3s, border-color .3s, transform .25s var(--ease);
}

.gallery__nav:hover {
  background: rgba(255, 46, 136, .5);
  border-color: rgba(255, 120, 180, .8);
  transform: translateY(-50%) scale(1.08);
}
.gallery__nav:active { transform: translateY(-50%) scale(.96); }
.gallery__nav:focus-visible { outline: 2px solid var(--pink-3); outline-offset: 3px; }

.gallery__nav--prev { left: clamp(10px, 1.6vw, 18px); }
.gallery__nav--next { right: clamp(10px, 1.6vw, 18px); }

/* --- полоса под рамкой --- */
.gallery__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.gallery__count {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--pink-2);
}

.gallery__hint {
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* маленькая кнопка рядом со счётчиком */
.btn--sm {
  width: auto;
  padding: 13px 22px;
  font-size: 12px;
  border-radius: 16px;
  box-shadow: 0 14px 34px -14px rgba(255, 46, 136, .95);
}
.btn--sm[hidden] { display: none; }

/* на телефоне стрелок нет — листаем свайпом */
@media (hover: none), (max-width: 620px) {
  .gallery__nav { display: none; }
  .gallery__hint { font-size: 11px; letter-spacing: .12em; }
}

/* ------------------------------------------------------------
   ЭКРАН 5 — ПОЗДРАВЛЕНИЕ
   ------------------------------------------------------------ */
.greet {
  width: min(760px, 100%);
  text-align: center;
  padding: clamp(10px, 3vw, 30px) 0;
}

.greet__age {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: clamp(88px, 24vw, 190px);
  line-height: .82;
  letter-spacing: -.04em;
  background: linear-gradient(180deg, #fff 0%, var(--pink-2) 45%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 60px rgba(255, 46, 136, .65));
  animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 45px rgba(255, 46, 136, .5)); }
  50%      { filter: drop-shadow(0 0 85px rgba(255, 46, 136, .9)); }
}

.greet__title {
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(22px, 4.6vw, 40px);
  line-height: 1.3;
  margin: 6px 0 clamp(26px, 4vw, 40px);
}

.greet__card {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 30px;
  background:
    linear-gradient(165deg, rgba(255, 46, 136, .11), rgba(255, 255, 255, .015) 45%),
    var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    0 45px 120px -45px rgba(255, 46, 136, .8),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.wish p {
  font-size: clamp(15px, 1.9vw, 17px);
  line-height: 1.85;
  color: rgba(255, 236, 245, .88);
}
.wish p + p { margin-top: 16px; }

.sign {
  margin-top: 26px;
  font-family: var(--font-d);
  font-size: clamp(13px, 1.6vw, 15px);
  letter-spacing: .06em;
  color: var(--pink-2);
}

.sparkle-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: clamp(22px, 3.5vw, 34px);
  font-size: 16px;
  color: var(--pink);
  text-shadow: 0 0 22px rgba(255, 46, 136, .95);
}
.sparkle-row span { animation: beat 1.6s ease-in-out infinite; }
.sparkle-row span:nth-child(2) { animation-delay: .2s; }
.sparkle-row span:nth-child(3) { animation-delay: .4s; }

@keyframes beat {
  0%, 100% { transform: scale(1); opacity: .75; }
  50%      { transform: scale(1.4); opacity: 1; }
}

/* --- появление элементов поздравления --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.greet.is-in .reveal {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   ЭКРАН 5 — «ТЫКАЙ НА МОЙ НОСИК»
   ------------------------------------------------------------ */
.nose {
  width: min(560px, 100%);
  text-align: center;
  padding: clamp(6px, 2vw, 20px) 0;
}

/* формат ровно как у фото (1920×2560 = 3:4), поэтому носик
   всегда остаётся в одной и той же точке кадра */
.nose__frame {
  position: relative;
  width: min(430px, 100%, 58dvh);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border-radius: clamp(20px, 2vw, 28px);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow:
    0 50px 130px -45px rgba(255, 46, 136, .8),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .35s var(--ease), box-shadow .5s var(--ease);
}

.nose__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;                   /* кадр совпадает с фото — проценты не «плывут» */
  display: block;
  -webkit-user-drag: none;
  animation: cardIn 1s var(--ease) both;
}

/* --- носик --- */
.nose__hot {
  position: absolute;
  left: 37%;                            /* центр носика — по середине кадра */
  top: 47%;                             /* уровень носа */
  width: 26%;
  height: 15%;
  padding: 0;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

/* мягкое свечение вокруг носика — подсказка, куда тыкать */
.nose__hot::before {
  content: '';
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 46, 136, .38), transparent 68%);
  opacity: .9;
  animation: nosePulse 2.2s ease-in-out infinite;
  pointer-events: none;
  transition: opacity .3s;
}

.nose__hot:active::before,
.nose__hot:hover::before { opacity: 1; animation-duration: 1.1s; }

.nose__hot:focus-visible {
  outline: 2px solid var(--pink-3);
  outline-offset: 2px;
}

@keyframes nosePulse {
  0%, 100% { transform: scale(.86); opacity: .45; }
  50%      { transform: scale(1.06); opacity: 1; }
}

/* отклик на «тык» */
.nose__frame.is-poked {
  animation: pokePop .6s var(--ease);
}
@keyframes pokePop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.035); box-shadow: 0 60px 150px -40px rgba(255, 46, 136, 1); }
  100% { transform: scale(1); }
}

.nose__caption {
  margin-top: clamp(16px, 3vw, 26px);
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(16px, 3.6vw, 22px);
  letter-spacing: .04em;
  background: linear-gradient(100deg, #fff 0%, var(--pink-2) 45%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: beat 2.6s ease-in-out infinite;
}

.nose__next {
  margin: clamp(18px, 3vw, 26px) auto 0;
  width: auto;
}

/* ------------------------------------------------------------
   МОБИЛЬНЫЕ
   ------------------------------------------------------------ */
@media (max-width: 480px) {
  .card { border-radius: 28px; }
  .field input { padding: 20px 60px 20px 18px; }
  .field__hint { right: 16px; }
  .btn { padding: 19px 22px; font-size: 14px; }

  .violet--1 { top: 3%; left: 1%; opacity: .2; }
  .violet--2 { top: 62%; right: 1%; opacity: .17; }
  .violet--3 { bottom: 3%; left: 3%; opacity: .14; }

  .nose__frame { width: min(360px, 100%, 52dvh); }
  .nose__caption { font-size: 16px; }
}

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