/* ===========================================================================
   Proof Miners. One object: the pit face.
   Built to his design picture (art/ref/design-reference-1024.jpg): three full
   bleed bands, a 9:1 display-to-body scale, flat pixel objects with hard black
   outlines, one acid green accent on exactly one object. The world's colour is
   read off his own X banner: pit navy lit only by cyan ore.
   Every surface here is a generated PNG worn as a nine-slice. No CSS panels.
   =========================================================================== */

@font-face {
  font-family: "Pixeloid";
  src: url("/fonts/PixeloidSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Pixeloid";
  src: url("/fonts/PixeloidSans.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Departure";
  src: url("/fonts/DepartureMono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* measured off his banner and his design picture, not picked */
  --pit: #0a1024;
  --pit-deep: #05091a;
  --rock: #16224a;
  --blue: #2233a2;
  --blue-lit: #3c50cf;
  --pale: #dce5fe;
  --white: #ffffff;
  --ink: #0a0c18;
  --crystal: #2ef2fc;
  --green: #41fd62;
  --fault: #ff6475;
  --lamp: #ffc24a;
  --brass: #c8923c;
  --timber: #8b4a2e;
  --iron: #7c8aa8;

  --display: "Pixeloid", "Trebuchet MS", sans-serif;
  --mono: "Departure", ui-monospace, "Cascadia Mono", monospace;

  /* one page gutter, one seam between cells, everywhere */
  --gutter: clamp(16px, 3.2vw, 56px);
  --seam: clamp(14px, 1.4vw, 24px);
  --band: clamp(48px, 5vw, 80px);

  --out: 4px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--pit-deep);
  /* overflow-x: clip, never hidden: hidden freezes every sticky element on the page */
  overflow-x: clip;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--pit);
  color: var(--pale);
  font: 400 22px/1.5 var(--mono);
  font-synthesis: none;
  overflow-x: clip;
}

/* every picture on this site is pixel art, including the ones worn as a nine-slice border-image:
   a smooth resample would turn his crisp plates to mush */
img,
canvas,
.headframe__beam,
.headframe__name,
.sign,
.tag,
.key,
.field,
.seam,
.slab,
.win,
.bubble__body,
.floor__rails {
  image-rendering: pixelated;
}

a {
  color: var(--crystal);
  text-underline-offset: 4px;
}

:focus-visible {
  outline: 4px solid var(--lamp);
  outline-offset: 3px;
}

/* --------------------------------------------------------------- the world */

.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.world__wall {
  position: absolute;
  inset: -3%;
  background: url("/img/wall.png") center / cover no-repeat;
  opacity: 0.26;
  filter: blur(4px) saturate(0.8);
  animation: drift 90s linear infinite alternate;
}
.world__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}
.world::after {
  /* the pit is dark at the edges: the lamp only reaches the middle */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(118% 76% at 50% 30%, rgba(10, 16, 36, 0.35) 0%, rgba(5, 9, 26, 0.95) 100%);
}
@keyframes drift {
  from {
    transform: translate3d(-1.2%, -0.8%, 0) scale(1.02);
  }
  to {
    transform: translate3d(1.2%, 0.8%, 0) scale(1.05);
  }
}

/* ----------------------------------------------------------- the headframe */
/* The world has a bar because a mine has a headframe: a timber beam across the
   shaft, the name plate bolted to it, and the shift tags hanging off it. */

