:root {
  --yellow: #ffed00;
  --black: #000;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #000;
}

body {
  overflow: hidden;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

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

.experience {
  --pointer-x: 0;
  --pointer-y: 0;
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  transition: background 700ms ease, color 500ms ease;
}

.scene,
.scene > div {
  position: absolute;
  inset: 0;
}

.kapikua-shower {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  animation: shower-window 30s linear infinite;
}

.kapikua-star {
  position: absolute;
  top: -16vh;
  left: var(--star-x);
  width: var(--star-length);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, currentColor 58%, #fff 100%);
  box-shadow: 0 0 10px currentColor;
  color: #fff;
  opacity: 0;
  transform: rotate(-34deg);
  animation: star-cross var(--star-duration) var(--star-delay) linear infinite;
}

.kapikua-star:nth-child(3n),
.kapikua-star:nth-child(5n) {
  color: var(--yellow);
}

.preview-heading {
  position: absolute;
  z-index: 20;
  top: clamp(22px, 4vw, 48px);
  left: clamp(22px, 4vw, 56px);
  display: grid;
  gap: 7px;
  letter-spacing: 0.16em;
}

.preview-heading span {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.5;
}

.preview-heading strong {
  font-size: 11px;
  font-weight: 700;
}

.logo-zone {
  position: relative;
  z-index: 10;
  display: grid;
  width: min(72vw, 760px);
  aspect-ratio: 4 / 3;
  place-items: center;
  perspective: 1200px;
}

.brand-stage {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.brand-stage img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.brand-aura {
  position: absolute;
  z-index: 1;
  top: 32%;
  left: 50%;
  width: 6%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  filter: blur(2px);
  transform: translate(-50%, -50%);
}

.concept-copy {
  position: absolute;
  z-index: 20;
  right: clamp(22px, 4vw, 56px);
  bottom: clamp(114px, 15vh, 156px);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-align: right;
}

.concept-copy > span {
  padding-top: 5px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.concept-copy h1 {
  margin: 0;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 620;
  letter-spacing: -0.035em;
}

.concept-copy p {
  margin: 7px 0 0;
  font-size: 11px;
  letter-spacing: 0.03em;
  opacity: 0.52;
}

.concept-switcher {
  position: absolute;
  z-index: 30;
  bottom: clamp(20px, 4vw, 44px);
  left: 50%;
  display: grid;
  width: min(92vw, 820px);
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 999px;
  background: rgb(0 0 0 / 54%);
  box-shadow: 0 14px 50px rgb(0 0 0 / 28%);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.concept-switcher button {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-right: 1px solid rgb(255 255 255 / 10%);
  padding: 15px 20px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.5;
  transition: background 240ms ease, color 240ms ease, opacity 240ms ease;
}

.concept-switcher button:last-child {
  border-right: 0;
}

.concept-switcher button:hover,
.concept-switcher button:focus-visible,
.concept-switcher button.is-active {
  background: rgb(255 255 255 / 8%);
  opacity: 1;
  outline: none;
}

.concept-switcher button.is-active span {
  color: var(--yellow);
}

.concept-switcher span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.concept-switcher strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 01 · Órbita cognitiva */
.scene-orbit {
  background:
    radial-gradient(circle at 50% 46%, #171500 0, #050500 30%, #000 68%),
    #000;
}

.scene-orbit .brand-stage {
  animation: orbit-brand-in 1.75s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform: rotateX(calc(var(--pointer-y) * -5deg)) rotateY(calc(var(--pointer-x) * 7deg));
  transition: transform 180ms ease-out;
}

.scene-orbit .logo-zone,
.scene-network .logo-zone {
  mix-blend-mode: screen;
}

.scene-orbit .brand-aura {
  box-shadow: 0 0 30px rgb(255 237 0 / 46%), 0 0 110px rgb(255 237 0 / 28%);
  animation: aura-pulse 3.8s 1s ease-in-out infinite;
}

.orbit-system {
  display: grid;
  place-items: center;
  transform: translate(calc(var(--pointer-x) * -12px), calc(var(--pointer-y) * -10px));
  transition: transform 280ms ease-out;
}

.orbit-ring {
  position: absolute;
  display: block;
  width: min(70vw, 780px);
  aspect-ratio: 1;
  border: 1px solid rgb(255 237 0 / 17%);
  border-radius: 50%;
  box-shadow: inset 0 0 60px rgb(255 237 0 / 2%);
}

.orbit-ring b {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 20px var(--yellow);
}

.orbit-ring-one {
  animation: orbit-spin 18s linear infinite;
  transform: rotateX(67deg) rotateZ(0deg);
}

.orbit-ring-two {
  width: min(54vw, 620px);
  border-color: rgb(255 255 255 / 12%);
  animation: orbit-spin-reverse 13s linear infinite;
  transform: rotateY(66deg) rotateZ(32deg);
}

.orbit-ring-two b {
  background: #fff;
  box-shadow: 0 0 16px #fff;
}

.orbit-ring-three {
  width: min(82vw, 920px);
  border-color: rgb(255 255 255 / 7%);
  animation: orbit-spin 26s linear infinite;
  transform: rotateX(73deg) rotateZ(-24deg);
}

.orbit-core {
  width: min(36vw, 430px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 237 0 / 10%), transparent 68%);
  filter: blur(14px);
  animation: core-breathe 5s ease-in-out infinite;
}

/* 02 · Portal Kapikúa */
.scene-portal {
  color: #fff;
  background: var(--yellow);
}

.scene-portal .preview-heading {
  color: #000;
}

.scene-portal .logo-zone {
  width: min(62vw, 660px);
  padding: clamp(20px, 3vw, 42px);
  border-radius: clamp(34px, 5vw, 68px);
  background: #000;
  box-shadow:
    0 36px 90px rgb(0 0 0 / 28%),
    0 0 0 1px rgb(0 0 0 / 46%),
    0 0 0 2px rgb(255 255 255 / 78%);
  isolation: isolate;
  animation: portal-card-in 1.5s cubic-bezier(0.16, 1, 0.3, 1) both, portal-float 7s 1.6s ease-in-out infinite;
}

.scene-portal .brand-stage {
  z-index: 2;
  animation: portal-logo-in 1.15s 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.scene-portal .brand-aura {
  box-shadow: 0 0 24px rgb(255 237 0 / 42%), 0 0 72px rgb(255 237 0 / 24%);
  animation: aura-pulse 3.8s ease-in-out infinite;
}

.portal-border {
  display: none;
}

.scene-portal .portal-border {
  position: absolute;
  z-index: 1;
  inset: -4px;
  display: block;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--border-angle),
    transparent 0deg 302deg,
    rgb(255 237 0 / 12%) 310deg,
    var(--yellow) 317deg,
    #fff 323deg 329deg,
    var(--yellow) 335deg,
    rgb(255 237 0 / 10%) 342deg,
    transparent 360deg
  );
  filter:
    drop-shadow(0 0 2px rgb(255 255 255 / 88%))
    drop-shadow(0 0 8px rgb(255 237 0 / 86%));
  -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;
  pointer-events: none;
  animation: portal-border-trace 4.8s linear infinite;
}

.scene-portal .logo-zone::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgb(255 255 255 / 58%);
  box-shadow:
    inset 0 0 0 1px rgb(255 237 0 / 30%),
    inset 0 0 18px rgb(255 237 0 / 7%),
    0 0 12px rgb(255 237 0 / 18%);
  content: "";
  pointer-events: none;
}

.scene-portal .kapikua-star {
  height: 1.5px;
  color: rgb(0 0 0 / 72%);
  box-shadow: 0 0 8px rgb(0 0 0 / 24%);
}

.scene-portal .kapikua-star:nth-child(3n),
.scene-portal .kapikua-star:nth-child(5n) {
  color: #fff;
}

.portal-field {
  overflow: hidden;
}

.portal-sun {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38vw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  filter: blur(90px);
  opacity: 0.24;
  transform: translate(-50%, -50%);
}

.portal-ray {
  position: absolute;
  top: -35%;
  width: 18%;
  height: 170%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 20%), transparent);
  filter: blur(22px);
  transform: rotate(18deg);
  animation: ray-sweep 8s linear infinite;
}

