@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/Montserrat-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/Montserrat-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-dark: #0f0f0f;
  --brand-red: #dd0000;
  --text: #ffffff;
  --wall-blue: #1f4fbf;
  --maze-bg: #000000;
  --maze-goal: #00ff66;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--text);
  background: var(--bg-dark);
  min-height: 100svh;
  overflow: hidden;
}

.page-shell {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 14px;
  isolation: isolate;
}

.gif-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 220ms linear;
  background: var(--bg-dark);
}

body.gif-ready .gif-bg {
  opacity: 1;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.62) 0%,
      rgba(0, 0, 0, 0.3) 45%,
      rgba(0, 0, 0, 0.72) 100%
    ),
    radial-gradient(circle at 20% 14%, rgba(221, 0, 0, 0.42), transparent 42%);
}

.hero {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vh, 24px);
  text-align: center;
}

.hero-mark {
  width: min(70vw, 540px);
  max-width: 540px;
  height: auto;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45));
}

.maze-cta {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.34);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.87rem, 2.2vw, 1rem);
  letter-spacing: 0.01em;
  line-height: 1.2;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  transition: background 150ms linear, transform 120ms linear;
}

.maze-cta:hover,
.maze-cta:focus-visible {
  background: rgba(221, 0, 0, 0.74);
  border-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
  outline: none;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  padding: 12px 14px max(14px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.footer-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  pointer-events: auto;
}

.footer-nav a {
  color: #fff;
  font-size: 0.88rem;
  line-height: 1.1;
  text-decoration: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.86);
  opacity: 0.94;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  outline: none;
}

.maze-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-items: center;
  padding: 24px 16px 74px;
  background: rgba(0, 0, 0, 0.7);
}

body.maze-active .maze-panel {
  display: grid;
}

.maze-chrome {
  width: min(100%, 900px);
  display: grid;
  justify-items: center;
  gap: 12px;
}

.maze-back {
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.maze-back:hover,
.maze-back:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.maze-canvas {
  width: min(100%, 900px);
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: var(--maze-bg);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  touch-action: none;
  display: block;
}

.jumpscare-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: #000;
}

.jumpscare-overlay.active {
  display: flex;
}

.jumpscare-image {
  width: min(92vw, 900px);
  height: auto;
  max-height: 92vh;
  object-fit: contain;
}

@media (max-width: 640px) {
  .hero-mark {
    width: min(84vw, 540px);
  }

  .maze-cta {
    width: min(92vw, 420px);
  }

  .footer-nav a {
    font-size: 0.8rem;
  }

  .maze-panel {
    padding-top: 12px;
    padding-bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gif-bg {
    transition: none;
  }

  .maze-cta {
    transition: none;
  }
}
