/* Cosmic Walnut. The same dark room, ivory serif and walnut as the games. */

@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --room: #14100d;
  --ivory: #f2ebdb;
  --soft: #bdb4a2;
  --rule: rgba(242, 235, 219, .16);
  --serif: ui-serif, "New York", "Source Serif 4", Georgia, serif;
  --system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 4vw, 64px);
  --head: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--head); }
body { margin: 0; background: var(--room); color: var(--ivory); font: 400 clamp(18px, .5vw + 15px, 21px)/1.5 var(--serif); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3 { font-weight: 400; letter-spacing: -.012em; }
:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ivory); color: var(--room); padding: 8px 14px; z-index: 600; }
.skip:focus { left: 8px; }

.site-head {
  position: sticky; top: 0; z-index: 500; height: var(--head); display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 var(--gutter); background: var(--room); view-transition-name: site-head;
}
.home { display: flex; align-items: center; gap: 11px; text-decoration: none; font-size: 20px; white-space: nowrap; }
.home img { width: 60px; height: 36px; }
.site-head nav { display: flex; gap: clamp(16px, 2.6vw, 32px); }
.site-head nav a { padding: 10px 0; text-decoration: none; color: var(--soft); transition: color .2s ease; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--ivory); }
@media (max-width: 480px) { .home span { display: none; } }

