/* ============================================================
   С Днём Рождения, Никита — стили
   ============================================================ */

:root {
  --bg: #07070b;
  --bg-2: #0d0e15;
  --ink: #f4f5fa;
  --muted: #9aa0b4;
  --line: rgba(255, 255, 255, 0.09);

  --gold: #f5b21a;
  --porsche: #f5b21a;
  --bmw: #2e8bff;
  --bmw-2: #ff3b3b;
  --trophy: #ff7a18;

  --accent: var(--gold);

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

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* учитываем «чёлку» / Dynamic Island и нижний индикатор iPhone */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body.locked { overflow: hidden; height: 100vh; height: 100dvh; }

button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

::selection { background: var(--gold); color: #000; }

/* ---------- ФОН ---------- */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(46, 139, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(255, 122, 24, 0.10), transparent 60%),
    linear-gradient(180deg, #07070b 0%, #0a0a12 50%, #07070b 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.content { position: relative; z-index: 2; }

/* ============================================================
   ПРЕЛОАДЕР
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 38px;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 40%, #14151f, #050507 70%);
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.rev { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tacho { width: 200px; height: 200px; transform: rotate(135deg); }
.tacho-track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 6; stroke-dasharray: 405 540; stroke-linecap: round; }
.tacho-fill {
  fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 405 540; stroke-dashoffset: 405;
  filter: drop-shadow(0 0 8px rgba(245,178,26,0.7));
  transition: stroke-dashoffset 0.15s linear;
}
.tacho-needle {
  stroke: #fff; stroke-width: 3; stroke-linecap: round;
  transform-origin: 100px 100px; transform: rotate(0deg);
  transition: transform 0.15s linear;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.6));
}
.tacho-cap { fill: #fff; }

.rev-label {
  font-family: var(--font-display);
  font-weight: 600; font-size: 13px; letter-spacing: 0.35em;
  color: var(--muted);
}
.rev-percent { font-family: var(--font-display); font-weight: 800; font-size: 30px; }
.rev-percent span { color: var(--gold); }

.ignite-btn {
  font-family: var(--font-display);
  font-weight: 800; font-size: 15px; letter-spacing: 0.2em;
  color: #000; background: var(--gold);
  border: none; border-radius: 100px;
  padding: 18px 44px; cursor: pointer;
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.3s, scale 0.2s;
  box-shadow: 0 0 0 0 rgba(245,178,26,0.5);
  animation: pulse 2s infinite;
}
.ignite-btn.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ignite-btn:hover { scale: 1.05; }
.ignite-btn:active { scale: 0.97; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(245,178,26,0.45); }
  70% { box-shadow: 0 0 0 22px rgba(245,178,26,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,178,26,0); }
}

/* ============================================================
   ЗВУК
   ============================================================ */
.sound-toggle {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  z-index: 40;
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 100px;
  padding: 9px 16px; color: var(--ink); cursor: pointer;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.18em; font-weight: 600;
  transition: background 0.3s, border-color 0.3s;
}
.sound-toggle:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 4px; background: var(--gold); border-radius: 2px; }
.sound-toggle.on .eq i { animation: eq 0.8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: 0.15s; }
.eq i:nth-child(3) { animation-delay: 0.3s; }
.eq i:nth-child(4) { animation-delay: 0.45s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 14px; } }

/* ============================================================
   ТИПОГРАФИКА / REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

section { padding: 9vh 7vw; position: relative; }

.section-head { margin-bottom: 6vh; }
.section-tag {
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.4em;
  color: var(--muted); margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.1rem, 6vw, 4.6rem); line-height: 0.98; letter-spacing: -0.01em;
}
.section-title em { font-style: normal; color: var(--gold); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  text-align: center;
  padding: calc(13vh + env(safe-area-inset-top)) 6vw calc(5vh + env(safe-area-inset-bottom));
  overflow: hidden;
}
.hero-photo {
  position: absolute; inset: 0; z-index: 0;
  background: url("assets/hero-nikita.png") no-repeat center 30%;
  background-size: cover;
  transform: scale(1.04);
  animation: heroZoom 18s ease-in-out infinite alternate;
}
@keyframes heroZoom { to { transform: scale(1.12); } }
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7,7,11,0.55) 0%, rgba(7,7,11,0) 28%),
    linear-gradient(0deg, rgba(7,7,11,0.95) 4%, rgba(7,7,11,0.55) 30%, rgba(7,7,11,0) 55%),
    radial-gradient(120% 80% at 50% 120%, rgba(245,178,26,0.18), transparent 60%);
}
.hero-top, .hero-bottom { position: relative; z-index: 2; width: 100%; }
.hero-bottom { display: flex; flex-direction: column; align-items: center; }

.hero-kicker {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(11px, 1.6vw, 14px); letter-spacing: 0.4em; color: #e7e9f3;
  text-shadow: 0 2px 18px rgba(0,0,0,0.7);
}
.hero-kicker span { color: var(--gold); }

.hero-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1rem, 3vw, 1.9rem); line-height: 1; letter-spacing: 0.06em;
  color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,0.7);
  margin-bottom: 0.4vh;
}

.hero-name {
  position: relative;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(3.4rem, 18vw, 11rem); line-height: 0.95; letter-spacing: -0.03em;
  margin: 0 0 1.6vh;
  background: linear-gradient(100deg, #ffe9a8 0%, var(--gold) 30%, #ff7a18 60%, #ff3b3b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto;
  animation: shimmer 6s linear infinite;
  filter: drop-shadow(0 6px 30px rgba(0,0,0,0.55)) drop-shadow(0 10px 50px rgba(245,178,26,0.3));
}
@keyframes shimmer { to { background-position: 200% center; } }

.hero-sub {
  font-size: clamp(1rem, 2.4vw, 1.4rem); color: #d6d9e6; max-width: 600px;
  font-weight: 600; text-shadow: 0 2px 14px rgba(0,0,0,0.8);
}

.scroll-hint {
  margin-top: 4vh; display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.3em; color: #c3c7d6;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.mouse {
  width: 26px; height: 42px; border: 2px solid rgba(255,255,255,0.3); border-radius: 14px;
  display: flex; justify-content: center; padding-top: 7px;
}
.mouse span { width: 4px; height: 8px; background: var(--gold); border-radius: 4px; animation: scroll 1.6s infinite; }
@keyframes scroll { 0% { opacity: 0; transform: translateY(-4px);} 40%{opacity:1;} 80%{opacity:0; transform: translateY(12px);} 100%{opacity:0;} }

/* ============================================================
   INTRO
   ============================================================ */
.intro { max-width: 920px; margin: 0 auto; }
.intro-text {
  font-size: clamp(1.15rem, 2.8vw, 1.9rem); line-height: 1.5; font-weight: 500;
  color: #d6d9e6; margin-bottom: 28px;
}
.intro-text b { color: #fff; font-weight: 800; }

/* ============================================================
   ПОДАРКИ
   ============================================================ */
.gift-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.gift-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 28px 28px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.25s var(--ease), border-color 0.4s, box-shadow 0.4s;
  will-change: transform;
}
.gift-card[data-accent="porsche"] { --c: var(--porsche); }
.gift-card[data-accent="bmw"]     { --c: var(--bmw); }
.gift-card[data-accent="trophy"]  { --c: var(--trophy); }

.gift-card:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 30px 80px rgba(0,0,0,0.5); }

