/* Stray Dream Arts · straydreamarts.com
   Photomontage. After Hannah Höch and Berlin Dada: pictures cut into odd fragments,
   type running at angles, teal and night blue-black on kraft paper, with rules and a pointing hand
   holding it together. The games' own art keeps its colour; only the scissors touch it. */

:root {
  --buff: #d6bd92;
  --buff-2: #c9ae80;
  --ink: #0d151e;
  --red: #0b6468; /* the spot colour; the name is from the first palette */
  --dim: #4a4a40;
  --dim-on-ink: #a9a48f;
  --red-on-ink: #35b3b6;
  --grain: rgba(13, 21, 30, 0.12);
  --serif: "Bodoni MT", Didot, "Bodoni 72", "Palatino Linotype", Palatino, Georgia, serif;
  --grot: "Arial Narrow", "Franklin Gothic Medium", "Roboto Condensed", "Segoe UI", sans-serif;
  --type: "Courier New", Courier, monospace;
  --gutter: clamp(18px, 5vw, 64px);
  --wrap: 1160px;
  /* the scissors: a few ways to cut a rectangle */
  --cut-a: polygon(0 6%, 94% 0, 100% 88%, 8% 100%);
  --cut-b: polygon(6% 0, 100% 8%, 92% 100%, 0 90%);
  --cut-c: polygon(0 0, 88% 6%, 100% 100%, 12% 92%);
  --cut-d: polygon(0 8%, 62% 0, 100% 12%, 96% 100%, 30% 92%, 4% 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 20px; }

body {
  margin: 0;
  background: var(--buff);
  background-image: radial-gradient(var(--grain) 0.7px, transparent 1px);
  background-size: 5px 5px;
  color: var(--ink);
  font: 400 clamp(16px, 0.35vw + 15px, 18.5px) / 1.55 var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; list-style: none; }
img, video { display: block; width: 100%; height: auto; }

a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: var(--buff); }

.in { max-width: var(--wrap); margin: 0 auto; position: relative; }
section { padding: clamp(56px, 9vw, 112px) var(--gutter); overflow: hidden; position: relative; }

/* top */

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px var(--gutter); border-bottom: 5px solid var(--ink); }
.top a { text-decoration: none; }
.mark { font: 700 1.3em var(--grot); text-transform: uppercase; letter-spacing: 0.14em; }
.top nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font: 700 0.76em var(--grot); text-transform: uppercase; letter-spacing: 0.18em; }
.top nav a[aria-current] { color: var(--red); }
.top .play { background: var(--red); color: var(--buff); padding: 0.3em 0.8em; transform: rotate(-6deg); }
.top .play:hover { background: var(--ink); color: var(--buff); }
@media (max-width: 640px) { .top nav a:not(.play) { display: none; } }

/* type */

.kicker { font: 700 0.78em var(--grot); text-transform: uppercase; letter-spacing: 0.22em; margin-bottom: 1.6em; }
.kicker::before { content: "☞ "; color: var(--red); font-size: 1.4em; letter-spacing: 0; }
.kicker a { text-decoration: none; border-bottom: 2px solid var(--red); }

h1 { font: 700 clamp(3.2rem, 10.4vw, 9.4rem) / 0.9 var(--grot); text-transform: uppercase; letter-spacing: -0.01em; }
h1 em { font: italic 400 1.06em var(--serif); text-transform: none; color: var(--red); display: inline-block; transform: rotate(9deg); }
h2 { font: 400 clamp(2.4rem, 6vw, 5rem) / 0.96 var(--serif); margin-bottom: 0.5em; }
h2::first-letter { font: 700 1.5em var(--grot); color: var(--red); }
h3 { font: 700 1.5em / 1 var(--grot); text-transform: uppercase; letter-spacing: 0.06em; }

.lead { font-size: 1.14em; max-width: 30em; border-left: 6px solid var(--ink); padding-left: 16px; }
.lead em { font-style: italic; color: var(--red); }
.small { font: 400 0.88em / 1.6 var(--type); color: var(--dim); }

.acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }
.btn { display: inline-block; font: 700 0.76em var(--grot); text-transform: uppercase; letter-spacing: 0.2em; padding: 0.9em 1.3em; border: 2.5px solid var(--ink); background: none; color: inherit; text-decoration: none; cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.15s; }
.btn:hover { background: var(--ink); color: var(--buff); }
.btn.go { background: var(--red); border-color: var(--red); color: var(--buff); }
.btn.go:hover { background: var(--ink); border-color: var(--ink); color: var(--buff); transform: rotate(-2deg); }

/* hero */

