:root {
  --bg: #ffffff;
  --ink: #0b0b0c;
  --muted: #6b6b70;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem;
  text-align: center;
}

h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.4rem, 9vw, 6.5rem);
  letter-spacing: -0.035em;
  line-height: 1;
  overflow-wrap: anywhere;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 1.5s both;
}

p {
  margin: 0;
  /* el padding izquierdo compensa el espacio final del interletrado y centra el texto */
  padding-left: 0.32em;
  font-size: clamp(0.7rem, 1.6vw, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 1.8s both;
}

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

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#dot {
  position: fixed;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--ink);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: transform;
}

#dot.on { opacity: 1; }

/* Solo con ratón o trackpad y con JavaScript activo: el punto sustituye al cursor */
@media (hover: hover) and (pointer: fine) {
  html.js, html.js * { cursor: none; }
  /* durante la entrada de las puertas el cursor es el normal (el punto queda tapado por ellas) */
  html.js .doors, html.js .doors * { cursor: default; }
}

/* ------------------------------------------------------------------ */
/* Puertas de entrada (ODD-001, estilo A). Solo CSS: sin JavaScript.      */
/* Línea de tiempo: 0–1,3 s rendija de luz · 0,9–2,2 s se abren ·        */
/*                  1,5–2,7 s aparece el texto · 2,6 s se retiran.       */
/* ------------------------------------------------------------------ */
.doors {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  animation: doors-gone 0s linear 2.6s forwards;
}

@keyframes doors-gone { to { visibility: hidden; } }

.door {
  position: absolute;
  background: #0b0b0c;
  will-change: transform;
  backface-visibility: hidden;
  animation-duration: 1.3s;
  animation-delay: 0.9s;
  animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
  animation-fill-mode: forwards;
}

.seam {
  position: absolute;
  background: #fff;
  box-shadow: 0 0 18px 2px rgba(255, 255, 255, 0.35);
  animation: seam-v 1.3s cubic-bezier(0.65, 0, 0.35, 1) both;
}

/* Dos puertas que se deslizan hacia los lados, con una rendija de luz en el centro */
.door { top: 0; bottom: 0; width: 50%; }
.door-l { left: 0; animation-name: slide-l; }
.door-r { right: 0; animation-name: slide-r; }
.seam { left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -0.5px; transform-origin: center; }

@keyframes slide-l { to { transform: translateX(-101%); } }
@keyframes slide-r { to { transform: translateX(101%); } }
@keyframes seam-v {
  0%   { transform: scaleY(0); opacity: 1; }
  55%  { transform: scaleY(1); opacity: 1; }
  75%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* Preferencia de reducir movimiento: sin puertas ni animaciones, la landing aparece directamente */
@media (prefers-reduced-motion: reduce) {
  .doors { display: none; }
  h1, p { animation: none; }
}
