@font-face {
  font-family: "Mulish";
  src: url("assets/Font-Mulish/Mulish-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #f4f2f8;
  --muted: #d7d3e4;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Mulish", system-ui, sans-serif;
  color: var(--ink);
  background: #14101f;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ---------- Background (static, zoom on load, parallax on scroll) ---------- */
.bg, .bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
.bg { overflow: hidden; }
.bg__img {
  position: absolute;
  inset: -8%;                 /* oversized so parallax translate never shows edges */
  background: url("assets/bg_image.png") center / cover no-repeat;
  animation: bgZoom 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.bg-overlay { z-index: -1; background: rgba(0, 0, 0, 0.75); }

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

/* ---------- Scrim (darken everything except active thumb) ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
body.has-active .scrim { opacity: 1; pointer-events: auto; }

/* ---------- Content column (centered; scrolls when taller than viewport) ---------- */
.content {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;   /* safe: falls back to top when overflowing, no clip */
  text-align: center;
  padding: 96px 24px;
}

/* Vertical rhythm (per design spec) */
.title { margin-top: 28px; }
.subtext { margin-top: 10px; }
.thumbs { margin-top: 110px; }
.footer__note { margin-top: 110px; }
.footer__email { margin-top: 20px; }
.footer__copy { margin-top: 120px; }

/* ---------- Logo ---------- */
.logo {
  background: none;
  border: 0;
  cursor: pointer;
  line-height: 0;
  padding: 0;
}
.logo img {
  width: 141px;
  height: 141px;
  border-radius: 50%;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}
.logo.swing img { animation: swing 0.7s ease; }
@keyframes swing {
  0% { transform: rotate(0); }
  30% { transform: rotate(-24deg); }
  60% { transform: rotate(16deg); }
  100% { transform: rotate(0); }
}

/* ---------- Type ---------- */
.title {
  font-weight: 900;
  font-size: 48px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.subtext {
  font-weight: 200;
  font-size: 24px;
  line-height: 1.4;
  max-width: 44ch;
  color: var(--muted);
}

/* ---------- Thumbnails ---------- */
.thumbs {
  display: flex;
  gap: 22px;
}
.thumb {
  position: relative;
  width: 200px;
  height: 200px;
  cursor: pointer;
  outline: none;
  animation: thumbAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.thumbs .thumb:nth-child(1) { animation-delay: 0.34s; }
.thumbs .thumb:nth-child(2) { animation-delay: 0.44s; }
@keyframes thumbAppear {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}

.thumb__img {
  position: relative;
  z-index: 2;                      /* above .links so buttons emerge from behind it */
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

/* Game title above the enlarged preview */
.thumb__title {
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-bottom: 44px;             /* clears the scaled image (30px) + gap */
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.thumb.active .thumb__title { opacity: 1; transform: translate(-50%, 0); }
.thumb:focus-visible .thumb__img { box-shadow: 0 0 0 3px var(--ink); }

/* Active: raise above scrim, scale up (200 -> 260), reveal store buttons */
.thumb.active { z-index: 30; }
.thumb.active .thumb__img { transform: scale(1.3); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6); }

/* Store buttons: circular, appear from under the thumbnail.
   top:100% keeps the hit-area touching the (scaled) image so PC hover doesn't
   drop when the cursor crosses the gap toward the buttons.
   padding-top clears the scaled overflow (30px) + 20px gap from the thumbnail. */
.links {
  position: absolute;
  top: 100%;
  left: 50%;
  padding-top: 50px;
  display: flex;
  gap: 20px;                       /* 20px between buttons */
  z-index: 1;                      /* behind .thumb__img: buttons slide out from behind it */
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -80px) scale(0.6);   /* start tucked behind the thumbnail */
  transition: opacity 0.35s ease 0.05s, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
}
.thumb.active .links {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}
.links a {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}
.links a:hover { transform: translateY(-3px); }
.links img { width: 56%; height: 56%; object-fit: contain; }

/* ---------- Footer text ---------- */
.footer__note {
  font-weight: 200;
  font-size: 24px;
  line-height: 1.4;
  max-width: 50ch;
  color: var(--muted);
}
.footer__email { font-weight: 200; font-size: 24px; }
.footer__email a { color: var(--ink); }
.footer__copy { font-weight: 200; font-size: 12px; color: var(--muted); opacity: 0.8; }

/* ---------- Load-in (text) ---------- */
.content > *:not(.thumbs) {
  animation: riseIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.title { animation-delay: 0.1s; }
.subtext { animation-delay: 0.18s; }
.footer__note { animation-delay: 0.26s; }
.footer__email { animation-delay: 0.32s; }
.footer__copy { animation-delay: 0.38s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .content { padding: 72px 24px; }
  .logo img { width: 100px; height: 100px; }
  .title { font-size: 24px; }
  .subtext { font-size: 16px; max-width: 26ch; }
  .thumb { width: 160px; height: 160px; }
  .thumb__img { border-radius: 24px; }
  .thumb.active .thumb__img { transform: scale(1.5); }   /* 160 -> 240 */
  .thumb__title { font-size: 16px; margin-bottom: 54px; }
  .links { padding-top: 60px; }                           /* 40px overflow + 20px gap */
  .links a { width: 48px; height: 48px; }
  .footer__note, .footer__email { font-size: 16px; }
  .footer__copy { font-size: 8px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg__img, .content > *, .thumb, .logo.swing img { animation: none; }
  .thumb__img, .links, .scrim, .thumb__title { transition: none; }
}
