/* Crooked House
   A room from a hand-painted cartoon adventure game. The page is a sheet pinned
   to a leaning wall, and the site menu is a panel of verbs at the bottom. */

/* The fonts are the Latin subsets that Google Fonts serves. Nunito is a variable
   font, so one file holds every weight from 200 to 1000. The italic is 400 only. */
@font-face {
  font-family: "Luckiest Guy";
  src: url("fonts/luckiest-guy.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Nunito;
  src: url("fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Nunito;
  src: url("fonts/nunito-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: Silkscreen;
  src: url("fonts/silkscreen.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paint pots. Hex values appear only here and in the two cursor images. */
  --c-ink: #1b1024;
  --c-night: #140b20;
  --c-plum: #431a5c;
  --c-grape: #7a39b0;
  --c-violet: #a46ad8;
  --c-slime: #9be24e;
  --c-mustard: #f7c337;
  --c-tangerine: #f26d2b;
  --c-bubble: #ff6aae;
  --c-teal: #1fb2a8;
  --c-sky: #233f94;
  --c-paper: #fff3d4;
  --c-paper-edge: #f2d9a4;

  /* Jobs */
  --ink: var(--c-ink);
  --paper: var(--c-paper);
  --paper-edge: var(--c-paper-edge);
  --wall-a: var(--c-grape);
  --wall-b: color-mix(in oklab, var(--c-grape) 78%, var(--c-ink));
  --wainscot: var(--c-plum);
  --rail: var(--c-mustard);
  --tile-a: var(--c-teal);
  --tile-b: color-mix(in oklab, var(--c-teal) 45%, var(--c-ink));
  --board: var(--c-tangerine);
  --name: var(--c-slime);
  --title: var(--c-mustard);
  --initial: var(--c-tangerine);
  --ribbon: var(--c-slime);
  --ribbon-alt: var(--c-bubble);
  --subhead: var(--c-grape);
  --dateline: var(--c-grape);
  --link: var(--c-grape);
  --link-line: var(--c-tangerine);
  --link-hot: var(--c-mustard);
  --well: color-mix(in oklab, var(--c-plum) 55%, var(--c-ink));
  --panel: color-mix(in oklab, var(--c-ink) 75%, black);
  --verb: color-mix(in oklab, var(--c-violet) 72%, var(--c-paper));
  --verb-hot: var(--c-slime);
  --sentence: var(--c-teal);
  --slot: color-mix(in oklab, var(--c-grape) 38%, var(--c-ink));

  /* Shapes */
  --line: 3px;
  --wobbly: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --wobbly-sm: 30px 6px 26px 6px / 6px 26px 6px 30px;
  --outline-3:
    3px 0 var(--ink), -3px 0 var(--ink), 0 3px var(--ink), 0 -3px var(--ink),
    2px 2px var(--ink), -2px -2px var(--ink), 2px -2px var(--ink), -2px 2px var(--ink);
  --outline-2:
    2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink),
    1.5px 1.5px var(--ink), -1.5px -1.5px var(--ink), 1.5px -1.5px var(--ink), -1.5px 1.5px var(--ink);

  --panel-h: 9.75rem;
  --rope: 4.5rem;

  --title-font: "Luckiest Guy", "Arial Black", Impact, sans-serif;
  --body-font: Nunito, "Trebuchet MS", system-ui, sans-serif;
  --pixel-font: Silkscreen, "Courier New", monospace;
  --code-font: ui-monospace, Menlo, Consolas, monospace;

  /* The crosshair of an adventure game. The second one is lit, for links. */
  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cg fill='%231b1024'%3E%3Crect x='10' width='4' height='9'/%3E%3Crect x='10' y='15' width='4' height='9'/%3E%3Crect y='10' width='9' height='4'/%3E%3Crect x='15' y='10' width='9' height='4'/%3E%3C/g%3E%3Cg fill='%23fff3d4'%3E%3Crect x='11' y='1' width='2' height='7'/%3E%3Crect x='11' y='16' width='2' height='7'/%3E%3Crect x='1' y='11' width='7' height='2'/%3E%3Crect x='16' y='11' width='7' height='2'/%3E%3C/g%3E%3C/svg%3E") 12 12, crosshair;
  --cursor-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cg fill='%231b1024'%3E%3Crect x='10' width='4' height='9'/%3E%3Crect x='10' y='15' width='4' height='9'/%3E%3Crect y='10' width='9' height='4'/%3E%3Crect x='15' y='10' width='9' height='4'/%3E%3C/g%3E%3Cg fill='%239be24e'%3E%3Crect x='11' y='1' width='2' height='7'/%3E%3Crect x='11' y='16' width='2' height='7'/%3E%3Crect x='1' y='11' width='7' height='2'/%3E%3Crect x='16' y='11' width='7' height='2'/%3E%3C/g%3E%3C/svg%3E") 12 12, pointer;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--c-night);
  cursor: var(--cursor);
  scroll-padding-bottom: calc(var(--panel-h) + 2rem);
}

body {
  margin: 0;
  min-height: 100dvh;
  padding: 0 1.25rem calc(var(--panel-h) + 4.5rem);
  overflow-x: clip;
  font: 400 1.125rem/1.6 var(--body-font);
  color: var(--ink);
}

a { cursor: var(--cursor-hot); }

::selection { background: var(--c-mustard); color: var(--ink); }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── The room ─────────────────────────────────────────────────────────────
   Fixed behind the page. The stripes fan out from a point below the floor,
   so no stripe is vertical. */

.room {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 60% at 50% 0%, rgb(255 236 170 / 0.3), transparent 70%),
    repeating-conic-gradient(at 46% 150%, var(--wall-a) 0deg 2deg, var(--wall-b) 2deg 4deg);
}

/* Wood panels under a rail that is not level */
.room::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: 60%;
  bottom: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 7.5rem, var(--ink) 7.5rem calc(7.5rem + 3px)),
    linear-gradient(rgb(0 0 0 / 0.35), transparent 30%),
    var(--wainscot);
  border-top: 0.7rem solid var(--rail);
  box-shadow: 0 -3px 0 var(--ink), inset 0 3px 0 var(--ink);
  transform: rotate(-1.6deg) skewX(-9deg);
  transform-origin: 50% 0;
}

