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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}


/* ========== Header (brand + title) ========== */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 20%;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  pointer-events: none;
  padding: 0 16px;
}

.site-brand {
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 400;
  font-size: clamp(0.95rem, 2.4vw, 1.3rem);
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.25),
    0 2px 6px rgba(0,0,0,0.55),
    0 0 18px rgba(255,255,255,0.12);
}

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(1.3rem, 3.6vw, 2.15rem);
  letter-spacing: 0.08em;
  margin: 0;
  line-height: 1.15;
  background: linear-gradient(
    180deg,
    #fff8e0 0%,
    #ffe566 18%,
    #f0c14a 40%,
    #d4a017 55%,
    #f5d76e 75%,
    #fff0b3 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* мягкая тень без 3D-перспективы — не рябит */
  filter:
    drop-shadow(0 1px 0 #8a6a10)
    drop-shadow(0 2px 6px rgba(0,0,0,0.45))
    drop-shadow(0 0 20px rgba(255, 200, 50, 0.3));
}

/* ========== 3D Scene ========== */
/* header ~20% + gaps; button zone + bottom ~20% */
.scene {
  position: fixed;
  top: 28%;
  bottom: 28%;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1100px;
  perspective-origin: 50% 50%;
  z-index: 1;
}

.cloud {
  position: relative;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
  will-change: transform;
}

.card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w, 240px);
  height: var(--card-h, 135px);   /* 16:9, +50% */
  margin-left: calc(var(--card-w, 240px) / -2);
  margin-top: calc(var(--card-h, 135px) / -2);
  transform-style: preserve-3d;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background: #111;
  transition: filter 0.35s ease, opacity 0.35s ease;
  backface-visibility: hidden;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.card.is-front {
  z-index: 10;
}

/* --- Loading placeholders in cloud --- */
.card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(145deg, #1a1a22 0%, #0d0d12 100%);
  border-radius: inherit;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.card.show-placeholder .card-placeholder {
  opacity: 1;
  pointer-events: auto;
}

.card.is-ready .card-placeholder {
  opacity: 0;
  pointer-events: none;
}

.card-ph-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(212, 175, 55, 0.25);
  border-top-color: #d4af37;
  animation: spin 0.85s linear infinite;
}

.card-ph-text {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

.card.is-error .card-ph-ring {
  display: none;
}

.card.is-ready img {
  opacity: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ========== CTA Button ========== */
.cta-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 10%;
  display: flex;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
}

.cta-btn {
  pointer-events: auto;
  position: relative;
  border: none;
  cursor: pointer;
  padding: 18px 48px;
  border-radius: 999px;
  background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
  color: #f5e6c8;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  letter-spacing: 0.04em;
  box-shadow:
    0 4px 0 #000,
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(212, 175, 55, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(0) scale(1);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              background 0.25s ease,
              color 0.25s ease;
  animation: pulse 3s ease-in-out infinite;
  will-change: transform;
}

.cta-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.5), transparent 50%, rgba(212, 175, 55, 0.25));
  z-index: -1;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.cta-btn:hover {
  transform: translateY(-4px) scale(1.06);
  color: #fff8e7;
  background: linear-gradient(145deg, #252525 0%, #141414 100%);
  box-shadow:
    0 8px 0 #000,
    0 16px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(212, 175, 55, 0.55),
    0 0 40px rgba(212, 175, 55, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cta-btn:hover::before {
  opacity: 1;
}

.cta-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 2px 0 #000,
    0 4px 12px rgba(0, 0, 0, 0.5);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.09); }
  55% { transform: scale(0.97); }
  70% { transform: scale(1.05); }
}

.cta-btn:hover {
  animation: none;
}