.headframe {
  position: relative;
  z-index: 3;
  padding: 0 var(--gutter);
}
/* the beam is one object across the whole shaft; the sign is bolted to it and the tags hang off it */
.headframe__top {
  position: relative;
  height: clamp(74px, 6.6vw, 112px);
  margin: 0 calc(var(--gutter) * -1);
}
.headframe__beam {
  position: absolute;
  inset: 0;
  border-image: url("/img/beam.png") 0 118 fill / 0 118px / 0 stretch;
}
.headframe__name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  max-width: calc(100% - var(--gutter) * 2);
  /* slices measured off the plate: the corner bolts sit 70 x 76 px inside it */
  padding: calc(24px + 10px) calc(26px + clamp(20px, 2vw, 34px));
  border-image: url("/img/enamel.png") 70 76 fill / 24px 26px / 0 stretch;
  text-decoration: none;
  color: var(--white);
}
.headframe__title {
  font: 700 clamp(27px, 2.6vw, 36px) / 1 var(--display);
  letter-spacing: 0.02em;
  color: var(--white);
}
.headframe__ticker {
  font: 400 22px/1 var(--mono);
  color: var(--crystal);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 1.1vw, 20px);
  margin-top: clamp(0px, 0.3vw, 6px);
  padding-bottom: clamp(16px, 1.8vw, 26px);
}
/* every tag is the same object at the same size, so the row reads as one board and no hook is
   stretched out of shape; the label is stamped on the brass plate, which is the bottom 42% of it */
.tag {
  position: relative;
  display: block;
  width: 196px;
  aspect-ratio: 384 / 420;
  border: 0;
  background: url("/img/tag.png") center / contain no-repeat;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s steps(3);
}
.tag__plate {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 48%;
  bottom: 10%;
  display: grid;
  align-content: center;
  justify-items: center;
  color: #2a1c08;
  font: 700 22px/1.08 var(--display);
  text-align: center;
}
.tag:hover {
  transform: translateY(3px);
}
.tag[aria-current="page"] {
  /* the tag you are standing on is lifted off its hook and hangs lower */
  transform: translateY(10px);
  filter: drop-shadow(0 0 10px rgba(46, 242, 252, 0.55));
}


/* ------------------------------------------------------------------- bands */

main {
  position: relative;
  z-index: 2;
  display: block;
}
.band {
  padding: 0 var(--gutter) var(--band);
}
.band--floor {
  /* his design picture closes on a saturated blue field holding three objects */
  margin-top: clamp(16px, 1.6vw, 30px);
  padding-top: clamp(30px, 3vw, 52px);
  background: linear-gradient(180deg, rgba(34, 51, 162, 0) 0%, rgba(34, 51, 162, 0.55) 42%, rgba(34, 51, 162, 0.72) 100%);
}

/* the premise: the giant lockup of his design picture, set left, at its scale (the ratio of the
   display to the body type is the design; shrinking it is what kills it) */
.premise {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(26px, 2.4vw, 40px);
  padding: clamp(22px, 2.2vw, 34px) 0 clamp(14px, 1.4vw, 22px);
}
@media (min-width: 1100px) {
  .premise {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    align-items: start;
  }
}
.premise__line {
  margin: 0;
  font: 700 clamp(34px, 4.6vw, 84px) / 0.98 var(--display);
  letter-spacing: -0.01em;
  color: var(--white);
  text-shadow: 0 6px 0 rgba(5, 9, 26, 0.8);
}
.premise__line em {
  font-style: normal;
  color: var(--crystal);
}
.premise__sub {
  margin: clamp(18px, 1.8vw, 26px) 0 0;
  max-width: 48ch;
  color: var(--pale);
}
.premise__side {
  display: grid;
  gap: clamp(16px, 1.6vw, 24px);
  justify-items: start;
  padding-top: clamp(0px, 1vw, 18px);
}

/* the last run, printed on the rock under the lamp that is burning it */
.last {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: calc(28px + 14px) calc(28px + 20px);
  border-image: url("/img/seam.png") 56 fill / 28px / 0 round;
  image-rendering: pixelated;
}
.last__head {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--lamp);
  font: 700 22px/1.2 var(--display);
}
.last__body {
  color: #b7c6ee;
  overflow-wrap: anywhere;
}

/* the one green object on the site, straight out of his design picture: the live count of lemmas
   Lean has accepted. Its tail is a separate plate hanging off the body it belongs to, because a
   nine-slice would smear it across the whole bottom edge. */
