/* Don't Wake the Cat: the website.
   The page is the game's living room. You start on the wallpaper, the pictures hang on the wall, the cats sleep on a
   shelf, and the footer is the floor. Colours, type and button shapes are the game's own. */

@font-face { font-family: "DynaPuff"; src: url("/fonts/dynapuff-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "DynaPuff"; src: url("/fonts/dynapuff-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-soft-normal.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-soft-italic.woff2") format("woff2"); font-style: italic; font-weight: 100 900; font-display: swap; }

:root {
  --ink: #2a2140;        /* outlines and text */
  --milk: #fff7e8;       /* paper, and text on the wall */
  --butter: #ffd66b;     /* the thing to press */
  --tomato: #e85d4a;     /* picture frames */
  --rug: #c4412d;        /* the rug: the same red, deep enough for cream text to pass on it */
  --sage: #7dbf8e;
  --wall: #37757c;       /* a shade deeper than the game's wall, so cream text passes on it */
  --wood: #cf8d46;
  --wood-deep: #c07f38;
  --display: "DynaPuff", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  --text: "Fraunces", "Iowan Old Style", Georgia, serif;
  --measure: 34rem;
  --edge: clamp(1.25rem, 5vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0; color: var(--milk); background-color: var(--wall);
  /* the wallpaper: small fish, as in the game */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='168' height='112' viewBox='0 0 168 112'%3E%3Cg fill='%23fff7e8' fill-opacity='.055'%3E%3Cpath d='M22 22c7-7 19-7 27 0-8 7-20 7-27 0zm-9-6 9 6-9 6z'/%3E%3Cpath d='M106 78c7-7 19-7 27 0-8 7-20 7-27 0zm-9-6 9 6-9 6z'/%3E%3C/g%3E%3C/svg%3E");
  font-family: var(--text); font-size: 1.125rem; line-height: 1.6; font-variation-settings: "SOFT" 100; font-weight: 420;
  -webkit-font-smoothing: antialiased;
}
img, canvas, iframe { max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .16em; }
:focus-visible { outline: 4px solid var(--butter); outline-offset: 4px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.02; margin: 0; text-wrap: balance; font-variation-settings: normal; }
p { margin: 0; }
.voice { font-style: italic; font-weight: 500; }           /* the narrator, whispering */
.wrap { width: min(100% - 2 * var(--edge), 70rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--butter); color: var(--ink); padding: .6rem 1rem; border-radius: 12px; font-family: var(--display); font-weight: 600; }
.skip:focus { top: 1rem; }

/* the sticker lettering of the game's own name */
.sticker { color: var(--milk); -webkit-text-stroke: .16em var(--ink); paint-order: stroke fill; filter: drop-shadow(0 .09em 0 var(--ink)); }

/* buttons: the game's */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 3.5rem; padding: .6rem 1.4rem;
  background: var(--butter); color: var(--ink); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; text-decoration: none; cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.btn.quiet { background: var(--milk); min-height: 3rem; font-size: 1.05rem; font-weight: 600; box-shadow: 0 4px 0 var(--ink); }

/* ---------- the top of the wall ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(55, 117, 124, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 3px solid var(--ink); }
.top .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; }
.name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1; text-decoration: none; margin-right: auto; display: flex; align-items: center; gap: .6rem; }
.name img { width: 2.4rem; height: 2.4rem; border-radius: 28%; border: 2.5px solid var(--ink); }
.top nav { display: flex; align-items: center; gap: clamp(.9rem, 2.2vw, 1.8rem); font-family: var(--display); font-weight: 600; font-size: 1.02rem; }
.top nav a { text-decoration: none; padding: .4rem 0; }
.top nav a:hover, .top nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .35em; }
.top nav .btn { min-height: 2.6rem; padding: .3rem 1rem; font-size: 1rem; box-shadow: 0 4px 0 var(--ink); }
.top nav .btn:hover { text-decoration: none; }
.name, .top nav a { white-space: nowrap; }
@media (max-width: 56rem) { .top nav a.far { display: none; } }
@media (max-width: 30rem) { .name span { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem); }
.hero .wrap { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 58rem) { .hero .wrap { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); } }
.hero h1 { font-size: clamp(2.9rem, 8.2vw, 5.6rem); line-height: .9; letter-spacing: -.01em; transform: rotate(-3deg); transform-origin: 0 100%; margin: .4rem 0 0 .1em; }
.hero .voice { font-size: clamp(1.25rem, 2.4vw, 1.55rem); line-height: 1.4; max-width: 27rem; margin-top: 2.2rem; }
.hero .facts { max-width: 29rem; margin-top: 1rem; }
.hero .go { display: flex; flex-wrap: wrap; gap: 1rem 1.2rem; align-items: center; margin-top: 2rem; }
.soon { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
.soon li { font-family: var(--display); font-weight: 600; font-size: .95rem; line-height: 1.15; padding: .5rem .9rem; border: 2.5px dashed rgba(255, 247, 232, .55); border-radius: 14px; }

/* the phone, with the game running in it. The game is laid out for a 390 x 800 screen and scaled to fit (site.js sets --k). */
.phone { justify-self: center; width: min(100%, 23.5rem, max(15rem, (100svh - 11rem) * .4875)); }
.phone .case { background: var(--ink); border-radius: 13% / 6.4%; padding: 3.2%; box-shadow: 0 12px 0 rgba(20, 12, 50, .38); }
.phone .screen { position: relative; aspect-ratio: 390 / 800; overflow: hidden; border-radius: 11% / 5.4%; background: #3d7f86; isolation: isolate; }
.phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone .screen iframe { position: absolute; left: 0; top: 0; width: 390px; max-width: none; height: 800px; border: 0; transform-origin: 0 0; transform: scale(var(--k, 1)); visibility: hidden; }
.phone.live .screen iframe { visibility: visible; }
.phone .cover { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.phone .cover span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.phone .cover:focus-visible { outline-offset: -6px; }
/* The whole screen is a way in to the full-screen game, until the game is running in it and there is a mouse to play it with.
   On a touch screen, or with the phone under the words, it stays a way in: a game inside a page is a poor thing to scroll past. */
@media (min-width: 58rem) and (pointer: fine) { .phone.live .cover { display: none; } }
.phone .under { margin-top: 1.4rem; text-align: center; font-size: 1rem; }

/* ---------- sections on the wall ---------- */
section { padding-block: clamp(3rem, 7vw, 5rem); }
.lede { display: grid; gap: 1rem; max-width: var(--measure); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); }
h2.sticker { -webkit-text-stroke-width: .18em; }

/* pictures hanging on the wall */
.hang { display: grid; gap: clamp(2.2rem, 4vw, 3rem); list-style: none; margin: 0; padding: 0; counter-reset: step; }
@media (min-width: 52rem) { .hang { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
.frame { position: relative; background: var(--milk); color: var(--ink); border: 3px solid var(--ink); border-radius: 10px; padding: .8rem .8rem 1.1rem;
  box-shadow: 0 0 0 .55rem var(--tomato), 0 0 0 calc(.55rem + 3px) var(--ink), .5rem 1rem 0 calc(.55rem + 3px) rgba(20, 12, 50, .28); margin: .75rem;
  transform: rotate(var(--tilt, -1.5deg)); transform-origin: 50% -1.4rem; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); counter-increment: step; }
.frame:nth-child(2) { --tilt: 1.8deg; box-shadow: 0 0 0 .55rem var(--butter), 0 0 0 calc(.55rem + 3px) var(--ink), .5rem 1rem 0 calc(.55rem + 3px) rgba(20, 12, 50, .28); }
.frame:nth-child(3) { --tilt: -.8deg; box-shadow: 0 0 0 .55rem var(--sage), 0 0 0 calc(.55rem + 3px) var(--ink), .5rem 1rem 0 calc(.55rem + 3px) rgba(20, 12, 50, .28); }
@media (min-width: 52rem) { .frame:nth-child(2) { margin-top: 2.6rem; } }
@media (min-width: 36rem) and (max-width: 51.99rem) { .frame { width: min(100% - 1.5rem, 30rem); } .frame:nth-child(even) { margin-left: auto; } }   /* hung left, right, left */
.frame:hover, .frame:focus-within { transform: rotate(0deg); }
.frame::before { content: ""; position: absolute; left: 50%; top: -1.75rem; width: .8rem; height: .8rem; margin-left: -.4rem; background: var(--ink); border-radius: 50%; }   /* the nail */
.frame img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 6px; background: #3d7f86; }
.frame h3 { font-size: 1.45rem; margin: 1rem .3rem .35rem; }
.frame h3::before { content: counter(step) ". "; }
.frame p { margin: 0 .3rem; font-size: 1.05rem; line-height: 1.5; }

/* rooms: three phone pictures */
.rooms { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(12.5rem, 19rem); justify-content: space-between; gap: clamp(1.2rem, 3vw, 2.4rem); list-style: none; margin: 0; padding: .5rem 0 2rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--milk) transparent; border-radius: 6px; }
.rooms li { scroll-snap-align: center; }
.rooms figure { margin: 0; }
.rooms img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 1.6rem; box-shadow: 0 10px 0 rgba(20, 12, 50, .35); }
.rooms li:nth-child(2) img { transform: translateY(1.5rem); }
.rooms figcaption { margin-top: 2.4rem; }
.rooms figcaption b { display: block; font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1.1; margin-bottom: .3rem; }
@media (max-width: 40rem) { .rooms { grid-auto-columns: 15rem; } }
@media (min-width: 52rem) { .rooms { overflow: visible; } }

/* what else is in the pile: a plain list, two columns when there is room */
.also { display: grid; gap: 1.6rem 3rem; margin: 0; padding: 0; }
@media (min-width: 44rem) { .also { grid-template-columns: 1fr 1fr; } }
.also dt { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.15; margin-bottom: .3rem; }
.also dd { margin: 0; max-width: 30rem; }

/* the cats, each asleep on its own perch on the wall */
.shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.4rem clamp(1.4rem, 4vw, 3rem); list-style: none; margin: 0; padding: 0; }
@media (min-width: 46rem) { .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shelf li { text-align: center; }
@media (min-width: 46rem) { .shelf li:nth-child(even) { margin-top: 2.2rem; } }
.cat { position: relative; isolation: isolate; display: block; width: 100%; margin: 0; padding: 0; background: none; border: 0; cursor: pointer; border-radius: 14px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cat::after { content: ""; position: absolute; z-index: -1; left: 2%; right: 2%; top: 89.5%; height: .9rem; background: var(--wood); border: 3px solid var(--ink); border-radius: 6px; box-shadow: 0 6px 0 rgba(20, 12, 50, .3); }   /* the perch */
.cat canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
.cat.up canvas { animation: jolt .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jolt { 0% { transform: translateY(0) scale(1); } 28% { transform: translateY(-16%) scale(1.05, .96); } 100% { transform: none; } }
.shelf b { display: block; font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; margin-top: 1.5rem; }
.shelf span { display: block; font-size: 1rem; line-height: 1.3; margin-top: .2rem; }
.shhh { margin-top: 2.6rem; min-height: 1.6em; }

/* ---------- the floor ---------- */
.floor { color: var(--ink); background-color: var(--wood);
  background-image: repeating-linear-gradient(90deg, transparent 0 10.9rem, rgba(42, 33, 64, .16) 10.9rem 11rem), linear-gradient(var(--wood), var(--wood-deep));
  border-top: 1.3rem solid var(--milk); box-shadow: inset 0 3px 0 var(--ink), 0 -3px 0 var(--ink); }
.get { text-align: center; padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2.5rem, 6vw, 4rem); }
.rug { position: relative; width: min(100%, 44rem); margin: 0 auto; padding: clamp(2.2rem, 6vw, 3.6rem) clamp(1.4rem, 6vw, 4rem); background: var(--rug); color: var(--milk); border: 3px solid var(--ink); border-radius: 50% / 46%;
  box-shadow: inset 0 0 0 .6rem var(--rug), inset 0 0 0 calc(.6rem + 3px) var(--butter), 0 8px 0 rgba(42, 33, 64, .35); }
.rug h2 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
@media (max-width: 40rem) { .rug { border-radius: 2.6rem; padding: 2.4rem 1.4rem 2.6rem; } }   /* an oval is too tight for the words on a phone */
.rug p { margin: .9rem auto 0; max-width: 27rem; }
.rug .soon { justify-content: center; }
.rug .soon + p { margin-top: 1.6rem; }
.foot { padding-block: 2.5rem 3rem; font-size: 1rem; }
.foot .wrap { display: grid; gap: 2rem; }
@media (min-width: 44rem) { .foot .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h2 { font-size: 1.15rem; margin-bottom: .6rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.foot .fine { grid-column: 1 / -1; font-size: .9rem; line-height: 1.5; border-top: 2.5px solid rgba(42, 33, 64, .35); padding-top: 1.2rem; }

/* ---------- paper pages: privacy, support ---------- */
.paper { padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 8vw, 6rem); }
.sheet { background: var(--milk); color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 10px 0 rgba(20, 12, 50, .35);
  width: min(100% - 2 * var(--edge), 48rem); margin-inline: auto; padding: clamp(1.5rem, 5vw, 3.5rem); }
.sheet h1 { font-size: clamp(2.1rem, 5.5vw, 3.2rem); line-height: 1; }
.sheet .dated { margin-top: .8rem; font-size: 1rem; opacity: .8; }
.sheet h2 { font-size: clamp(1.45rem, 3.4vw, 1.85rem); margin: 2.6rem 0 .7rem; scroll-margin-top: 6rem; }
.sheet h3 { font-size: 1.2rem; margin: 1.6rem 0 .4rem; }
.sheet p, .sheet ul, .sheet ol, .sheet dl { max-width: 38rem; }
.sheet p + p, .sheet ul + p, .sheet p + ul { margin-top: .9rem; }
.sheet ul, .sheet ol { margin: .6rem 0 0; padding-left: 1.3rem; }
.sheet li + li { margin-top: .4rem; }
.sheet a { color: #6a2fb0; }
.sheet .contents { margin-top: 1.8rem; padding: 1.1rem 1.3rem; border: 2.5px dashed rgba(42, 33, 64, .35); border-radius: 16px; }
.sheet .contents h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.sheet .contents ol { margin: 0; padding-left: 1.3rem; columns: 2 14rem; column-gap: 2.5rem; }
.sheet .contents li { break-inside: avoid; }
.sheet .short { margin-top: 1.8rem; padding: 1.1rem 1.3rem; background: var(--butter); border: 3px solid var(--ink); border-radius: 16px; }
.sheet .short h2 { margin: 0 0 .4rem; font-size: 1.3rem; }
.sheet details { border-top: 2.5px solid rgba(42, 33, 64, .18); padding: .9rem 0; max-width: 40rem; }
.sheet details:last-of-type { border-bottom: 2.5px solid rgba(42, 33, 64, .18); }
.sheet summary { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; cursor: pointer; list-style-position: outside; margin-left: 1.2rem; }
.sheet details p, .sheet details ul { margin-top: .6rem; margin-left: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame, .btn { transition: none; }
  .cat.up canvas { animation: none; }
}

/* ---------- the page that is not there ---------- */
.lost { padding-block: clamp(4rem, 14vw, 9rem); }
.lost h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: .95; max-width: 14ch; transform: rotate(-3deg); transform-origin: 0 100%; }
.lost .voice { font-size: 1.4rem; margin-top: 2.2rem; }
.lost .go { display: flex; flex-wrap: wrap; gap: 1rem 1.2rem; margin-top: 2rem; }
