/* 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; }

/* Standing Eight · game page: title picture, genre, words, the way on; the trailer; the game in six parts, each with a
   screenshot or a short silent clip; all screenshots; the game at a glance; the note on AI; the state on Steam.
   The page starts in the colour the start page ends in (--s8-handoff). Pixel art is scaled by whole numbers only. */

html { background: var(--s8-handoff); }
body.s8 { background: var(--s8-handoff); color: var(--s8-ink); }
.s8-hero { height: clamp(560px, 92vh, 1080px); }
.s8-hero .hero__logo { width: clamp(300px, 33vw, 640px); }

.s8-h {
  display: flex; align-items: baseline; gap: 16px; margin: 0 0 clamp(14px, 1.6vw, 24px);
  font: 600 clamp(22px, 2vw, 34px)/1.1 var(--font-brand); letter-spacing: .14em; text-transform: uppercase; color: var(--s8-ink);
}
.s8-h__meta { font: 500 13px/1 var(--font-brand); letter-spacing: .2em; color: rgba(244,234,216,.6); }
.s8-trailer .s8-h::after, .s8-shots .s8-h::after, .s8-glance .s8-h::after {
  content: ""; flex: 1; height: 1px; align-self: center; background: linear-gradient(to right, rgba(240,168,72,.7), rgba(244,234,216,.12) 40%, rgba(244,234,216,0));
}

