:root {
  --paper: #f7f5f2;
  --ink: #141210;
  --muted: #6e6761;
  --red: #ad0f30;
  --red-bright: #c81b40;
  --red-deep: #7e0a22;
  --line: rgba(20, 18, 16, 0.1);
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(173, 15, 48, 0.16);
  color: var(--red-deep);
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 999px;
}

/* ---------- Fondo ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1300px 850px at 50% -12%, #fffdfb 0%, rgba(255, 253, 251, 0) 62%),
    linear-gradient(180deg, #f8f6f3 0%, #f5f3ef 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.orb--red {
  top: -22vmax;
  left: -16vmax;
  width: 48vmax;
  height: 48vmax;
  background: radial-gradient(circle at 32% 32%, rgba(173, 15, 48, 0.3), rgba(173, 15, 48, 0) 68%);
  animation: drift 26s ease-in-out infinite alternate;
}

.orb--silver {
  right: -22vmax;
  bottom: -26vmax;
  width: 54vmax;
  height: 54vmax;
  background: radial-gradient(circle at 60% 40%, rgba(146, 155, 166, 0.42), rgba(146, 155, 166, 0) 70%);
  animation: drift 32s ease-in-out infinite alternate-reverse;
}

.orb--glow {
  top: 38%;
  left: 50%;
  width: 42vmax;
  height: 30vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%);
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(20, 18, 16, 0.07) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* ---------- Escenario ---------- */
.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.4rem, 3.5vh, 2.2rem);
  width: 100%;
  min-height: 100svh;
  padding: clamp(1.25rem, 4vw, 2.75rem);
}

/* ---------- Tarjeta ---------- */
.card {
  position: relative;
  isolation: isolate;
  width: min(720px, 100%);
  padding: clamp(2.25rem, 5.5vw, 3.6rem) clamp(1.35rem, 5vw, 3.5rem) clamp(2.5rem, 5vw, 3.2rem);
  text-align: center;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(255, 255, 255, 0.74) 55%,
    rgba(255, 255, 255, 0.88) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: clamp(26px, 4vw, 38px);
  box-shadow:
    0 40px 90px -40px rgba(20, 18, 16, 0.36),
    0 12px 30px -18px rgba(20, 18, 16, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  overflow: hidden;
  animation: card-in 1s var(--ease) both;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 80% at 50% -20%, rgba(173, 15, 48, 0.07), transparent 58%);
  pointer-events: none;
}

.brand {
  --logo-w: clamp(186px, 42vw, 292px);
  position: relative;
  display: flex;
  justify-content: center;
}

/* Halo que nace con el logo */
.brand::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78%;
  height: 190%;
  transform: translate(-50%, -50%) scale(0.72);
  background: radial-gradient(ellipse at center, rgba(173, 15, 48, 0.07), transparent 68%);
  opacity: 0;
  pointer-events: none;
  animation: halo-in 2.2s var(--ease) 0.2s both;
}

/* Destello que recorre el logo una sola vez */
.brand::after {
  content: "";
  position: absolute;
  top: -4%;
  bottom: -4%;
  left: calc(50% - var(--logo-w) / 2);
  width: calc(var(--logo-w) * 0.45);
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.95) 50%,
    transparent 100%
  );
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-220%) skewX(-14deg);
  animation: logo-sheen 1.4s ease-in-out 1.3s both;
}

.brand img {
  position: relative;
  display: block;
  width: var(--logo-w);
  height: auto;
  -webkit-mask-image: linear-gradient(90deg, #000 40%, rgba(0, 0, 0, 0.45) 54%, transparent 68%);
  mask-image: linear-gradient(90deg, #000 40%, rgba(0, 0, 0, 0.45) 54%, transparent 68%);
  -webkit-mask-size: 280% 100%;
  mask-size: 280% 100%;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: logo-reveal 1.5s cubic-bezier(0.65, 0, 0.35, 1) 0.15s both;
}

/* ---------- Texto ---------- */
h1 {
  margin: clamp(1.7rem, 4vw, 2.25rem) 0 0;
  font-size: clamp(2.3rem, 6.6vw, 4.05rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
  color: var(--ink);
}

h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.06em;
  letter-spacing: -0.015em;
  padding-right: 0.05em;
  color: var(--red);
  background: linear-gradient(100deg, var(--red-bright) 0%, var(--red) 45%, var(--red-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  max-width: 44ch;
  margin: 1.15rem auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  font-weight: 400;
  line-height: 1.75;
  text-wrap: pretty;
}

/* ---------- Acciones ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: clamp(1.6rem, 4vw, 2.15rem);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease);
}

.btn svg {
  flex: none;
  display: block;
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright) 0%, var(--red) 55%, var(--red-deep) 100%);
  box-shadow:
    0 16px 30px -14px rgba(173, 15, 48, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.32) 48%, transparent 64%);
  transform: translateX(-130%);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 38px -16px rgba(173, 15, 48, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn--primary:hover::after {
  transform: translateX(130%);
}

.btn--ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
}

.btn--ghost svg {
  color: var(--red);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  color: var(--red);
  background: #fff;
  border-color: rgba(173, 15, 48, 0.32);
  box-shadow: 0 14px 26px -18px rgba(20, 18, 16, 0.4);
}

.hint {
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  opacity: 0.82;
}

/* ---------- Barra de progreso decorativa ---------- */
.card__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(20, 18, 16, 0.06);
  overflow: hidden;
  animation: fade-in 1.4s 0.6s both;
}

.card__bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, var(--red) 45%, var(--red-bright) 55%, transparent);
  animation: scan 6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* ---------- Pie ---------- */
.foot {
  margin: 0;
  color: rgba(20, 18, 16, 0.42);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.6;
  text-align: center;
  text-transform: uppercase;
  animation: fade-in 1.2s 0.5s both;
}

.foot span {
  color: rgba(173, 15, 48, 0.7);
}

/* ---------- Animaciones ---------- */
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes logo-reveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.965);
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

@keyframes halo-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes logo-sheen {
  0% {
    opacity: 0;
    transform: translateX(-220%) skewX(-14deg);
  }
  12% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(340%) skewX(-14deg);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4vmax, 3vmax, 0) scale(1.07);
  }
  100% {
    transform: translate3d(-2vmax, 5vmax, 0) scale(0.97);
  }
}

@keyframes scan {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(300%);
  }
}

.card > :not(.card__bar):not(.brand) {
  animation: rise 0.9s var(--ease) both;
}

h1 {
  animation-delay: 0.95s;
}
.lede {
  animation-delay: 1.08s;
}
.actions {
  animation-delay: 1.2s;
}
.hint {
  animation-delay: 1.3s;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 340px;
    margin-inline: auto;
  }

  .btn {
    width: 100%;
    padding-block: 1rem;
  }

  .foot {
    font-size: 0.6rem;
    letter-spacing: 0.11em;
  }
}

@media (max-height: 720px) and (min-width: 561px) {
  .card {
    padding-block: 2rem 2.5rem;
  }

  .brand {
    --logo-w: clamp(170px, 34vh, 250px);
  }

  h1 {
    font-size: clamp(2.1rem, 5.4vw, 3.3rem);
  }
}

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

  .card,
  .card > :not(.card__bar) {
    opacity: 1;
    transform: none;
  }
}