.bubble {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 34px;
}
.bubble__body {
  display: grid;
  gap: 8px;
  padding: calc(29px + 12px) calc(29px + clamp(18px, 1.8vw, 26px));
  border-image: url("/img/bubble-body.png") 58 fill / 29px / 0 stretch;
  color: #06230f;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 42px;
  top: 100%;
  width: 40px;
  height: 25px;
  margin-top: -2px;
  background: url("/img/bubble-tail.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
.bubble__n {
  font: 700 clamp(40px, 4.2vw, 58px) / 1 var(--display);
  color: #06230f;
}
.bubble__label {
  font: 400 22px/1.3 var(--mono);
  color: #0c3a1a;
  max-width: 40ch;
}

/* ------------------------------------------------------- plates and keys */

/* a section head is an enamel sign bolted to the rock, never a text heading */
.sign {
  display: flex;
  align-items: center;
  gap: 20px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 var(--seam);
  padding: calc(35px + 12px) calc(38px + clamp(18px, 1.8vw, 28px));
  border-image: url("/img/enamel.png") 70 76 fill / 35px 38px / 0 stretch;
  font: 700 clamp(22px, 2vw, 32px) / 1.1 var(--display);
  color: var(--white);
}
.sign__count {
  font: 400 22px/1 var(--mono);
  color: var(--crystal);
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 60px;
  padding: 20px calc(20px + clamp(20px, 2vw, 30px)) 34px;
  border: 0;
  background: none;
  border-image: url("/img/key.png") 20 40 56 40 fill / 10px 20px 28px 20px / 0 stretch;
  color: var(--ink);
  font: 700 22px/1 var(--display);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s steps(2);
}
.key:hover:not([disabled]):not([aria-disabled="true"]) {
  transform: translateY(-3px);
}
.key:active:not([disabled]):not([aria-disabled="true"]) {
  transform: translateY(2px);
}
/* the one key that starts a thing, lit like the ore it is about to cut */
.key--lit {
  color: #04202a;
  filter: sepia(1) saturate(5.5) hue-rotate(152deg) brightness(1.06) drop-shadow(0 0 12px rgba(46, 242, 252, 0.45));
}
.key[disabled],
.key[aria-disabled="true"] {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.62);
  color: #3a4256;
}
.key__mark {
  width: 26px;
  height: 26px;
  image-rendering: auto;
}

.field {
  display: block;
  width: 100%;
  min-height: 62px;
  padding: calc(28px + 10px) calc(28px + 16px);
  border: 0;
  border-image: url("/img/field.png") 57 fill / 28px / 0 stretch;
  background: none;
  color: var(--pale);
  font: 400 22px/1.3 var(--mono);
}
.field::placeholder {
  color: #5b6a93;
}
textarea.field {
  min-height: 132px;
  resize: vertical;
}
select.field {
  appearance: none;
  cursor: pointer;
}

.label {
  display: block;
  margin: 0 0 10px;
  font: 700 22px/1.2 var(--display);
  color: var(--white);
}
.hint {
  margin: 10px 0 0;
  color: #93a4cd;
  font-size: 22px;
}

/* ---------------------------------------------------------------- the seam */
/* every open problem is a dressed stone slab cut into the face */

.seams {
  display: grid;
  gap: var(--seam);
}
.seam {
  container-type: inline-size;
  position: relative;
  display: block;
  width: 100%;
  padding: calc(28px + clamp(8px, 0.8vw, 14px)) calc(28px + clamp(18px, 1.8vw, 30px));
  border: 0;
  background: none;
  border-image: url("/img/seam.png") 56 fill / 28px / 0 round;
  color: var(--pale);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s steps(3), filter 0.12s linear;
}
.seam:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 0 14px rgba(46, 242, 252, 0.4));
}
.seam__ghost {
  position: absolute;
  top: 50%;
  left: 58%;
  transform: translateY(-50%);
  font: 700 clamp(56px, 7vw, 116px) / 1 var(--display);
  color: rgba(220, 229, 254, 0.055);
  pointer-events: none;
  user-select: none;
}
.seam__grid {
  position: relative;
  display: grid;
  gap: clamp(12px, 1.2vw, 20px);
  grid-template-columns: minmax(0, 1fr);
}
@container (min-width: 760px) {
  .seam__grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}