/* Dark corners */
.room::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgb(0 0 0 / 0.6));
}

.floor {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: calc(var(--panel-h) - 1.5rem);
  height: 19vh;
  overflow: hidden;
  border-top: var(--line) solid var(--ink);
  perspective: 16vh;
  perspective-origin: 36% -30%;
  rotate: -1.6deg;
}

.floor::before {
  content: "";
  position: absolute;
  left: -80%;
  right: -80%;
  top: 0;
  height: 600%;
  background: repeating-conic-gradient(var(--tile-a) 0 25%, var(--tile-b) 0 50%) 0 0 / 7rem 7rem;
  transform-origin: 50% 0;
  transform: rotateX(68deg);
}

.floor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgb(0 0 0 / 0.5), transparent 45%);
}

.window {
  position: absolute;
  left: 6vw;
  top: 15vh;
  width: 11rem;
  height: 15rem;
  border: 0.7rem solid var(--rail);
  outline: var(--line) solid var(--ink);
  box-shadow: inset 0 0 0 var(--line) var(--ink), 12px 12px 0 rgb(0 0 0 / 0.35);
  background:
    radial-gradient(circle at 70% 24%, color-mix(in oklab, var(--c-paper) 75%, var(--c-slime)) 0 1.5rem, transparent 1.56rem),
    radial-gradient(circle at 18% 16%, var(--c-paper) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 36% 38%, var(--c-paper) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 58%, var(--c-paper) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 24% 72%, var(--c-paper) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 84%, var(--c-paper) 0 1.5px, transparent 2.5px),
    linear-gradient(var(--c-night), var(--c-sky));
  transform: skewX(-7deg) rotate(-4deg);
}

