
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Space+Grotesk:wght@400;500;700&display=swap');

/* ========================================
   YY / 001 — IDENTIDAD VISUAL
======================================== */

:root {
  color-scheme: dark;
  --red: #c2081a;
  --ink: #090909;
  --white: #eeeeee;
  --muted: #999999;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ========================================
   PANTALLAS
======================================== */

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(28px, 7vw, 64px) 8vw;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 28px;
}

.screen.active {
  display: flex;
}

/* ========================================
   TIPOGRAFÍA
======================================== */

h1,
h2,
.number,
.secret,
.last {
  font-family: 'Special Elite', cursive;
  font-weight: 400;
}

h1,
h2 {
  font-size: clamp(28px, 7vw, 58px);
  line-height: 1.17;
  max-width: 680px;
  margin: 0;
  letter-spacing: -0.045em;
}

/* ========================================
   PANTALLA 1 — ENTRADA
======================================== */

.hero-mark {
  width: clamp(120px, 30vw, 240px);
  height: clamp(120px, 30vw, 240px);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-7deg);
  margin-bottom: 3vh;
}

.hero-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* ========================================
   BOTONES
======================================== */

button {
  cursor: pointer;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 5px;
}

.circle-btn {
  position: relative;
  padding: 24px 38px;
  margin: 20px 0;
  font-size: 16px;
  letter-spacing: 0.07em;
  font-weight: 700;
  isolation: isolate;
}

.circle-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--red);
  border-radius: 51% 49% 53% 47% /
                 45% 55% 45% 55%;
  transform: rotate(-8deg);
  z-index: -1;
  pointer-events: none;
}

.circle-btn span {
  color: var(--red);
  margin-left: 8px;
}

.circle-btn:active {
  transform: scale(0.97);
}

.text-btn {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ========================================
   CONTADOR
======================================== */

.counter {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2em;
  position: absolute;
  bottom: 22px;
  margin: 0;
}

/* ========================================
   PANTALLA 2 — BUZÓN
======================================== */

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #777777;
  position: absolute;
  top: 34px;
}

textarea {
  width: min(100%, 560px);
  height: 190px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #4a4a4a;
  border-radius: 0;
  color: var(--white);
  padding: 18px 8px;
  font: 17px/1.6 'Space Grotesk', sans-serif;
  resize: vertical;
}

textarea::placeholder {
  color: #777777;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  max-width: 560px;
  color: #aaaaaa;
  font-size: 12px;
  line-height: 1.5;
}

.consent input {
  accent-color: var(--red);
  margin-top: 3px;
  flex-shrink: 0;
}

.hint {
  font-size: 11px;
  color: #777777;
  max-width: 360px;
  line-height: 1.6;
}

/* ========================================
   PANTALLA 3 — IDENTIFICACIÓN
======================================== */

.card {
  width: min(100%, 440px);
  aspect-ratio: 4 / 5;
  background: #080808;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #181818;
  overflow: hidden;
}

/* Logotipos en las esquinas */

