/* ==========================================================================
   MAINFRAME • CREATIVE AGENCY HERO & MOUSE-SCRUB VIDEO (PESTAÑA PRUEBA)
   ========================================================================== */

:root {
  --font-heading: 'HelveticaNowDisplay-Medium', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'HelveticaNowDisplayW01-Rg', 'Helvetica Neue', Arial, sans-serif;
}

body[data-current-world="prueba"] {
  font-family: var(--font-body);
}

body[data-current-world="prueba"] #spheres-canvas-container {
  display: block !important;
  opacity: 1 !important;
  z-index: 12 !important;
  pointer-events: none !important;
}

#view-prueba {
  position: relative;
  width: 100%;
  min-height: 100vh;
  height: auto;
  overflow: visible;
  font-family: var(--font-body);
  color: #FFFFFF;
  background-color: transparent;
  z-index: auto;
}

#view-prueba:not(.is-active) .mainframe-video-bg,
#view-prueba:not(.is-active) .mainframe-canvas-bg,
#view-prueba:not(.is-active) .mainframe-navbar,
#view-prueba:not(.is-active) .mainframe-video-overlay,
#view-prueba:not(.is-active) .mainframe-mobile-overlay,
#view-prueba:not(.is-active) #multiverse-ambient-warp,
#view-prueba:not(.is-active) #multiverse-chromatic-flash,
#view-prueba:not(.is-active) #multiverse-hud-capsule {
  display: none !important;
}

/* Background Full-Screen Mouse-Scrub Canvas (60FPS Instant Eye Scrubbing) */
.mainframe-canvas-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  display: block;
  pointer-events: none;
  transition: opacity 0.35s ease-out;
}

/* Background Full-Screen Mouse-Scrub Video */
.mainframe-video-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  object-fit: cover;
  object-position: 70% center;
  pointer-events: none;
  opacity: 0; /* Smooth fallback, canvas provides instant zero-latency rendering */
}

/* Dark subtle vignette over video to enhance typography readability */
.mainframe-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 30% 50%, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
}

/* ==========================================================================
   MAINFRAME NAVBAR (FIXED, Z-INDEX: 10)
   ========================================================================== */
.mainframe-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .mainframe-navbar {
    padding: 20px 32px;
  }
}

/* Logo Left */
.mainframe-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #FFFFFF;
}

.mainframe-logo-text {
  font-family: var(--font-heading);
  font-size: 21px;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  font-weight: 500;
}

@media (min-width: 640px) {
  .mainframe-logo-text {
    font-size: 26px;
  }
}

.mainframe-logo-asterisk {
  font-size: 25px;
  color: #FFFFFF;
  user-select: none;
  letter-spacing: -0.02em;
  line-height: 1;
}

@media (min-width: 640px) {
  .mainframe-logo-asterisk {
    font-size: 30px;
  }
}

/* Desktop Navigation Links (Center, hidden below md) */
.mainframe-nav-links {
  display: none;
  align-items: center;
  font-size: 23px;
  color: #FFFFFF;
  font-weight: 400;
}

@media (min-width: 768px) {
  .mainframe-nav-links {
    display: flex;
  }
}

.mainframe-nav-link {
  color: #FFFFFF;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mainframe-nav-link:hover {
  opacity: 0.6;
}

.mainframe-nav-separator {
  color: #FFFFFF;
  margin-right: 0.35em;
  user-select: none;
}

/* Desktop CTA (Right, hidden below md) */
.mainframe-nav-cta {
  display: none;
  font-size: 23px;
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

@media (min-width: 768px) {
  .mainframe-nav-cta {
    display: block;
  }
}

.mainframe-nav-cta:hover {
  opacity: 0.6;
}

/* Mobile Hamburger Button (Visible below md) */
.mainframe-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 20;
}

@media (min-width: 768px) {
  .mainframe-hamburger {
    display: none;
  }
}

.mainframe-bar {
  width: 24px;
  height: 2px;
  background-color: #FFFFFF;
  transition: all 300ms ease;
  transform-origin: center;
}