.hero { min-height: min(92vh, 860px); display: flex; align-items: center; }
.hero .in { width: 100%; z-index: 1; }
.hero h1 { max-width: 8ch; transform: rotate(-4deg); transform-origin: left bottom; margin-top: 0.3em; }
.hero .lead { margin: 1.8em 0 0; }
/* a fragment of the game, cut out and pasted in */
.hero::before {
  content: "";
  position: absolute;
  right: -2%;
  top: 6%;
  width: min(52vw, 640px);
  aspect-ratio: 1.1;
  background: url("img/scrapfit-classes.jpg") 12% center / cover;
  filter: grayscale(1) contrast(1.3) sepia(0.25);
  clip-path: polygon(18% 0, 74% 6%, 100% 34%, 86% 78%, 52% 100%, 8% 84%, 0 38%);
  transform: rotate(6deg);
}
.hero::after {
  content: "";
  position: absolute;
  right: 30%;
  top: 12%;
  width: 34%;
  height: 14px;
  background: var(--red);
  transform: rotate(-28deg);
  box-shadow: 0 60px 0 -4px var(--ink), 40px 300px 0 0 var(--red);
}
@media (max-width: 800px) { .hero::before { opacity: 0.3; } .hero::after { display: none; } }

/* a game, on black */

.dark { background: var(--ink); color: var(--buff); }
.dark .btn { border-color: var(--buff); }
.dark .btn:hover { background: var(--buff); color: var(--ink); }
.dark .btn.go { border-color: var(--red); }
.dark .small { color: var(--dim-on-ink); }
.dark a:hover { color: var(--red-on-ink); }
/* on black, the spot colour switches to its brighter version so it stays readable */
.dark .shout, .dark .kicker::before, .dark .steps h3::before, .dark .numbers div:nth-child(even) dt, .dark .review h3::first-letter { color: var(--red-on-ink); }

.banner { clip-path: var(--cut-d); margin-bottom: 36px; }
.shout { font: 700 clamp(4rem, 14vw, 12rem) / 0.84 var(--grot); text-transform: uppercase; transform: rotate(-3deg); transform-origin: left; color: var(--red); margin-bottom: 0.3em; }
.shout::first-letter { font: inherit; color: var(--buff); }
.dark .lead { border-color: var(--buff); margin-top: 1.6em; }
/* the banner carries the game's logo, so the section heading is for screen readers only */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.steps { display: grid; gap: 20px; margin: 60px 0 0; counter-reset: s; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: s; }
.steps .cut { aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.steps video { height: 100%; object-fit: cover; }
.steps li:nth-child(1) .cut { clip-path: polygon(0 0, 100% 10%, 92% 100%, 6% 88%); }
.steps li:nth-child(2) .cut { clip-path: polygon(8% 6%, 96% 0, 100% 90%, 0 100%); }
.steps li:nth-child(3) .cut { clip-path: polygon(0 12%, 90% 0, 100% 100%, 10% 92%); }
@media (min-width: 820px) { .steps li:nth-child(2) { transform: translateY(26px) rotate(1.5deg); } }
.steps h3 { margin: 0.7em 0 0.2em; }
.steps h3::before { content: counter(s); font: italic 400 2.2em / 0.6 var(--serif); color: var(--red); float: left; margin-right: 0.2em; }
.steps p { font-size: 0.94em; opacity: 0.9; }

.numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 8px; margin: 90px 0 0; }
@media (min-width: 720px) { .numbers { grid-template-columns: repeat(5, 1fr); } }
.numbers div:nth-child(odd) { transform: rotate(-5deg); }
.numbers div:nth-child(even) { transform: rotate(4deg) translateY(14px); }
.numbers dt { font: 700 clamp(3.4rem, 8vw, 7rem) / 0.82 var(--grot); }
.numbers div:nth-child(even) dt { font: italic 400 clamp(3.4rem, 8vw, 7rem) / 0.82 var(--serif); color: var(--red); }
.numbers dd { font: 700 0.68em var(--grot); text-transform: uppercase; letter-spacing: 0.18em; margin-top: 0.6em; }

