/* Second State Games: the studio's front door. Two colours and one line
   weight, like the logo, with the games' own art as the only colour. The page
   has a second state in which black and white change places. */

:root {
  --bg: #000;
  --fg: #fff;
  --quiet: #8a8a8a;
  --line: 2px;
  --edge: clamp(20px, 5vw, 72px);
  /* The headline's size. The stage also uses it, to work out how much of the screen is left under the headline. */
  --big: clamp(34px, 4.6vw, 80px);
  /* The widest the page's column gets. */
  --page: 1480px;
}
/* State 2: black on white. */
:root[data-state="2"] { --bg: #fff; --fg: #000; --quiet: #6b6b6b; }

* { box-sizing: border-box; }
/* The stage is as wide as the window, scrollbar and all; this hides the sliver that hangs over. */
html { background: var(--bg); overflow-x: clip; }
body {
  margin: 0 auto; max-width: var(--page); padding: 0 var(--edge);
  background: var(--bg); color: var(--fg);
  font: 19px/1.55 "Helvetica Neue", Helvetica, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1, h2, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
button { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
:focus-visible { outline: var(--line) solid var(--fg); outline-offset: 6px; }

/* ---------- Top: the name, and the switch ---------- */
header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 0; }
.mark { font-weight: 700; letter-spacing: -.01em; margin-right: auto; }
.plain { font-size: 15px; padding: 8px 0; border-bottom: var(--line) solid transparent; }
.plain:hover, .plain[aria-current] { border-color: var(--fg); }

.state { display: flex; align-items: center; gap: 6px; padding: 8px 0; font-size: 15px; }
.state i { width: 14px; height: 14px; border: var(--line) solid var(--fg); border-radius: 50%; }
.state i:first-child { background: var(--fg); }
:root[data-state="2"] .state i:first-child { background: none; }
:root[data-state="2"] .state i:nth-child(2) { background: var(--fg); }
.state span { margin-left: 8px; }
.state b { display: inline-block; min-width: 1ch; }

/* ---------- The sentence, and the two figures standing on its rule ---------- */
.hero { position: relative; margin-bottom: clamp(40px, 6vw, 72px); }
.face {
  --ink: var(--fg);
  --paper: var(--bg);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0 24px;
  padding-top: clamp(12px, 3vw, 40px);
  font-size: var(--big);
  color: var(--ink); background: var(--paper);
  border-bottom: var(--line) solid var(--ink);
}
/* On the front page the rule is the top edge of the stage, so the figures stand on its roof. */
.hero.roof { margin-bottom: 0; }
.roof .face { border-bottom: 0; }
h1 { font-size: 1em; line-height: 1.02; font-weight: 700; letter-spacing: -.03em; padding-bottom: .5em; }
h1 span { display: block; }
h1 br.narrow { display: none; }
/* "quirky" does not sit straight, and jumps about when the headline is pointed at. */
.quirk { font-weight: inherit; white-space: nowrap; }
.quirk i { display: inline-block; font-style: normal; transform: rotate(var(--tilt)) translateY(var(--hop)); }
.quirk i:nth-child(1) { --tilt: -8deg; --hop: .02em; } .quirk i:nth-child(2) { --tilt: 5deg; --hop: -.05em; }
.quirk i:nth-child(3) { --tilt: -3deg; --hop: .04em; } .quirk i:nth-child(4) { --tilt: 9deg; --hop: -.02em; }
.quirk i:nth-child(5) { --tilt: -6deg; --hop: -.06em; } .quirk i:nth-child(6) { --tilt: 7deg; --hop: .03em; }
.hero:hover .quirk i { animation: jig .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.hero:hover .quirk i:nth-child(even) { animation-delay: .07s; }
@keyframes jig { 40% { transform: rotate(calc(var(--tilt) * -1.4)) translateY(-.16em); } }

.figures { display: block; height: 2.5em; aspect-ratio: 92.3 / 119.8; color: var(--ink); }
.figures svg { display: block; width: 100%; height: 100%; overflow: visible; }
.figures .line { fill: currentColor; }
.defs { position: absolute; }
/* The figures stay an outline in both states (black on white in state 2); their inside is never filled. */
.figures .fill { display: none; }

/* The copy of the hero that shows in the circle under the mouse: the other
   state's colours. home.js sets its clip-path. */
.face.two {
  --ink: var(--bg);
  --paper: var(--fg);
  position: absolute; inset: 0; pointer-events: none;
  clip-path: circle(0 at 50% 50%);
}

h2 { font-size: 16px; font-weight: 700; padding-bottom: 14px; }
section { padding-bottom: clamp(56px, 9vw, 120px); }

/* ---------- The stage: the games, side by side, as wide as the window ----------
   Everything else on the page is black and white; the colour is all in here,
   and it is the games' own. Each half runs a few seconds of its game. Pointing
   at one gives it more of the room and quiets the other. Its colours do not
   change with the page's state. */
.stage {
  --pad: clamp(20px, 2.6vw, 40px);
  /* Where the page's column of text starts, measured from the window's edge. */
  --gutter: max(var(--edge), calc((100vw - var(--page)) / 2 + var(--edge)));
  display: flex; gap: var(--line);
  width: 100vw; margin-left: calc(50% - 50vw); padding: 0;
  /* Tall enough to end at the bottom of the first screen: the screen, less the top bar and the two-line headline. */
  --rest: calc(95px + clamp(12px, 3vw, 40px) + 2.54 * var(--big));
  height: clamp(440px, calc(100vh - var(--rest)), 1200px);
  height: clamp(440px, calc(100svh - var(--rest)), 1200px);
  background: var(--fg); border-block: var(--line) solid var(--fg);
}
.game {
  --pop: #d2232f; --shade: 6 4 8; --mid: .8; --high: .5;
  position: relative; isolation: isolate; overflow: hidden;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: var(--pad);
  color: #fff; background: #000;
  transition: flex-grow .5s cubic-bezier(.2, .7, .2, 1);
}
.game.dew { --pop: #7a55f5; --shade: 26 10 72; --mid: .45; --high: .12; }
.game:first-child { padding-left: var(--gutter); }
.game:last-child { padding-right: var(--gutter); }
.game:focus-visible { outline-offset: -8px; outline-color: #fff; }

.reel { position: absolute; inset: 0; z-index: -1; transition: filter .4s; }
.reel img, .reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel video { opacity: 0; transition: opacity .4s; }
.game.playing video { opacity: 1; }
/* A shade rising from the bottom, in the game's own dark, so the words can be read over any frame. */
.reel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(var(--shade) / .92), rgb(var(--shade) / var(--mid)) 32%, rgb(var(--shade) / var(--high)) 56%, rgb(var(--shade) / 0) 82%);
}

.tag { padding: 5px 11px 6px; font-size: 14px; line-height: 1.3; color: #000; background: #fff; }
.bill { display: grid; justify-items: start; gap: 14px; }
.logo { display: block; width: clamp(150px, min(17vw, 30vh), 310px); height: auto; }
.horde .logo { image-rendering: pixelated; }
.dew .logo { width: clamp(200px, min(23vw, 41vh), 420px); margin-left: -1.5%; }
.game .what { max-width: 24em; font-size: clamp(17px, 1.5vw, 24px); line-height: 1.4; color: #fff; text-wrap: balance; }
.game .go { margin-top: 6px; padding: 10px 18px 11px; font-size: 17px; color: #000; background: #fff; transition: color .15s, background-color .15s; }

@media (hover: hover) and (pointer: fine) {
  .game.lead { flex-grow: 1.45; }
  .stage.picked .game:not(.lead) .reel { filter: brightness(.5) saturate(.55); }
  .game.lead .go { color: #fff; background: var(--pop); }
}

/* ---------- Under the stage: a word about who, and where to find me ---------- */
.more {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: 0 clamp(40px, 8vw, 120px);
  padding-top: clamp(48px, 7vw, 96px);
}
.name { font-size: clamp(26px, 3vw, 38px); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.what { max-width: 30em; color: var(--quiet); }
.go { font-weight: 700; margin-top: 4px; }
.go::after { content: "\2192"; display: inline-block; margin-left: 10px; transition: transform .15s; }
a:hover .go::after, a:focus-visible .go::after { transform: translateX(8px); }

/* Plain ruled rows, for the links on the contact page. */
.games li { border-top: var(--line) solid var(--fg); }
.games li:last-child { border-bottom: var(--line) solid var(--fg); }
.games a { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) auto; align-items: baseline; gap: 6px 24px; padding: 18px 0 20px; }
.games .go { margin: 0; white-space: nowrap; }
/* The short kind, on the front page: a name and where it goes. */
.games.short a { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 0 16px; }
.games.short .name { font-size: clamp(22px, 2.2vw, 28px); }

.about { max-width: 34em; font-size: clamp(20px, 2vw, 25px); line-height: 1.45; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0 36px; border-top: var(--line) solid var(--fg); font-size: 15px; color: var(--quiet); }
footer a:hover, .under { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Contact ---------- */
.face.lone { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 760px) {
  .face { gap: 0 12px; font-size: clamp(24px, 7.1vw, 50px); }
  .face.lone { font-size: clamp(34px, 9vw, 60px); }
  h1 br.narrow { display: inline; }
  h1 br.wide { display: none; }
  .figures { height: 2.3em; }
  /* The games stack, each a tall window of its own. */
  .stage { flex-direction: column; height: auto; }
  .game { flex: none; height: min(74vh, 128vw); }
  .game, .game:first-child, .game:last-child { padding-inline: var(--edge); }
  .logo { width: clamp(150px, 42vw, 220px); }
  .dew .logo { width: clamp(200px, 56vw, 300px); }
  .more { grid-template-columns: minmax(0, 1fr); }
  .games a { grid-template-columns: minmax(0, 1fr); }
  .games.short a { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 480px) {
  header { gap: 16px; padding: 20px 0; }
  .state span { display: none; }
}

/* The logo shivers like a drawing only for people who have not asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .figures svg { filter: url(#boil); }
}

@media (prefers-reduced-motion: reduce) {
  .hero:hover .quirk i { animation: none; }
  * { transition: none !important; }
  .game.lead { flex-grow: 1; }
}