/* Glazing bars */
.window::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      transparent calc(50% - 6px), var(--ink) calc(50% - 6px) calc(50% - 3px),
      var(--rail) calc(50% - 3px) calc(50% + 3px),
      var(--ink) calc(50% + 3px) calc(50% + 6px), transparent calc(50% + 6px)),
    linear-gradient(
      transparent calc(44% - 6px), var(--ink) calc(44% - 6px) calc(44% - 3px),
      var(--rail) calc(44% - 3px) calc(44% + 3px),
      var(--ink) calc(44% + 3px) calc(44% + 6px), transparent calc(44% + 6px));
}

/* Sill */
.window::after {
  content: "";
  position: absolute;
  left: -1.8rem;
  right: -1.8rem;
  top: calc(100% + 0.7rem);
  height: 1.1rem;
  background: var(--rail);
  border: var(--line) solid var(--ink);
  border-radius: 3px 5px 4px 6px;
}

.clock {
  position: absolute;
  right: 8vw;
  top: 17vh;
  width: 8.5rem;
  aspect-ratio: 1;
  background:
    radial-gradient(circle, var(--paper) 0 60%, transparent 61%),
    repeating-conic-gradient(from -1.5deg, var(--ink) 0 3deg, var(--paper) 3deg 30deg);
  border: var(--line) solid var(--ink);
  border-radius: 53% 47% 50% 50% / 47% 53% 47% 53%;
  box-shadow:
    0 0 0 0.6rem var(--rail),
    0 0 0 calc(0.6rem + 3px) var(--ink),
    12px 14px 0 calc(0.6rem + 3px) rgb(0 0 0 / 0.35);
  rotate: 9deg;
}

/* Pendulum */
.clock::before {
  content: "";
  position: absolute;
  left: calc(50% - 1.25rem);
  top: calc(100% + 0.6rem);
  width: 2.5rem;
  height: 6.5rem;
  background:
    radial-gradient(circle at 50% calc(100% - 1.25rem), var(--rail) 0 1rem, var(--ink) 1.04rem 1.2rem, transparent 1.24rem),
    linear-gradient(90deg, transparent calc(50% - 2px), var(--ink) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) top / 100% calc(100% - 2.3rem) no-repeat;
  transform-origin: 50% -0.6rem;
  animation: tick 1.1s ease-in-out infinite alternate;
}

/* Pin */
.clock::after {
  content: "";
  position: absolute;
  inset: calc(50% - 7px);
  background: var(--c-tangerine);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 6px;
  height: 25%;
  margin-left: -3px;
  background: var(--ink);
  border-radius: 3px;
  transform-origin: 50% 100%;
  animation: spin 72s linear infinite;
}

.hand.minute {
  width: 4px;
  height: 38%;
  margin-left: -2px;
  animation-duration: 6s;
}

@keyframes spin { to { transform: rotate(1turn); } }
@keyframes tick { from { transform: rotate(-13deg); } to { transform: rotate(13deg); } }
@keyframes swing { from { transform: rotate(-2.2deg); } to { transform: rotate(1.8deg); } }

/* ── The sign ─────────────────────────────────────────────────────────────
   Hangs from two ropes and swings. Its outline boils (see #boil in the page). */

.sign {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: var(--rope) auto 0;
  padding: 1.1rem 2.5rem 1.15rem;
  text-align: center;
  transform-origin: 50% calc(-1 * var(--rope));
  animation: swing 4.5s ease-in-out infinite alternate;
}

.sign::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(176deg, transparent 0 9px, rgb(0 0 0 / 0.09) 9px 11px),
    linear-gradient(var(--board), color-mix(in oklab, var(--board) 78%, var(--ink)));
  border: var(--line) solid var(--ink);
  border-radius: var(--wobbly-sm);
  box-shadow: 9px 9px 0 rgb(0 0 0 / 0.4);
  filter: url(#boil);
}

/* Ropes */
.sign::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: calc(100% - 4px);
  height: var(--rope);
  border-inline: var(--line) solid var(--ink);
}