.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 20px; margin: 90px 0 0; }
@media (min-width: 820px) { .shots { grid-template-columns: repeat(3, 1fr); } }
.shots button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; transition: transform 0.2s; }
.shots button:hover { transform: scale(1.03) rotate(0deg) !important; }
.shots img { aspect-ratio: 16 / 9; object-fit: cover; }
.shots figure:nth-child(3n+1) button { clip-path: var(--cut-a); transform: rotate(-2deg); }
.shots figure:nth-child(3n+2) button { clip-path: var(--cut-b); transform: rotate(1.6deg); }
.shots figure:nth-child(3n) button { clip-path: var(--cut-c); transform: rotate(-1deg); }
.shots figcaption { font: italic 400 0.92em var(--serif); margin-top: 8px; opacity: 0.85; }
dialog.light { padding: 0; border: 4px solid var(--buff); background: #000; max-width: min(96vw, 1600px); max-height: 94vh; }
dialog.light::backdrop { background: rgba(23, 19, 15, 0.92); }
dialog.light img { max-height: 92vh; width: auto; max-width: 100%; cursor: zoom-out; }

.review { display: grid; gap: 20px 56px; align-items: center; margin-top: 90px; padding-top: 40px; border-top: 5px solid var(--buff); position: relative; }
@media (min-width: 860px) { .review { grid-template-columns: 1fr 1.1fr; } }
.review::before { content: ""; position: absolute; left: 0; top: -5px; width: 30%; height: 5px; background: var(--red); }
.review h3 { font: 400 clamp(1.8rem, 3.6vw, 2.8rem) / 1 var(--serif); text-transform: none; letter-spacing: 0; margin-bottom: 0.5em; }
.review h3::first-letter { font: 700 1.5em var(--grot); color: var(--red); }
/* the review sleeps until asked for, so the page talks to YouTube only on request */
.tube { position: relative; aspect-ratio: 16 / 9; display: grid; place-content: center; justify-items: center; gap: 10px; border: 2.5px solid var(--buff); text-align: center; padding: 16px; }
.tube iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.close { display: grid; gap: 24px 56px; align-items: end; margin-top: 90px; }
@media (min-width: 860px) { .close { grid-template-columns: 1fr auto; } }
.close h3 { font: 700 clamp(2.6rem, 7vw, 5.6rem) / 0.86 var(--grot); transform: rotate(-3deg); transform-origin: left; margin-bottom: 0.4em; }
.close .acts { margin: 0; }

/* about */

#about::before { content: ""; position: absolute; left: -6%; top: 20%; width: 58%; height: 12px; background: var(--red); transform: rotate(-14deg); }
.about { display: grid; gap: 24px 56px; }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1.1fr; align-items: start; } .about .kicker { grid-column: 1 / -1; } .about h2 { font-size: clamp(3rem, 7vw, 6rem); transform: rotate(-5deg); } }
.about .lead { margin-bottom: 1.2em; }
.facts { margin-top: 2em; border-top: 5px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 7em 1fr; gap: 12px; padding: 9px 0; border-bottom: 2px solid var(--ink); }
.facts dt { font: 700 0.72em var(--grot); text-transform: uppercase; letter-spacing: 0.2em; padding-top: 0.4em; }

/* taste */

.alt { background: var(--buff-2); }
.cols { display: grid; gap: clamp(36px, 5vw, 72px); margin-top: 2.4em; }
@media (min-width: 940px) { .cols { grid-template-columns: 1fr 1.35fr; align-items: start; } }
.hours li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: baseline; padding: 6px 0 0; border-bottom: 2px solid var(--ink); }
.hours b { font: 700 1.08em var(--grot); text-transform: uppercase; letter-spacing: 0.06em; }
.hours li:nth-child(even) b { font: italic 400 1.2em var(--serif); text-transform: none; letter-spacing: 0; }
.hours span { font: 700 0.8em var(--type); }
.hours i { grid-column: 1 / -1; display: block; height: 8px; width: var(--w); background: var(--ink); margin-bottom: -2px; }
.hours li:nth-child(3n+1) i { background: var(--red); }
.reveal .hours i { width: 0; transition: width 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s; }
.reveal.on .hours i { width: var(--w); }
.shelf { display: grid; gap: 36px 32px; }
@media (min-width: 620px) { .shelf { grid-template-columns: 1fr 1fr; } }
.shelf h3 { font: 700 0.8em var(--grot); letter-spacing: 0.24em; border-bottom: 5px solid var(--ink); padding-bottom: 0.4em; margin-bottom: 0.5em; }
.shelf > div:nth-child(even) h3 { border-color: var(--red); }
.shelf li { padding: 0.3em 0; }
.shelf a { font-style: italic; font-size: 1.1em; }
.shelf span { display: block; font: 400 0.78em / 1.5 var(--type); color: var(--dim); }

/* strays, on the home page */