.gift-glow {
  position: absolute; top: -40%; right: -30%; width: 280px; height: 280px; border-radius: 50%;
  background: var(--c); opacity: 0.16; filter: blur(60px); transition: opacity 0.4s;
  transform: translateZ(-1px);
}
.gift-card:hover .gift-glow { opacity: 0.32; }

.gift-num {
  font-family: var(--font-display); font-weight: 900; font-size: 64px; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--c) 60%, transparent);
  opacity: 0.5; transform: translateZ(30px);
}
.gift-tag {
  display: inline-block; margin: 14px 0 16px;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.28em; font-weight: 700;
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  padding: 6px 13px; border-radius: 100px; transform: translateZ(24px);
}
.gift-name {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.1; margin-bottom: 12px; transform: translateZ(40px);
}
.gift-desc { color: var(--muted); font-size: 0.97rem; margin-bottom: 22px; transform: translateZ(20px); }
.gift-desc b { color: #e6e8f2; font-weight: 700; }

.gift-meta { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; transform: translateZ(16px); }
.gift-meta li { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--line); padding-bottom: 9px; }
.gift-meta span { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.gift-meta b { font-family: var(--font-display); font-size: 13px; font-weight: 600; }

.gift-open {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
  color: #000; background: var(--c);
  border: none; border-radius: 13px; padding: 15px 20px; cursor: pointer;
  transform: translateZ(30px);
  transition: filter 0.25s, gap 0.25s, transform 0.2s;
}
.gift-open svg { width: 20px; height: 20px; fill: none; stroke: #000; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s; }
.gift-open:hover { filter: brightness(1.1); }
.gift-open:hover svg { transform: translateX(5px); }
.gift-open:active { transform: translateZ(30px) scale(0.98); }

/* ============================================================
   ПИСЬМО
   ============================================================ */
.letter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; max-width: 1100px; }
.note {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--line); border-radius: 20px; padding: 38px 34px;
}
.note::before {
  content: "“"; position: absolute; top: 2px; left: 22px;
  font-family: Georgia, serif; font-size: 120px; color: var(--gold); opacity: 0.22; line-height: 1;
}
.note p { font-size: clamp(1.05rem, 2vw, 1.35rem); font-weight: 500; color: #e7e9f3; position: relative; }
.note footer { margin-top: 22px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--gold); }

