/* Ammonite Design Studios
   One stylesheet for every page. Each game brings its own colours through
   --bg, --ink and --accent, set inline from games.json. */

@font-face {
  font-family: "Cabin";
  src: url("fonts/cabin-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cabin";
  src: url("fonts/cabin-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* the site itself is black with white type, like the studio logo;
     each game then brings its own colours */
  --black: #000;
  --white: #fff;
  --bg: var(--black);
  --ink: var(--white);
  --accent: var(--ink);
  --pad: clamp(1rem, 2.6vw, 2.5rem);
  --ease: cubic-bezier(.2, .75, .15, 1);
  --spring: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.45 "Cabin", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--pad); top: -4rem; z-index: 10; padding: .6rem .9rem; background: var(--white); color: var(--black); }
.skip:focus { top: .5rem; }

.label { font-size: .75rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; line-height: 1.2; }
.num { font-variant-numeric: tabular-nums; }
.ico { display: inline-block; flex: none; width: 1.15em; height: 1.15em; margin-right: .5em; vertical-align: -.22em; }
.arr { display: inline-block; margin-left: .3em; transition: translate .5s var(--spring); }

/* Big condensed titles. Each one is sized to the width of its container:
   --w is the title's width in em, worked out when the site is built. */
.title {
  font-weight: 700;
  font-stretch: 75%;
  line-height: .84;
  letter-spacing: -.025em;
  color: var(--accent);
  text-wrap: nowrap;
}
.title a { color: inherit; text-decoration: none; display: block; }
.line { display: block; overflow: clip; padding: .1em .05em .25em; margin: -.1em -.05em -.25em; }
.line > span { display: block; }

/* ── Header ─────────────────────────────────────────────── */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem var(--pad);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand__mark { width: 1.9rem; height: 1.9rem; flex: none; }
.spin { transform-origin: 51.65% 56.68%; will-change: transform; }
.brand__name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; }
.brand__name span { font-weight: 400; }
/* tagline: on its own line under the name on phones, beside it on wider screens */
.top__id { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.top__nav { flex: none; }
.top__note { margin-left: 2.5rem; margin-top: -.15rem; font-size: .8125rem; line-height: 1.25; opacity: .62; text-wrap: balance; }
@media (min-width: 720px) {
  .top__id { flex-direction: row; align-items: center; gap: .9rem; }
  .top__note { margin: 0; padding-left: .9rem; border-left: 1px solid color-mix(in srgb, currentColor 40%, transparent); font-size: .9375rem; white-space: nowrap; }
}
.top__nav { display: flex; gap: 1.4rem; }
.top__link { font-size: .75rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; padding: .6rem 0; background: linear-gradient(currentColor, currentColor) 0 calc(100% - .35rem) / 100% 1px no-repeat; transition: background-size .4s var(--ease); }
.top__link:hover { background-size: 0 1px; background-position: 100% calc(100% - .35rem); }
.top__link, .brand__name { white-space: nowrap; }
/* phones: the name stacks like the logo, and the logo is the way home */
@media (max-width: 719px) {
  .top { align-items: flex-start; }
  .brand__name { line-height: 1.12; }
  .brand__name span { display: block; }
  .top__note { margin-top: .35rem; }
  .top__link--games { display: none; }
}

/* ── Intro sentence (it doubles as the index) ───────────── */

.intro {
  padding: clamp(.75rem, 2vw, 2rem) var(--pad) clamp(1.5rem, 2.6vw, 2.5rem);
  max-width: 62rem;
  font-size: clamp(1.75rem, 1.05rem + 3.2vw, 4rem);
  font-weight: 600;
  font-stretch: 82%;
  line-height: 1.04;
  letter-spacing: -.022em;
  text-wrap: balance;
}
.intro a {
  text-decoration: none;
  padding: 0 .06em;
  margin: 0 -.06em;
  background: linear-gradient(var(--c), var(--c)) 0 92% / 100% .16em no-repeat;
  transition: background-size .45s var(--ease);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.intro a:hover, .intro a:focus-visible { background-size: 100% 92%; }

/* ── The wall of games ──────────────────────────────────── */

/* Every game is its own block: a gap all round, and always the same order
   inside (label, title, picture, then the line of text and store links). */
.home .top { padding-bottom: 1.1rem; }
.wall { --gut: clamp(.5rem, .9vw, .875rem); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gut); }

.plate {
  --pp: clamp(1rem, 2.2vw, 2rem);
  grid-column: 1 / -1;
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  container-type: inline-size;
  overflow: clip;
  scroll-margin-top: 0;
}
@media (min-width: 720px) { .plate { grid-column: span var(--span, 6); } }

.plate__head { display: flex; gap: 1.1rem; padding: var(--pp) var(--pp) 0; }
.plate__view { margin-left: auto; white-space: nowrap; }
.plate__title { padding: .7rem var(--pp) .1em; font-size: min(calc((100cqi - 2 * var(--pp)) / var(--w)), 24rem); }
.plate__media { margin-top: auto; }
.plate__title + .plate__media { border-top: clamp(.9rem, 1.8vw, 1.5rem) solid var(--bg); }
.plate__foot { display: grid; gap: .9rem; padding: 1.1rem var(--pp) var(--pp); }
.plate__tag { font-size: clamp(1.0625rem, .95rem + .5vw, 1.375rem); font-weight: 500; line-height: 1.2; max-width: 26ch; text-wrap: balance; }

/* feature: the title sits on the artwork, which fades up into the plate */
.plate--feature .plate__title { position: relative; z-index: 1; font-size: min(calc((100cqi - 2 * var(--pp)) / var(--w)), 26rem); }
.plate--feature .plate__media {
  margin-top: -6.5cqi; border-top: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%);
  mask-image: linear-gradient(to bottom, transparent, #000 22%);
  background: none;
}

.stores { display: flex; flex-wrap: wrap; gap: .1rem 1.5rem; }
.stores a { display: inline-block; padding: .55rem 0; font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 calc(100% - .4rem) / 100% 1.5px no-repeat; }
a:hover > .arr, .plate:hover .plate__view .arr { translate: .18em -.18em; }
.plate:hover .plate__view .arr { translate: .3em 0; }

/* media: artwork, optional flip-book frames, optional video loop */
.media { position: relative; display: block; overflow: clip; aspect-ratio: var(--ar-m, 4/5); background: color-mix(in srgb, var(--ink) 12%, var(--bg)); }
@media (min-width: 720px) { .media { aspect-ratio: var(--ar, 16/9); } }
.media > * {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--focus, 50% 50%);
  scale: 1.06;
  transition: scale 1.4s var(--ease), opacity .5s linear;
}
.media__frame, .media__video { opacity: 0; }
.media__frame.on, .media.playing .media__video { opacity: 1; }
.media__frame { transition: scale 1.4s var(--ease), opacity .12s linear; }
@media (hover: hover) { .plate:hover .media > * { scale: 1.1; } }

