:root {
  --fondo: #140c05;
  --texto: #fff;
  --acento: #f3d36b;
  --ancho-marco: min(100%, 64rem, calc(50svh * 1.5));
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--texto);
  background: var(--fondo);
}

.portada {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 32px 20px;
  overflow: hidden;
}

/* La misma foto, muy desenfocada, rellena la pantalla */
.reflejo {
  position: absolute;
  inset: -10%;
  background: url("img/fondo.jpg") center / cover no-repeat;
  filter: blur(36px) saturate(1.2) brightness(0.5);
  animation: respirar 14s ease-in-out infinite alternate;
}

/* La foto, entera, como una copia enmarcada */
.marco {
  position: relative;
  width: var(--ancho-marco);
  aspect-ratio: 1600 / 1066;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transform: rotate(-1.5deg);
  animation: entrada 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both, flotar 7s 1.1s ease-in-out infinite alternate;
}

.marco img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Cinta de obra bajo la foto: rayas que avanzan */
.cinta {
  position: relative;
  z-index: 1;
  width: 130%;
  height: 26px;
  margin-top: 28px;
  background: repeating-linear-gradient(-45deg, var(--fondo) 0 14px, var(--acento) 14px 28px);
  background-size: 39.6px 39.6px;
  transform: rotate(2.5deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: aparecer 1s 0.5s ease-out both, avanzar 1.6s 1.5s linear infinite;
}

.contenido {
  position: relative;
  z-index: 1;
  max-width: 80rem;
  margin-top: 36px;
  text-align: center;
  animation: aparecer 1.2s 0.8s ease-out both;
}

.linea {
  display: block;
  width: 56px;
  height: 2px;
  margin: 0 auto 18px;
  background: var(--acento);
  transform-origin: center;
  animation: trazo 1.2s 1.2s ease-out both;
}

h1 {
  font-size: clamp(1.7rem, min(8.5vw, 9svh), 4.5rem);
  font-weight: 400;
  line-height: 1.04;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

@keyframes entrada {
  from { opacity: 0; transform: translateY(40px) rotate(-4deg) scale(0.94); }
  to { opacity: 1; transform: rotate(-1.5deg); }
}

@keyframes flotar {
  from { transform: translateY(0) rotate(-1.5deg); }
  to { transform: translateY(-8px) rotate(-0.8deg); }
}

@keyframes avanzar {
  to { background-position: 39.6px 0; }
}

@keyframes respirar {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}

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

@keyframes trazo {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (min-width: 768px) {
  .cinta { width: 115%; height: 30px; margin-top: 48px; }
  .contenido { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .reflejo,
  .marco,
  .cinta,
  .contenido,
  .linea {
    animation: none;
  }
}