/* Hamburger active transformation */
.mainframe-hamburger.is-open .mainframe-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mainframe-hamburger.is-open .mainframe-bar:nth-child(2) {
  opacity: 0;
}

.mainframe-hamburger.is-open .mainframe-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Fullscreen Overlay (z-index: 9) */
.mainframe-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 32px;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mainframe-mobile-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .mainframe-mobile-overlay {
    display: none !important;
  }
}

.mainframe-mobile-link {
  font-size: 32px;
  font-weight: 500;
  color: #FFFFFF;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mainframe-mobile-link:hover {
  opacity: 0.6;
}

.mainframe-mobile-cta {
  font-size: 32px;
  font-weight: 500;
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==========================================================================
   HERO SECTION (Z-INDEX: 1)
   ========================================================================== */
.mainframe-hero-section {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 48px;
  padding-left: 20px;
  padding-right: 20px;
  overflow: hidden;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .mainframe-hero-section {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (min-width: 768px) {
  .mainframe-hero-section {
    justify-content: center;
    padding-bottom: 0;
    padding-left: 40px;
    padding-right: 40px;
  }
}

.mainframe-content-container {
  display: none !important;
}

/* 1. Blurred intro label */
.mainframe-blurred-label {
  pointer-events: none;
  user-select: none;
  margin-bottom: 20px;
  font-size: clamp(18px, 4vw, 26px);
  line-height: 1.3;
  font-weight: 400;
  color: #FFFFFF;
  filter: blur(4px);
  -webkit-filter: blur(4px);
}

@media (min-width: 640px) {
  .mainframe-blurred-label {
    margin-bottom: 24px;
  }
}

/* 2. Typewriter text */
.mainframe-typewriter-text {
  color: #FFFFFF;
  margin-bottom: 20px;
  font-size: clamp(18px, 4vw, 26px);
  line-height: 1.35;
  font-weight: 400;
  min-height: 54px;
}

@media (min-width: 640px) {
  .mainframe-typewriter-text {
    margin-bottom: 24px;
  }
}

/* Blinking cursor while typing */
.mainframe-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: #FFFFFF;
  vertical-align: middle;
  margin-left: 2px;
  animation: mainframeBlink 1s step-end infinite;
}

@keyframes mainframeBlink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* 3. Action pill buttons */
.mainframe-action-pills-container {
  display: flex;
  flex-wrap: wrap;
  row-gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.mainframe-action-pills-container.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* White Pill Buttons */
.mainframe-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #FFFFFF;
  color: #000000;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 9999px;
  font-size: 13px;
  padding: 0.3em 16px;
  margin: 0 0.2em 0.4em;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

@media (min-width: 640px) {
  .mainframe-pill-btn {
    font-size: 15px;
    padding: 0.3em 20px;
  }
}

.mainframe-pill-btn:hover {
  background-color: #000000;
  color: #FFFFFF;
}

/* Outline Pill Button (Reach us) */
.mainframe-pill-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: #FFFFFF;
  border: 1px solid #FFFFFF;
  border-radius: 9999px;
  font-size: 13px;
  padding: 0.3em 16px;
  margin: 0 0.2em 0.4em;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  gap: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
  position: relative;
}

@media (min-width: 640px) {
  .mainframe-pill-outline {
    font-size: 15px;
    padding: 0.3em 20px;
    gap: 12px;
  }
}

.mainframe-pill-outline:hover {
  background-color: #FFFFFF;
  color: #000000;
}

.mainframe-email-text {
  text-decoration: underline;
  text-underline-offset: 1px;
}

.mainframe-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
}

/* Copy notification toast */
.mainframe-copy-toast {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mainframe-copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mouse Scrub Hint on Top Right of Hero */
.mainframe-scrub-hint {
  position: absolute;
  bottom: 24px;
  right: 32px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.05em;
  user-select: none;
  pointer-events: none;
}

/* ==========================================================================
   MAINFRAME MULTIVERSE ENGINE & CHROMATIC SHIFTS
   ========================================================================== */

/* Ambient Atmospheric Warp Layer (Behind everything in Prueba) */
#multiverse-ambient-warp {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 25%, #162E3B 0%, #0E1A24 45%, #070B10 100%);
  transition: background 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: background;
}

/* Chromatic Light Flash Layer ("Cambio de mundo por un instante") */
#multiverse-chromatic-flash {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1.0);
  will-change: opacity, transform;
}