.sign .name {
  display: block;
  font: 400 clamp(2.4rem, 8vw, 3.75rem) / 1 var(--title-font);
  letter-spacing: 0.03em;
  color: var(--name);
  text-decoration: none;
  text-shadow: var(--outline-3), 5px 6px 0 var(--ink);
}

.sign .name:hover { background: none; color: var(--c-mustard); }

.sign .tagline {
  margin: 0.45rem 0 0;
  font: 400 0.8rem/1.2 var(--pixel-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── The page ─────────────────────────────────────────────────────────────
   The paper, its outline and its shadow are one pseudo-element, so the wobble
   filter bends the edge and leaves the text alone. */

.page {
  position: relative;
  max-width: 46rem;
  margin: 2.75rem auto 0;
  padding: 3.5rem 3.5rem 2.5rem;
  rotate: -0.7deg;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 30% 15%, var(--paper) 45%, var(--paper-edge));
  border: var(--line) solid var(--ink);
  border-radius: var(--wobbly);
  box-shadow: 12px 12px 0 rgb(0 0 0 / 0.45);
  filter: url(#wobble);
}

/* Two pushpins */
.page::after {
  content: "";
  position: absolute;
  top: 0.9rem;
  left: 1.3rem;
  right: 1.3rem;
  height: 1.6rem;
  --pin-light: radial-gradient(circle at 34% 32%, var(--paper) 0 0.17rem, transparent 0.21rem);
  --pin: radial-gradient(circle, var(--c-bubble) 0 0.6rem, var(--ink) 0.63rem 0.78rem, transparent 0.8rem);
  background:
    var(--pin-light) 0 0 / 1.6rem 1.6rem no-repeat,
    var(--pin) 0 0 / 1.6rem 1.6rem no-repeat,
    var(--pin-light) 100% 0 / 1.6rem 1.6rem no-repeat,
    var(--pin) 100% 0 / 1.6rem 1.6rem no-repeat;
}

.dateline {
  margin: 0 0 0.9rem;
  font: 400 0.8rem/1.3 var(--pixel-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dateline);
}

h1 {
  margin: 0 0 1.9rem;
  font: 400 clamp(2.2rem, 7.5vw, 3.4rem) / 1.08 var(--title-font);
  letter-spacing: 0.02em;
  color: var(--title);
  text-shadow: var(--outline-3), 5px 6px 0 var(--ink);
  rotate: -1.5deg;
  transform-origin: 0 50%;
}

/* A paper ribbon. Every second one leans the other way. */
h2 {
  display: table;
  margin: 2.6rem 0 1.1rem;
  padding: 0.28em 0.65em 0.1em;
  font: 400 1.6rem/1.15 var(--title-font);
  letter-spacing: 0.04em;
  color: var(--paper);
  text-shadow: var(--outline-2);
  background: var(--ribbon);
  border: var(--line) solid var(--ink);
  border-radius: var(--wobbly-sm);
  box-shadow: 5px 5px 0 var(--ink);
  rotate: 1deg;
}

h2:nth-of-type(even) {
  background: var(--ribbon-alt);
  rotate: -1.2deg;
}

h3 {
  margin: 2rem 0 0.5rem;
  font: 400 1.3rem/1.2 var(--title-font);
  letter-spacing: 0.03em;
  color: var(--subhead);
}

p { margin: 0 0 1.1rem; }

.opening::first-letter {
  float: left;
  margin: 0.08em 0.1em 0 0;
  font: 400 5.2em/0.8 var(--title-font);
  color: var(--initial);
  text-shadow: var(--outline-3), 4px 5px 0 var(--ink);
}

a {
  font-weight: 700;
  color: var(--link);
  text-decoration: underline wavy var(--link-line) 2px;
  text-underline-offset: 0.22em;
}

a:hover { background: var(--link-hot); color: var(--ink); }

a:focus-visible {
  outline: var(--line) dashed var(--ink);
  outline-offset: 3px;
}

ul, ol { margin: 0 0 1.2rem; padding-left: 1.7rem; }
li { margin: 0.3rem 0; }
article ul > li::marker { content: "✦  "; color: var(--c-tangerine); }
article ol > li::marker { font-family: var(--title-font); color: var(--subhead); }

/* A line of dialogue. Each speaker has a colour. */
blockquote {
  --speaker: var(--c-slime);
  margin: 2.2rem 0;
  text-align: center;
}

blockquote p {
  margin: 0;
  font: 800 1.4rem/1.35 var(--body-font);
  color: var(--speaker);
  text-shadow: var(--outline-2);
}

blockquote footer {
  margin-top: 0.5rem;
  font: 400 0.75rem/1.2 var(--pixel-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.line-bubble { --speaker: var(--c-bubble); }
.line-teal { --speaker: var(--c-teal); }
.line-mustard { --speaker: var(--c-mustard); }

/* A squiggle */
hr {
  width: 60%;
  height: 14px;
  margin: 2.6rem auto;
  border: 0;
  background: var(--c-grape);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 7Q7 -1 14 7T28 7' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") center / 28px 14px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 7Q7 -1 14 7T28 7' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") center / 28px 14px repeat-x;
}

code { font: 0.9em var(--code-font); }

:not(pre) > code {
  padding: 0.05em 0.35em;
  white-space: nowrap;
  background: var(--paper-edge);
  border: 2px solid var(--ink);
  border-radius: 6px 3px 7px 3px;
}

pre {
  margin: 1.7rem 0;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--paper);
  background: var(--well);
  border: var(--line) solid var(--ink);
  border-radius: var(--wobbly-sm);
  box-shadow: 6px 6px 0 var(--ink);
  rotate: 0.5deg;
}

pre code { font-size: inherit; }

.kw { color: var(--c-bubble); }
.fn { color: var(--c-slime); }
.typ { color: var(--c-teal); }
.num { color: var(--c-tangerine); }
.str { color: var(--c-mustard); }
.com { color: var(--verb); font-style: italic; }

.table-scroll {
  margin: 1.6rem 0;
  padding: 0 8px 8px 0;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 31rem;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 1rem;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: 12px 5px 14px 5px;
  box-shadow: 6px 6px 0 var(--ink);
}

th, td {
  padding: 0.45rem 0.8rem;
  text-align: left;
  border-bottom: 2px solid var(--ink);
}

th {
  font: 400 0.8rem/1.2 var(--pixel-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--c-mustard);
}

tbody tr:nth-child(even) { background: var(--paper-edge); }
tbody tr:last-child td { border-bottom: 0; }

.swatch {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.5em;
  vertical-align: -0.2em;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 5px 2px 6px 2px;
}

.colophon {
  margin-top: 2.6rem;
  padding-top: 1rem;
  font-size: 0.9rem;
  color: color-mix(in oklab, var(--ink) 75%, var(--paper));
  border-top: 2px dashed var(--ink);
}

.colophon p:last-child { margin-bottom: 0; }

/* ── The verb panel ───────────────────────────────────────────────────────
   The site menu. Each verb is a link. The sentence line is written by the
   :has() rules at the end of this block, one for each verb and object. */

.interface {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 1.75rem;
  height: var(--panel-h);
  padding: 0.4rem max(1rem, calc((100vw - 58rem) / 2)) 0.7rem;
  background: var(--panel);
  border-top: var(--line) solid var(--ink);
  box-shadow: 0 -6px 0 var(--wainscot), 0 -9px 0 var(--ink);
}

.sentence {
  grid-column: 1 / -1;
  margin: 0 0 0.3rem;
  overflow: hidden;
  font: 400 1rem/1.5 var(--pixel-font);
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--sentence);
}

.sentence::before { content: "Walk to Odd Hours"; }

.verbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.verbs li { margin: 0; }

.verbs a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.5rem;
  font: 400 1.1rem/1 var(--pixel-font);
  color: var(--verb);
  text-decoration: none;
}

.verbs a:hover,
.verbs a:focus-visible {
  color: var(--verb-hot);
  background: none;
  outline: none;
  text-shadow: 0 0 10px color-mix(in oklab, var(--verb-hot) 65%, transparent);
}

.pockets {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.4rem;
  min-height: 0;
}

.arrows {
  display: grid;
  gap: 0.4rem;
  width: 1.9rem;
}

.arrows span,
.inventory a {
  display: grid;
  place-items: center;
  background: var(--slot);
  border: 2px solid color-mix(in oklab, var(--c-violet) 40%, var(--ink));
  border-radius: 5px 3px 6px 3px;
}

.arrows span {
  font: 400 0.8rem/1 var(--pixel-font);
  color: var(--verb);
}

.inventory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inventory li { min-height: 0; margin: 0; }

.inventory a {
  height: 100%;
  text-decoration: none;
}

.inventory a:hover,
.inventory a:focus-visible {
  background: color-mix(in oklab, var(--slot) 75%, var(--verb-hot));
  border-color: var(--verb-hot);
  outline: none;
}

.inventory svg {
  width: auto;
  height: 84%;
  max-height: 2.9rem;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  fill: none;
}

.f-mustard { fill: var(--c-mustard); }
.f-tangerine { fill: var(--c-tangerine); }
.f-bubble { fill: var(--c-bubble); }
.f-teal { fill: var(--c-teal); }
.f-slime { fill: var(--c-slime); }
.f-paper { fill: var(--c-paper); }
.f-slot { fill: var(--slot); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.interface:has(#v-open:is(:hover, :focus-visible)) .sentence::before { content: "Open the archive"; }
.interface:has(#v-read:is(:hover, :focus-visible)) .sentence::before { content: "Read the latest posts"; }
.interface:has(#v-pick:is(:hover, :focus-visible)) .sentence::before { content: "Pick up the RSS feed"; }
.interface:has(#v-look:is(:hover, :focus-visible)) .sentence::before { content: "Look at the author"; }
.interface:has(#v-talk:is(:hover, :focus-visible)) .sentence::before { content: "Talk to the author"; }
.interface:has(#v-use:is(:hover, :focus-visible)) .sentence::before { content: "Use the projects"; }
.interface:has(#v-push:is(:hover, :focus-visible)) .sentence::before { content: "Push the big red button"; }
.interface:has(#v-pull:is(:hover, :focus-visible)) .sentence::before { content: "Pull the lever"; }
.interface:has(#v-give:is(:hover, :focus-visible)) .sentence::before { content: "Give the author a coffee"; }
.interface:has(#i-key:is(:hover, :focus-visible)) .sentence::before { content: "Look at key (posts on CSS)"; }
.interface:has(#i-bulb:is(:hover, :focus-visible)) .sentence::before { content: "Look at light bulb (ideas)"; }
.interface:has(#i-cup:is(:hover, :focus-visible)) .sentence::before { content: "Look at teacup (notes)"; }
.interface:has(#i-magnet:is(:hover, :focus-visible)) .sentence::before { content: "Look at magnet (games)"; }
.interface:has(#i-sock:is(:hover, :focus-visible)) .sentence::before { content: "Look at sock (nobody knows)"; }
.interface:has(#i-battery:is(:hover, :focus-visible)) .sentence::before { content: "Look at battery (hardware)"; }

/* ── Narrow screens ───────────────────────────────────────────────────── */

@media (max-width: 1150px) {
  .window, .clock { display: none; }
}

@media (max-width: 700px) {
  :root { --panel-h: 8.5rem; --rope: 3rem; }
  body { padding-inline: 0.75rem; font-size: 1.0625rem; }
  .sign { padding-inline: 1.5rem; }
  /* A tall sheet that turns about its centre runs off a narrow screen */
  .page { margin-top: 2rem; padding: 3rem 1.4rem 2rem; rotate: none; }
  .page::before { box-shadow: 7px 7px 0 rgb(0 0 0 / 0.45); }
  .interface { grid-template-columns: minmax(0, 1fr); padding-inline: 0.5rem; }
  .pockets { display: none; }
  .verbs a { justify-content: center; padding: 0; font-size: 0.95rem; }
  .sentence { font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sign, .hand, .clock::before { animation: none; }
  .sign::before { filter: url(#wobble); }
}
