/* ==========================================================================
   PAGE TRANSITION — covers the viewport between pages, 8bit D pulses
   while the next page loads underneath, then fades away once ready.
   ========================================================================== */

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--c-black);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1; /* visible by default on load — avoids a flash of raw content */
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.page-transition.is-hidden {
  opacity: 0;
}

.page-transition__mark {
  position: relative;
  width: 110px;
  height: 117px; /* matches the 8bit mark's real aspect ratio (1634x1745) */
}

.page-transition__mark-fill {
  position: absolute;
  inset: 0;
  -webkit-mask-image: url('../images/d-marks/8bit.png');
  mask-image: url('../images/d-marks/8bit.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.page-transition__mark-fill--base {
  background: #4a4a4a;
}

.page-transition__mark-fill--accent {
  background: var(--c-neon);
  clip-path: inset(100% 0 0 0);
  animation: pageTransitionFill 1.6s ease-in-out infinite;
}

@keyframes pageTransitionFill {
  0%   { clip-path: inset(100% 0 0 0); }
  50%  { clip-path: inset(0% 0 0 0); }
  100% { clip-path: inset(100% 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .page-transition__mark-fill--accent { animation: none; clip-path: inset(0% 0 0 0); }
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */

@keyframes modalPop {
  0%   { opacity: 0; transform: scale(0.92) translateY(28px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes heroReveal {
  0%   { opacity: 0; filter: blur(18px); transform: translateY(22px); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--ticker-distance, -50%)); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CONTACT MODAL
   ========================================================================== */

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s linear, visibility 0.15s;
}

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

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.contact-modal__panel {
  position: relative;
  z-index: 1;
  width: min(1320px, 94vw);
  min-height: clamp(480px, 64vw, 622px);
  max-height: 90vh;
  overflow: hidden;
  background: var(--c-black);
  color: var(--c-white);
  border: 1px solid #3c3c3c;
  border-radius: var(--radius-panel);
  padding: clamp(40px, 5vw, 64px) clamp(28px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Base state for the entrance animation */
  opacity: 0;
  transform: scale(0.92) translateY(28px);
  animation: none;
}

.contact-modal.is-open .contact-modal__panel {
  animation: modalPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* The glow blooms in slightly after the panel settles, rather than
   everything snapping in at once — gives the entrance a layered, built
   feel instead of a flat fade. */
.contact-modal__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(140% 107.13% at 50% 10%, rgba(0, 0, 0, 0) 37.41%, #72119B 69.27%, #FFFFFF 100%);
  opacity: 0;
  transform: scaleY(0.85);
  transform-origin: bottom center;
}

.contact-modal.is-open .contact-modal__glow {
  animation: modalGlowBuild 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

@keyframes modalGlowBuild {
  0%   { opacity: 0; transform: scaleY(0.85); }
  100% { opacity: 1; transform: scaleY(1); }
}

.contact-modal__close {
  position: absolute;
  top: clamp(20px, 3vw, 40px);
  right: clamp(20px, 3vw, 56px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px 11px 15px;
  border-radius: var(--radius-circle);
  background: var(--c-white);
  color: var(--c-black);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.42px;
  text-transform: uppercase;
  transition: background 0.2s var(--ease-soft), transform 0.2s var(--ease-soft);
}

.contact-modal__close:hover {
  background: var(--c-neon);
  transform: scale(1.04);
}

.contact-modal__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 380px) 1fr;
  gap: clamp(40px, 8vw, 160px);
  align-items: start;
}

.contact-modal__eyebrow {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  letter-spacing: 2px;
  margin-bottom: 18px;
}

.contact-modal__headline {
  font-weight: 700;
  font-size: clamp(34px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -1.92px;
  color: var(--c-white);
}

.contact-modal__details {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
  min-width: 0;
}

.contact-modal__row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-modal__label {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.contact-modal__value {
  display: block;
  font-weight: 400;
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: -0.72px;
  color: var(--c-white);
  overflow-wrap: anywhere;
}

a.contact-modal__value {
  transition: color 0.2s var(--ease-soft);
}

a.contact-modal__value:hover {
  color: var(--c-neon);
}

@media (max-width: 720px) {
  .contact-modal__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .contact-modal__close span {
    display: none; /* icon only on small screens, keeps the pill compact */
  }
  .contact-modal__close {
    padding: 11px;
  }
}
