/* Paleta de Identidad visual de Dipplos. */
:root {
  --bg: #13111C;
  --bg-deep: #0E0C15;
  --text: #ECEAF3;
  --muted: #C9C5D6;
  --faint: #8F8AA3;
  --violet: #8B5CF6;
  --violet-deep: #6D28D9;
  --lavender: #DDD6FE;
  --lilac: #C4B5FD;
  --card: #241E38;
  --rail: #17151F;
  --line: rgba(196, 181, 253, 0.14);
  --focus: #C4B5FD;
  --live: #34D399;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- fondo */
#scene {
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0;
  background: radial-gradient(ellipse at 74% 50%, #2A1D4E 0%, #13111C 45%, #0E0C15 100%);
}
/* Oscurece el lado del texto para que se lea sobre el movimiento. */
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(14, 12, 21, 0.78) 0%, rgba(14, 12, 21, 0.5) 30%, rgba(14, 12, 21, 0.1) 50%, rgba(14, 12, 21, 0) 60%),
    linear-gradient(0deg, rgba(14, 12, 21, 0.8) 0%, rgba(14, 12, 21, 0) 20%);
}
.grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 7s steps(8) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------- etiquetas HUD */
.hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.hud-tag {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 11px 9px;
  border: 1px solid rgba(196, 181, 253, 0.28);
  border-radius: 8px;
  background: rgba(19, 17, 28, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.45s ease;
  will-change: transform, opacity;
}
.hud-tag.on { opacity: 1; }
.hud-k {
  font-size: 10px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--lilac);
  display: flex; align-items: center; gap: 7px;
}
.hud-k::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 1px; }
/* El cuadradito dice qué es el bloque, con el color que tiene en el mapa. */
.hud-tag[data-type="ai"] .hud-k::before { background: var(--violet); box-shadow: 0 0 8px rgba(139, 92, 246, 0.9); }
.hud-tag[data-type="human"] .hud-k::before { background: var(--lavender); }
/* Tarjeta del centro: lo que se comparte pasa por el hueco del mapa. */
.hud-tag.hub { align-items: center; text-align: center; padding: 9px 14px 10px; border-color: rgba(196, 181, 253, 0.5);
  background: rgba(36, 30, 56, 0.72); box-shadow: 0 0 34px rgba(139, 92, 246, 0.35); }
.hud-tag.hub .hud-k::before { display: none; }
/* Qué hace el bloque, con el cuadradito del color del recurso con el que interactúa. */
.hud-a {
  display: flex; align-items: center; gap: 7px;
  margin-top: 2px;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.hud-a::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--res, var(--lilac)); box-shadow: 0 0 8px var(--res, var(--lilac)); }

