/* The tiger is the page: the coat fills the top, it fades to black, and each game is a piece of white fur with stripes wrapping its edge. */
@property --sight {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 150%;
}

:root {
  --water: #050608;
  --fur: #f4f0e8;
  --stripe: #15120f;
  --eye: #93c9ea;
  --mist: #a4adb6;
  --display: 'Abril Fatface', 'Didot', 'Bodoni 72', Georgia, serif;
  --body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--water); }

body {
  margin: 0;
  padding-bottom: 76px;
  background: var(--water);
  color: var(--fur);
  font: 400 17px/1.55 var(--body);
}

a { color: inherit; text-decoration: none; }

a:focus-visible {
  outline: 2px solid var(--eye);
  outline-offset: 4px;
}

.hero {
  position: relative;
  display: grid;
  justify-items: end;
  align-content: center;
  min-height: clamp(520px, 74vh, 760px);
  padding-block: 40px 150px;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(clamp(24px, 6vw, 96px), env(safe-area-inset-right, 0px));
  color: var(--stripe);
  overflow: hidden;
}

.tiger {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(244, 240, 232, 0) 48%, rgba(244, 240, 232, 0.62) 72%),
    url('https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/White_tiger_in_zoo.jpg/1920px-White_tiger_in_zoo.jpg') 0 46% / cover no-repeat;
  -webkit-mask-image:
    radial-gradient(ellipse at 22% 46%, #000 var(--sight), transparent calc(var(--sight) + 12%)),
    linear-gradient(0deg, transparent 2%, #000 34%);
  mask-image:
    radial-gradient(ellipse at 22% 46%, #000 var(--sight), transparent calc(var(--sight) + 12%)),
    linear-gradient(0deg, transparent 2%, #000 34%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  animation: open-eye 1.5s ease-out both;
}

/* The page opens on the tiger's eye, then the coat appears around it. */
@keyframes open-eye {
  from { --sight: 5%; }
  to { --sight: 150%; }
}

.tiger canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

.tiger canvas.ready { opacity: 1; }

.hero > :not(.tiger) { position: relative; }

.hero h1 {
  margin: 0;
  font: 400 clamp(120px, 20vw, 280px)/0.86 var(--display);
  letter-spacing: 0.015em;
}

.hero p {
  margin: 14px 8px 0 0;
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 600;
}

.hero .watch {
  min-height: 1.5em;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.games {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  max-width: 1200px;
  margin: -118px auto 0;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--fur);
  color: var(--stripe);
  overflow: hidden;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.18s ease-out;
}

.glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(460px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 62%);
  mix-blend-mode: soft-light;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.game:hover .glare { opacity: 1; }

.art { position: relative; overflow: hidden; }

.art video, .art .scare {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.lead.live video { opacity: 1; }

/* The doorway fades in slowly while you hover, the way the game makes you wait. */
.side:hover .scare { opacity: 1; transition: opacity 1.8s ease-in 0.5s; }

.verdict {
  position: absolute;
  left: 50%;
  bottom: 14px;
  padding: 6px 14px;
  background: var(--stripe);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
}

.side.caught .verdict { opacity: 1; }

.game img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.side img { aspect-ratio: 16 / 9; }

.coat {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 26px 26px;
  overflow: hidden;
}

.coat::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: 240px;
  background: url('/coat.svg') right center / auto 100% no-repeat;
  transform-origin: right center;
  transition: transform 0.25s ease-out;
}

.side .coat::after { width: 104px; }

.game:hover .coat::after { transform: scaleX(1.14); }

.coat > * { position: relative; z-index: 1; max-width: calc(100% - 96px); }

.side .coat > * { max-width: calc(100% - 70px); }

.game h2 {
  margin: 0;
  font: 400 clamp(32px, 3.6vw, 44px)/1.08 var(--display);
}

.game p { margin: 0; }

.game .needs { color: #5b5549; font-size: 15px; }

.play {
  display: inline-block;
  width: fit-content;
  margin-top: 14px;
  padding: 11px 26px;
  background: var(--stripe);
  color: var(--eye);
  font-weight: 600;
  transition: color 0.12s ease-out;
}

.game:hover .play { color: #fff; }

.news {
  position: relative;
  max-width: 1200px;
  margin: clamp(56px, 8vw, 96px) auto 0;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

.news h2 {
  margin: 0 0 12px;
  font: 400 clamp(30px, 3.2vw, 40px)/1.1 var(--display);
}

.news ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(20px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.news a {
  display: block;
  padding: 16px 0;
  border-top: 1px solid rgba(244, 240, 232, 0.2);
}

.news small { display: block; color: var(--eye); font-size: 14px; font-weight: 600; }

.news b { display: block; font-size: 19px; font-weight: 600; }

.news span { display: block; color: var(--mist); font-size: 16px; }

.news a:hover b { color: var(--eye); }

.foot {
  position: relative;
  max-width: 1200px;
  margin: 32px auto 0;
  padding-block: 0 28px;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  color: var(--mist);
  font-size: 14px;
}

.foot a { text-decoration: underline; }

.dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  transform: translateX(-50%);
  background: rgba(22, 24, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 32px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
}

.dock a, .dock button {
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--fur);
  font: 600 15px/1.2 var(--body);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease-out;
}

.dock a:hover, .dock button:hover { background: rgba(255, 255, 255, 0.12); }

.dock .home { padding: 5px; line-height: 0; }

.dock .home img { width: 28px; height: 28px; border-radius: 8px; }

kbd {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--mist);
  font: 400 13px/1.2 var(--body);
}

#menu {
  width: min(560px, calc(100% - 32px));
  margin: 16vh auto 0;
  padding: 0;
  background: rgba(16, 18, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 24px 70px rgba(0, 0, 0, 0.6);
  color: var(--fur);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
}

#menu::backdrop { background: rgba(5, 6, 8, 0.55); }

#menu input {
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  outline: 0;
  background: none;
  color: var(--fur);
  font: 400 18px/1.3 var(--body);
}

#menu input::placeholder { color: var(--mist); }

#menu ul { margin: 0; padding: 8px; list-style: none; }

#menu button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--fur);
  font: 400 16px/1.3 var(--body);
  text-align: left;
  cursor: pointer;
}

#menu button.on { background: rgba(147, 201, 234, 0.18); }

#menu button span { color: var(--mist); font-size: 14px; }

#menu .none { padding: 12px; color: var(--mist); }

#wipe {
  position: fixed;
  z-index: 9;
  background: var(--water);
  transition: inset 0.28s ease-in;
}

.lost {
  position: relative;
  display: grid;
  gap: 20px;
  justify-items: start;
  width: fit-content;
  max-width: calc(100% - 48px);
  margin: 20vh auto 0;
  padding: 32px 96px 32px 36px;
  background: var(--fur) url('/coat.svg') right center / auto 100% no-repeat;
  color: var(--stripe);
}

.lost h1 { margin: 0; font: 400 clamp(40px, 7vw, 64px)/1.05 var(--display); }

.lost .play { margin-top: 0; }

.lost .play:hover { color: #fff; }

@media (max-width: 820px) {
  .hero {
    justify-items: start;
    align-content: end;
    min-height: 520px;
    padding-block: 40px 96px;
    color: var(--fur);
  }
  .tiger {
    background:
      url('https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/White_tiger_in_zoo.jpg/1280px-White_tiger_in_zoo.jpg') 8% 0 / auto 76% no-repeat;
    -webkit-mask-image: linear-gradient(0deg, transparent 26%, #000 58%);
    mask-image: linear-gradient(0deg, transparent 26%, #000 58%);
    -webkit-mask-composite: source-over;
    mask-composite: add;
    animation: none;
  }
  .hero h1 { font-size: clamp(100px, 29vw, 160px); }
  .coat::after, .side .coat::after { width: 92px; }
  .coat > *, .side .coat > * { max-width: calc(100% - 58px); }
  .hero p { margin-left: 2px; }
  .games { grid-template-columns: minmax(0, 1fr); margin-top: -64px; }
  .news ul { grid-template-columns: minmax(0, 1fr); }
  #open-menu { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tiger { animation: none; }
  .coat::after, .play, .game { transition: none; }
  .game:hover .coat::after { transform: none; }
  .side:hover .scare { transition: none; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .news li, .news h2 {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

@keyframes rise {
  from { opacity: 0.2; transform: translateY(22px); }
}