/* gentle parallax where the browser can drive it from scroll */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .media > * { animation: drift linear both; animation-timeline: view(); }
    @keyframes drift { from { translate: 0 -2.4%; } to { translate: 0 2.4%; } }
  }
}

/* strip: a row of objects you can swipe through */
.strip { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.strip__track { display: flex; width: max-content; }
.strip__img { width: max(30cqi, 13.5rem); height: auto; scroll-snap-align: start; }
.plate--strip .plate__media { container-type: inline-size; }

/* bleed: the artwork is the whole plate, title set on top of it */
@media (min-width: 720px) {
  .plate--bleed .plate__media { order: -1; margin-top: 0; border-top: 0; }
  .plate--bleed .plate__head { position: absolute; z-index: 2; top: 0; left: 0; right: 0; }
  .plate--bleed .plate__title { position: absolute; z-index: 2; top: calc(var(--pp) + 1.2rem); left: 0; font-size: 7.4cqi; pointer-events: none; }
  .plate--bleed .plate__title a { pointer-events: auto; }
  .plate--bleed .line { display: inline-block; vertical-align: top; }
  .plate--bleed .line + .line { margin-left: .2em; }
  .plate--bleed .plate__foot { margin-top: 0; grid-template-columns: 1fr auto; align-items: end; }
  .plate--bleed .plate__tag { max-width: 40ch; }
}

/* poster: flat graphic backdrop, a cut-out figure standing in front of the title */
.plate--poster { --shade: rgb(18 20 18 / .34); min-height: 150vw; background: var(--bg) center / cover no-repeat; }
.plate--poster .plate__media { position: absolute; inset: 0; z-index: 1; overflow: clip; }
.poster__figure { position: absolute; left: 50%; bottom: -1%; width: auto; height: 68%; max-width: none; transform: translateX(-50%); transform-origin: 50% 100%; transition: scale 1.2s var(--ease); }
@media (hover: hover) { .plate--poster:hover .poster__figure { scale: 1.05; } }
.plate--poster .plate__media { margin-top: 0; border-top: 0; }
.plate--poster .plate__head { position: relative; z-index: 2; pointer-events: none; }
.plate--poster .plate__title { position: relative; z-index: 0; }
.plate--poster .plate__foot { position: relative; z-index: 2; pointer-events: none; margin-top: auto; }
.plate--poster .plate__foot a { pointer-events: auto; }
@media (min-width: 720px) {
  .plate--poster { min-height: calc(100vw * var(--span) / 12 * 1.25); }
  .plate--feature .plate__foot { grid-template-columns: 1fr auto; align-items: end; }
  .plate--feature .plate__tag { max-width: 34ch; }
}

/* entrances */
.js .plate__media, .js .g__media { clip-path: inset(0 0 100% 0); }
.js .plate--poster .plate__media { clip-path: none; }
.js .plate--poster:not(.in) .poster__figure { translate: 0 40%; opacity: 0; }
.js .plate--poster.in .poster__figure { transition: translate 1.3s var(--spring) .15s, opacity .5s linear .15s, scale 1.2s var(--ease); }
.js .in .plate__media, .js .in .g__media { clip-path: inset(0); transition: clip-path 1.1s var(--ease); }
.js .plate:not(.in) .media > * { scale: 1.3; }
.js .line > span { translate: 0 150%; }
.js .in .line > span, .js .line.in > span { translate: 0; transition: translate 1s var(--spring) calc(var(--i, 0) * 90ms + 80ms); }
.js .plate__head, .js .plate__foot { opacity: 0; translate: 0 .8rem; }
.js .in .plate__head, .js .in .plate__foot { opacity: 1; translate: 0; transition: opacity .7s linear .25s, translate .9s var(--ease) .25s; }

/* ── Game pages ─────────────────────────────────────────── */

.g__head { padding: clamp(1rem, 3vw, 3rem) var(--pad) 0; container-type: inline-size; }
.g__meta { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.g__title { padding-bottom: .12em; font-size: min(calc(100cqi / var(--w-m)), 30rem); }
.g__title-1 { display: none; }
@media (min-width: 720px) {
  .g__title { font-size: min(calc(100cqi / var(--w)), 24rem); }
  .g__title-1 { display: block; }
  .g__title-m { display: none; }
}
.g__body { margin-top: clamp(.5rem, 1.4vw, 1.25rem); }
.g__media { aspect-ratio: var(--ar); }
.g__media.media { aspect-ratio: var(--ar-m, var(--ar)); }
@media (min-width: 720px) { .g__media.media { aspect-ratio: var(--ar); } }
.g--wide .g__media.media { max-height: 86svh; width: 100%; }
.strip--hero { aspect-ratio: auto; container-type: inline-size; }
.strip--hero .strip__img { width: max(18cqi, 13.5rem); }

.g__info { display: grid; gap: 2.25rem; padding: clamp(1.75rem, 5vw, 5rem) var(--pad); }
.g__lead { font-size: clamp(1.625rem, 1.1rem + 2.2vw, 3rem); font-weight: 600; font-stretch: 82%; line-height: 1.05; letter-spacing: -.02em; max-width: 19ch; text-wrap: balance; margin-bottom: 1.4rem; }
.g__text p:not(.g__lead) { max-width: 44ch; font-size: 1.0625rem; }
.g__text p + p { margin-top: .9em; }
.g__get .label { margin-bottom: .8rem; opacity: .7; }
.g__stores { border-top: 1.5px solid currentColor; }
.g__stores a { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .85rem 0 .95rem; border-bottom: 1.5px solid currentColor; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem); font-weight: 700; font-stretch: 78%; letter-spacing: -.02em; line-height: 1; text-decoration: none; transition: padding .5s var(--spring); }
.g__stores a:hover { padding-left: .5rem; }
.g__stores .stores__name { display: flex; align-items: center; }
.g__stores .ico { width: .82em; height: .82em; margin-right: .42em; }
@media (min-width: 720px) {
  .g__info { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--pad); align-items: start; }
  .g--square .g__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .g--square .g__info { grid-template-columns: 1fr; gap: 3rem; padding-top: 0; padding-left: clamp(2rem, 5vw, 5rem); }
}

