/* Root variables */
:root {
  --ink: #ffffff;
  --muted: #5a6b74;
  --bg: #21414e00;
  --panel: #ffffff;
  --line: #d5dde1;
  --accent: #0f5c6e;
}

@font-face {
  font-family: "Born2bSportyV2";
  src: url("assets/fonts/Born2bSportyV2.ttf") format("truetype"); /* or .otf → format("opentype") */
  font-display: swap;
}

/* Background image and default font */
body {
  font-size: 28px;
  color: #e8fce3;
  margin: 0;
  font-family: "Born2bSportyV2", sans-serif;

  background-color: var(--bg);
  background-image: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  image-rendering: pixelated;
}

/* Back: bgpt (static) */
.bgpt {
  z-index: -3;
  background-image: url("assets/bg_pt.png");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

/* Middle: trees (static) */
.trees {
  z-index: -2;
  background-image: url("assets/trees_pt.png");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

/* Front: snow, scrolls toward the bottom right */
.snowfront {
  z-index: 9999;
  overflow: hidden;
  --h: 100vh;
  --w: calc(100vh * 1920 / 1080);
}

.snowfront::before {
  content: "";
  position: absolute;
  /* one extra tile on the top and left, so there are no gaps while it moves */
  top: calc(var(--h) * -1);
  left: calc(var(--w) * -1);
  width: calc(100% + var(--w));
  height: calc(100% + var(--h));
  background-image: url("assets/snowfront_pt.png");
  background-size: var(--w) var(--h);
  background-repeat: repeat;
  will-change: transform;
  animation: snow-fall 25s linear infinite;
}
/* Back snow: behind the UI, in front of the trees, slower */
.snowback {
  z-index: 100;
  overflow: hidden;
  --h: 100vh;
  --w: calc(100vh * 1920 / 1080);
}

.snowback::before {
  content: "";
  position: absolute;
  top: calc(var(--h) * -1);
  left: calc(var(--w) * -1);
  width: calc(100% + var(--w));
  height: calc(100% + var(--h));
  background-image: url("assets/snowback_pt.png");
  background-size: var(--w) var(--h);
  background-repeat: repeat;
  will-change: transform;
  animation: snow-fall 40s linear infinite; /* front snow is 20s */
}
@keyframes snow-fall {
  from { transform: translate(0, 0); }
  to   { transform: translate(var(--w), var(--h)); }
}

/* Keep the home icon in the top-left corner */
.home-link {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  display: inline-block;
  line-height: 0;
}

.home-icon {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: fill;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.site-nav {
  display: flex;
  gap: 32px;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.06em;
}

/* Tilt effect */
a,
button,
[role="button"],
[onclick],
.card,
.panel,
.member-photo,
.callout,
.roadmap-item,
.ref-item,
.home-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  transform-origin: center;
  box-shadow: none;
}

.home-icon {
  display: block;
}

a:hover,
button:hover,
[role="button"]:hover,
[onclick]:hover,
.card:hover,
.panel:hover,
.member-photo:hover,
.callout:hover,
.roadmap-item:hover,
.ref-item:hover {
  transform: rotate(-3deg) scale(1.05);
}

/* Tilt the icon, not its wrapper */
.home-link:hover {
  transform: none;
}

.home-link:hover .home-icon {
  transform: rotate(-5deg) scale(1.1);
}

/* Reduced motion: no animation, tilt still applies */
@media (prefers-reduced-motion: reduce) {
  a,
  button,
  [role="button"],
  [onclick],
  .card,
  .panel,
  .member-photo,
  .callout,
  .roadmap-item,
  .ref-item,
  .home-icon {
    transition: none;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-footer {
  font-size: 1.4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink);
  text-decoration: none;
}

.title-row {
  display: flex;
  flex-wrap: wrap;        /* stacks on narrow screens */
  align-items: center;    /* vertically centers the image and embed */
  justify-content: center;
  gap: 20px;
}

/* Title: 83x48 scaled 4x */
.image {
  width: 460px;   /* 83 * 4 */
  height: auto;
  image-rendering: pixelated;
}

/* Home icon: 50x50 scaled 2x */
.home-icon {
  width: 100px;   /* 50 * 2 */
  height: 100px;
  image-rendering: pixelated;
}

/* Remove default link colours and underlines */
a,
a:link,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}

/* Hidden until the secret is triggered */
.secret-home {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10000;
  font-size: 3rem;
}

.secret-home a {
  pointer-events: auto;
}

/* Secret mode: hide the UI and trees, show the link */
body.secret-mode main,
body.secret-mode .trees {
  display: none;
}

body.secret-mode .secret-home {
  display: flex;
}

/* Scale banners, icon and embeds to the screen */
:root {
  --icon: clamp(56px, 14vw, 100px); /* home icon size */
}

img {
  max-width: 100%;
  height: auto;
}

/* Title banners: keep your width, but never wider than the screen */
.image {
  max-width: 90%;
}

/* Home icon */
.home-icon {
  width: var(--icon);
  height: var(--icon);
}

/* Header matches the icon size */
.site-header {
  height: var(--icon);
}

/* Keep page content below the fixed icon and header */
main {
  padding-top: calc(var(--icon) + 40px);
}

/* itch.io embed: shrinks with the screen, height stays at 175 */
.game-section {
  width: 100%;
  max-width: 560px;
}

.game-section iframe {
  width: 100%;
  max-width: 100%;
  border: 0;
}

audio {
  max-width: 100%;
}

/* Small screens: tighter nav so it doesn't hit the icon */
@media (max-width: 600px) {
  .site-header {
    font-size: 1rem;
    right: 10px;
  }

  .site-nav {
    gap: 12px;
  }

  .home-link {
    left: 10px;
    top: 10px;
  }
}

/* No page scrolling */
html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100dvh; /* accounts for mobile browser toolbars */
}

main {
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* centers the content vertically */
  padding: calc(var(--icon) + 20px) 20px 20px; /* clears the fixed icon and nav */
  overflow: hidden;
}

/* Desktop: start the content near the top instead of centering it */
@media (min-width: 900px) {
  main {
    justify-content: flex-start;
    padding-top: 30px;
  }
}

/* The script wraps main's content in this and scales it to fit */
.fit {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  transform-origin: center center;
}

/* Natural sizes: the scaling handles small screens */
.fit .image {
  max-width: none;
}

.fit p {
  max-width: 700px;
}

.fit .game-section {
  width: auto;
  max-width: none;
}

.fit .game-section iframe {
  width: 560px;
  max-width: none;
}

a > .image {
  display: block;
}