:root {
  --bg: #1a0f0a;
  --bg-2: #23140d;
  --red: #dd2e3f;
  --cream: #dccfb5;
  --teal: #37beb4;
  --pink: #ee8c9b;
  --nav-h: 68px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.25rem;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.site-nav.nav-scrolled {
  background: rgba(20, 11, 7, 0.92);
  backdrop-filter: blur(6px);
  border-bottom-color: rgba(220, 207, 181, 0.15);
}

/* logo is always visible; the rest of the bar only appears once scrolled */
.nav-logo { flex: 0 0 auto; }
.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.site-nav.nav-scrolled .nav-links {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav-links a { transition: color 0.15s ease; }
.nav-links a:hover { color: var(--red); }

/* A single red bar that slides between menu items to underline the current
   section. Position and width are set in JS from the active link's box. */
.nav-underline {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.65, 0, 0.35, 1),
              width 0.38s cubic-bezier(0.65, 0, 0.35, 1),
              opacity 0.3s ease;
}
.nav-underline.is-visible { opacity: 1; }
/* Back on the landing the menu itself is hidden, so fade the bar out with it.
   Higher specificity than .is-visible, so it always wins there. */
.site-nav:not(.nav-scrolled) .nav-underline { opacity: 0; }

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--cream);
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.2s ease;
}
.nav-toggle svg { width: 26px; height: 26px; fill: currentColor; }
.nav-toggle .bar {
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.site-nav.nav-open .nav-toggle { color: var(--red); }
.site-nav.nav-open .nav-toggle .bar-top { transform: translateY(6px) rotate(45deg); }
.site-nav.nav-open .nav-toggle .bar-mid { opacity: 0; }
.site-nav.nav-open .nav-toggle .bar-bot { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Landing ---------- */
.landing {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1rem;
  background: radial-gradient(60% 55% at 50% 42%, rgba(221, 46, 63, 0.12), transparent 70%);
  /* Clip the overflowing ident here, so letters fly off the screen edges rather
     than bleeding over the sections below. */
  overflow: hidden;
}
.ident-stage {
  width: min(720px, 92vw);
  aspect-ratio: 730 / 400;
  position: relative;
  transform-origin: top left;
  transition: transform 0.75s cubic-bezier(0.6, 0, 0.2, 1), opacity 0.6s ease;
}
.ident-stage svg {
  width: 100%;
  height: 100%;
  display: block;
  /* Let the scattering letters fly past the stage box instead of being clipped
     at its edges. The landing section clips them at the screen edge instead. */
  overflow: visible;
}
.ident-stage svg path { fill: #e83c3c; }
/* Hand-off: the hero flies up toward the corner logo and fades */
.ident-stage.ident-lift {
  transform: translate(-34vw, -36vh) scale(0.12);
  opacity: 0;
  pointer-events: none;
}
/* During the intro: lock scroll and hide the corner logo until the hand-off */
html.intro-active { overflow: hidden; }
html.intro-active .nav-logo { opacity: 0; pointer-events: none; }
.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  font-size: 1.6rem;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ---------- Sections ---------- */
.section {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 2rem;
}
.section-inner {
  width: 100%;
  max-width: 1100px;
  max-height: 100%;
  overflow-y: auto;
}
.section h2 {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 0 0 1.4rem;
}
.section h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 0.6rem;
  background: var(--red);
}
.lead {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(220, 207, 181, 0.85);
  max-width: 60ch;
}
/* Links inside body copy need their own colour — the global rule inherits it */
.lead a {
  color: var(--red);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.lead a:hover { border-color: var(--red); }
/* Sign-off line sitting under a game grid */
.prototypes-more { margin: 1.4rem 0 0; }

/* ---------- Game grid ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
}
.game-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}
.game-card {
  border: 1px solid rgba(220, 207, 181, 0.14);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.game-card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.game-card:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.game-carousel {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #2a1710, #3a1d13);
}
.game-carousel .shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.game-carousel .shot.active { opacity: 1; }

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(20, 11, 7, 0.6);
  color: var(--cream);
  border: 0;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.15s ease;
}
.game-card:hover .carousel-arrow { opacity: 1; }
.carousel-arrow:hover { background: var(--red); }
.carousel-arrow.prev { left: 6px; }
.carousel-arrow.next { right: 6px; }

.game-title {
  padding: 0.6rem 0.75rem;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
/* Frozen first frame of a GIF cover; hidden on hover so the gif plays */
.gif-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.gif-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: rgba(8, 5, 3, 0.7);
  color: var(--cream);
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.game-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 1.6rem 0.8rem 0.7rem;
  background: linear-gradient(to top, rgba(8, 5, 3, 0.92) 12%, rgba(8, 5, 3, 0.5) 55%, transparent);
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--cream);
}

/* ---------- Media placeholder box (About images, feature card) ---------- */
.media-box {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(135deg, #2a1710, #3a1d13);
  border: 1px solid rgba(220, 207, 181, 0.14);
}
.media-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-media {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1.75rem;
}

/* Caption revealed on hover. Add data-caption="..." to any .media-box; boxes
   without the attribute get nothing. Sized to match the game card captions. */
.media-box[data-caption]::after {
  content: attr(data-caption);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem 0.8rem 0.7rem;
  background: linear-gradient(to top, rgba(8, 5, 3, 0.92) 12%, rgba(8, 5, 3, 0.5) 55%, transparent);
  color: var(--cream);
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.media-box[data-caption]:hover::after { opacity: 1; }
/* No hover on touch, so keep captions visible there */
@media (hover: none) {
  .media-box[data-caption]::after { opacity: 1; }
}

.feature-card {
  display: block;
  max-width: 440px;
  margin-top: 1.75rem;
  transition: transform 0.15s ease;
}
.feature-card .media-box { transition: border-color 0.15s ease; }
.feature-card:hover { transform: translateY(-3px); }
.feature-card:hover .media-box { border-color: var(--red); }
.feature-card .game-title { padding: 0.6rem 0; }

/* ---------- Social ---------- */
#connect .section-inner { overflow: visible; }
/* Icons with no URL yet stay dimmed and non-interactive */
.social-icon[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.social-icon[aria-disabled="true"]:hover {
  color: var(--cream);
  border-color: rgba(220, 207, 181, 0.18);
  transform: none;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}
.social-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(220, 207, 181, 0.18);
  border-radius: 6px;
  color: var(--cream);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.social-icon:hover {
  color: var(--red);
  border-color: var(--red);
  transform: translateY(-2px);
}
.social-icon.active {
  color: var(--bg);
  background: var(--red);
  border-color: var(--red);
}
.social-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
}

.social-widget {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 560px;
  max-height: 44vh;
  overflow: auto;
  border: 1px solid rgba(220, 207, 181, 0.14);
  border-radius: 6px;
  background: var(--bg-2);
}
.social-widget[hidden] { display: none; }
.social-widget-placeholder {
  padding: 1.25rem;
  color: rgba(220, 207, 181, 0.85);
  font-size: 0.95rem;
  line-height: 1.5;
}
.social-widget-placeholder strong {
  font-family: "Chakra Petch", sans-serif;
  color: var(--cream);
}

/* ---------- Contact ---------- */
.contact-email {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.4rem;
  color: var(--red);
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease;
}
.contact-email:hover { border-color: var(--red); }

/* ---------- Work With Us ---------- */
.wwu-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
}
.wwu-btn {
  padding: 0.85rem 2.4rem;
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 5px;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1rem;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.wwu-btn:hover { filter: brightness(1.1); }
.wwu-btn:active { transform: translateY(1px); }

/* ---------- Connect (Contact + Social stacked, sharing one screen) ---------- */
.connect-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
/* Order Contact above Social regardless of source order */
#contact-col { order: 0; }
#social-col { order: 1; }
.connect-col h2 { margin-bottom: 1.2rem; }

/* ---------- Newsletter ---------- */
.newsletter {
  margin-top: 1.75rem;
  max-width: 460px;
}
.newsletter-label {
  display: block;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}
.newsletter-row {
  display: flex;
  gap: 0.5rem;
}
.newsletter-input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid rgba(220, 207, 181, 0.2);
  border-radius: 5px;
  color: var(--cream);
  font: inherit;
}
.newsletter-input::placeholder { color: rgba(220, 207, 181, 0.4); }
.newsletter-input:focus { outline: none; border-color: var(--red); }
.newsletter-btn {
  padding: 0.6rem 1.1rem;
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 5px;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.newsletter-btn:hover { filter: brightness(1.1); }
.newsletter-btn:active { transform: translateY(1px); }
.newsletter-msg {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}
.newsletter-msg.ok { color: var(--teal); }
.newsletter-msg.err { color: var(--red); }

/* ---------- Game detail modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 3, 0.8);
  backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-2);
  border: 1px solid rgba(220, 207, 181, 0.15);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(8, 5, 3, 0.55);
  color: var(--cream);
  border: 0;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: var(--red); color: #fff; }
.modal-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a1710, #3a1d13);
}
.modal-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Screenshot slideshow shown when a game has no video */
.modal-slideshow {
  position: absolute;
  inset: 0;
}
.modal-slideshow .modal-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* show the whole screenshot rather than cropping it */
  opacity: 0;
  transition: opacity 0.35s ease;
}
.modal-slideshow .modal-shot.active { opacity: 1; }
/* Card arrows only appear on hover; in the modal they should always show */
.modal-slideshow .carousel-arrow { opacity: 1; }

.modal-video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  color: rgba(220, 207, 181, 0.6);
  font-size: 0.95rem;
}
.modal-body { padding: 1.5rem; }
.modal-title {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.6rem;
  margin: 0 0 0.75rem;
}
.modal-desc {
  color: rgba(220, 207, 181, 0.85);
  line-height: 1.6;
  margin: 0 0 1.5rem;
  white-space: pre-line;
}
/* Award wreaths / laurels — a row of small images under the description */
.modal-awards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.modal-awards:empty { display: none; }
.modal-awards img {
  height: 64px;
  width: auto;
  display: block;
}
@media (max-width: 720px) {
  .modal-awards img { height: 52px; }
}
.modal-play {
  display: inline-block;
  padding: 0.7rem 2.2rem;
  background: var(--red);
  color: #fff;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 5px;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.modal-play:hover { filter: brightness(1.1); }
.modal-play:active { transform: translateY(1px); }

.modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  html { scroll-snap-type: none; }
  .landing, .section { height: auto; min-height: 100vh; }
  .section-inner { max-height: none; overflow: visible; }
  .about-media { grid-template-columns: 1fr 1fr; }

  /* Collapse the menu into a hamburger dropdown */
  .nav-toggle { display: grid; }
  .site-nav:not(.nav-scrolled) .nav-toggle { opacity: 0; pointer-events: none; }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    margin: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 1.25rem 0.75rem;
    background: rgba(20, 11, 7, 0.97);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(220, 207, 181, 0.15);
    font-size: 0.95rem;
  }
  /* On mobile the dropdown is driven by nav-open, not nav-scrolled */
  .site-nav.nav-scrolled .nav-links {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }
  .site-nav.nav-open .nav-links {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(220, 207, 181, 0.08);
  }
  /* The sliding bar is horizontal, so it makes no sense in the stacked
     dropdown — mark the current section with colour instead. */
  .nav-underline { display: none; }
  .nav-links a.active { color: var(--red); }

  /* No hover on touch: keep carousel arrows visible so shots can be cycled */
  .carousel-arrow { opacity: 1; }
}