.gallery { padding-bottom: clamp(2rem, 5vw, 5rem); }
.gallery__bar { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad) .9rem; }
.gallery__bar .label { opacity: .7; }
.gallery__nav { display: none; gap: .25rem; }
.gallery__nav button { width: 2.75rem; height: 2.75rem; border: 1.5px solid currentColor; background: none; border-radius: 50%; font-size: 1.1rem; cursor: pointer; transition: background .25s, color .25s; }
.gallery__nav button:hover { background: var(--ink); color: var(--bg); }
@media (hover: hover) and (min-width: 720px) { .gallery__nav { display: flex; } }
.gallery__track { display: flex; gap: .6rem; padding: 0 var(--pad); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); scrollbar-width: none; overscroll-behavior-x: contain; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track li { flex: none; scroll-snap-align: start; }
.shot { height: clamp(17rem, 62svh, 40rem); width: auto; max-width: 92vw; object-fit: cover; background: color-mix(in srgb, var(--ink) 12%, var(--bg)); }

.next { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem var(--pad); align-items: end; padding: clamp(1.5rem, 4vw, 3.5rem) var(--pad); background: var(--bg); color: var(--ink); text-decoration: none; container-type: inline-size; overflow: clip; }
.next__label { grid-column: 1 / -1; display: flex; gap: 1rem; }
.next__title { font-size: min(calc(62cqi / var(--w)), 15rem); }
.next__art { grid-row: 2; grid-column: 2; width: clamp(6rem, 26cqi, 20rem); aspect-ratio: 1; object-fit: cover; transition: scale .9s var(--spring), rotate .9s var(--spring); }
.next__arr { position: absolute; right: var(--pad); top: clamp(1.2rem, 3.6vw, 3.2rem); font-size: 1.5rem; line-height: 1; transition: translate .5s var(--spring); }
.next:hover .next__art { scale: 1.06; rotate: -3deg; }
.next:hover .next__arr { translate: .4rem 0; }