/* ========== Preview (fullscreen) ========== */
.preview {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.preview.is-open {
  opacity: 1;
  visibility: visible;
}

.preview-inner {
  position: relative;
  width: 90%;
  max-width: 1100px;
  max-height: 90vh;
  transform: scale(0.85);
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview.is-open .preview-inner {
  transform: scale(1);
}

.preview-stage {
  position: relative;
  width: 100%;
  min-height: min(52vh, 360px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-inner img {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.preview-inner img.is-shown {
  opacity: 1;
}

.preview-loading {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 5;
  pointer-events: none;
}

.preview-loading.is-visible {
  display: flex;
}

.preview-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(212, 175, 55, 0.25);
  border-top-color: #d4af37;
  animation: spin 0.8s linear infinite;
}

.preview-close {
  position: absolute;
  top: -48px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.2s;
}

.preview-close:hover {
  color: #fff;
}

.preview-link {
  position: relative;
  z-index: 6;
  flex-shrink: 0;
  display: inline-block;
  margin-top: 18px;
  padding: 12px 28px;
  border-radius: 999px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #1a1400;
  background: linear-gradient(180deg, #ffe566 0%, #d4a017 50%, #b8860b 100%);
  box-shadow:
    0 3px 0 #8a6a10,
    0 8px 24px rgba(0,0,0,0.45),
    0 0 20px rgba(255, 200, 50, 0.25);
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
  text-align: center;
}

.preview-link:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.08);
  box-shadow:
    0 5px 0 #8a6a10,
    0 12px 32px rgba(0,0,0,0.5),
    0 0 28px rgba(255, 200, 50, 0.35);
}



/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  padding: 20px;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #141414;
  border-radius: 20px;
  padding: 32px 28px 28px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.modal h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #f5e6c8;
  text-align: center;
  line-height: 1.3;
}

.modal-sub {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 24px;
  line-height: 1.4;
  text-align: center;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.field input:focus {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.field input:invalid:not(:placeholder-shown) {
  border-color: rgba(255, 80, 80, 0.5);
}

.send-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 20px 0 12px;
  text-align: center;
}

.messengers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.msg-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.msg-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.msg-btn:active {
  transform: translateY(0);
}

.msg-max {
  background: linear-gradient(145deg, #7b5cff, #5a3fd4);
  box-shadow: 0 4px 14px rgba(106, 76, 230, 0.4);
}

.msg-wa {
  background: linear-gradient(145deg, #25d366, #128c7e);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.msg-tg {
  background: linear-gradient(145deg, #2aabee, #229ed9);
  box-shadow: 0 4px 14px rgba(42, 171, 238, 0.35);
}

.msg-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, #e8b923, #c49a1a);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.call-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
}

.call-btn:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
  .top-header {
    height: 18%;
    justify-content: flex-start;
    padding-top: 3%; /* Best-WebMaster.Ru выше на ~5% */
  }
  .site-brand {
    font-size: 0.9rem;
  }
  .page-title {
    font-size: 1.25rem;
  }
  .scene {
    top: 24%;
    bottom: 26%;
  }
  .card {
    --card-w: 150px;
    --card-h: 84px;
  }
  .cta-btn {
    padding: 14px 32px;
  }
  .preview-close {
    top: -40px;
    font-size: 0.85rem;
  }
  .msg-btn {
    padding: 10px 8px;
    font-size: 0.78rem;
  }
  .cta-wrap {
    bottom: 8%;
  }
  .preview-link {
    font-size: 0.82rem;
    padding: 10px 20px;
    margin-top: 14px;
  }
  .preview-inner img {
    max-height: 70vh;
  }
}

@media (min-width: 601px) {
  .top-header {
    justify-content: flex-start;
    padding-top: 1.5%; /* выше, зазор между строками тот же */
    height: 16%;
  }
  .cta-wrap {
    bottom: 5%; /* кнопка ниже на 5% */
  }
  .scene {
    bottom: 24%;
  }
}

@media (min-width: 900px) {
  .card {
    --card-w: 260px;
    --card-h: 146px;
  }
}

@media (min-width: 1400px) {
  .card {
    --card-w: 290px;
    --card-h: 163px;
  }
}
