@font-face {
  font-family: "Griffy";
  src: url("fonts/Griffy-Regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("fonts/Fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --night: #1a1030;
  --night-2: #2a1840;
  --panel: #2e1d48;
  --panel-edge: #47306a;
  --cream: #fbf1dc;
  --muted: #c7b8e0;
  --gold: #f5c96a;
  --pink: #ff8fc8;
  --violet: #b57cf0;
  --steam: #5aa7e0;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--cream);
  font: 400 clamp(17px, 16.3px + 0.19vw, 18px)/1.55 "Fredoka", system-ui, sans-serif;
  overflow-x: hidden;
}

/* Night sky: gradient, faint moon, twinkling stars and slow drifting clouds, fixed behind everything. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(60vmax 40vmax at 85% -5%, #4a2c7a 0%, transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 60%, var(--night) 100%);
}

/* Crescent: a transparent disc whose offset shadow is the moon, plus a soft halo. */
.moon {
  --m: clamp(125px, 16vw + 65px, 400px);
  position: absolute;
  top: clamp(7vh, 12vh - 0.5vw, 10vh);
  left: clamp(15px, 9vw - 20px, 8vw);
  width: var(--m);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: calc(var(--m) * -0.22) calc(var(--m) * 0.14) 0 0 #f5c96a;
  opacity: 0.22;
  transform: rotate(-12deg);
  animation: moon-glow 9s ease-in-out infinite alternate;
}
.moon::after {
  content: "";
  position: absolute;
  inset: -60%;
  border-radius: 50%;
  /* centred on the crescent (the shadow's disc), not on the transparent disc that casts it */
  translate: calc(var(--m) * -0.22) calc(var(--m) * 0.14);
  background: radial-gradient(closest-side, #f5c96a40, transparent 70%);
}
@keyframes moon-glow { from { opacity: 0.18; } to { opacity: 0.28; } }

.stars { position: absolute; inset: 0; }
.stars i, .stars .sparkle {
  position: absolute;
  animation: twinkle ease-in-out infinite alternate;
}
.stars i { border-radius: 50%; background: #fff; box-shadow: 0 0 4px #fff8; }
.stars .sparkle { fill: var(--gold); filter: drop-shadow(0 0 4px #f5c96a99); }
@keyframes twinkle {
  0% { opacity: 0.15; transform: scale(0.7); }
  60% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0.35; transform: scale(0.85); }
}

/* Clouds: flat, very faint, drifting left to right and bobbing a little. */
.cloud {
  position: absolute;
  left: 0;
  overflow: visible;
  fill: #e9dcff;
  animation: drift linear infinite, bob ease-in-out infinite alternate;
}
.c1 { top: 14vh; width: 260px; height: 148px; opacity: 0.06; animation-duration: 140s, 7s; animation-delay: -20s, 0s; }
.c2 { top: 38vh; width: 180px; height: 103px; opacity: 0.045; animation-duration: 190s, 9s; animation-delay: -110s, -3s; }
.c3 { top: 62vh; width: 320px; height: 182px; opacity: 0.05; animation-duration: 230s, 11s; animation-delay: -60s, -5s; }
.c4 { top: 82vh; width: 220px; height: 125px; opacity: 0.04; animation-duration: 170s, 8s; animation-delay: -150s, -2s; }
.c5 { top: 4vh; width: 150px; height: 86px; opacity: 0.05; animation-duration: 210s, 10s; animation-delay: -170s, -6s; }
.c6 { top: 26vh; width: 520px; height: 296px; opacity: 0.045; animation-duration: 260s, 12s; animation-delay: -30s, -4s; }
.c7 { top: 70vh; width: 460px; height: 262px; opacity: 0.04; animation-duration: 300s, 13s; animation-delay: -190s, -7s; }
.c2, .c4, .c6 { scale: -1 1; }  /* mirrored so the clouds don't all look alike */
@keyframes drift { from { translate: -560px 0; } to { translate: calc(100vw + 40px) 0; } }
@keyframes bob { from { transform: translateY(-6px); } to { transform: translateY(6px); } }

a { color: var(--gold); }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.7em 1.4em;
  border-radius: 999px;
  font: 600 1rem/1 "Fredoka", sans-serif;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, .lightbox .nav:focus-visible, .socials a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.btn-ghost {
  color: var(--cream);
  border: 2px solid var(--panel-edge);
  background: #ffffff0a;
}
.btn-ghost:hover { border-color: var(--violet); }
.btn-steam {
  font-size: 1.25rem;
  padding: 0.85em 1.7em;
  color: #241431;
  background: linear-gradient(180deg, #ffe39a, var(--gold));
  box-shadow: 0 6px 0 #b8893a, 0 10px 30px #f5c96a55;
}
.btn-steam:hover { box-shadow: 0 8px 0 #b8893a, 0 14px 36px #f5c96a77; }
.btn-steam:active { transform: translateY(3px); box-shadow: 0 3px 0 #b8893a; }
.steam-icon { width: 1.4em; height: 1.4em; fill: currentColor; }

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px;
}
.studio {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
}
.studio-logo { width: 44px; height: 44px; }
.studio-name { font: 600 1.15rem/1 "Fredoka", sans-serif; letter-spacing: 0.02em; }

/* Hero */
.hero {
  text-align: center;
  padding: 8px 16px 0;
}
.game-title { margin: 0 auto; max-width: 760px; }
.game-title img { width: 100%; height: auto; margin: -2% auto -4%; }
.pitch {
  max-width: 34em;
  margin: 0 auto 28px;
  font-size: clamp(1.05rem, 0.95rem + 0.42vw, 1.2rem);
  color: var(--muted);
}
.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.soon { font-size: 0.95rem; color: var(--muted); }
/* Skull row: one image per skull, same scale as in the game. Each bobs gently on its own
   timing (--d duration, --o offset); hover brings a skull forward and makes it bigger. */
.skull-row {
  display: flex;
  justify-content: center;
  overflow-x: clip;  /* clips the sides only, hover can still grow upwards */
  align-items: flex-end;
  margin: 36px -16px 0;
  padding: 0 8px 12px;
}
.skull {
  position: relative;
  flex: none;
  /* Fixed size, like the Steam button (their full-screen ratio is the look). All nine always fit:
     the row is ~1520px wide side by side, so the overlap grows just enough for the screen
     (none on wide screens, a tight fan on phones, centre skull on top). */
  /* scale lerps from 0.75x on a 375px phone to full size at 1100px and up (no snap) */
  --k: clamp(0.42px, 0.3476px + 0.01931vw, 0.56px);
  --span: calc(var(--k) * 2714);  /* the nine side by side at this --k */
  width: calc(var(--w) * var(--k));
  height: auto;
  /* the row spans at most 1048px, the same width as the feature cards below it */
  margin: 0 min(0px, calc((min(100vw - 48px, 1048px) - var(--span)) / 16));
  transform-origin: 50% 85%;
  animation: skull-bob var(--d) ease-in-out var(--o) infinite alternate;
  transition: scale 0.25s cubic-bezier(.3, 1.6, .5, 1), filter 0.25s ease;
}
.skull.center { width: calc(var(--w) * var(--k) * 1.2); }
.skull:first-child { margin-left: 0; }  /* overlap only between skulls, never past the row's edges */
.skull:last-child { margin-right: 0; }
/* Touch screens: the last tapped skull stays in front of its neighbours until another is tapped.
   With a mouse, hover brings a skull forward and it drops back into its layer afterwards. */
@media (hover: none) {
  .skull.front { z-index: 40 !important; }
}
@media (hover: hover) {
  .skull:hover {
    --base: 1.22;
    z-index: 50 !important;
    scale: var(--base);
    filter: drop-shadow(0 0 18px #b57cf0aa);
  }
}
.skull { --base: 1; cursor: default; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-drag: none; }
@keyframes skull-bob { from { translate: 0 -4px; } to { translate: 0 4px; } }

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 1080px;
  margin: 16px auto 0;
  padding: 0 16px;
}
.feature {
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: 22px;
  padding: 20px 22px;
}
.feature h2 {
  margin: 0 0 6px;
  font: 400 1.6rem/1.15 "Griffy", serif;
  color: var(--gold);
}
.feature p { margin: 0; color: var(--muted); }

/* Gallery */
.section-title {
  font: 400 clamp(2rem, 5vw, 2.8rem)/1.1 "Griffy", serif;
  color: var(--cream);
  text-shadow: 0 0 18px #b57cf099;
  margin: 0 0 18px;
}
.gallery {
  max-width: 1180px;
  margin: 72px auto 0;
  padding: 0 16px;
  text-align: center;
}
/* Screenshot stack: one row of overlapping, slightly tilted photo prints. Each card is
   offset by --step so its edge shows. The middle card is on top and the rest fan out behind it;
   the active card (under the pointer) lifts to the front. */
.shots {
  --n: 10;
  --card: min(440px, 58vw);
  --row: min(1100px, calc(100vw - 48px));
  --step: calc((var(--row) - var(--card)) / (var(--n) - 1));
  list-style: none;
  display: flex;
  justify-content: center;
  width: var(--row);
  margin: 0 auto;
  padding: 28px 0 36px;
}
.shots li {
  flex: none;
  width: var(--card);
  position: relative;
  z-index: var(--z);
  rotate: var(--r);
  transition: translate 0.25s cubic-bezier(.3, 1.5, .5, 1), rotate 0.25s ease, scale 0.25s ease;
}
.shots li + li { margin-left: calc(var(--step) - var(--card)); }
.shots li:nth-child(1) { --r: -4deg; --z: 1; translate: 0 6px; }
.shots li:nth-child(2) { --r: 2.5deg; --z: 2; translate: 0 -4px; }
.shots li:nth-child(3) { --r: -1.5deg; --z: 3; translate: 0 8px; }
.shots li:nth-child(4) { --r: 3deg; --z: 4; translate: 0 -2px; }
.shots li:nth-child(5) { --r: -1deg; --z: 10; translate: 0 4px; }
.shots li:nth-child(6) { --r: 1.5deg; --z: 9; translate: 0 -6px; }
.shots li:nth-child(7) { --r: -2deg; --z: 8; translate: 0 6px; }
.shots li:nth-child(8) { --r: 3.5deg; --z: 7; translate: 0 -3px; }
.shots li:nth-child(9) { --r: -2.5deg; --z: 6; translate: 0 5px; }
.shots li:nth-child(10) { --r: 2deg; --z: 5; translate: 0 0; }
.shots li.active { z-index: 20; rotate: 0deg; translate: 0 -18px; scale: 1.06; }
.shots button {
  display: block;
  width: 100%;
  padding: 7px 7px 22px;
  border: 0;
  border-radius: 6px;
  background: #fbf1dc;
  box-shadow: 0 10px 24px #0008, 0 2px 0 #c9b998;
  cursor: zoom-in;
}
.shots li.active button { box-shadow: 0 18px 40px #000a, 0 0 0 3px var(--pink); }
.shots img { width: 100%; height: auto; border-radius: 3px; }

/* Lightbox */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(1600px, 94vw);
  max-height: 92vh;
}
.lightbox::backdrop { background: #0d0718e6; }
.lightbox img { border-radius: 14px; width: min(calc(100vw - 150px), 84vh * 16 / 9, 1600px); height: auto; aspect-ratio: 16 / 9; cursor: zoom-out; }
.lightbox .nav {
  position: fixed;
  top: 50%;
  translate: 0 -50%;
  width: 52px;
  height: 52px;
  border: 2px solid var(--panel-edge);
  border-radius: 50%;
  background: #2e1d48dd;
  color: var(--cream);
  font: 600 34px/1 "Fredoka", sans-serif;
  padding-bottom: 4px;
  cursor: pointer;
}
.lightbox .nav:hover { border-color: var(--gold); color: var(--gold); }
.lightbox .prev { left: 16px; }
.lightbox .next { right: 16px; }
.lightbox .count {
  position: fixed;
  left: 50%;
  bottom: 14px;
  translate: -50% 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.lightbox .close {
  position: fixed;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--panel);
  color: var(--cream);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

/* Discord callout */
.discord {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1000px;
  margin: 88px auto 0;
  padding: 30px 34px;
  border-radius: 28px;
  background:
    radial-gradient(120% 140% at 0% 0%, #6d5cf233 0%, transparent 60%),
    linear-gradient(135deg, #3a2466, #2e1d48);
  border: 2px solid #7a63d8;
  box-shadow: 0 0 40px #7a63d84d;
}
.discord-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 26px;
  background: #5865f2;
  box-shadow: 0 6px 0 #3c45b8;
  transform: rotate(-6deg);
}
.discord-icon { width: 54px; height: 54px; fill: #fff; }
.discord-text { flex: 1; }
.discord-text .section-title { margin-bottom: 8px; }
.discord-text p { margin: 0; color: var(--muted); }
.btn-discord {
  flex: none;
  font-size: 1.15rem;
  padding: 0.85em 1.5em;
  color: #fff;
  background: #5865f2;
  box-shadow: 0 6px 0 #3c45b8, 0 10px 30px #5865f255;
}
.btn-discord:hover { box-shadow: 0 8px 0 #3c45b8, 0 14px 36px #5865f277; }
.btn-discord:active { transform: translateY(3px); box-shadow: 0 3px 0 #3c45b8; }
.btn-icon { width: 1.35em; height: 1.35em; fill: currentColor; }
.soon a { color: var(--gold); }

/* Music player (bottom of the page) */
.music {
  max-width: 860px;
  margin: 88px auto 0;
  padding: 0 16px;
  text-align: center;
}
.player {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: 24px;
  text-align: left;
}
.player .cover {
  flex: none;
  width: 112px;
  height: 112px;
  border-radius: 16px;
  box-shadow: 0 6px 18px #0007;
}
.player-main { flex: 1; min-width: 0; }
.track-title {
  margin: 0;
  font: 400 1.6rem/1.15 "Griffy", serif;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist { margin: 2px 0 10px; color: var(--muted); font-style: italic; }
.track-artist a { color: var(--muted); }
.progress { display: flex; align-items: center; gap: 12px; }
.seek { flex: 1; min-width: 0; accent-color: var(--gold); cursor: pointer; }
.time { flex: none; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ctl {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid var(--panel-edge);
  border-radius: 50%;
  background: #ffffff0a;
  color: var(--cream);
  cursor: pointer;
}
.ctl svg { width: 20px; height: 20px; fill: currentColor; }
.ctl:hover { border-color: var(--gold); color: var(--gold); }
.ctl.play {
  width: 50px;
  height: 50px;
  border: 0;
  background: linear-gradient(180deg, #ffe39a, var(--gold));
  color: #241431;
  box-shadow: 0 4px 0 #b8893a;
}
.ctl.play:hover { color: #241431; }
.ctl.play svg { width: 24px; height: 24px; }
.ctl:focus-visible, .tracklist button:focus-visible, .music-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.i-pause, .music-on .i-play { display: none; }
.music-on .i-pause { display: block; }
.tracklist { list-style: none; margin: 14px 0 0; padding: 0; text-align: left; }
.tracklist button {
  display: grid;
  grid-template-columns: 28px 1fr auto 52px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--cream);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tracklist button:hover { background: #ffffff0d; }
.tracklist .current { background: #ffffff12; color: var(--gold); }
.tracklist .n, .tracklist .d { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tracklist .d { text-align: right; }
.tracklist .a { color: var(--muted); font-style: italic; font-size: 0.9rem; }
.credit { margin: 12px 0 0; font-size: 0.85rem; color: var(--muted); }

/* Floating music toggle: always reachable, bottom right. */
.music-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 2px solid var(--panel-edge);
  border-radius: 50%;
  background: #2e1d48e6;
  color: var(--cream);
  cursor: pointer;
  box-shadow: 0 8px 24px #0008;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.music-toggle:hover { transform: translateY(-2px); border-color: var(--gold); }
.music-toggle .note { width: 24px; height: 24px; fill: currentColor; }
.music-toggle .eq { display: none; align-items: flex-end; gap: 3px; height: 20px; }
.music-toggle .eq i { width: 4px; height: 100%; border-radius: 2px; background: #241431; transform-origin: bottom; animation: eq 0.9s ease-in-out infinite alternate; }
.music-toggle .eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.3s; }
.music-toggle .eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.6s; }
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
.music-on .music-toggle { background: linear-gradient(180deg, #ffe39a, var(--gold)); border-color: #b8893a; }
.music-on .music-toggle .note { display: none; }
.music-on .music-toggle .eq { display: flex; }

/* About */
.about {
  display: flex;
  gap: 28px;
  align-items: center;
  max-width: 860px;
  margin: 88px auto 0;
  padding: 28px;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: 28px;
}
.about-logo { width: 96px; height: 96px; flex: none; }
.about p { margin: 0 0 18px; color: var(--muted); }
.about .section-title { margin-bottom: 10px; }

/* Footer */
.footer {
  text-align: center;
  padding: 64px 16px 40px;
  color: var(--muted);
}
.footer p { margin: 8px 0; }
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.socials a {
  padding: 0.5em 1.1em;
  border-radius: 999px;
  border: 2px solid var(--panel-edge);
  color: var(--cream);
  text-decoration: none;
  font-weight: 500;
}
.socials a:hover { border-color: var(--pink); color: var(--pink); }
.small { font-size: 0.85rem; opacity: 0.8; }

@media (max-width: 900px) and (min-width: 641px) {
  .discord { flex-wrap: wrap; margin-left: 16px; margin-right: 16px; }
  .discord-text { flex-basis: calc(100% - 120px); }
  .btn-discord { margin-left: 116px; }
}

@media (max-width: 640px) {

  .skull-row { margin-top: 28px; }

  .studio-name { font-size: 1rem; }

  .discord { flex-direction: column; text-align: center; margin: 64px 16px 0; padding: 26px 20px; gap: 18px; }
  .player { flex-direction: column; text-align: center; gap: 14px; }
  .player .cover { width: 140px; height: 140px; }
  .controls { justify-content: center; }
  .tracklist button { grid-template-columns: 22px 1fr 44px; }
  .tracklist .a { display: none; }
  .music-toggle { right: 12px; bottom: 12px; width: 48px; height: 48px; }
  .footer { padding-bottom: 84px; }  /* room for the floating music toggle */
  .about { flex-direction: column; text-align: center; margin: 64px 16px 0; padding: 22px; }
  .gallery { margin-top: 56px; }
  .shots { --row: calc(100vw - 32px); --card: 62vw; padding: 18px 0 28px; }
  .shots button { padding: 4px 4px 12px; }
  .lightbox img { width: 94vw; }
  .lightbox .nav { width: 42px; height: 42px; font-size: 28px; top: auto; bottom: 8px; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .shots button, .shots li { transition: none; }
  .moon, .stars i, .stars .sparkle, .cloud, .skull, .music-toggle .eq i { animation: none; }
  .skull { transition: none; }
  .cloud { translate: 20vw 0; }
  .c2 { translate: 70vw 0; } .c3 { translate: 45vw 0; } .c4 { translate: 5vw 0; } .c5 { translate: 55vw 0; }
  .c6 { translate: 60vw 0; } .c7 { translate: 10vw 0; }
}
