/* games.mdrzn.it — dispatch rack
 *
 * The page is an operations rack. Each game is a progress strip seated in a
 * rail: a spec plate on the left, the game in the middle, a status lamp and
 * launch label on the right. Hover pulls the strip out of the rail.
 */

:root {
  --putty:      #cbcfc0;  /* rack enamel */
  --putty-dim:  #adb29f;  /* rail groove — darker than the panel so it reads as recessed */
  --ink:        #1b2420;  /* oxidized green-black */
  --ink-soft:   #45514a;
  --paper:      #f2f0e6;  /* the strips themselves */
  --amber:      #c8901a;  /* instrument amber — live */
  --standby:    #9e3b2a;

  --display: "Saira Condensed", "Arial Narrow", sans-serif;
  --mono: "Space Mono", ui-monospace, "Courier New", monospace;

  --rail-pad: clamp(0.5rem, 1.4vw, 0.875rem);
  --shell: min(1180px, 100% - clamp(1.5rem, 5vw, 4.5rem));
}

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

body {
  margin: 0;
  background: var(--putty);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

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

:where(a):focus-visible,
:where(.strip__hit):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ── masthead ─────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: var(--shell);
  margin: 0 auto;
  padding: 1.5rem 0 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 28%, transparent);
}

.masthead__mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.masthead__mark span { color: var(--ink-soft); }

.masthead__meta {
  margin: 0;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── thesis ───────────────────────────────────────────────── */

.thesis {
  width: var(--shell);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: minmax(0, 1fr);
}

.thesis__line {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 11vw, 7.5rem);
  line-height: 0.86;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.thesis__sub {
  margin: 0;
  max-width: 46ch;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

@media (min-width: 900px) {
  .thesis {
    grid-template-columns: 1.35fr 1fr;
    align-items: end;
  }
  .thesis__sub { padding-bottom: 0.6rem; }
}

/* ── rack ─────────────────────────────────────────────────── */

.rack {
  width: var(--shell);
  margin: 0 auto;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.rack__columns {
  display: none;
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  /* line up with strip content: rail padding plus the strip's own padding */
  padding: 0 calc(var(--rail-pad) + 1.125rem) 0.5rem;
}

@media (min-width: 860px) {
  .rack__columns {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr) 12rem 6.5rem;
    gap: clamp(0.75rem, 2vw, 1.5rem);
  }
  /* the viewport column has no printed label — it is an image, not a field */
  .rack__columns span:last-child { grid-column: 4; }
}

.rack__notice {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  background: var(--paper);
  border-left: 3px solid var(--standby);
  font-size: 0.75rem;
  line-height: 1.6;
}

.rack__notice code { font-weight: 700; }

/* The rail: a recessed groove the strips sit in. */
.rack__rail {
  list-style: none;
  margin: 0;
  padding: var(--rail-pad);
  display: grid;
  gap: var(--rail-pad);
  background: var(--putty-dim);
  border-radius: 2px;
  box-shadow:
    inset 0 3px 8px rgb(27 36 32 / 0.34),
    inset 0 1px 2px rgb(27 36 32 / 0.3),
    inset 0 -1px 0 rgb(255 255 255 / 0.26);
}

/* ── strip ────────────────────────────────────────────────── */

.strip {
  position: relative;
  display: grid;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  grid-template-columns: minmax(0, 1fr);
  padding: 1rem 1.125rem;
  background: var(--paper);
  border-radius: 1px;
  /* seated: hard top light, shadow below, and a spine on the left edge */
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    inset 3px 0 0 var(--ink),
    0 1px 2px rgb(27 36 32 / 0.3),
    0 6px 10px -6px rgb(27 36 32 / 0.45);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1),
              box-shadow 220ms ease;
}

.strip--live:hover,
.strip--live:focus-within {
  transform: translateX(clamp(4px, 1vw, 10px));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    inset 3px 0 0 var(--amber),
    0 2px 3px rgb(27 36 32 / 0.28),
    0 14px 22px -10px rgb(27 36 32 / 0.5);
}

@media (min-width: 860px) {
  .strip {
    grid-template-columns: 8.5rem minmax(0, 1fr) 12rem 6.5rem;
    align-items: center;
  }
}

/* The whole strip is the target; the CTA is only the affordance. */
.strip__hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

/* spec plate — what the game needs, not a serial number */
.strip__plate {
  margin: 0;
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.strip__specrow {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.625rem;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px dotted color-mix(in srgb, var(--ink) 30%, transparent);
  padding-bottom: 0.3rem;
}

.strip__specrow:last-child { border-bottom: 0; padding-bottom: 0; }
.strip__specrow dt { color: color-mix(in srgb, var(--ink) 52%, transparent); }
.strip__specrow dd { margin: 0; font-weight: 700; text-align: right; white-space: nowrap; }

@media (min-width: 860px) {
  .strip__plate {
    border-right: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
    padding-right: clamp(0.75rem, 1.5vw, 1.25rem);
    min-height: 4rem;
    align-content: center;
  }
}

.strip__body { min-width: 0; }

.strip__title {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.125rem);
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.strip__blurb {
  margin: 0;
  max-width: 52ch;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.strip__source {
  position: relative;
  z-index: 3;
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.strip__source:hover { color: var(--ink); }

/* viewport — a small inset screen. Landscape, so the strip stays low: a rack
 * strip is wide and short, and a portrait thumbnail would fight that. */
.strip__viewport {
  display: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--ink) 12%, transparent) 0 2px,
      transparent 2px 7px
    );
  /* a screen set into the strip, not a floating thumbnail */
  border: 1px solid color-mix(in srgb, var(--ink) 55%, transparent);
  box-shadow:
    inset 0 1px 4px rgb(27 36 32 / 0.55),
    0 1px 0 rgb(255 255 255 / 0.5);
}

.strip__viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.03);
}