/* Footage, edge to edge */
.reel { position: relative; height: calc(100vh - var(--head)); height: calc(100svh - var(--head)); min-height: 420px; overflow: hidden; background: #000; }
.reel video { width: 100%; height: 100%; object-fit: cover; }
.reel::after { content: ""; position: absolute; inset: 30% 0 0 0; background: linear-gradient(transparent, rgba(8, 6, 4, .78) 45%, rgba(8, 6, 4, .95)); pointer-events: none; }
.reel-words { position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: clamp(28px, 6vh, 64px); }
.reel h1 { margin: 0; max-width: 16em; font-size: clamp(40px, 6.4vw, 96px); line-height: 1.04; }
.reel-words p { margin: .4em 0 0; font-size: clamp(19px, 1.5vw + 8px, 28px); line-height: 1.3; }
.reel-words .cta { margin-top: 1em; }

.cta { display: inline-block; width: fit-content; padding: .6em 1.15em; border-radius: 999px; background: var(--ivory); color: var(--room); font-size: 18px; line-height: 1.2; text-decoration: none; transition: scale .25s cubic-bezier(.22, 1, .36, 1); }
.cta:hover { scale: 1.04; }

/* The first page: choose games or apps. Each door has its own world. */
.look-door .site-head nav { display: none; }
.look-door .site-foot { display: none; }
.look-door .site-head { position: absolute; inset: 0 0 auto 0; background: none; justify-content: center; }
.look-door .home { font-size: 24px; text-shadow: 0 1px 12px rgba(0, 0, 0, .7); }
.doors { display: flex; height: 100vh; height: 100svh; overflow: hidden; }
.door { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; display: grid; place-items: center; text-decoration: none; transition: flex-grow .7s cubic-bezier(.22, 1, .36, 1); }
.door:hover, .door:focus-visible { flex-grow: 1.45; }
.door span { position: relative; z-index: 2; font-size: clamp(52px, 8.4vw, 136px); line-height: 1; }
.door-games { background: #000; }
.door-games video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.door-games::after { content: ""; position: absolute; inset: 0; background: rgba(8, 6, 4, .52); transition: background .5s ease; }
.door-games:hover::after { background: rgba(8, 6, 4, .2); }
.door-apps video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.door-apps::after { content: ""; position: absolute; inset: 0; background: rgba(20, 22, 26, .52); transition: background .5s ease; }
.door-apps:hover::after { background: rgba(20, 22, 26, .2); }
.door-apps { background: #232629; color: #f4f5f6; font-family: var(--system); font-weight: 600; letter-spacing: -.02em; grid-template-rows: auto auto; align-content: center; gap: clamp(16px, 2.5vw, 32px); }
@media (max-width: 760px), (orientation: portrait) {
  .doors { flex-direction: column; }
  .door:hover, .door:focus-visible { flex-grow: 1; }
}

/* Apps look like the Mac apps they are: graphite, system type, the app's orange. */
.look-apps { background: #232629; color: #f4f5f6; font-family: var(--system); --room: #232629; --rule: rgba(255, 255, 255, .16); --soft: #a9adb2; }
.look-apps h1, .look-apps h2, .look-apps h3 { font-weight: 600; letter-spacing: -.022em; }
.look-apps .home { font-family: var(--serif); }
.look-apps .cta { background: #ff5c33; color: #fff; }
.apps-shelf h1 { margin: 0 0 .5em; font-size: clamp(44px, 6vw, 88px); line-height: 1; }
.app-features { display: grid; gap: clamp(48px, 6vw, 88px); }
.app-feature { display: block; text-decoration: none; }
.app-feature .app-art { aspect-ratio: 16 / 9; }
.app-feature:hover .app-art { translate: 0 -4px; }
.app-feature .app-art video { object-position: 50% 50%; }
.app-words { display: flex; align-items: center; gap: clamp(14px, 2vw, 24px); margin-top: clamp(16px, 2vw, 24px); }
.app-icon { width: clamp(64px, 7vw, 96px); flex: none; }
.apps-shelf .app-words h2 { margin: 0; font-size: clamp(30px, 3.6vw, 52px); line-height: 1.08; }
.app-words p { margin: .15em 0 0; max-width: 40em; color: var(--soft); }
.app-tiles { display: grid; gap: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 44px); }
@media (min-width: 760px) { .app-tiles { grid-template-columns: 1fr 1fr; } }
.app-tile { display: block; text-decoration: none; }
.app-art { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: #2d3135; transition: translate .4s cubic-bezier(.22, 1, .36, 1); }
.app-tile:hover .app-art { translate: 0 -4px; }
.app-art video, .app-art img:not(.icon) { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.app-art .icon { width: 42%; }
.apps-shelf .app-tile h2 { margin: .55em 0 0; font-size: clamp(28px, 2.8vw, 42px); line-height: 1.1; }
.app-tile p { margin: .25em 0 0; max-width: 34em; color: var(--soft); }
.app-art-large { aspect-ratio: auto; width: auto; max-width: 100%; background: none; }
.app-art-large video, .app-art-large img:not(.icon) { width: auto; max-width: 100%; height: auto; max-height: calc(100svh - var(--head) - 280px); min-height: 340px; object-fit: contain; border-radius: 12px; }
.app-art-large .icon { width: clamp(140px, 20vw, 260px); }

/* The shelf */
.shelf { padding: clamp(40px, 5vw, 72px) var(--gutter) 0; }
.shelf h2 { margin: 0 0 .55em; font-size: clamp(40px, 5vw, 72px); line-height: 1; }
.cards { display: grid; gap: clamp(28px, 3vw, 44px); }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } .card-lead { grid-column: 1 / -1; } }
.card { position: relative; display: block; overflow: hidden; border-radius: 8px; text-decoration: none; background: #000; }
.card video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: scale 1s cubic-bezier(.22, 1, .36, 1); }
.card:hover video { scale: 1.04; }
.card::after { content: ""; position: absolute; inset: 50% 0 0 0; background: linear-gradient(transparent, rgba(8, 6, 4, .9)); pointer-events: none; }
.card-words { position: absolute; z-index: 1; left: clamp(16px, 2vw, 28px); right: clamp(16px, 2vw, 28px); bottom: clamp(14px, 1.8vw, 24px); }
.card h3 { margin: 0; font-size: clamp(28px, 3vw, 46px); line-height: 1.08; }
.card-lead h3 { font-size: clamp(32px, 4.6vw, 68px); }
.card p { margin: .15em 0 0; }

/* A game's page */
.whole { display: grid; place-items: center; padding: clamp(40px, 6vw, 88px) var(--gutter); }
.whole video { width: auto; max-width: 100%; height: auto; max-height: calc(100svh - var(--head) - 48px); border-radius: 10px; box-shadow: 0 0 0 1px var(--rule); }
.shot { position: relative; margin: 0; background: #000; }
.shot video { width: 100%; height: auto; }
.shot figcaption { position: absolute; left: var(--gutter); bottom: clamp(20px, 4vw, 56px); font-size: clamp(28px, 4.4vw, 64px); line-height: 1.08; text-shadow: 0 2px 18px rgba(0, 0, 0, .8); }
.close { padding: clamp(48px, 6vw, 88px) var(--gutter); text-align: center; }
.close p { margin: 0 auto .9em; }


.app-top { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100svh - var(--head) - 90px); padding: 40px var(--gutter); text-align: center; }
.app-top h1 { margin: .35em 0 0; font-size: clamp(44px, 6.4vw, 96px); line-height: 1.04; }
.app-top p { margin: .6em 0 0; max-width: 28em; font-size: clamp(20px, 1.5vw + 10px, 28px); line-height: 1.3; }
.app-top .cta { margin-top: 1.2em; }
.app-top .avail:empty { display: none; }
.app-top p + p { font-size: inherit; line-height: 1.5; color: var(--soft); }

/* About */
.sky { position: relative; isolation: isolate; background: #0e1419; min-height: calc(100vh - var(--head)); min-height: calc(100svh - var(--head)); overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 60px var(--gutter) 34vh; }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.sky h1 { margin: 0; max-width: 12em; font-size: clamp(44px, 6.6vw, 104px); line-height: 1.04; }
.planet { position: absolute; z-index: -1; right: 3vw; bottom: clamp(-200px, -13vw, -50px); width: clamp(440px, 62vw, 960px); max-width: none; will-change: transform; }
.letter { max-width: 34em; margin: 0 auto; padding: clamp(56px, 8vw, 110px) var(--gutter); font-size: clamp(21px, 1vw + 16px, 27px); line-height: 1.45; }
.letter p { margin: 0 0 1em; }

.site-foot { padding: clamp(48px, 6vw, 80px) var(--gutter) 28px; color: var(--soft); font-size: .9em; }
.site-foot p { margin: 0; }

@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