/* ============================================================
   ФИНАЛ
   ============================================================ */
.finale { text-align: center; min-height: 88vh; min-height: 88dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding-bottom: calc(11vh + env(safe-area-inset-bottom)); }
.finale-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(2rem, 7vw, 5rem); line-height: 1; }
.finale-title em { font-style: normal; color: var(--gold); }
.finale-sub { color: var(--muted); font-size: clamp(1rem, 2vw, 1.3rem); max-width: 560px; }

.boom-btn {
  margin-top: 14px;
  font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: 0.12em;
  color: #000;
  background: linear-gradient(100deg, var(--gold), #ff7a18);
  border: none; border-radius: 100px; padding: 22px 56px; cursor: pointer;
  box-shadow: 0 18px 50px rgba(245,178,26,0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.3s;
}
.boom-btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 24px 70px rgba(245,178,26,0.5); }
.boom-btn:active { transform: scale(0.97); }

.signature { margin-top: 36px; font-family: var(--font-display); font-size: 13px; letter-spacing: 0.2em; color: var(--muted); }

/* ============================================================
   ЛАЙТБОКС
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px;
  background: rgba(4,4,8,0.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0.4s;
  padding: calc(6vh + env(safe-area-inset-top)) 5vw calc(6vh + env(safe-area-inset-bottom));
}
.lightbox.open { opacity: 1; visibility: visible; }

.lb-stage { perspective: 1600px; max-width: 100%; }
.lb-frame {
  background: linear-gradient(180deg, #16171f, #0c0d13);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 50px 120px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  transform: rotateY(18deg) scale(0.9); opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.5s;
  width: -moz-fit-content; width: fit-content;
  max-width: min(860px, 92vw); margin-inline: auto;
}
.lightbox.open .lb-frame { transform: rotateY(0) scale(1); opacity: 1; }
.lb-frame[data-accent="porsche"] { box-shadow: 0 50px 120px rgba(0,0,0,0.7), 0 0 60px rgba(245,178,26,0.25); }
.lb-frame[data-accent="bmw"] { box-shadow: 0 50px 120px rgba(0,0,0,0.7), 0 0 60px rgba(46,139,255,0.3); }
.lb-frame[data-accent="trophy"] { box-shadow: 0 50px 120px rgba(0,0,0,0.7), 0 0 60px rgba(255,122,24,0.3); }

.lb-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.16em; color: var(--muted);
}
.lb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.lb-frame[data-accent="bmw"] .lb-dot { background: var(--bmw); box-shadow: 0 0 10px var(--bmw); }
.lb-frame[data-accent="trophy"] .lb-dot { background: var(--trophy); box-shadow: 0 0 10px var(--trophy); }

.lb-imgwrap { position: relative; line-height: 0; font-size: 0; }
#lbImg { display: block; max-width: 100%; max-height: 70vh; max-height: 70dvh; object-fit: contain; background: #fff; }

/* кликабельная зона QR — без рамки, просто кликабельная область */
.lb-hotspot {
  position: absolute; display: block; cursor: pointer;
  background: transparent; border: 0;
}

/* навигация по страницам — стрелки наложены поверх краёв, не занимают ширину */
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(10,10,16,0.55); border: 1px solid var(--line); color: #fff;
  font-size: 28px; line-height: 1; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background 0.3s, transform 0.2s; display: none;
}
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-stage.multi .lb-nav { display: block; }
.lb-nav:hover { background: rgba(255,255,255,0.2); transform: translateY(-50%) scale(1.08); }
.lb-nav:active { transform: translateY(-50%) scale(0.94); }

