/* Pancake Studios. The games carry the page; everything else stays out of the way. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  /* Bricolage Grotesque 800, subset to the letters of "Pancake Studios". */
  font-family: "Wordmark";
  src: url("/assets/fonts/wordmark.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #09090b;
  --fg: #f4f4f5;
  --muted: rgba(244, 244, 245, 0.55);
  --gutter: clamp(20px, 4vw, 56px);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

img, picture, canvas, svg { display: block; }
h1, h2, p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 4px; }

.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }
.pixelated { image-rendering: pixelated; image-rendering: crisp-edges; }

/* Header */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  padding: calc(var(--gutter) * 0.6) var(--gutter);
  pointer-events: none;
}
.brand a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 800 1.15rem/1 "Wordmark", var(--font);
  letter-spacing: -0.01em;
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}
.brand img { width: 36px; height: 36px; border-radius: 8px; }

/* Game sections */

.game {
  position: relative;
  height: 100svh;
  min-height: 560px;
  max-height: 1200px;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}
.game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 40%);
  pointer-events: none;
}
.stage { position: absolute; inset: 0; z-index: -2; }
.stage > *,
.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stage > canvas { opacity: 0; transition: opacity 1.2s ease; touch-action: pan-y; }
.stage.is-live > canvas { opacity: 1; }

.caption {
  position: absolute;
  left: var(--gutter);
  right: calc(var(--gutter) + 56px);
  bottom: calc(var(--gutter) * 1.1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.motion-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: calc(var(--gutter) * 1.1);
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: var(--fg);
  cursor: pointer;
  opacity: 0.7;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 0.2s;
}
.motion-toggle:hover { opacity: 1; }
.stage.is-live ~ .motion-toggle { display: grid; }
.motion-toggle .icon { width: 14px; height: 14px; }
.motion-toggle .i-play,
.motion-toggle[aria-pressed="true"] .i-pause { display: none; }
.motion-toggle[aria-pressed="true"] .i-play { display: block; }

/* Sensory Overload */

.so-logo {
  width: clamp(220px, 30vw, 440px);
  height: auto;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55));
}

.steam {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #171a21;
  transition: background-color 0.2s, transform 0.2s;
}
.steam:hover { background: #fff; transform: translateY(-1px); }
.steam svg { height: 26px; width: auto; aspect-ratio: 295.457 / 90.473; fill: currentColor; }

.reviews {
  min-height: 1.5em;
  margin-top: -8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  padding: 28px var(--gutter) 32px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--fg); }
.socials { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; }
.socials a { display: block; padding: 4px; }
.socials .icon { width: 17px; height: 17px; }

@media (max-width: 640px) {
  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* 404 */

.lost {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: var(--gutter);
  text-align: center;
}
.lost h1 { font-size: 15px; font-weight: 500; }
.lost a { color: var(--muted); font-size: 14px; }
.lost a:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; }
}
