/* Process Games — site styles (mobile-first) */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #e4e4e4;
  --btn-bg: #000000;
  --btn-text: #ffffff;
  --btn-hover: #333333;
  --radius: 12px;
  --gutter: 16px;
  --max: 1120px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.wrapper {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.site-header__logo img {
  width: 40px;
  height: 40px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.site-nav a {
  text-decoration: none;
  padding: 8px 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Home intro: full-screen animated logo that fades out on scroll */

.intro {
  --header-h: 65px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 420px;
  overflow: hidden;
}

.intro__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 4vh, 40px);
  margin: 0;
  /* --p (0..1) is set from scroll position by site.js */
  opacity: calc(1 - var(--p, 0) * 1.25);
  transform: translateY(calc(var(--p, 0) * -8vh)) scale(calc(1 - var(--p, 0) * .25));
  will-change: opacity, transform;
}

.intro__mark {
  width: min(48vw, 34vh, 300px);
  animation: mark-in 1.1s cubic-bezier(.2, .8, .2, 1) both,
    mark-float 5s ease-in-out 1.2s infinite;
}

.intro__word {
  width: min(56vw, 38vh, 340px);
  animation: word-in .8s cubic-bezier(.2, .8, .2, 1) .55s both;
}

.intro__scroll {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  color: var(--text);
  opacity: calc(1 - var(--p, 0) * 4);
  animation: fade-in .6s ease 1.4s both;
}

.intro__scroll svg {
  width: 28px;
  height: 28px;
  animation: nudge 1.8s ease-in-out 2s infinite;
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: rotate(-120deg) scale(.3);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mark-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Cards rise in as they scroll into view (only when JS is running) */

.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .intro__logo {
    opacity: 1;
    transform: none;
  }

  .intro__mark,
  .intro__word,
  .intro__scroll,
  .intro__scroll svg {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Game cards */

.games {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-top: 8px;
  padding-bottom: 48px;
}

.game {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.game__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f2f2f2;
}

.game__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 20px var(--gutter);
}

.game__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  text-align: center;
}

.game__title a {
  text-decoration: none;
}

.game__title a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.stores {
  display: grid;
  grid-template-columns: min(220px, 100%);
  justify-content: center;
  gap: 10px;
  margin-top: auto;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color .15s;
}

.btn__icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.btn--inline {
  display: inline-flex;
}

.btn:hover,
.btn:focus-visible {
  background: var(--btn-hover);
}

.btn:focus-visible {
  outline: 3px solid #6aa0ff;
  outline-offset: 2px;
}

/* Gameplay video that fades in over the game image (see site.js) */

.media {
  position: relative;
  display: block;
  overflow: hidden;
}

.media__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s ease;
  pointer-events: none;
}

.media__video.is-playing {
  opacity: 1;
}

/* Single game page */

.game-page {
  max-width: 760px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.game-page .game__title {
  font-size: 28px;
  margin-bottom: 20px;
}

.game-page .media {
  border-radius: var(--radius);
}

.game-page .stores {
  margin-top: 20px;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  font-weight: 600;
}

/* Text pages (privacy policy, terms of service, 404) */

.prose {
  max-width: 760px;
  padding-top: 32px;
  padding-bottom: 48px;
  overflow-wrap: anywhere;
}

.prose h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.prose h2 {
  font-size: 20px;
  line-height: 1.3;
  margin: 32px 0 8px;
}

.prose ul {
  padding-left: 20px;
}

.prose li {
  margin-bottom: 8px;
}

.prose .updated {
  color: var(--muted);
  margin-top: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.site-footer p {
  margin: 0;
}

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

/* Larger screens */

@media (min-width: 720px) {
  .games {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .js .games > .reveal:nth-child(even) {
    transition-delay: .12s;
  }

  .game__body {
    padding: 24px;
  }

  .game__title {
    font-size: 24px;
  }

  .game-page .stores {
    grid-template-columns: repeat(auto-fit, 220px);
  }

  .site-nav {
    font-size: 14px;
    gap: 24px;
  }
}