.seam__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
}
.seam__n {
  font: 700 clamp(27px, 2.2vw, 36px) / 1 var(--display);
  color: var(--white);
}
.seam__text {
  margin: 0;
  max-width: 68ch;
  color: #c3d1f4;
  overflow-wrap: anywhere;
}
.seam__side {
  display: grid;
  gap: 12px;
  justify-items: start;
}
@container (min-width: 760px) {
  .seam__side {
    justify-items: end;
    text-align: right;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font: 400 22px/1.2 var(--mono);
  color: var(--ink);
  background: var(--iron);
  box-shadow: inset 0 0 0 var(--out) var(--ink);
}
.badge--ready {
  background: var(--crystal);
}
.badge--partial {
  background: #8fb0ff;
}
.badge--research {
  background: #6d7ca0;
  color: #0b1024;
}
.badge--solved {
  background: var(--green);
}
.badge--prize {
  background: var(--lamp);
}

/* the ore strip: one crystal per lemma Lean accepted */
.ore {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 46px;
}
.ore__one {
  width: 18px;
  height: 46px;
  background: url("/img/crystal.png") center / contain no-repeat;
}
.ore__one--dim {
  filter: grayscale(1) brightness(0.42);
}
.ore__one--green {
  background-image: url("/img/crystal-green.png");
}
.ore__none {
  color: #7f8dae;
  font-size: 22px;
}

/* a coin working a seam */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  background: rgba(5, 9, 26, 0.72);
  box-shadow: inset 0 0 0 2px rgba(124, 138, 168, 0.55);
  color: var(--pale);
  font: 400 22px/1 var(--mono);
  text-decoration: none;
}
.chip img {
  width: 34px;
  height: 28px;
  object-fit: contain;
}
.chip:hover {
  box-shadow: inset 0 0 0 2px var(--crystal);
}

/* ------------------------------------------------------------- the floor */
/* his design picture's last band: a blue field holding exactly three objects */

.floor {
  display: grid;
  gap: clamp(22px, 2.4vw, 40px);
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
}
@media (min-width: 1100px) {
  .floor {
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr) minmax(0, 300px);
  }
}
.floor__rails {
  height: 54px;
  margin: 0 calc(var(--gutter) * -1);
  border-image: url("/img/rails.png") 0 160 fill / 0 160px / 0 round;
}

