/* Eight Fifteen Labs — home page: one section per game, each a gameplay phone beside a short description (the phone
   alternates sides). Fonts and accents come from the Word Arrow Escape page. The privacy and terms pages add legal.css. */

@font-face { font-family: "Lilita One"; src: url("/fonts/LilitaOne.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("/fonts/Fredoka-Bold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }

:root {
  --bg: #23254a;
  --shade: #34376a;    /* the block offset behind the phone */
  --cream: #fcf7ec;
  --text-soft: #c9cbe8;
  --text-faint: #9a9cc4;
  --yellow: #ffd65c;
  --felt: #23994a;
  --page: 1080px;
  --gutter: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }
body {
  display: flex; flex-direction: column; min-height: 100svh;
  margin: 0;
  font: 500 18px/1.55 "Fredoka", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--cream);
  background: var(--bg);
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; padding: 8px 14px; background: var(--yellow); color: var(--bg); border-radius: 10px; }

.site-header, .game, .site-footer { width: 100%; max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------------------------------------------------------------- header */
.site-header { padding-top: clamp(20px, 3vw, 32px); }
.brand { display: flex; align-items: center; gap: 12px; font: 400 clamp(20px, 2vw, 24px)/1 "Lilita One", sans-serif; letter-spacing: .3px; }

/* ---------------------------------------------------------------- the game */
main { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }
.game {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  column-gap: clamp(56px, 8vw, 112px);
  padding-block: clamp(32px, 5vw, 56px) clamp(48px, 6vw, 72px);
}

.phone { position: relative; isolation: isolate; width: clamp(230px, 22vw, 290px); aspect-ratio: 9 / 16; border-radius: 34px; }
.phone::before { content: ""; position: absolute; inset: 0; z-index: -1; translate: 26px 26px; border-radius: inherit; background: var(--shade); }
.phone video, .phone img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: inherit; background: var(--felt);
  box-shadow: 0 18px 40px rgba(8, 9, 30, .35);
}

.game-icon { width: 80px; height: 80px; border-radius: 20px; margin-bottom: 22px; }
.game-title { font: 400 clamp(38px, 4.6vw, 58px)/1.05 "Lilita One", sans-serif; letter-spacing: .5px; }
.game-tagline { margin-top: 10px; font: 400 clamp(22px, 2.3vw, 28px)/1.2 "Lilita One", sans-serif; color: var(--yellow); }
.game-lede { margin-top: 18px; max-width: 30em; font-size: clamp(17px, 1.5vw, 19px); color: var(--text-soft); }
.game-platforms { margin-top: 10px; font-size: 15px; color: var(--text-faint); }

.game-link {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px;
  padding: 12px 22px;
  background: var(--yellow); color: var(--bg); text-decoration: none;
  font-weight: 700; font-size: 17px;
  border-radius: 999px;
  transition: background-color .2s;
}
.game-link svg { transition: translate .2s; }
.game-link:hover { background: #ffe596; }
.game-link:hover svg { translate: 4px 0; }

/* A rule between the games, and every second game puts its phone on the right. */
.game + .game { position: relative; }
.game + .game::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: rgba(255, 255, 255, .1); }
.game--flip { grid-template-columns: minmax(0, 1fr) auto; }
.game--flip .phone { order: 2; }
.game--flip .phone video { background: #3fa9f5; }
.game--wlj .phone video { background: #eef0f7; }

/* Narrow screens: description first, then the phone. */
@media (max-width: 820px) {
  .game, .game--flip { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .game--flip .phone { order: 0; }
  .game-copy { order: -1; }
  .phone { justify-self: center; width: min(250px, 62vw); margin-right: 26px; /* room for the offset block */ }
  .game-icon { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 18px; }
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding-block: 20px 28px;
  font-size: 14px; color: var(--text-faint);
}
.site-footer::before { content: ""; flex-basis: 100%; height: 1px; margin-bottom: 12px; background: rgba(255, 255, 255, .1); }
.site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }
/* YouTube's red icon, 20 px tall and never recoloured, then "YouTube". Its clear space is the white triangle's width
   (7 px at this size): the gap before the word, and the nav's own gap on the other sides. */
.site-footer .yt { display: inline-flex; align-items: center; gap: 8px; }
.site-footer .yt img { display: block; width: auto; height: 20px; }
/* Narrow screens: the address on a row of its own, so the short links wrap together rather than leaving one alone. */
@media (max-width: 519px) {
  .site-footer nav a[href^="mailto:"] { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .game-link, .game-link svg { transition: none; }
}
