/* Magora.
   El estudio: el negro del abismo, el rojo de la M, el hueso de las letras romanas y el fuego del ojo.
   La portada es sólo el nombre, vivo: el ojo mira al puntero, parpadea y arde. */
:root {
  --m-red: #bf1f22;
  --m-red-2: #e2402c;
  --m-ember: #f0661f;
  --m-bone: #e8dfcc;

  --bg: #0a0607;
  --bg-2: #120a0b;
  --bg-3: #1a0f10;
  --fg: #f2ece2;
  --fg-2: #b4a99d;
  --fg-3: #7b706a;
  --line: rgba(232, 214, 200, 0.1);
  --line-2: rgba(232, 214, 200, 0.17);
  --edge: rgba(255, 230, 210, 0.08);
  --accent: #e2402c;
  --focus: #ff8a5c;
  --ghost: #2a1a1b;
  --intro-bg: #000;
}
::selection { background: rgba(226, 64, 44, 0.45); }

/* ---------------------------------------------------------------- la intro (lienzo de 640 × 360 a escala entera) */

.intro__canvas { width: min(100vw, calc(100vh * 16 / 9)); height: auto; aspect-ratio: 16 / 9; }
.m-logo__canvas.en-vuelo { position: relative; z-index: 300; transform-origin: 0 0; will-change: transform; }

/* ---------------------------------------------------------------- portada */

/* Sin aislar la portada: el nombre, al volar desde la intro, tiene que pasar por encima de ella. */
.m-hero {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100svh; max-height: 1080px;
  display: grid; align-items: center; text-align: center;
}
.m-hero__fire {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(42% 38% at 50% 46%, rgba(130, 16, 20, 0.34), rgba(130, 16, 20, 0) 72%),
    radial-gradient(80% 55% at 50% 108%, rgba(80, 10, 12, 0.55), rgba(80, 10, 12, 0) 70%);
}
/* Detrás del nombre corre el montaje de los juegos, oscurecido: el nombre sigue siendo lo primero. */
.m-hero__montaje { z-index: -1; }
.m-hero__montaje video { opacity: 0.5; filter: saturate(0.8); }
.m-hero__montaje::after {
  background:
    radial-gradient(58% 52% at 50% 46%, rgba(10, 6, 7, 0.45), rgba(10, 6, 7, 0.9) 100%),
    linear-gradient(180deg, rgba(10, 6, 7, 0.8) 0%, rgba(10, 6, 7, 0) 22%);
}
.m-hero__foot { position: absolute; left: 0; right: 0; bottom: clamp(20px, 3vw, 36px); display: flex; }
.m-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 140px; z-index: -1; background: linear-gradient(0deg, var(--bg), transparent); }
.m-hero__inner { display: grid; justify-items: center; gap: 26px; padding-block: calc(var(--header-h) + 64px) 104px; }
.m-hero__kicker { justify-content: center; }
.m-logo { position: relative; width: min(100%, 820px); display: grid; place-items: center; line-height: 0; margin-block: 10px 6px; }
.m-logo::before {
  content: ""; position: absolute; z-index: -1; left: 60.7%; top: 61%; width: 34%; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 130, 44, 0.5), rgba(191, 31, 34, 0.24) 50%, rgba(191, 31, 34, 0) 76%);
  opacity: calc(0.3 + var(--brillo, 0.6) * 0.45);
}
.m-logo__img, .m-logo__canvas { grid-area: 1 / 1; }
.m-tagline { font: 600 clamp(1.5rem, 2.6vw, 2.25rem)/1.1 var(--f-sans); letter-spacing: -0.035em; color: var(--m-bone); }
.m-hero__lede { margin-inline: auto; text-align: center; max-width: 54ch; }
.m-hero__actions { justify-content: center; margin-top: 4px; }

/* ---------------------------------------------------------------- el ojo */