.portal-ray-one {
  left: 5%;
}

.portal-ray-two {
  left: 70%;
  animation-delay: -4.2s;
}

.scene-portal .concept-copy {
  color: #000;
}

.scene-portal .concept-copy > span {
  color: #000;
}

.scene-portal .concept-switcher {
  border-color: rgb(0 0 0 / 18%);
  background: rgb(255 237 0 / 72%);
  color: #000;
}

.scene-portal .concept-switcher button {
  border-color: rgb(0 0 0 / 12%);
}

.scene-portal .concept-switcher button:hover,
.scene-portal .concept-switcher button:focus-visible,
.scene-portal .concept-switcher button.is-active {
  background: rgb(0 0 0 / 10%);
}

.scene-portal .concept-switcher button.is-active span {
  color: #000;
}

/* 03 · Red de conocimiento */
.scene-network {
  background:
    radial-gradient(circle at 50% 42%, rgb(255 237 0 / 10%), transparent 32%),
    linear-gradient(145deg, #000 0, #060606 52%, #0c0b00 100%);
}

.network-field {
  overflow: hidden;
}

.network-grid {
  position: absolute;
  inset: -30%;
  background-image:
    linear-gradient(rgb(255 255 255 / 6%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px),
    linear-gradient(45deg, transparent 49.8%, rgb(255 237 0 / 6%) 50%, transparent 50.2%);
  background-size: 72px 72px, 72px 72px, 144px 144px;
  mask-image: radial-gradient(circle at center, #000 0, transparent 70%);
  transform: perspective(700px) rotateX(58deg) translateY(24%) translateX(calc(var(--pointer-x) * -14px));
  transform-origin: center;
  transition: transform 260ms ease-out;
}

.network-scan {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--yellow), #fff, transparent);
  box-shadow: 0 0 24px rgb(255 237 0 / 70%);
  opacity: 0.6;
  animation: network-scan 5.5s ease-in-out infinite;
}

.network-node {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px #fff;
  animation: node-flicker 3.6s ease-in-out infinite;
}

.network-node:nth-of-type(3n) {
  width: 8px;
  height: 8px;
  background: var(--yellow);
  box-shadow: 0 0 18px var(--yellow);
}

.node-1 { top: 16%; left: 14%; animation-delay: -0.5s; }
.node-2 { top: 28%; left: 78%; animation-delay: -2.3s; }
.node-3 { top: 72%; left: 18%; animation-delay: -1.1s; }
.node-4 { top: 82%; left: 83%; animation-delay: -3.2s; }
.node-5 { top: 48%; left: 7%; animation-delay: -1.9s; }
.node-6 { top: 12%; left: 58%; animation-delay: -2.8s; }
.node-7 { top: 64%; left: 92%; animation-delay: -0.2s; }
.node-8 { top: 88%; left: 54%; animation-delay: -2.5s; }
.node-9 { top: 36%; left: 26%; animation-delay: -1.4s; }
.node-10 { top: 22%; left: 91%; animation-delay: -3.4s; }
.node-11 { top: 76%; left: 34%; animation-delay: -0.8s; }
.node-12 { top: 54%; left: 72%; animation-delay: -2.1s; }

.scene-network .brand-stage {
  animation: network-logo-in 1.8s cubic-bezier(0.16, 1, 0.3, 1) both, network-hover 7s 1.8s ease-in-out infinite;
}

.scene-network .brand-aura {
  box-shadow: 0 0 36px rgb(255 237 0 / 56%), 0 0 130px rgb(255 237 0 / 28%);
  animation: data-pulse 2.8s ease-in-out infinite;
}

@keyframes orbit-brand-in {
  from { opacity: 0; filter: blur(12px); transform: scale(0.82) rotateX(-8deg); }
  to { opacity: 1; filter: blur(0); }
}

@keyframes orbit-spin {
  to { transform: rotateX(67deg) rotateZ(360deg); }
}

@keyframes orbit-spin-reverse {
  to { transform: rotateY(66deg) rotateZ(-328deg); }
}

@keyframes core-breathe {
  50% { opacity: 0.46; transform: scale(1.14); }
}

@keyframes aura-pulse {
  50% { opacity: 0.72; transform: translate(-50%, -50%) scale(1.18); }
}

@keyframes portal-card-in {
  from { opacity: 0; transform: translateY(36px) scale(0.86); border-radius: 50%; }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes portal-logo-in {
  from { opacity: 0; transform: scale(0.74); filter: blur(12px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes portal-float {
  50% { transform: translateY(-10px); box-shadow: 0 52px 110px rgb(0 0 0 / 34%); }
}

@keyframes portal-border-trace {
  to { --border-angle: 360deg; }
}

@keyframes ray-sweep {
  from { transform: translateX(-180%) rotate(18deg); }
  to { transform: translateX(620%) rotate(18deg); }
}

@keyframes network-scan {
  0%, 100% { top: 4%; opacity: 0; }
  16%, 74% { opacity: 0.65; }
  86% { top: 94%; opacity: 0; }
}

@keyframes node-flicker {
  0%, 100% { opacity: 0.22; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes network-logo-in {
  from { opacity: 0; clip-path: inset(0 50% 0 50%); filter: brightness(3) blur(4px); }
  to { opacity: 1; clip-path: inset(0 0 0 0); filter: brightness(1); }
}

@keyframes network-hover {
  50% { transform: translateY(-7px); }
}

@keyframes data-pulse {
  50% { opacity: 0.38; transform: translate(-50%, -50%) scale(1.34); }
}

@keyframes shower-window {
  0% { opacity: 0; }
  1.5% { opacity: 1; }
  31.5% { opacity: 1; }
  33.333% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes star-cross {
  0% {
    opacity: 0;
    transform: translate3d(22vw, -12vh, 0) rotate(-34deg) scaleX(0.4);
  }
  8% { opacity: 0.9; }
  76% { opacity: 0.72; }
  100% {
    opacity: 0;
    transform: translate3d(-72vw, 126vh, 0) rotate(-34deg) scaleX(1);
  }
}

@media (max-width: 760px) {
  .logo-zone,
  .scene-portal .logo-zone {
    width: min(92vw, 620px);
  }

  .scene-portal .logo-zone {
    padding: 14px;
    border-radius: 34px;
  }

  .preview-heading {
    top: 20px;
    left: 20px;
  }

  .concept-copy {
    right: 20px;
    bottom: 116px;
  }

  .concept-copy p {
    max-width: 230px;
  }

  .concept-switcher {
    bottom: 18px;
    width: calc(100vw - 28px);
    border-radius: 24px;
  }

  .concept-switcher button {
    min-height: 64px;
    padding: 12px 8px;
  }

  .concept-switcher strong {
    display: none;
  }

  .concept-switcher span {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
