/* ============================================================
   MIZHGAN.КОМ — main stylesheet
   Built on the MIZHGAN design system (see tokens.css).
   ============================================================ */

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--mz-bg);
  background-image: var(--mz-bg-tile);
  color: var(--mz-ink);
  font-family: var(--mz-font-display);
  height: 100%;
  overflow: hidden;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  box-sizing: border-box;
}

.viewport {
  width: min(100vw, calc(100svh * 1259 / 740));
  max-width: 1259px;
  container-type: inline-size;
  aspect-ratio: 1259 / 740;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1259px;
  height: 740px;
  background-color: var(--mz-bg);
  background-image: var(--mz-bg-tile);
  transform-origin: top left;
  transform: scale(calc(100cqw / 1259px));
}

/* ---------- framing ribbons ---------- */
.ribbon {
  position: absolute;
  left: 0;
  right: 0;
  height: 42px;
  background-image: url('img/c8-55.png');
  background-repeat: repeat-x;
  background-position: 50% 50%;
  z-index: 6;
}
.ribbon.top    { top: 0; }
.ribbon.bottom { bottom: 0; }

/* ---------- decorative assets ---------- */
.gif {
  position: absolute;
  image-rendering: pixelated;
  z-index: 1;
}
.sprite {
  position: absolute;
  background-image: url('img/sprite8.png');
  background-repeat: no-repeat;
  image-rendering: pixelated;
  z-index: 1;
}
.sprite7 {
  position: absolute;
  background-image: url('img/sprite7.png');
  background-repeat: no-repeat;
  image-rendering: pixelated;
  z-index: 1;
  transform-origin: top left;
}
/* portrait + kiss stay one inseparable unit; on desktop the wrapper is
   transparent so the sprites keep their absolute coords against .stage */
.scully-unit { display: contents; }
.sprite18r {
  position: absolute;
  background-image: url('img/sprite18-right.png');
  background-repeat: no-repeat;
  image-rendering: pixelated;
  z-index: 1;
}