#multiverse-chromatic-flash.is-flashing {
  animation: multiverseFlashPulse 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes multiverseFlashPulse {
  0% {
    opacity: 0.92;
    transform: scale(1.05);
    filter: blur(0px);
  }
  30% {
    opacity: 0.75;
    transform: scale(1.02);
    filter: blur(4px);
  }
  100% {
    opacity: 0;
    transform: scale(1.0);
    filter: blur(12px);
  }
}

/* Multiverse Floating HUD Capsule */
#multiverse-hud-capsule {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  z-index: 1000;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(10, 15, 24, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
}

#multiverse-hud-capsule.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.hud-capsule-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00F0FF;
  box-shadow: 0 0 10px currentColor;
  animation: hudDotPulse 1.4s ease-in-out infinite alternate;
}

@keyframes hudDotPulse {
  from { transform: scale(0.85); opacity: 0.7; }
  to { transform: scale(1.3); opacity: 1; }
}

.hud-capsule-icon {
  font-size: 16px;
}

.hud-capsule-info {
  display: flex;
  flex-direction: column;
}

.hud-capsule-title {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hud-capsule-badge {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.08em;
}

/* Scroll Down Cue on Hero */
.mainframe-scroll-down-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
}

.mainframe-scroll-down-cue:hover {
  color: #FFFFFF;
  transform: translateX(-50%) translateY(3px);
}

.mainframe-scroll-arrow {
  width: 18px;
  height: 18px;
  animation: bounceDown 1.8s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Multiverse Interactive Universe Selector Bar */
.multiverse-selector-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 28px auto 0;
  max-width: 900px;
}

.multiverse-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.multiverse-nav-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  color: #FFFFFF;
}

.multiverse-nav-pill.is-active[data-universe="tef"],
.multiverse-nav-pill:hover[data-universe="tef"] {
  border-color: #E11D48;
  background: rgba(225, 29, 72, 0.22);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(225, 29, 72, 0.35);
}

.multiverse-nav-pill.is-active[data-universe="ielts"],
.multiverse-nav-pill:hover[data-universe="ielts"] {
  border-color: #2563EB;
  background: rgba(37, 99, 235, 0.22);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
}

.multiverse-nav-pill.is-active[data-universe="vector"],
.multiverse-nav-pill:hover[data-universe="vector"] {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.22);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.multiverse-nav-pill.is-active[data-universe="morpho"],
.multiverse-nav-pill:hover[data-universe="morpho"] {
  border-color: #7C3AED;
  background: rgba(124, 58, 237, 0.22);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.multiverse-nav-pill.is-active[data-universe="pulse"],
.multiverse-nav-pill:hover[data-universe="pulse"] {
  border-color: #D97706;
  background: rgba(217, 119, 6, 0.22);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.35);
}

/* Stacking Deck in Prueba View */
#prueba-stacking-deck {
  background: transparent !important;
  position: relative;
  z-index: 10;
  padding-top: 100px;
}

#prueba-stacking-deck .stacking-card {
  position: sticky;
  top: calc(260px + var(--card-index) * 18px);
  max-width: 1020px;
  margin: 0 auto;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: linear-gradient(145deg, rgba(19, 23, 32, 0.92) 0%, rgba(10, 13, 18, 0.97) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 20px 26px 22px;
}

#prueba-stacking-deck .stacking-card-bento {
  height: 350px;
}

#prueba-stacking-deck .stacking-card.is-universe-active {
  transform: translateY(-4px) scale(1.01);
}