.cart {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.cart img {
  width: clamp(150px, 15vw, 230px);
  height: auto;
  animation: rock 6s ease-in-out infinite;
}
@keyframes rock {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(10px); }
}
.pot img {
  width: clamp(140px, 14vw, 210px);
  height: auto;
}
.pot {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.pot__n {
  font: 700 clamp(27px, 2.4vw, 36px) / 1 var(--display);
  color: var(--lamp);
}
.floor__cap {
  font-size: 22px;
  color: #b7c6ee;
}

/* ------------------------------------------------------------ the window */
/* the one window of the site, rebuilt from his design picture's code window.
   The contract and every outside link live here and nowhere else. */

.win {
  position: relative;
  border-image: url("/img/window.png") 79 14 14 14 fill / 79px 14px 14px 14px / 0 stretch;
  color: var(--ink);
}
.win__bar {
  display: flex;
  align-items: center;
  height: 58px;
  margin-top: -74px;
  padding: 0 34px 0 94px;
  font: 700 22px/1 var(--display);
  color: var(--white);
  letter-spacing: 0.04em;
}
.win__body {
  padding: calc(14px + 26px);
  display: grid;
  gap: 20px;
}
.win__addr {
  display: block;
  width: 100%;
  padding: calc(28px + 8px) calc(28px + 14px);
  border-image: url("/img/field.png") 57 fill / 28px / 0 stretch;
  image-rendering: pixelated;
  color: var(--crystal);
  font: 400 22px/1.45 var(--mono);
  overflow-wrap: anywhere;
  min-width: 0;
  user-select: all;
}
.win__addr--empty {
  color: #7f8dae;
  user-select: none;
}
.win__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.win__note {
  margin: 0;
  color: #39477a;
  font-size: 22px;
}

/* ------------------------------------------------------------- the pages */

.sheet {
  display: grid;
  gap: var(--seam);
  padding: clamp(28px, 3vw, 48px) 0 0;
}
.cols {
  display: grid;
  gap: var(--seam);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  .cols--2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .cols--form {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
  }
}

/* a reading slab: stone with the text on its dressed face */
.slab {
  padding: calc(28px + clamp(16px, 1.6vw, 26px)) calc(28px + clamp(18px, 1.8vw, 30px));
  border-image: url("/img/seam.png") 56 fill / 28px / 0 round;
}
.slab h2 {
  margin: 0 0 16px;
  font: 700 clamp(27px, 2.2vw, 36px) / 1.1 var(--display);
  color: var(--white);
}
.slab h3 {
  margin: 26px 0 10px;
  font: 700 22px/1.2 var(--display);
  color: var(--crystal);
}
.slab p {
  margin: 0 0 16px;
  max-width: 72ch;
  color: #c3d1f4;
}
.slab p:last-child {
  margin-bottom: 0;
}
.slab ol,
.slab ul {
  margin: 0 0 16px;
  padding-left: 1.4em;
  max-width: 72ch;
  color: #c3d1f4;
}
.slab li {
  margin-bottom: 10px;
}

/* a run of the solver, printed in the coin's notebook */
.runs {
  display: grid;
  gap: 14px;
}
.run {
  display: grid;
  gap: 12px;
  padding: 22px 26px;
  background: rgba(5, 9, 26, 0.74);
  box-shadow: inset 0 0 0 3px #263355;
}
.run__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.run__verdict {
  font: 700 22px/1 var(--display);
}
.run--pass .run__verdict {
  color: var(--green);
}
.run--fail .run__verdict {
  color: var(--fault);
}
.run__code {
  margin: 0;
  padding: 18px 22px;
  background: #060a18;
  box-shadow: inset 0 0 0 3px #1c2746;
  color: #9fb4e8;
  font: 400 22px/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 340px;
  overflow: auto;
}
.run__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  color: #8fa0c9;
  font-size: 22px;
}

/* a labelled row of facts; the label column is fixed, the value fluid */
.rows {
  display: grid;
  gap: 2px;
}
.rows__r {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 20px;
  padding: 14px 0;
  border-bottom: 2px solid rgba(124, 138, 168, 0.22);
}
@media (min-width: 620px) {
  .rows__r {
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: baseline;
  }
}
.rows__k {
  color: #8fa0c9;
}
.rows__v {
  color: var(--white);
  overflow-wrap: anywhere;
  min-width: 0;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(34px, 4vw, 64px) 24px;
  text-align: center;
  color: #93a4cd;
}
.empty img {
  width: 120px;
  height: auto;
  opacity: 0.75;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--seam);
}
.filter {
  min-height: 56px;
  padding: 16px 32px 26px;
  border: 0;
  background: none;
  border-image: url("/img/key.png") 20 40 56 40 fill / 8px 16px 22px 16px / 0 stretch;
  image-rendering: pixelated;
  color: #2b3348;
  font: 400 22px/1 var(--mono);
  cursor: pointer;
  filter: brightness(0.82) saturate(0.7);
}
.filter[aria-pressed="true"] {
  color: var(--ink);
  filter: sepia(1) saturate(5.5) hue-rotate(152deg) brightness(1.06);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 9;
  transform: translateX(-50%);
  padding: 16px 28px;
  background: var(--crystal);
  color: var(--ink);
  box-shadow: inset 0 0 0 4px var(--ink);
  font: 700 22px/1 var(--display);
}
.toast--bad {
  background: var(--fault);
  color: var(--white);
}

