/* Stealth Mode.
   Debajo, el mundo de la pantalla de acceso (violeta y la oficina en pixel art). Encima,
   un manto negro que solo se abre bajo el foco del cursor y al paso del radar. */

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

:root {
  --black: #000;
  --white: #fff;
  --mute: rgba(255, 255, 255, .5);
  --faint: rgba(255, 255, 255, .14);
  --violet: #8D6EFF;
  --lime: #B5FF00;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --mx: 50vw; --my: 50vh;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100vh; min-height: 100svh;
  overflow: hidden;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
@media (pointer: fine) { body { cursor: none; } .foot-motion { cursor: none; } }

/* ------------------------------------------------------------ el mundo oculto */
.world {
  position: fixed; inset: 0;
  /* El fondo de la pantalla de acceso. */
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(141, 110, 255, .55) 0%, rgba(141, 110, 255, 0) 55%),
    linear-gradient(150deg, #382B87 0%, #24134D 100%);
  animation: world-in 2.4s .3s var(--ease) both;
}
.world-office {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated; opacity: .6;
}

/* El manto: negro, con el foco y la estela del radar recortados. */
.cloak {
  position: fixed; inset: 0; pointer-events: none;
  background: rgba(0, 0, 0, .88);
  -webkit-mask-image:
    radial-gradient(circle min(24vmax, 380px) at var(--mx) var(--my), rgba(0,0,0,.78) 0%, rgba(0,0,0,.9) 45%, #000 100%),
    conic-gradient(from var(--sweep) at 50% 50%, #000 0deg, rgba(0,0,0,.88) 5deg, #000 80deg, #000 360deg);
  mask-image:
    radial-gradient(circle min(24vmax, 380px) at var(--mx) var(--my), rgba(0,0,0,.78) 0%, rgba(0,0,0,.9) 45%, #000 100%),
    conic-gradient(from var(--sweep) at 50% 50%, #000 0deg, rgba(0,0,0,.88) 5deg, #000 80deg, #000 360deg);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  animation: sweep 11s linear infinite;
}
/* Viñeta y grano: dan cuerpo al negro. */
.grain {
  position: fixed; inset: -50%; pointer-events: none; opacity: .09;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
.hud::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0, 0, 0, .75) 100%);
}

/* ------------------------------------------------------------ HUD */
.corner { position: fixed; width: 18px; height: 18px; border: 0 solid var(--faint); animation: fade 1.6s 1.6s both; }
.corner.tl { top: 28px; left: 28px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 28px; right: 28px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 28px; left: 28px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 28px; right: 28px; border-bottom-width: 1px; border-right-width: 1px; }

.reticle {
  position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none;
  transform: translate3d(var(--rx, 50vw), var(--ry, 50vh), 0);
  opacity: 0; transition: opacity .4s;
}
.has-pointer .reticle { opacity: 1; }
.reticle-ring {
  position: absolute; left: -18px; top: -18px; width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 50%;
}
.reticle-ring::before, .reticle-ring::after {
  content: ""; position: absolute; background: rgba(255, 255, 255, .55);
}
.reticle-ring::before { left: 50%; top: -8px; width: 1px; height: 50px; transform: translateX(-.5px); -webkit-mask: linear-gradient(#000 0 8px, transparent 8px 42px, #000 42px); mask: linear-gradient(#000 0 8px, transparent 8px 42px, #000 42px); }
.reticle-ring::after { top: 50%; left: -8px; height: 1px; width: 50px; transform: translateY(-.5px); -webkit-mask: linear-gradient(90deg, #000 0 8px, transparent 8px 42px, #000 42px); mask: linear-gradient(90deg, #000 0 8px, transparent 8px 42px, #000 42px); }
.reticle-label {
  position: absolute; left: 30px; top: 14px; white-space: nowrap;
  font: 400 10px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--mute);
}
.reticle.is-lost .reticle-ring { border-color: var(--lime); animation: ping 1s var(--ease) infinite; }
.reticle.is-lost .reticle-label { color: var(--lime); }

/* ------------------------------------------------------------ contenido */
.stage {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(40px, 8vh, 96px);
  padding: 96px clamp(24px, 6vw, 96px);
  text-align: center;
}

/* El logo: la silueta isométrica y el nombre al lado. */
.lockup { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 30px); }
.mark-btn {
  appearance: none; background: none; border: 0; padding: 0; margin: 0; color: inherit;
  cursor: pointer; border-radius: 12px; transition: transform .6s var(--ease), filter .6s var(--ease);
}
@media (pointer: fine) { .mark-btn { cursor: none; } }
.mark-btn:hover { transform: translateY(-3px) scale(1.03); filter: drop-shadow(0 0 22px rgba(255, 255, 255, .12)); }
.mark-btn:focus-visible { outline: 1px solid var(--lime); outline-offset: 8px; }
.mark { height: clamp(120px, 13vw, 176px); width: auto; overflow: visible; display: block; }
.lockup-rule { width: 1px; height: clamp(44px, 5vw, 64px); background: linear-gradient(transparent, rgba(255,255,255,.4), transparent); animation: grow-y 1.2s 1.3s var(--ease) both; }
.wordmark { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-transform: uppercase; }
.wordmark-top {
  font-weight: 600; font-size: clamp(20px, 2.1vw, 30px); line-height: 1; letter-spacing: .42em; margin-right: -.42em;
  animation: track-in 1.6s 1.2s var(--ease) both;
}
.wordmark-bottom {
  font-weight: 300; font-size: clamp(10px, .9vw, 13px); line-height: 1; letter-spacing: 1.08em; color: rgba(255, 255, 255, .72);
  animation: track-in 1.6s 1.4s var(--ease) both;
}

/* La silueta: cada faceta entra por separado y un destello la recorre. */
.mark .facet { animation: facet-in 1.1s var(--ease) both; animation-delay: calc(.35s + var(--d, 0) * 1s); }
.mark .ground { animation: fade 1.6s .2s both; }
.mark .shadow { animation: fade 1.4s 1s both; }
.mark .craft { animation: hover 7s ease-in-out 2s infinite; }
.mark .glint { animation: glint 7s 2.4s var(--ease) infinite; }

.headline {
  margin: 0; font-weight: 200;
  font-size: clamp(2.9rem, 8.4vw, 9.5rem);
  line-height: .94; letter-spacing: -.055em;
}
.headline .line { display: block; }
.headline .w {
  display: inline-block; font-style: normal;
  animation: word-in 1.6s var(--ease) both; animation-delay: calc(1.5s + var(--i) * .12s);
}
.headline .accent {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 1.12em; letter-spacing: -.02em; padding-right: .06em;
  background: linear-gradient(100deg, #fff 0%, #fff 38%, #CFC4FF 47%, #fff 52%, #fff 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: word-in 1.6s var(--ease) both, shimmer 6s 3.2s ease-in-out infinite;
  animation-delay: calc(1.5s + var(--i) * .12s), 3.2s;
}

.foot {
  position: fixed; left: 56px; right: 56px; bottom: 50px; z-index: 6;
  display: flex; justify-content: space-between; align-items: center;
  font: 400 10px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--mute);
  animation: fade 1.6s 2.2s both;
}
.foot-status { display: inline-flex; align-items: center; gap: 12px; }
.foot-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); animation: blink 2.4s ease-in-out infinite; }
.foot-motion {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; padding: 8px 0; cursor: pointer; transition: color .3s;
}
.foot-motion:hover, .foot-motion:focus-visible { color: var(--white); }
.foot-motion:focus-visible { outline: 1px solid var(--lime); outline-offset: 6px; }
.foot-motion .when-paused, .foot-motion.is-paused .when-playing { display: none; }
.foot-motion.is-paused .when-paused { display: inline; }

/* ------------------------------------------------------------ el aviso */
.is-briefed .reticle { opacity: 0; }
.intel {
  position: fixed; inset: 0; margin: auto;
  width: min(620px, calc(100vw - 40px)); max-height: calc(100vh - 40px);
  padding: clamp(36px, 6vw, 64px) clamp(28px, 6vw, 64px) clamp(28px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 4px;
  background: linear-gradient(180deg, rgba(14, 12, 20, .92), rgba(4, 4, 6, .96));
  color: var(--white); cursor: auto; overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.intel::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px) saturate(.6); -webkit-backdrop-filter: blur(10px) saturate(.6); }
.intel[open] { animation: intel-in .9s var(--ease) both; }
.intel[open]::backdrop { animation: fade .6s both; }
.intel .corner { position: absolute; animation: none; border-color: rgba(255, 255, 255, .3); width: 12px; height: 12px; }
.intel .corner.tl { top: 12px; left: 12px; } .intel .corner.tr { top: 12px; right: 12px; }
.intel .corner.bl { bottom: 12px; left: 12px; } .intel .corner.br { bottom: 12px; right: 12px; }
.intel-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 40%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(181, 255, 0, .07), transparent);
  animation: scan 3.2s .4s linear infinite;
}
.intel-kicker {
  margin: 0 0 28px; display: flex; align-items: center; gap: 12px;
  font: 400 10px/1 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--mute);
}
.intel-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); animation: blink 1.2s ease-in-out infinite; }
.intel-title {
  margin: 0; font-weight: 200; font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.04; letter-spacing: -.04em;
}
.intel-title em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.intel[open] .intel-title { animation: word-in 1.2s .15s var(--ease) both; }
.intel-actions { margin-top: 40px; display: flex; justify-content: flex-end; }
.intel-close {
  font: 400 10px/1 var(--mono); letter-spacing: .26em; text-transform: uppercase;
  color: var(--black); background: var(--white); border: 0; border-radius: 999px;
  padding: 14px 22px; cursor: pointer; transition: background .3s, transform .3s var(--ease);
}
.intel-close:hover { background: var(--lime); transform: translateY(-1px); }
.intel-close:focus-visible { outline: 1px solid var(--lime); outline-offset: 4px; }
@keyframes intel-in { from { opacity: 0; transform: translateY(16px) scale(.97); filter: blur(10px); } }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(260%); } }