/* Colores de los cuatro recursos del centro (paleta de Identidad visual). */
[data-res="data"] { --res: #8B5CF6; }
[data-res="knowledge"] { --res: #C4B5FD; }
[data-res="learnings"] { --res: #ECEAF3; }
[data-res="files"] { --res: #6D28D9; }

/* Nombres de los recursos del centro (los átomos se dibujan en WebGL). */
.core {
  position: absolute; left: 0; top: 0;
  opacity: 0; transition: opacity 0.8s ease;
  will-change: transform;
}
.core.on { opacity: 1; }
.core-label {
  display: block;
  font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); white-space: nowrap;
  text-shadow: 0 1px 8px rgba(14, 12, 21, 0.9);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.core.hit .core-label { color: #fff; text-shadow: 0 0 12px var(--res), 0 1px 8px rgba(14, 12, 21, 0.9); }
.core-caption {
  position: absolute; left: 0; top: 0;
  padding: 5px 10px;
  font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap;
  border: 1px solid rgba(196, 181, 253, 0.35); border-radius: 999px;
  background: rgba(19, 17, 28, 0.7);
  opacity: 0; transition: opacity 0.45s ease;
}
.core-caption.on { opacity: 1; }
.hud-v { font-size: 13px; font-weight: 700; color: var(--text); }
/* Mira sobre el bloque que sigue la etiqueta. */
.hud-dot {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px;
  border: 1.5px solid rgba(236, 234, 243, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(196, 181, 253, 0.8), inset 0 0 6px rgba(196, 181, 253, 0.6);
  opacity: 0; transition: opacity 0.45s ease;
  will-change: transform, opacity;
}
.hud-dot::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px;
  border-radius: 50%; background: #fff;
}
.hud-dot.on { opacity: 1; animation: reticle 2.4s ease-in-out infinite; }
@keyframes reticle { 50% { box-shadow: 0 0 22px rgba(196, 181, 253, 1), inset 0 0 8px rgba(196, 181, 253, 0.8); } }
.hud-line {
  position: absolute; left: 0; top: 0; height: 0;
  border-top: 1.5px dashed rgba(196, 181, 253, 0.75);
  transform-origin: 0 0;
  opacity: 0; transition: opacity 0.45s ease;
  will-change: transform, width, opacity;
}
.hud-line.on { opacity: 1; }

/* --------------------------------------------------------------- página */
.page {
  position: relative; z-index: 3;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 26px clamp(20px, 5vw, 76px) 22px;
  pointer-events: none;
}
.page a, .page form, .page button, .page input, .page .done { pointer-events: auto; }

.top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--text); text-decoration: none;
  font-size: 23px; font-weight: 800; letter-spacing: -0.02em;
}
.brand:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: 8px; }
.status {
  margin: 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 15px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 21, 31, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* En escritorio app.js lo ubica cerca del centro, a la izquierda de los anillos (ver placeStatus). */
.status.is-placed { position: absolute; left: 0; top: 0; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: ping 2.2s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.75); }
  80%, 100% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
}

.hero { display: flex; align-items: center; }
.copy { width: min(640px, 100%); }
/* Lugar de la animación en celular; en escritorio la animación ocupa el costado derecho. */
.stage { display: none; }

.tag, .done-k {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0;
  padding: 8px 13px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--lilac);
}
/* Esquinas tipo visor. */
.tag::before, .tag::after, .done-k::before, .done-k::after {
  content: ""; position: absolute; width: 9px; height: 9px;
  border: 1.5px solid rgba(196, 181, 253, 0.65);
}
.tag::before, .done-k::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.tag::after, .done-k::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.tag-sq { width: 7px; height: 7px; background: var(--violet); box-shadow: 0 0 12px rgba(139, 92, 246, 0.9); }