.litter { display: grid; gap: 34px 22px; margin-top: 2.2em; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.litter a { display: block; text-decoration: none; transition: transform 0.2s; }
.litter li:nth-child(odd) a { transform: rotate(-2deg); }
@media (min-width: 700px) { .litter li:nth-child(even) a { transform: rotate(1.6deg) translateY(16px); } }
.litter a:hover { transform: rotate(0deg) scale(1.02) !important; color: inherit; }
.litter .thumb { aspect-ratio: 16 / 10; overflow: hidden; }
.litter img { height: 100%; object-fit: cover; }
.litter li:nth-child(3n+1) .thumb { clip-path: var(--cut-a); }
.litter li:nth-child(3n+2) .thumb { clip-path: var(--cut-b); }
.litter li:nth-child(3n) .thumb { clip-path: var(--cut-c); }
.px img { image-rendering: pixelated; }
.litter .y { display: block; font: 700 0.76em var(--grot); letter-spacing: 0.2em; color: var(--red); margin-top: 10px; }
.litter b { display: block; font: 700 1.3em / 1.05 var(--grot); text-transform: uppercase; letter-spacing: 0.04em; }
.litter .d { display: block; font-style: italic; font-size: 0.94em; }

/* the strays page */

.pagehead h1 { transform: rotate(-4deg); transform-origin: left bottom; margin: 0.2em 0 0.5em; }
.pagehead h1::after { content: "."; color: var(--red); }
.entry { display: grid; gap: 18px clamp(24px, 5vw, 64px); padding: clamp(40px, 6vw, 80px) 0; border-top: 5px solid var(--ink); scroll-margin-top: 20px; position: relative; }
.entry::before { content: ""; position: absolute; left: 0; top: -5px; width: 22%; height: 5px; background: var(--red); }
.entry:nth-of-type(even)::before { left: auto; right: 0; }
@media (min-width: 900px) { .entry { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; } .entry:nth-of-type(even) .words { order: 2; } }
.entry .y { font: italic 400 clamp(3rem, 6vw, 5rem) / 0.8 var(--serif); color: var(--red); display: block; transform: rotate(-6deg); transform-origin: left; margin-bottom: 0.25em; }
.entry h2 { font: 700 clamp(2rem, 4.6vw, 3.6rem) / 0.92 var(--grot); text-transform: uppercase; letter-spacing: 0.01em; margin-bottom: 0.2em; }
.entry h2::first-letter { font: inherit; color: inherit; }
.entry .kicker { margin-bottom: 1.2em; }
.entry p + p { margin-top: 0.8em; }
.entry .credit { font: 400 0.84em / 1.6 var(--type); color: var(--dim); }
.pic { display: block; }
.entry:nth-of-type(3n+1) .pic { clip-path: var(--cut-a); transform: rotate(-1.6deg); }
.entry:nth-of-type(3n+2) .pic { clip-path: var(--cut-b); transform: rotate(1.4deg); }
.entry:nth-of-type(3n) .pic { clip-path: var(--cut-c); transform: rotate(-1deg); }
.pic.pad { background: var(--buff-2); padding: clamp(20px, 5vw, 56px); }
.pic.pad img { width: min(100%, 280px); margin: 0 auto; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pair .pic:first-child { clip-path: var(--cut-b); transform: rotate(-2deg); }
.pair .pic:last-child { clip-path: var(--cut-a); transform: rotate(2deg) translateY(14px); }
a.pic:hover { transform: rotate(0deg) scale(1.02) !important; }

/* a game page */

.cabinet { position: relative; width: 640px; height: 480px; max-width: 100%; margin-top: 2em; border: 5px solid var(--ink); background: #000; overflow: hidden; box-sizing: content-box; }
.cabinet > img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: 0.75; }
.cabinet > .btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-3deg); z-index: 2; }
.cabinet > .btn:hover { transform: translate(-50%, -50%) rotate(0deg); }
.cabinet ruffle-player { display: block; width: 100%; height: 100%; }
.keys { font: 700 0.8em var(--type); margin-top: 12px; }

/* nothing here */

.lost { min-height: 100svh; display: grid; align-content: center; }
.lost h1 { transform: rotate(-4deg); transform-origin: left bottom; max-width: 9ch; margin: 0.2em 0 0.6em; }

/* footer */

footer { border-top: 5px solid var(--ink); padding: 26px var(--gutter); font: 700 0.72em var(--grot); text-transform: uppercase; letter-spacing: 0.2em; }
footer .in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { text-decoration: none; }

/* pieces are laid down as you reach them */

.js .reveal { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 30px)) rotate(var(--rot, -3deg)); transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.2, 1.2, 0.35, 1); }
.js .reveal:nth-child(even) { --rot: 3deg; --dx: 18px; }
.js .reveal.on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .reveal .hours i { width: var(--w); transition: none; }
}