.lamp {
  display: inline-block;
  width: 30px;
  height: 44px;
  vertical-align: -12px;
  background: url("/img/lamp.png") center / contain no-repeat;
  animation: flicker 2.6s steps(2) infinite;
}
@keyframes flicker {
  0%, 44%, 100% { opacity: 1; }
  50%, 94% { opacity: 0.74; }
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .world__dust {
    display: none;
  }
}


/* the pile: his design picture stacks objects of different sizes in its middle band, so the first
   screen carries the three seams worth looking at as well as the premise */
.pile {
  display: grid;
  gap: var(--seam);
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(16px, 1.6vw, 26px);
}
.pile__head {
  grid-column: 1 / -1;
  margin: 0;
  color: #93a4cd;
  font-size: 22px;
}
@media (min-width: 900px) {
  .pile {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.pile__one {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: calc(28px + 8px) calc(28px + 12px);
  border-image: url("/img/seam.png") 56 fill / 28px / 0 round;
  image-rendering: pixelated;
  color: var(--pale);
  text-decoration: none;
  transition: transform 0.12s steps(3), filter 0.12s linear;
}
.pile__one:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 0 12px rgba(46, 242, 252, 0.4));
}
.pile__n {
  font: 700 27px/1 var(--display);
  color: var(--white);
}
.pile__text {
  color: #b2c2e9;
  font-size: 22px;
  line-height: 1.35;
}
.pile__foot {
  color: var(--crystal);
  font-size: 22px;
}

/* the shift board key: the drawer the tags live in on a phone. A lamp room board with five tags on
   long hooks is a thousand pixels of chrome at 390, so on a phone the tags lie flat in a drawer and
   the beam carries one key that opens it. */
.board {
  display: none;
}

/* ------------------------------------------------------------------- the phone */
/* drawn, not squeezed: the headframe keeps its beam and its sign, the tags move into a drawer, and
   the bands stack in the order the eye reads them */
@media (max-width: 720px) {
  :root {
    --band: 40px;
  }
  /* the beam comes out of its fixed box so the sign can hang off it and the band can grow */
  .headframe__top {
    height: auto;
    display: grid;
  }
  .headframe__beam {
    position: static;
    height: 52px;
  }
  .headframe__name {
    position: static;
    transform: none;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: -22px auto 0;
    padding: calc(24px + 8px) calc(26px + 12px);
    gap: 4px;
  }
  .headframe__title {
    font-size: 27px;
    white-space: nowrap;
  }

  .board {
    display: grid;
    place-items: center;
    width: calc(100% - 0px);
    min-height: 60px;
    margin: 12px 0 0;
    padding: 18px 24px 26px;
    border: 0;
    background: none;
    border-image: url("/img/key.png") 20 40 56 40 fill / 10px 20px 28px 20px / 0 stretch;
    image-rendering: pixelated;
    color: var(--ink);
    font: 700 22px/1 var(--display);
    cursor: pointer;
  }
  .board[aria-expanded="true"] {
    filter: sepia(1) saturate(5.5) hue-rotate(152deg) brightness(1.06);
  }

  .tags {
    display: none;
    margin-top: 12px;
    gap: 10px;
  }
  .tags[data-open] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tag {
    width: 100%;
    aspect-ratio: 384 / 227;
    background-image: url("/img/tag-plate.png");
  }
  .tag[aria-current="page"] {
    transform: none;
    filter: drop-shadow(0 0 8px rgba(46, 242, 252, 0.6)) brightness(1.1);
  }
  .tag__plate {
    left: 8%;
    right: 8%;
    top: 14%;
    bottom: 14%;
    font-size: 18px;
  }

  .seam__ghost {
    display: none;
  }
  .win__bar {
    height: 50px;
    margin-top: -66px;
    padding: 0 22px 0 82px;
  }
  .win__body {
    padding: calc(14px + 18px);
  }
  .premise__line {
    text-shadow: 0 4px 0 rgba(5, 9, 26, 0.8);
  }
}

@media (max-width: 400px) {
  .tags[data-open] {
    grid-template-columns: minmax(0, 1fr);
  }
  .tag {
    aspect-ratio: 384 / 150;
  }
}