/* ── Plain text pages ───────────────────────────────────── */

.doc { padding: clamp(1rem, 3vw, 3rem) var(--pad) clamp(3rem, 8vw, 7rem); }
.doc__title { font-size: clamp(3rem, 12vw, 9rem); text-wrap: balance; white-space: normal; }
.doc__body { max-width: 42rem; margin-top: clamp(2rem, 5vw, 4rem); }
.doc__body h2 { font-size: 1.25rem; font-weight: 700; margin: 2.2em 0 .6em; }
.doc__body p, .doc__body li { margin-bottom: .8em; }
.doc__body ul { padding-left: 1.2rem; list-style: disc; }

/* ── Footer / contact ───────────────────────────────────── */

.foot { position: relative; padding: clamp(2.5rem, 7vw, 6.5rem) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); background: var(--black); color: var(--white); container-type: inline-size; overflow: clip; }
.foot > * { position: relative; }
.foot__mark { position: absolute; right: -14cqi; top: -10cqi; width: 78cqi; height: 78cqi; opacity: .11; pointer-events: none; }
.foot .label { opacity: .6; }
.foot__about { margin-bottom: clamp(2.5rem, 6vw, 5rem); padding-bottom: clamp(2.5rem, 6vw, 5rem); border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.foot__lead { margin-top: 1rem; max-width: 20ch; font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.5rem); font-weight: 600; font-stretch: 82%; line-height: 1.04; letter-spacing: -.022em; text-wrap: balance; }
.foot__text { margin-top: 1.25rem; max-width: 40ch; font-size: 1.125rem; opacity: .8; }
.foot__about, .foot__contact { scroll-margin-top: 1rem; }
.foot__mail { display: block; margin-top: 1rem; font-size: min(calc(100cqi / var(--w2)), 9rem); font-weight: 700; font-stretch: 75%; line-height: .92; letter-spacing: -.025em; text-decoration: none; }
.foot__mail span { display: inline-block; background: linear-gradient(currentColor, currentColor) 0 100% / 0 .05em no-repeat; transition: background-size .6s var(--ease); }
.foot__mail:hover span { background-size: 100% .05em; }
.foot__note { margin-top: 1.4rem; max-width: 30ch; font-size: 1.125rem; opacity: .8; }
.foot__row { display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; margin-top: clamp(3rem, 9vw, 7rem); padding-top: 1.1rem; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); opacity: 1 !important; }
.foot__row a { text-decoration: none; padding: .35rem 0; }
.foot__row a:hover { text-decoration: underline; text-underline-offset: .3em; }
.foot__copy { margin-left: auto; padding: .35rem 0; opacity: .6; }
.foot__legal { margin-top: .9rem; max-width: 60ch; font-size: .8125rem; line-height: 1.45; opacity: .5; }
@media (min-width: 720px) {
  .foot__mark { right: -4cqi; top: -9cqi; width: 40cqi; height: 40cqi; }
  .foot__mail { font-size: min(calc(100cqi / var(--w1)), 11rem); }
}

/* ── Page-to-page transitions ───────────────────────────── */

@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .plate__media, .js .g__media { clip-path: none; }
  .js .line > span, .js .plate__head, .js .plate__foot { translate: 0; opacity: 1; }
  .js .plate:not(.in) .media > *, .media > * { scale: 1; }
  @view-transition { navigation: none; }
}