/* Con la animación en pausa, todo quieto. */
.is-still .cloak, .is-still .grain, .is-still .mark .craft, .is-still .mark .glint,
.is-still .headline .accent, .is-still .foot-status i { animation-play-state: paused; }

/* ------------------------------------------------------------ animaciones */
@keyframes sweep { to { --sweep: 360deg; } }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
@keyframes world-in { from { opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes track-in { from { opacity: 0; letter-spacing: 1.4em; filter: blur(8px); } }
@keyframes facet-in { from { opacity: 0; transform: translateY(-14px); } }
@keyframes word-in { from { opacity: 0; transform: translateY(.35em); filter: blur(14px); } }
@keyframes shimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0% 0; } }
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes glint { 0% { transform: skewX(-22deg) translateX(-80px); } 30%, 100% { transform: skewX(-22deg) translateX(420px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(181, 255, 0, .5); } 100% { box-shadow: 0 0 0 16px rgba(181, 255, 0, 0); } }

/* ------------------------------------------------------------ teléfono */
@media (max-width: 640px) {
  .stage { gap: 56px; padding: 88px 22px 120px; }
  .lockup { flex-direction: column; gap: 18px; }
  .lockup-rule { width: 56px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); }
  .wordmark { align-items: center; }
  .headline { font-size: clamp(2.6rem, 13vw, 4rem); }
  .foot { left: 28px; right: 28px; bottom: 40px; }
  .corner.tl, .corner.tr { top: 20px; } .corner.bl, .corner.br { bottom: 20px; }
  .corner.tl, .corner.bl { left: 20px; } .corner.tr, .corner.br { right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