.m-eye__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(48px, 7vw, 128px); align-items: center; }
.m-eye__stage { position: relative; display: grid; justify-items: center; gap: 26px; padding-block: 32px; }
.m-eye__stage::before {
  content: ""; position: absolute; left: 50%; top: 44%; z-index: -1; width: min(120%, 560px); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(240, 102, 31, 0.2), rgba(191, 31, 34, 0.12) 45%, rgba(191, 31, 34, 0) 72%);
}
.m-eye__canvas { width: 240px; height: 280px; filter: drop-shadow(0 0 40px rgba(240, 102, 31, 0.25)); }
.m-eye__cap { display: flex; gap: 14px; font-size: 0.75rem; color: var(--fg-3); }
.m-eye__cap span + span::before { content: "·"; margin-right: 14px; }
.m-eye__copy { display: grid; gap: 20px; justify-items: start; }
.m-eye__text { color: var(--fg-2); max-width: 56ch; }
.m-eye__hint { display: inline-flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 0.8125rem; color: var(--fg-2); }
.m-eye__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--m-ember); box-shadow: 0 0 0 4px rgba(240, 102, 31, 0.16); animation: pulso 2.2s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { box-shadow: 0 0 0 3px rgba(240, 102, 31, 0.18); } 50% { box-shadow: 0 0 0 7px rgba(240, 102, 31, 0.06); } }
@media (max-width: 900px) { .m-eye__grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .m-eye__canvas { width: 180px; height: 210px; } .m-eye__cap span:first-child { font-size: 0; } .m-eye__cap span:first-child::after { content: "×6"; font-size: 0.75rem; } }

/* ---------------------------------------------------------------- lo que buscamos */

/* Al pasar el puntero, la franja muestra los juegos y cada valor repite sus tomas (montaje.js); la línea de
   arriba del valor elegido avanza con ellas. El video sube sobre el aire de la sección anterior y se
   desvanece en los bordes: apagada, la sección queda igual que siempre. */
.m-values { position: relative; isolation: isolate; }
.m-values__montaje {
  top: calc(var(--section) * -0.7); z-index: -1; opacity: 0; transition: opacity 0.7s var(--ease);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 24%, #000 76%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 24%, #000 76%, transparent);
}
.m-values__montaje video { filter: saturate(0.88); }
.m-values__montaje::after {
  background:
    linear-gradient(90deg, rgba(10, 6, 7, 0.45), rgba(10, 6, 7, 0) 62%),
    linear-gradient(180deg, rgba(10, 6, 7, 0.55), rgba(10, 6, 7, 0.68) 55%, rgba(10, 6, 7, 0.9));
}
.m-values.is-montaje .m-values__montaje { opacity: 1; }
.m-values__foot { position: absolute; left: 0; right: 0; bottom: clamp(28px, 4vw, 56px); display: flex; justify-content: flex-end; }

.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3.6vw, 56px); }
.value { position: relative; display: grid; gap: 14px; align-content: start; padding-top: 24px; border-top: 1px solid var(--line-2); }
.value::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--m-red-2);
  transform-origin: 0 50%; transform: scaleX(var(--avance, 0)); opacity: 0; transition: opacity 0.3s;
}
.value__num { font: 500 0.875rem/1 var(--f-mono); letter-spacing: 0.08em; color: var(--m-red-2); }
.value .h3, .value p { transition: color 0.4s; }
.value p { color: var(--fg-2); }
.value.is-on::before { opacity: 1; }
.value.is-on .h3 { color: var(--m-bone); }
.value.is-on p { color: var(--fg); }
.values:has(.is-on) .value:not(.is-on) :is(.h3, p) { color: var(--fg-3); }
@media (max-width: 860px) { .values { grid-template-columns: 1fr; gap: 36px; } }

/* ---------------------------------------------------------------- juegos */

/* El arte de Steam a escala entera (×2 en escritorio), sin recortar: la caja abraza la imagen. */
.m-game { display: grid; gap: clamp(32px, 4vw, 56px); }
.m-game__stage { width: 100%; }
.m-game__art { display: block; width: fit-content; max-width: 100%; line-height: 0; }
.m-game__art img { transition: filter 0.4s; }
.m-game__art:hover img { filter: brightness(1.08); }
.m-game__copy { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 32px clamp(40px, 6vw, 96px); align-items: start; }
.m-game__main { display: grid; gap: 18px; justify-items: start; }
.m-game__side { display: grid; gap: 28px; }
.m-game__title { font: 400 44px/48px var(--f-pixel); letter-spacing: 0; color: var(--m-bone); }
.m-game__text { color: var(--fg-2); max-width: 56ch; }
@media (max-width: 900px) { .m-game__copy { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- la casa */

.m-house { padding-block: clamp(64px, 8vw, 112px); border-top: 1px solid var(--line); }
.m-house__inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px clamp(28px, 4vw, 56px); align-items: center; }
.m-house__mark { --ghost: transparent; width: 38px; height: auto; aspect-ratio: 317 / 365; }
.m-house__copy { display: grid; gap: 8px; }
.m-house__copy p { color: var(--fg-2); max-width: 62ch; }
.m-house__links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
@media (max-width: 900px) { .m-house__inner { grid-template-columns: 1fr; } }