@media (max-width: 560px) {
  .lb-nav { width: 42px; height: 42px; font-size: 24px; }
  .lb-prev { left: 2px; }
  .lb-next { right: 2px; }
}

.lb-dots { display: none; gap: 9px; }
.lb-dots.multi { display: flex; }
.lb-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.28); transition: background 0.3s, transform 0.3s; padding: 0;
}
.lb-dots button.active { background: var(--gold); transform: scale(1.3); }

.lb-close {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top));
  right: calc(20px + env(safe-area-inset-right));
  z-index: 81;
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,0.07); border: 1px solid var(--line); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer; transition: background 0.3s, transform 0.3s;
}
.lb-close:hover { background: rgba(255,255,255,0.16); transform: rotate(90deg); }
.lb-hint { font-family: var(--font-display); font-size: 10px; letter-spacing: 0.14em; color: var(--muted); text-align: center; }
@media (max-width: 560px) {
  .lb-hint { font-size: 8px; letter-spacing: 0.08em; opacity: 0.85; }
}

/* ============================================================
   КОНФЕТТИ
   ============================================================ */
.confetti-canvas { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 980px) {
  .gift-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .letter-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  section { padding: 7vh 6vw; }
  .sound-toggle { padding: 8px 12px; }
  .sound-toggle .sound-label { display: none; }
  .hero { padding-top: 14vh; }
  .hero-name { letter-spacing: -0.04em; word-break: keep-all; }
  .hero-sub { padding: 0 4vw; }
  .gift-card { padding: 26px 22px 24px; border-radius: 20px; }
  .gift-open { padding: 17px 20px; }            /* крупная тач-зона */
  .note { padding: 32px 26px; }
  .boom-btn { padding: 20px 40px; width: 100%; max-width: 360px; }
  .lb-close { width: 46px; height: 46px; }
}

/* iPhone Pro Max (≈430–440px логической ширины) — крупный экран, можно дышать */
@media (min-width: 415px) and (max-width: 460px) {
  .hero-name { font-size: 5.4rem; }
  .gift-grid { gap: 22px; }
}

/* На тач-устройствах убираем «залипание» hover после тапа */
@media (hover: none) {
  .gift-card:hover { transform: none; }
  .boom-btn:hover, .ignite-btn:hover, .gift-open:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-name { animation: none; }
}