/* gentle bob for a few decorative elements (system: motion) */
@media (prefers-reduced-motion: no-preference) {
  .float-a { animation: mz-bob-a 7s ease-in-out infinite; }
  .float-b { animation: mz-bob-b 9s ease-in-out infinite; }
  .float-c { animation: mz-bob-c 8s ease-in-out infinite; }
}
@keyframes mz-bob-a { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes mz-bob-b { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(6px) rotate(1deg); } }
@keyframes mz-bob-c { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ---------- central halo ---------- */
.halo {
  position: absolute;
  top: 150px;
  left: 50%;
  width: 360px;
  height: 360px;
  margin-left: -180px;
  background-image: url('img/c8-35.gif');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  image-rendering: pixelated;
  opacity: 0.5;
  z-index: 2;
  mix-blend-mode: screen;
}

/* ---------- hero ---------- */
.hero {
  position: absolute;
  top: 120px;
  left: 50%;
  width: 680px;
  margin-left: -340px;
  text-align: center;
  z-index: 5;
}
.hero h1 {
  margin: 0;
  font-family: var(--mz-font-display);
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 94px;
  line-height: 1;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: var(--mz-glow-pink);
}
.hero h1 .dot { color: var(--mz-gold); }
.welcome {
  margin: 16px auto 0;
  max-width: 480px;
  font-family: var(--mz-font-ui);
  font-style: italic;
  font-weight: 700;
  font-size: 22px;
  line-height: 28px;
  color: #fff;
  text-shadow: var(--mz-shadow-hard);
}
.tagline {
  margin: 12px auto 0;
  max-width: 430px;
  font-family: var(--mz-font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 17px;
  line-height: 22px;
  color: var(--mz-gold);
  text-shadow: var(--mz-shadow-hard);
}

.kiss-seal {
  display: block;
  margin: 14px auto 14px;
  width: 132px;
  height: 70px;
  background-image: url('img/c8-38.gif');
  background-repeat: no-repeat;
  background-position: 50% 50%;
  image-rendering: pixelated;
}

/* ---------- CTA buttons ---------- */
.cta {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 26px;
  margin-top: 2px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  box-sizing: border-box;
  min-height: 66px;
  padding: 10px 24px;
  text-decoration: none;
  text-align: left;
  border: var(--mz-bevel-pink);
  background: linear-gradient(180deg, var(--mz-pink) 0%, var(--mz-magenta-deep) 100%);
  box-shadow: var(--mz-box-pink);
  transition: var(--mz-press), filter 0.12s ease;
}
.btn .btn-ico {
  font-family: var(--mz-font-ui);
  font-size: 28px;
  line-height: 1;
  color: #fff;
  flex: 0 0 auto;
  text-shadow: 1px 1px 0 #000, 0 0 10px var(--mz-pink-core);
}
.btn .btn-text { display: flex; flex-direction: column; gap: 3px; }
.btn .btn-main {
  font-family: var(--mz-font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #000, 0 0 8px rgba(255,0,102,0.6);
}
.btn .btn-sub {
  font-family: var(--mz-font-ui);
  font-style: italic;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 235, 245, 0.92);
  text-shadow: 1px 1px 0 #000;
}
.btn.tv {
  border: var(--mz-bevel-purple);
  background: linear-gradient(180deg, var(--mz-purple) 0%, var(--mz-purple-deep) 100%);
  box-shadow: var(--mz-box-purple);
}
.btn.tv .btn-ico  { text-shadow: 1px 1px 0 #000, 0 0 10px var(--mz-purple-glow); }
.btn.tv .btn-main { text-shadow: 1px 1px 0 #000, 0 0 8px rgba(204,51,255,0.6); }
.btn.tv .btn-sub  { color: rgba(240, 230, 255, 0.92); }
.btn:hover  { border-style: inset; filter: brightness(1.12); }
.btn:active { transform: translate(2px, 2px); }

/* ---------- fixed overlay controls (outside scaled stage) ---------- */
.music-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font-family: var(--mz-font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #fff;
  cursor: pointer;
  border: var(--mz-bevel-pink);
  background: linear-gradient(180deg, var(--mz-pink) 0%, var(--mz-magenta-deep) 100%);
  box-shadow: var(--mz-box-pink);
  text-shadow: 1px 1px 0 #000;
  transition: var(--mz-press), filter 0.12s ease;
}
.music-toggle:hover { border-style: inset; filter: brightness(1.12); }
.music-toggle:active { transform: translate(2px, 2px); }
.music-toggle .note { font-size: 18px; line-height: 1; }
.music-toggle.on {
  border: var(--mz-bevel-purple);
  background: linear-gradient(180deg, var(--mz-purple) 0%, var(--mz-purple-deep) 100%);
  box-shadow: var(--mz-box-purple);
}
.music-toggle.on .note { animation: mz-note-pulse 0.6s steps(2) infinite; }
@keyframes mz-note-pulse { 0% { transform: translateY(0); } 100% { transform: translateY(-3px); } }

/* sparkle trail */
.mz-sparkle {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  font-size: 16px;
  line-height: 1;
  color: var(--mz-amber);
  text-shadow: 0 0 6px var(--mz-pink-core), 0 0 10px var(--mz-purple-glow);
  animation: mz-spark 0.7s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes mz-spark {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(80deg) translateY(14px); }
}
@media (prefers-reduced-motion: reduce) {
  .mz-sparkle { display: none; }
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 720px) {
  html, body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body {
    display: block;
    min-height: 100svh;
  }

  .viewport {
    width: 100%;
    max-width: none;
    aspect-ratio: auto;
    container-type: normal;
    box-shadow: none;
    overflow: visible;
    min-height: 100svh;
  }

  .stage {
    position: static;
    width: 100%;
    height: auto;
    min-height: 100svh;
    transform: none;
    padding: 56px 12px 72px;
    box-sizing: border-box;
    display: flex;
    flex-flow: row wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 6px 10px;
  }

  .stage > .gif,
  .stage > .sprite,
  .stage > .sprite7,
  .stage > .sprite18r {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 0;
    transform: none !important;
    animation: none !important;
    flex: 0 0 auto;
  }

  /* keep the sacred sprites on mobile; hide filler hearts */
  .stage > .sprite { display: none; }

  /* portrait + kiss: stay one overlapping unit as a single flex item */
  .scully-unit {
    display: block;
    position: relative;
    width: 82px;
    height: 88px;
    flex: 0 0 auto;
    margin: 0;
  }
  .scully-unit .sprite7 {
    position: absolute !important;
    animation: none !important;
  }
  .scully-unit .sprite7:nth-child(1) { top: 0 !important;  left: 0 !important;  transform: scale(0.75) !important; }
  .scully-unit .sprite7:nth-child(2) { top: 9px !important; left: 42px !important; transform: scale(0.75) !important; }

  /* keep only the hero + buttons + car + Scully + 3 dancers on mobile;
     hide everything else so the page fits one screen (no scroll) */
  .stage > img[src*="c8-44"],
  .stage > img[src*="c8-12"],
  .stage > img[src*="c8-46"],
  .stage > img[src*="c8-45"],
  .stage > img[src*="c8-4."],
  .stage > img[src*="c6-11"],
  .stage > img[src*="c7-27"],
  .stage > img[src*="c6-10"],
  .stage > .mz-add,
  .stage > .mz-hide-m {
    display: none;
  }

  .ribbon { position: absolute; height: 32px; z-index: 6; }
  .ribbon.bottom { display: none; }
  .halo { display: none; }

  .hero {
    position: static;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    margin: 8px 0 18px;
    padding: 0 8px;
    box-sizing: border-box;
    order: -1;
  }
  .hero h1 { font-size: clamp(36px, 12vw, 64px); letter-spacing: 1px; }
  .welcome { margin-top: 14px; font-size: 19px; line-height: 24px; max-width: 100%; }
  .tagline { font-size: 17px; line-height: 22px; max-width: 100%; }
  .kiss-seal { margin: 16px auto 14px; transform: scale(1.1); }

  .cta {
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }
  .btn { width: 100%; justify-content: flex-start; }

  .music-toggle { left: 50%; transform: translateX(-50%); bottom: 12px; }
  .music-toggle:active { transform: translateX(-50%) translateY(2px); }
}