h1 {
  margin: 22px 0 22px;
  font-size: clamp(40px, min(5.4vw, 7.6vh), 88px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-wrap: balance;
}
.shine {
  background: linear-gradient(100deg, #DDD6FE 0%, #A78BFA 30%, #8B5CF6 50%, #C4B5FD 70%, #DDD6FE 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: -220% 0; } }

.lead {
  margin: 0;
  max-width: 600px;
  font-size: clamp(16px, 1.22vw, 19px);
  line-height: 1.55;
  font-weight: 500;
  color: var(--muted);
}
.lead p { margin: 0; color: var(--text); }
/* Los tres diferenciales, con un cuadradito violeta como el de las etiquetas. */
.diffs-k { margin: 14px 0 0 !important; font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lilac) !important; }
.diffs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.diffs li { position: relative; padding-left: 20px; font-size: 0.92em; line-height: 1.5; }
.diffs li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 7px; height: 7px; background: var(--violet); box-shadow: 0 0 10px rgba(139, 92, 246, 0.85);
}
.diffs strong { color: var(--text); font-weight: 800; }

/* ------------------------------------------------------------ formulario */
.signup { margin-top: 34px; }
.field {
  position: relative;
  display: flex; gap: 8px;
  max-width: 560px;
  padding: 7px;
  border-radius: 18px;
  background: rgba(23, 21, 31, 0.74);
  border: 1px solid rgba(196, 181, 253, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px -24px rgba(109, 40, 217, 0.65);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
/* Borde que gira alrededor del campo. */
.field::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--spin, 0deg), transparent 0deg, rgba(196, 181, 253, 0.9) 40deg, transparent 90deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 5s linear infinite;
  pointer-events: none;
}
@property --spin { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --spin: 360deg; } }
.field:focus-within {
  border-color: rgba(196, 181, 253, 0.6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18), 0 24px 70px -20px rgba(139, 92, 246, 0.8);
}
.field.bad { animation: shake 0.42s ease; border-color: rgba(244, 114, 182, 0.7); }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.field input {
  flex: 1; min-width: 0;
  padding: 13px 14px;
  border: 0; outline: 0; background: transparent;
  color: var(--text);
  font: inherit; font-size: 16px; font-weight: 600;
}
.field input::placeholder { color: var(--faint); }
.field button {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border: 0; border-radius: 12px;
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  color: #fff;
  font: inherit; font-size: 15px; font-weight: 800; white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.field button::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg);
  animation: sweep 3.8s ease-in-out infinite;
}
@keyframes sweep { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.field button:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -10px rgba(139, 92, 246, 0.95); filter: brightness(1.08); }
.field button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.field button:disabled { cursor: progress; filter: saturate(0.6); }
.btn-arrow { transition: transform 0.2s ease; }
.field button:hover .btn-arrow { transform: translateX(3px); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.msg { min-height: 1.4em; margin: 12px 2px 0; font-size: 14px; font-weight: 600; color: #F9A8D4; }
.note { margin: 2px 2px 0; max-width: 520px; font-size: 13px; line-height: 1.55; color: var(--faint); }

.done { margin-top: 34px; padding: 22px 24px; max-width: 560px; border-radius: 18px; border: 1px solid rgba(196, 181, 253, 0.3); background: rgba(36, 30, 56, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.done-t { margin: 14px 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.done-s { margin: 0; color: var(--muted); line-height: 1.55; }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(38, 35, 51, 0.9);
  font-size: 12.5px; color: var(--faint);
}
.foot-link { white-space: nowrap; color: var(--muted); font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(196, 181, 253, 0.35); transition: color 0.2s ease, border-color 0.2s ease; }
.foot-link:hover { color: var(--text); border-color: var(--lilac); }
.foot-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

/* ------------------------------------------------------------- entrada */
.d-0 { --d: 0; } .d-1 { --d: 1; } .d-2 { --d: 2; } .d-3 { --d: 3; } .d-4 { --d: 4; } .d-5 { --d: 5; } .d-6 { --d: 6; }
.reveal { animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(0.35s + var(--d) * 0.11s); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* Pantallas de escritorio bajas: todo entra sin scroll. */
@media (min-width: 861px) and (max-height: 980px) {
  .page { gap: 16px; padding-top: 20px; padding-bottom: 16px; }
  h1 { margin: 16px 0 16px; }
  .signup, .done { margin-top: 24px; }
}

/* -------------------------------------------------------------- celular */
@media (max-width: 860px) {
  /* En celular el orden es: acceso anticipado, la frase, el formulario, la animación, la
     descripción y el pie. */
  .veil { background: none; }
  .page { gap: 18px; padding-top: 18px; }
  .hero { align-items: stretch; padding-top: 22px; }
  .copy { display: flex; flex-direction: column; }
  .copy > .tag { order: 1; align-self: flex-start; }
  .copy > h1 { order: 2; margin: 18px 0 4px; font-size: clamp(38px, 11vw, 52px); }
  .copy > .signup, .copy > .done { order: 3; margin-top: 18px; }
  .copy > .stage { order: 4; display: block; height: min(112vw, 500px); margin: 8px calc(-1 * clamp(20px, 5vw, 76px)) 0; }
  .copy > .lead { order: 5; margin-top: 4px; }
  .status { padding: 7px 11px; font-size: 9.5px; letter-spacing: 0.14em; }
  .brand { font-size: 20px; }
  .field { flex-direction: column; }
  .field button { justify-content: center; padding: 15px 18px; }
  .hud-tag { padding: 6px 9px 7px; gap: 2px; border-radius: 7px; }
  .hud-k { font-size: 8.5px; letter-spacing: 0.14em; gap: 5px; }
  .hud-v { font-size: 11.5px; }
  .hud-dot { width: 14px; height: 14px; left: -7px; top: -7px; }
  .hud-a { font-size: 10.5px; }
  .core-label { font-size: 7.5px; letter-spacing: 0.04em; }
  .core-caption { font-size: 9.5px; padding: 3px 8px; }
}

/* Celulares chicos: el aviso de lista abierta entra en una línea. */
@media (max-width: 400px) {
  .status { white-space: nowrap; padding: 6px 9px; font-size: 8.5px; letter-spacing: 0.1em; gap: 7px; }
  .brand { font-size: 18px; gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .done { animation: none; }
  .grain, .field::before, .field button::after, .shine, .status-dot { animation: none; }
}