.corner {
  position: absolute;
  top: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.corner.left {
  left: 20px;
}

.corner.right {
  right: 20px;
}

.card-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Texto central */

.card-main {
  width: 100%;
  padding: 0 12px;
}

.card-main h2 {
  font-size: clamp(22px, 5vw, 34px);
}

.number {
  color: var(--red);
  font-size: clamp(58px, 15vw, 104px);
  line-height: 1.4;
  letter-spacing: -0.055em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ========================================
   ACCIONES
======================================== */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.actions button {
  font-size: 12px;
  letter-spacing: 0.05em;
  border: 1px solid #555555;
  padding: 14px 18px;
  min-width: 130px;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.actions button:hover {
  border-color: var(--red);
  background: rgba(194, 8, 26, 0.08);
}

/* ========================================
   PANTALLA 4 — CLAVE SECRETA
======================================== */

.secret {
  color: var(--red);
  font-size: clamp(28px, 7vw, 54px);
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.last {
  font-size: 26px;
  margin-top: 20px;
}

/* ========================================
   MENSAJES DE ERROR
======================================== */

.error {
  position: fixed;
  bottom: 5px;
  left: 5%;
  width: 90%;
  color: #ff8d96;
  text-align: center;
  font-size: 13px;
  pointer-events: none;
  z-index: 10;
}

/* ========================================
   ADAPTACIÓN A CELULARES
======================================== */

@media (max-width: 480px) {

  .screen {
    padding: 40px 6vw;
    gap: 24px;
  }

  h1,
  h2 {
    font-size: clamp(27px, 8vw, 38px);
  }

  .hero-mark {
    width: 145px;
    height: 145px;
    margin-bottom: 10px;
  }

  .card {
    width: min(100%, 360px);
  }

  .corner {
    width: 26px;
    height: 26px;
    top: 18px;
  }

  .corner.left {
    left: 18px;
  }

  .corner.right {
    right: 18px;
  }

  .card-main h2 {
    font-size: clamp(20px, 6vw, 28px);
  }

  .number {
    font-size: clamp(48px, 14vw, 72px);
  }

  .actions button {
    min-width: 120px;
    padding: 13px 14px;
  }

  .secret {
    font-size: clamp(25px, 7vw, 38px);
  }
}

/* ========================================
   PANTALLAS GRANDES
======================================== */

@media (min-width: 800px) {

  .screen {
    gap: 36px;
  }

  .card {
    max-width: 440px;
  }
}

/* Accesibilidad: menos movimiento */

@media (prefers-reduced-motion: reduce) {

  .actions button {
    transition: none;
  }
}



/* ========================================
   YY / 001 — LA Y ESTÁ VIVA
======================================== */

/* Contenedor del logotipo */
#welcome .hero-mark {
  position: relative;
  isolation: isolate;
  animation: yy-breathe 6s ease-in-out infinite;
  will-change: transform;
}

/* Nuestro logotipo original */
#welcome .hero-logo {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;

  animation: yy-heat 5.5s ease-in-out infinite;
}

/* Resplandor detrás de la Y */
#welcome .hero-mark::before {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: 0;

  background: url("/assets/y-logo.svg")
    center / contain no-repeat;

  filter: blur(15px);
  opacity: 0;

  animation: yy-glow 5.5s ease-in-out infinite;
  pointer-events: none;
}

/* Movimiento sigiloso */
@keyframes yy-breathe {
  0%, 100% {
    transform: rotate(-7deg) translateY(0) scale(1);
  }

  50% {
    transform: rotate(-6deg) translateY(-5px)
      scale(1.025);
  }
}

/* Luz interna */
@keyframes yy-heat {
  0%, 100% {
    filter: brightness(0.95);
  }

  45% {
    filter: brightness(1.18)
      drop-shadow(0 0 5px rgba(194, 8, 26, 0.25));
  }

  60% {
    filter: brightness(1.08);
  }
}

/* Resplandor rojo */
@keyframes yy-glow {
  0%, 100% {
    opacity: 0.04;
  }

  45% {
    opacity: 0.65;
  }

  65% {
    opacity: 0.18;
  }
}

/* Destello ocasional */
@keyframes yy-shine {
  0%, 28% {
    transform: translateX(-160%);
  }

  43% {
    transform: translateX(160%);
  }

  100% {
    transform: translateX(160%);
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  #welcome .hero-mark,
  #welcome .hero-logo,
  #welcome .hero-mark::before,
  #welcome .hero-mark::after {
    animation: none;
  }
}


/* ========================================
   YY / 001 — TRANSICIONES CINEMATOGRÁFICAS
======================================== */

/* Entrada suave de cada pantalla */
.screen.active {
  animation: yy-screen-in 0.65s ease-out both;
}

@keyframes yy-screen-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Salida hacia la oscuridad */
.screen.yy-leaving {
  display: flex;
  animation: yy-screen-out 0.28s ease-in both;
  pointer-events: none;
}

@keyframes yy-screen-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-7px);
  }
}

/* Aparición de la tarjeta */
#identity.active .card {
  animation: yy-card-appear 0.9s ease-out both;
}

@keyframes yy-card-appear {
  from {
    opacity: 0;
    transform: scale(0.965);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Número emergiendo lentamente */
#identity.active .number {
  animation: yy-number-reveal 1.15s
    cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes yy-number-reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Aparición de la clave */
#key.active .secret {
  animation: yy-secret-reveal 1s ease-out both;
}

@keyframes yy-secret-reveal {
  from {
    opacity: 0;
    letter-spacing: 0.2em;
  }

  to {
    opacity: 1;
    letter-spacing: 0.06em;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .screen.active,
  .screen.yy-leaving,
  #identity.active .card,
  #identity.active .number,
  #key.active .secret {
    animation: none;
  }
}

