/* ── Variables ── */
:root {
  --color-white: #ffffff;
  --color-black: #111111;
  --color-red: #cd122d;
  --color-red-dark: #a00e24;
  --color-red-soft: rgba(205, 18, 45, 0.08);
  --color-gray: #5c5c5c;
  --color-gray-light: #f4f4f5;
  --color-border: rgba(0, 0, 0, 0.08);
  --font-main: "Outfit", system-ui, -apple-system, sans-serif;
  --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-red: 0 12px 32px rgba(205, 18, 45, 0.18);
  --video-max-height: clamp(220px, 52vh, 58vh);
  --video-max-width: min(440px, 68vw);
  --video-stage-padding: clamp(1rem, 3vw, 2rem);
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-main);
  background: var(--color-white);
  color: var(--color-black);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ── Reference background (layout guide, subtle) ── */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.page-bg__reference {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.page-bg__reference.is-loaded {
  opacity: 0.06;
}

.bg-accent--grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(205, 18, 45, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(205, 18, 45, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, black 10%, transparent 70%);
}

/* ── Header ── */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem 0.75rem;
  background: transparent;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header__diamond {
  width: 14px;
  height: 14px;
  background: var(--color-red);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.header__logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--color-black);
}

/* ── Sticky notes row ── */
.notes-row {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 1rem 0.5rem;
}

.notes-row .decor {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
}

.decor--cream {
  background: #f5e6c8;
  color: #5c4a1e;
  transform: rotate(-2deg);
}

/* ── Main layout ── */
.main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(160px, 1.25fr) minmax(220px, 460px) minmax(160px, 1.25fr);
  gap: clamp(1.5rem, 3.5vw, 3rem);
  align-items: center;
  width: 100%;
  max-width: 1280px;
}

.hero__side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 260px;
}

.hero__side--left {
  align-items: flex-end;
  padding-right: 0.5rem;
}

.hero__side--right {
  align-items: flex-start;
  padding-left: 0.5rem;
}

/* ── Characters ── */
.character-wrap {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.1));
}

.character {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.character--space {
  max-width: min(320px, 100%);
}

.character--space.character--compact {
  max-width: min(260px, 100%);
}

.character--desk {
  max-width: min(300px, 100%);
}

/* ── Floating decor ── */
.decor {
  position: absolute;
  z-index: 1;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  user-select: none;
}

.decor--note {
  padding: 0.45rem 0.65rem;
  transform: rotate(-4deg);
}

.decor--pink {
  top: 8%;
  left: 10%;
  background: #ffb3c7;
  color: #7a1030;
}

.decor--yellow {
  bottom: 18%;
  left: 0;
  background: #ffe566;
  color: #6b5500;
  transform: rotate(3deg);
}

.decor--blue {
  top: 12%;
  right: 5%;
  background: #a8d8ff;
  color: #0a3d6b;
  transform: rotate(5deg);
}

.decor--tool {
  bottom: 10%;
  right: 12%;
  font-size: 1.4rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.hero__side--right .decor--blue {
  right: auto;
  left: 0;
}

.hero__side--right .decor--tool {
  right: auto;
  left: 15%;
}

/* ── Center content ── */
.hero__center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.hero__title {
  font-size: clamp(1.55rem, 3.5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-black);
}

.hero__subtitle {
  font-size: clamp(0.88rem, 1.6vw, 1rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-gray);
  max-width: 440px;
  padding: 0 0.25rem;
  margin-bottom: 0.15rem;
}

/* ── Video (sin contorno) ── */
.video-stage {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--video-stage-padding) 0;
  margin: 0.15rem 0;
}

.video-wrapper {
  position: relative;
  width: fit-content;
  max-width: var(--video-max-width);
  max-height: var(--video-max-height);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.video-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: var(--video-max-height);
}

.hero__video {
  display: block;
  width: auto;
  height: auto;
  max-width: var(--video-max-width);
  max-height: var(--video-max-height);
  object-fit: contain;
  object-position: center;
  border: none;
  outline: none;
  border-radius: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.hero__video.is-ready {
  opacity: 1;
}

.video-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: transparent;
  border-radius: 0;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 2;
}

.video-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.video-loader__bar {
  width: min(180px, 50%);
  height: 2px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.video-loader__progress {
  display: block;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--color-red-dark), var(--color-red));
  border-radius: 100px;
  animation: loader-bar 1.4s ease-in-out infinite;
}

