/* Goodnight People · the worlds of the games (pictures that the pointer lights) and the words of a game in its own
   type. Used by the start page and the game pages; the focal points and light colours per game come from the game
   list (written into a stylesheet of their own). */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--gp-night); color: var(--gp-creme); -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100svh; position: relative;
  font-family: var(--font-brand); font-weight: 500;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background: var(--gp-night);
}
img, svg, canvas, video { display: block; }
a { color: inherit; }
p, h1, h2, h3, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.seg { white-space: nowrap; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------------ worlds */
.art { position: absolute; inset: 0; overflow: hidden; background: #0b0a0e; contain: strict; }
.art__img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.art--pixel .art__img, .art__canvas { image-rendering: pixelated; }
.art__canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.art--pixel.is-live .art__img { visibility: hidden; }
.art--photo.is-live .art__img, .art__lit { width: auto; height: auto; object-fit: fill; transform-origin: 0 0; max-width: none; }
.art--photo.is-live .art__img { filter: brightness(var(--amb, .8)) saturate(.9); }
.art__lit {
  position: absolute; left: 0; top: 0; opacity: var(--lo, 0); filter: brightness(1.12) contrast(1.04);
  -webkit-mask-image: radial-gradient(circle var(--lr, 240px) at var(--lx, -999px) var(--ly, -999px), #000 0, rgba(0,0,0,.75) 38%, rgba(0,0,0,.25) 70%, transparent 100%);
  mask-image: radial-gradient(circle var(--lr, 240px) at var(--lx, -999px) var(--ly, -999px), #000 0, rgba(0,0,0,.75) 38%, rgba(0,0,0,.25) 70%, transparent 100%);
}
/* announcement: no picture; a closed night and the line of light under a closed door */
.art--announce {
  background:
    radial-gradient(60% 40% at var(--ax, 50%) var(--ay, 66%), rgba(181,71,58,calc(var(--glow, .5) * .16)), rgba(181,71,58,0) 70%),
    linear-gradient(to bottom, #0c0b0d, #121014 62%, #0a090b);
}
.art--announce::before {
  content: ""; position: absolute; left: var(--ax, 50%); top: var(--ay, 66%); width: var(--aw, min(46%, 420px)); height: 2px; transform: translate(-50%, -50%);
  background: linear-gradient(to right, rgba(181,71,58,0), rgba(214,120,96,1) 18%, rgba(241,213,190,1) 50%, rgba(214,120,96,1) 82%, rgba(181,71,58,0));
  box-shadow: 0 0 6px rgba(230,140,120,.9), 0 0 22px 3px rgba(181,71,58,.6), 0 10px 40px rgba(181,71,58,.35);
  opacity: calc(.45 + var(--glow, .5) * .55);
}
.art--announce::after {
  content: ""; position: absolute; left: var(--ax, 50%); top: var(--ay, 66%); width: calc(var(--aw, 420px) * 1.3); max-width: 60%; height: 34%; transform: translateX(-50%);
  background: radial-gradient(50% 60% at 50% 0%, rgba(181,71,58,calc(var(--glow, .5) * .22)), rgba(181,71,58,0) 80%);
}

/* ------------------------------------------------------------------ the words of a game, each game in its own type */
.game__title { margin: 0; line-height: 0; }
.game__logo { height: auto; }
.game__name {
  display: block; font: 700 clamp(30px, 3.4vw, 64px)/.95 var(--font-brand); letter-spacing: .14em; text-transform: uppercase;
  color: var(--gp-creme); padding-left: .14em;
}
.game__genre, .game__status { font: 500 12px/1.5 var(--font-brand); letter-spacing: .22em; text-transform: uppercase; text-wrap: balance; }
.game__genre { color: var(--gp-creme); }
.game__status { color: rgba(241,233,219,.74); }
.game__cta {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none; padding: 10px 0; position: relative;
  font: 600 13px/1 var(--font-brand); letter-spacing: .26em; text-transform: uppercase; color: var(--gp-creme);
}
.arrow { width: 28px; height: 1px; background: currentColor; position: relative; transition: width .5s var(--ease-out); flex: none; }
.arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.game__cta:hover .arrow, .game__cta:focus-visible .arrow { width: 40px; }
.game--pixel .game__genre { color: var(--s8-ink); }
.game--pixel .game__cta { color: var(--s8-sodium); }
.game--photo .game__genre, .game--photo .game__status { color: var(--omm-dim); }
.game--photo .game__cta { font: 600 13px/1 var(--font-omm-title); letter-spacing: .24em; color: var(--omm-bone); }

@media (pointer: coarse), (max-width: 700px) {
  .game__cta { min-height: 44px; padding-top: 0; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* Goodnight People · the clear site: the main game large (title picture, genre, words, the way in), the games as a
   list, the studio. Shared by the start page and the game page of the main game. Normal scrolling. */

/* ------------------------------------------------------------------ hero: the main game */
.hero { position: relative; height: clamp(500px, 74vh, 940px); overflow: hidden; background: var(--s8-handoff); isolation: isolate; }
.hero .art { position: absolute; inset: 0; }
.hero__shade {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(to top, rgba(13,11,20,.94) 0%, rgba(13,11,20,.6) 30%, rgba(13,11,20,0) 58%),
    linear-gradient(to right, rgba(13,11,20,.78) 0%, rgba(13,11,20,.3) 34%, rgba(13,11,20,0) 56%),
    linear-gradient(to bottom, rgba(13,11,20,.65) 0%, rgba(13,11,20,0) 18%);
}
.hero__text {
  position: absolute; z-index: 2; left: calc(var(--gutter) + 1vw); bottom: clamp(30px, 7vh, 92px); width: min(620px, 88vw);
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
}
.hero__kicker { font: 500 12px/1.3 var(--font-brand); letter-spacing: .3em; text-transform: uppercase; color: rgba(244,234,216,.74); }
.hero__title { margin: 0; line-height: 0; }
.hero__logo { width: clamp(280px, 27vw, 480px); height: auto; }
.hero__genre { font: 500 14px/1.4 var(--font-brand); letter-spacing: .24em; text-transform: uppercase; color: var(--s8-sodium); }
.hero__tag { font: 500 clamp(21px, 1.7vw, 30px)/1.2 var(--font-brand); letter-spacing: .03em; color: var(--s8-ink); text-wrap: balance; }
.hero__intro { font: 400 clamp(15px, 1.05vw, 18px)/1.6 var(--font-omm-text); color: rgba(244,234,216,.88); max-width: 52ch; text-wrap: pretty; }
.hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 22px; text-decoration: none; border-radius: 2px;
  font: 600 14px/1 var(--font-brand); letter-spacing: .22em; text-transform: uppercase; transition: background .3s ease, color .3s ease;
}
.btn--primary { background: var(--s8-sodium); color: #1d1408; }
.btn--primary:hover, .btn--primary:focus-visible { background: #ffd27a; }
.btn--quiet { border: 1px solid rgba(244,234,216,.4); color: var(--s8-ink); }
.btn--quiet:hover, .btn--quiet:focus-visible { border-color: var(--s8-ink); }
.btn:hover .arrow, .btn:focus-visible .arrow { width: 40px; }
/* the state of the game on Steam: a line of text while the store page is not public, a button once it is */
.hero__status { display: inline-flex; align-items: center; gap: 12px; font: 600 13px/1.3 var(--font-brand); letter-spacing: .22em; text-transform: uppercase; color: rgba(244,234,216,.8); }
.hero__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--s8-sodium); box-shadow: 0 0 8px rgba(240,168,72,.8); flex: none; }

/* ------------------------------------------------------------------ the games */
.games { position: relative; padding: clamp(28px, 3.4vw, 64px) calc(var(--gutter) + 1vw) clamp(56px, 7vw, 120px); background: #121113; scroll-margin-top: var(--head-h); }
.games__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(18px, 2.6vw, 40px); }
.games__title { font: 600 clamp(26px, 2.4vw, 42px)/1 var(--font-brand); letter-spacing: .16em; text-transform: uppercase; color: var(--gp-creme); }
.games__count { font: 500 13px/1 var(--font-brand); letter-spacing: .24em; text-transform: uppercase; color: rgba(241,233,219,.62); }
.games__seam {
  flex: 1; height: 1px; align-self: center; margin-left: 8px;
  background: linear-gradient(to right, #d27a62, rgba(241,233,219,.2) 35%, rgba(241,233,219,0));
  box-shadow: 0 0 8px rgba(181,71,58,.45);
}
.games__list { margin: 0; padding: 0; list-style: none; }

/* ------------------------------------------------------------------ the studio */
.studio {
  display: grid; justify-items: center; gap: 14px; text-align: center; padding: clamp(48px, 7vw, 110px) var(--gutter);
  background: radial-gradient(40% 70% at 50% 100%, rgba(181,71,58,.12), rgba(181,71,58,0)), #0f0e10;
}
.studio__mark { width: 46px; height: auto; }
.studio__text { font: 500 clamp(18px, 1.5vw, 26px)/1.35 var(--font-brand); letter-spacing: .04em; color: var(--gp-creme); max-width: 30ch; text-wrap: balance; }
.studio__link {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none;
  font: 600 13px/1 var(--font-brand); letter-spacing: .24em; text-transform: uppercase; color: rgba(241,233,219,.82);
}
.studio__link:hover .arrow { width: 40px; }

/* ------------------------------------------------------------------ leaving for a game page: quiet into the game's colour */
.handoff { position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0; background: var(--handoff, #000); }
html.leaving .handoff { opacity: 1; transition: opacity .38s ease var(--handoff-delay, .9s); }
html.leaving .gp-head { opacity: 0; transition: opacity .3s ease; }
html.leaving, html.leaving body { background: var(--handoff, #000); transition: background-color .4s ease; }

@media (max-width: 700px) {
  /* phones: the picture on top, the words below it on the night of the game */
  .hero { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .hero .art { position: relative; inset: auto; height: 50svh; flex: none; }
  .hero__shade { inset: 0 0 auto 0; height: 50svh; background: linear-gradient(to top, var(--s8-handoff) 0%, rgba(13,11,20,0) 30%), linear-gradient(to bottom, rgba(13,11,20,.75) 0%, rgba(13,11,20,0) 22%); }
  .hero__text { position: relative; left: auto; bottom: auto; width: auto; padding: 0 16px 30px; margin-top: -34px; gap: 9px; }
  .hero__logo { width: min(280px, 72vw); }
  .hero__genre { font-size: 12px; letter-spacing: .2em; }
  .hero__tag { font-size: 20px; }
  .hero__intro { font-size: 15px; }
  .btn { padding: 0 18px; font-size: 13px; }
  .hero__status { font-size: 12px; min-height: 44px; }
  .games { padding: 32px 16px 56px; }
}

/* written from the game list: focal points, light and handoff colours per game */
[data-id="standing-eight"] { --light: #f0a848; --handoff: #0d0b14; }
.art[data-id="standing-eight"] .art__img { object-position: 50.0% 66.0%; }
.card .art[data-id="standing-eight"] .art__img { object-fit: none; object-position: 50.8% min(calc(100% + 44px), 0px); }
[data-id="one-more-minute"] { --light: #ddc9ae; --handoff: #000000; }
.art[data-id="one-more-minute"] .art__img { object-position: 46.3% 42.0%; }
[data-id="drained"] { --light: #b5473a; --handoff: #0c0b0d; }

/* Goodnight People · start page "Light cards": the clear site with the brand's light. The light wedge of the mark
   falls from the door in the header across the main game; the games are cards divided by seams of terracotta light,
   each card a live picture that the pointer lights in that game's own way; a click opens the card into the game. */

/* the wedge of the mark, falling from the door in the header across the hero */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(118deg, rgba(214,120,96,.34) 0%, rgba(181,71,58,.16) 26%, rgba(181,71,58,0) 58%);
  clip-path: polygon(calc(var(--gutter) + 14px) 0%, calc(var(--gutter) + 44px) 0%, 74% 100%, 40% 100%);
  opacity: .55;
}
/* visitors arriving from outside on a wide screen: the main game opens out of the wedge (html.intro, set before the
   first paint); without script the picture opens on its own after 1.2 s, phones and calm visitors skip it */
html.intro .hero .art { clip-path: polygon(2% 0%, 3.5% 0%, 22% 100%, 18% 100%, 2% 0%); animation: wedge-in 1.25s cubic-bezier(.65, 0, .35, 1) 1.2s forwards; }
html.intro.live .hero .art { animation-delay: .05s; }
html.intro .hero::after { animation: wedge-glow 1.6s ease 1.2s both; }
html.intro.live .hero::after { animation-delay: .05s; }
@keyframes wedge-in {
  from { clip-path: polygon(2% 0%, 3.5% 0%, 22% 100%, 18% 100%, 2% 0%); }
  55% { clip-path: polygon(-10% 0%, 40% 0%, 120% 100%, -20% 100%, -10% 0%); }
  to { clip-path: polygon(-60% -20%, 160% -20%, 160% 120%, -60% 120%, -60% -20%); }
}
@keyframes wedge-glow { from { opacity: 1; } to { opacity: .55; } }

/* ------------------------------------------------------------------ cards */
/* rows are tall enough for the words and a whole figure in two steps on common screens; a row grows rather than
   cover a figure (the pixel picture keeps at least the room of its figure at native size) */
.games--cards .games__list {
  --cols: 3; --row-h: clamp(400px, 41vw, 660px);
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(var(--row-h), auto); gap: 2px;
  /* the gaps are seams of light: terracotta where the light enters at the top, fading downwards */
  background: linear-gradient(to bottom, rgba(222,128,104,.95), rgba(181,71,58,.5) 45%, rgba(241,233,219,.1));
  box-shadow: 0 -10px 30px -12px rgba(181,71,58,.45);
}
html[data-n="2"] .games--cards .games__list { --cols: 2; --row-h: clamp(420px, 40vw, 660px); }
html[data-n="4"] .games--cards .games__list { --cols: 4; }
html[data-n="5"] .games--cards .games__list { --cols: 6; --row-h: clamp(400px, 36vw, 600px); }
html[data-n="5"] .card { grid-column: span 2; }
html[data-n="5"] .card:nth-child(n+4) { grid-column: span 3; }
html[data-n="6"] .games--cards .games__list { --row-h: clamp(400px, 36vw, 600px); }
html[data-n="7"] .games--cards .games__list { --cols: 12; --row-h: clamp(400px, 30vw, 540px); }
html[data-n="7"] .card { grid-column: span 3; }
html[data-n="7"] .card:nth-child(n+5) { grid-column: span 4; }
html[data-n="8"] .games--cards .games__list { --cols: 4; --row-h: clamp(400px, 30vw, 540px); }

.card { position: relative; overflow: hidden; background: #0c0b0d; min-width: 0; --cta-h: 33px; }
.card[data-href] { cursor: pointer; }
.card__media { position: absolute; inset: 0; }
.card__media .art { position: absolute; inset: 0; }
.card__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(9,8,10,.92) 0%, rgba(9,8,10,.62) 28%, rgba(9,8,10,0) 55%);
}
.card__body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: clamp(18px, 2vw, 32px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
/* a card without a way in keeps the room of one, so its lines stand level with the neighbours' */
.card:not([data-href]) .card__body { padding-bottom: calc(clamp(18px, 2vw, 32px) + var(--cta-h) + 8px); }
/* pixel art: the picture stands above the words, never under them (its figure is never covered by a logo) */
.card.game--pixel { display: flex; flex-direction: column; }
.card.game--pixel .card__media { position: relative; inset: auto; flex: 1 1 auto; min-height: 132px; }
.card.game--pixel .card__media::after { inset: 0 0 -2px 0; background: linear-gradient(to top, #0c0b0d 0%, #0c0b0d 2px, rgba(12,11,13,0) 26%); }
/* the line of light of an announcement stays clear of its words (before the script places it) */
.card .art--announce { --ay: 55%; }
.card.game--pixel .card__body { position: relative; flex: none; }
.card__num { font: 500 12px/1 var(--font-brand); letter-spacing: .26em; color: rgba(241,233,219,.55); margin-bottom: 2px; }
.card .game__logo { width: min(86%, 320px); }
.card.game--photo .game__logo { width: min(92%, 360px); }
.card .game__name { font-size: clamp(30px, 3vw, 58px); line-height: 1.02; letter-spacing: .12em; overflow-wrap: anywhere; padding-left: 0; margin-bottom: 4px; }
.card__tag { display: none; }
.card .game__cta { padding-left: 0; }
.card:focus-within { outline: 2px solid var(--gp-creme); outline-offset: -4px; }
html[data-n="5"] .card .game__logo, html[data-n="8"] .card .game__logo, html[data-n="7"] .card .game__logo { width: min(86%, 240px); }
html[data-n="8"] .card .game__genre, html[data-n="7"] .card .game__genre,
html[data-n="8"] .card .game__status, html[data-n="7"] .card .game__status { font-size: 11px; letter-spacing: .18em; }

/* opening a card into the game */
.flip { position: fixed; z-index: 75; overflow: hidden; pointer-events: none; background: #0c0b0d;
  transition: left .85s cubic-bezier(.65, 0, .35, 1), top .85s cubic-bezier(.65, 0, .35, 1), width .85s cubic-bezier(.65, 0, .35, 1), height .85s cubic-bezier(.65, 0, .35, 1); }
.flip .art { position: absolute; inset: 0; }
html.leaving .games, html.leaving .studio, html.leaving .gp-foot, html.leaving .hero__text { opacity: 0; transition: opacity .4s ease; }

@media (pointer: coarse), (max-width: 700px) { .card { --cta-h: 44px; } }
@media (max-width: 700px) {
  .games--cards .games__list, html[data-n] .games--cards .games__list { --cols: 1; grid-auto-rows: auto; }
  html[data-n] .card, html[data-n] .card:nth-child(n) { grid-column: auto; height: min(116vw, 540px); }
  html[data-n] .card.game--pixel { height: min(142vw, 600px); }
  /* an announcement on a phone: only its words, under one seam of light (no empty picture box) */
  html[data-n] .card.game--announce { height: auto; }
  .card.game--announce .art--announce { --ay: 28px; }
  .card.game--announce .card__body { position: relative; padding-top: 58px; }
  .card:not([data-href]) .card__body { padding-bottom: clamp(18px, 2vw, 32px); }
  .card .game__logo, html[data-n] .card .game__logo { width: min(240px, 70vw); }
  .hero::after { clip-path: polygon(30px 0%, 54px 0%, 92% 100%, 52% 100%); }
}
@media (prefers-reduced-motion: reduce) {
  html.live .hero .art, html.live .hero::after { animation: none; }
}
