/* Curio Cabinet Games — "a museum after closing".
   Palette sampled from Domenico Remps, Cabinet of Curiosities (1690s).
   Re-sample from a high-resolution scan before launch. */

:root {
  --walnut: #241913;       /* page: the page is the cabinet */
  --ebony: #140e0b;        /* Night Registrar case, darker than the open one */
  --bone: #e4d8c3;         /* text only, never a background */
  --bone-dim: #b9ad99;     /* text inside the after-hours case (8.7:1 on ebony) */
  --oxblood: #8a2f27;      /* the Play button and nothing else */
  --oxblood-deep: #74261f;
  --brass: #b48a45;        /* rules, label frames, links */
  --verdigris: #5c8577;    /* hover and focus only, never text */

  --face-display: "IM Fell English", Georgia, serif;
  --face-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --face-label: "Cutive Mono", "Courier New", Courier, monospace;

  --gutter: clamp(1rem, 4vw, 3.5rem);

  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--walnut);
  color: var(--bone);
  font-family: var(--face-body);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

img,
video {
  display: block;
  max-width: 100%;
}

p {
  margin: 0;
  max-width: 65ch;
}

a {
  color: var(--brass);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--verdigris);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 3px;
}

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

.page {
  max-width: 88rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Masthead: small, top left. The display face stays above 28px. */

.masthead {
  padding: 1.5rem 0 2rem;
}

.studio-name {
  margin: 0;
  font-family: var(--face-display);
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1.1;
}

/* Labels: a 1px brass rule, like a museum label holder. */

.label {
  border: 1px solid var(--brass);
  padding: 1.5rem 1.5rem 1.75rem;
}

.accession,
.medium {
  font-family: var(--face-label);
  font-size: 1rem;
  line-height: 1.4;
}

.accession {
  color: var(--brass);
}

.exhibit-title {
  margin: 0.75rem 0 1rem;
  font-family: var(--face-display);
  font-size: clamp(2.25rem, 3.4vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
}

.description {
  margin-bottom: 1rem;
}

/* Exhibit 001: generous, the trailer offset left with its label beside it. */

.exhibit-pip {
  display: grid;
  grid-template-columns: minmax(0, 9fr) minmax(17rem, 4fr);
  column-gap: clamp(2rem, 4vw, 4rem);
  row-gap: 0.75rem;
  align-items: end;
}

/* Desktop: the transcript sits under the trailer; the label stays beside it, even when the transcript opens. */
.exhibit-pip .trailer { grid-area: 1 / 1; }
.exhibit-pip .transcript { grid-area: 2 / 1; align-self: start; }
.exhibit-pip .label { grid-area: 1 / 2; }

.transcript summary {
  width: fit-content;
  color: var(--brass);
  font-family: var(--face-label);
  font-size: 1rem;
  cursor: pointer;
}

.transcript summary:hover {
  text-decoration: underline 2px var(--verdigris);
  text-underline-offset: 0.2em;
}

.transcript-body {
  margin-top: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--brass);
}

.transcript-body p + p {
  margin-top: 0.75rem;
}

.trailer {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ebony);
}

.trailer video {
  width: 100%;
  height: 100%;
  background: var(--ebony);
  image-rendering: pixelated; /* keep Pip's pixels square when scaled */
}

/* The one vignette: lamplight on the object, lifted once the trailer plays. */
.trailer::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 7rem 1.5rem rgb(0 0 0 / 0.55);
  pointer-events: none;
}

.trailer.is-playing::after {
  display: none;
}

.play {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 2px;
  background: var(--oxblood);
  color: var(--bone);
  font-weight: 700;
  text-decoration: none;
}

.play:hover {
  background: var(--oxblood-deep);
}

/* Exhibit 002: narrower, darker, right of center. A case you lean in to see. */

.exhibit-registrar {
  width: min(100%, 34rem);
  margin: clamp(7rem, 16vw, 12rem) 12% clamp(5rem, 10vw, 8rem) auto;
}

.case {
  background: var(--ebony);
  padding: 0.75rem;
  color: var(--bone-dim);
}

/* Plates: a row of screenshots, one per view, snapping into place. */

.plates-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.plates.is-ready .plates-track {
  scrollbar-width: none;
}

.plates.is-ready .plates-track::-webkit-scrollbar {
  display: none;
}

.plate {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.plate img {
  width: 100%;
  height: auto;
  background: var(--walnut);
  animation: gallery-light 24s ease-in-out infinite;
}

.plate figcaption {
  margin-top: 0.5rem;
  font-family: var(--face-label);
  font-size: 1rem;
  line-height: 1.4;
}

/* A gallery light on a timer: holds, dims, holds, comes back. */
@keyframes gallery-light {
  0%, 35% { filter: brightness(0.9); }
  50%, 85% { filter: brightness(0.5); }
  100% { filter: brightness(0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .plate img {
    animation: none;
    filter: brightness(0.8);
  }
}

.plates-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.625rem;
}

.plates-controls[hidden] {
  display: none;
}

.plates-controls button {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--brass);
  border-radius: 2px;
  background: transparent;
  color: var(--brass);
  font-family: var(--face-label);
  font-size: 1rem;
  cursor: pointer;
}

.plates-controls button:hover {
  border-color: var(--verdigris);
}

.plates-count {
  font-family: var(--face-label);
  font-size: 1rem;
  white-space: nowrap;
}

/* Narrow cases: arrows only; the words stay for screen readers. */
@media (max-width: 30rem) {
  .plates-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .plates-controls button {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}

.label-tight {
  margin-top: 0.75rem;
  padding: 1rem 1rem 1.125rem;
}

.label-tight .exhibit-title {
  margin: 0.5rem 0 0.625rem;
  font-size: 1.875rem;
  color: var(--bone);
}

.label-tight .description {
  margin-bottom: 0.625rem;
}

.follow {
  display: inline-block;
  margin-top: 0.75rem;
}

/* Footer */

.footer {
  border-top: 1px solid var(--brass);
  padding: 1.5rem 0 2.5rem;
}

.credit {
  margin-top: 0.5rem;
}

/* Phones: exhibits stack, the trailer goes full width, the label sits beneath. */

@media (max-width: 56rem) {
  .exhibit-pip {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .exhibit-pip .trailer,
  .exhibit-pip .transcript,
  .exhibit-pip .label {
    grid-area: auto;
  }

  .exhibit-pip .transcript {
    margin-top: -0.75rem;
  }

  .trailer {
    margin-inline: calc(var(--gutter) * -1);
  }

  .exhibit-registrar {
    width: min(100%, 30rem);
    margin: 6rem 0 5rem auto;
  }
}