.video-loader__dots {
  display: flex;
  gap: 0.45rem;
}

.video-loader__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-red);
  animation: loader-dots 1.2s ease-in-out infinite;
}

.video-loader__dots span:nth-child(2) { animation-delay: 0.2s; }
.video-loader__dots span:nth-child(3) { animation-delay: 0.4s; }

/* ── Status ── */
.hero__status {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.45rem;
  max-width: 420px;
  margin-top: 0.1rem;
}

.hero__status-icon {
  font-size: 0.95rem;
  line-height: 1.5;
  flex-shrink: 0;
}

.hero__status-text {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--color-gray);
  text-align: left;
}

/* ── Button ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  padding: 0.75rem 2rem;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
  background: var(--color-red);
  border: 2px solid var(--color-red);
  border-radius: 100px;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.btn-primary:hover {
  background: var(--color-red-dark);
  border-color: var(--color-red-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary span {
  margin-right: 0.35rem;
}

/* ── Features ── */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
  max-width: 900px;
  padding-top: 0.5rem;
}

.feature {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.feature__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.feature p {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--color-gray);
}

.feature strong {
  color: var(--color-black);
  font-weight: 600;
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.1rem;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--color-border);
}

.footer p {
  font-size: 0.72rem;
  color: var(--color-gray);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer strong {
  color: var(--color-black);
  font-weight: 700;
}

/* ── Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  animation: fade-in 0.85s ease forwards;
}

.fade-in--delay-1 { animation-delay: 0.08s; }
.fade-in--delay-2 { animation-delay: 0.22s; }
.fade-in--delay-3 { animation-delay: 0.36s; }
.fade-in--delay-4 { animation-delay: 0.5s; }
.fade-in--delay-5 { animation-delay: 0.64s; }

@keyframes fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.float {
  animation: float 6s ease-in-out infinite;
}

.float--slow {
  animation-duration: 8s;
}

.float--delay-1 { animation-delay: 0.5s; }
.float--delay-2 { animation-delay: 1s; }
.float--delay-3 { animation-delay: 1.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes loader-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

@keyframes loader-dots {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__center { order: 1; }
  .hero__side--left { order: 2; }
  .hero__side--right { order: 3; }

  .hero__side {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    min-height: auto;
  }

  .hero__side--left,
  .hero__side--right {
    align-items: center;
    justify-content: center;
  }

  .character--space,
  .character--desk {
    max-width: min(240px, 40vw);
  }

  .character--space.character--compact {
    max-width: min(200px, 36vw);
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 1rem 1.25rem 0.5rem;
  }

  .notes-row {
    gap: 0.5rem;
  }

  .notes-row .decor {
    font-size: 0.55rem;
    padding: 0.35rem 0.5rem;
  }

  .main {
    padding: 1rem 1rem 1.5rem;
    gap: 1.5rem;
  }

  .hero__side {
    flex-direction: column;
  }

  .hero__side--left,
  .hero__side--right {
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .character--space,
  .character--desk {
    max-width: min(220px, 72vw);
  }

  .character--space.character--compact {
    max-width: min(190px, 65vw);
  }

  .video-stage {
    padding: 0.75rem 0;
  }

  .video-wrapper {
    max-width: min(380px, 90vw);
  }

  .hero__video {
    max-height: min(48vh, 320px);
  }

  .hero__status {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero__status-text {
    text-align: center;
  }

  .btn-primary {
    width: 100%;
    max-width: 300px;
  }

  .features {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .feature p {
    font-size: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .float {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .video-loader__progress,
  .video-loader__dots span {
    animation: none;
  }
}