.s8-trailer, .s8-features, .s8-shots, .s8-glance, .s8-ki, .s8-end { width: min(1500px, 100% - 2 * (var(--gutter) + 1vw)); margin: 0 auto; }
.s8-trailer { padding-top: clamp(40px, 5vw, 90px); scroll-margin-top: var(--head-h); }
.s8-trailer__video { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
/* the player keeps its controls inside; the ring goes around the whole player */
.s8-trailer__video:focus, .s8-trailer__video:focus-within { outline: 2px solid var(--s8-ink); outline-offset: 4px; }

/* the game in parts: words beside a screenshot or a clip, alternating sides */
.s8-features { padding-top: clamp(48px, 6vw, 110px); display: grid; gap: clamp(48px, 6vw, 110px); }
.s8-feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 72px); align-items: center; }
.s8-feature--flip .s8-feature__text { order: 2; }
.s8-feature__text p, .s8-list { margin: 0 0 14px; font: 400 17px/1.65 var(--font-omm-text); color: rgba(244,234,216,.88); max-width: 60ch; text-wrap: pretty; }
.s8-feature__text b { color: var(--s8-ink); font-weight: 600; }
.s8-list { padding-left: 0; list-style: none; }
.s8-list li { position: relative; padding: 6px 0 6px 20px; }
.s8-list li::before { content: ""; position: absolute; left: 0; top: 17px; width: 7px; height: 7px; background: var(--s8-sodium); }
.s8-feature__media { position: relative; margin: 0; aspect-ratio: 16 / 9; background: #000; overflow: hidden; box-shadow: 0 0 0 1px rgba(244,234,216,.08); }
.s8-feature__img, .s8-clip { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.s8-clip { cursor: pointer; }
/* pause and play a clip: a small square in the corner, the sign drawn in CSS (two bars, or a triangle) */
.s8-clip__toggle {
  position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 1px solid rgba(244,234,216,.35); border-radius: 2px; background: rgba(13,11,20,.72); color: var(--s8-ink); cursor: pointer;
}
.s8-clip__toggle[hidden] { display: none; }
.s8-clip__toggle:hover, .s8-clip__toggle:focus-visible { border-color: var(--s8-ink); background: rgba(13,11,20,.9); }
.s8-clip__toggle:focus-visible { outline: 2px solid var(--s8-ink); outline-offset: 2px; }
.s8-clip__icon { width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor; margin-left: 3px; }
.is-playing .s8-clip__icon { width: 12px; height: 14px; border: 0; margin: 0; background: linear-gradient(to right, currentColor 0 4px, transparent 4px 8px, currentColor 8px 12px); }

.s8-shots { padding-top: clamp(56px, 7vw, 120px); }
.s8-shots__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.s8-shots__grid img { width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; background: #000; }
/* each preview opens the full picture (1920 × 1080) */
.s8-shots__link { display: block; outline-offset: 3px; }
.s8-shots__link:hover img { filter: brightness(1.08); }
.s8-shots__link:focus-visible { outline: 2px solid var(--s8-ink); }
.s8-shots__grid figcaption { margin-top: 8px; font: 500 12px/1.3 var(--font-brand); letter-spacing: .2em; text-transform: uppercase; color: rgba(244,234,216,.7); }

.s8-glance { padding-top: clamp(56px, 7vw, 120px); }
.s8-glance ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.s8-glance li { position: relative; padding: 14px 0 14px 22px; border-top: 1px solid rgba(244,234,216,.1); font: 400 17px/1.5 var(--font-omm-text); color: rgba(244,234,216,.9); }
.s8-glance li::before { content: ""; position: absolute; left: 0; top: 24px; width: 8px; height: 8px; background: var(--s8-sodium); }

.s8-ki { padding-top: clamp(40px, 5vw, 80px); }
.s8-ki__h { margin: 0 0 8px; font: 600 13px/1.3 var(--font-brand); letter-spacing: .22em; text-transform: uppercase; color: rgba(244,234,216,.78); }
.s8-ki p { margin: 0; max-width: 92ch; font: 400 15px/1.6 var(--font-omm-text); color: rgba(244,234,216,.76); }

.s8-end { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: clamp(40px, 5vw, 80px) 0 clamp(64px, 8vw, 130px); }
.s8-end__line { margin: 0; font: 400 17px/1.5 var(--font-omm-text); color: rgba(244,234,216,.88); }
.gp-foot { background: #0b0910; }

/* ------------------------------------------------------------------ arriving from the start page */
/* the page starts in the game's colour (html.from-home is set before the first paint) and opens once the title
   picture stands where the takeover left it (html.hero-ready); without the script it opens on its own after 1.4 s */
.handoff--in { background: var(--s8-handoff); opacity: 0; z-index: 70; }
html.from-home .handoff--in { opacity: 1; }
html.from-home:not(.hero-ready) .handoff--in { animation: hand-in .7s 1.4s ease both; }
html.from-home.hero-ready .handoff--in { opacity: 0; transition: opacity .7s ease; }
@keyframes hand-in { from { opacity: 1; } to { opacity: 0; } }
html.from-home .s8-hero .hero__text > * { animation: rise .9s cubic-bezier(.16, 1, .3, 1) both; }
html.from-home .s8-hero .hero__text > :nth-child(2) { animation-delay: .1s; }
html.from-home .s8-hero .hero__text > :nth-child(3) { animation-delay: .18s; }
html.from-home .s8-hero .hero__text > :nth-child(4) { animation-delay: .26s; }
html.from-home .s8-hero .hero__text > :nth-child(5) { animation-delay: .34s; }
html.from-home .s8-hero .hero__text > :nth-child(6) { animation-delay: .42s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
html.from-home .gp-head { animation: rise-head .8s .5s ease both; }
@keyframes rise-head { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .s8-feature, .s8-feature--flip { grid-template-columns: 1fr; }
  .s8-feature--flip .s8-feature__text { order: 0; }
  .s8-shots__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .s8-hero { height: auto; }
  .s8-hero .hero__logo { width: min(300px, 78vw); }
  .s8-shots__grid, .s8-glance ul { grid-template-columns: 1fr; }
  /* on a phone the page is one column: a picture that already stands beside its section is not shown again */
  .s8-shots__grid .is-in-feature { display: none; }
  .s8-feature__text p, .s8-list, .s8-glance li { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html.from-home .handoff--in { display: none; }
}