@media (min-width: 860px) {
  .strip__viewport { display: block; }
}

/* launch block */
.strip__launch {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

@media (min-width: 860px) {
  .strip__launch { justify-content: flex-end; }
}

.strip__lamp {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: none;
  background: color-mix(in srgb, var(--ink) 30%, transparent);
  box-shadow: inset 0 1px 1px rgb(27 36 32 / 0.5);
  transition: background 220ms ease, box-shadow 220ms ease;
}

.strip--live:hover .strip__lamp,
.strip--live:focus-within .strip__lamp {
  background: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 26%, transparent);
}

.strip--standby .strip__lamp { background: var(--standby); }

.strip__cta {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.strip--standby .strip__cta { color: var(--standby); }

/* ── empty slot — honest, and an invitation ───────────────── */

/* Slim and quiet — an invitation, not a hole in the page. */
.strip--empty {
  background: color-mix(in srgb, var(--paper) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
  align-items: center;
  padding-block: 0.5rem;
  min-height: 0;
}

.strip__plate--blank {
  display: none;
  height: 1.25rem;
  /* .strip__plate sets min-height:4rem at this breakpoint, which would win
   * over the height above and leave the empty slot as tall as a real strip. */
  min-height: 0;
  border-right: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}

@media (min-width: 860px) {
  .strip--empty { grid-template-columns: 8.5rem minmax(0, 1fr); }
  .strip__plate--blank { display: block; }
}

.strip__emptylabel {
  margin: 0;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}

.strip__emptylabel span { letter-spacing: 0.1em; text-transform: none; }

/* ── footer ───────────────────────────────────────────────── */

.footer {
  width: var(--shell);
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 28%, transparent);
}

.footer p {
  margin: 0;
  max-width: 60ch;
  font-size: 0.6875rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .strip { transition: none; }
  .strip--live:hover, .strip--live:focus-within { transform: none; }
}
