/* ===========================================================================
   player.css — machine tiles, and the dialog they open.

   Replaces the silent backdrop video. Each machine is a real button showing
   its own still; pressing it opens one shared dialog with sound and controls.
   Nothing autoplays, and no video byte is fetched until a tile is pressed.
   ======================================================================== */

/* --- the tiles ----------------------------------------------------------- */

.machines{
  list-style: none;
  margin: clamp(0.5rem, 1.4cqw, 1.1rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: clamp(0.5rem, 1.2cqw, 1rem);
  width: 100%;
}

.machine{
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: inherit;
  font: inherit;
}

.machine__still{
  position: relative;
  width: 100%;
  height: clamp(96px, 13cqw, 150px);
  overflow: hidden;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--panel-edge);
  background: var(--plate-foam);
}
.machine__still img{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--d-leaf-in) var(--e-lay);
}
.machine:hover .machine__still img,
.machine:focus-visible .machine__still img{ transform: scale(1.03) }

/* The play affordance. A ring and a triangle — no third-party icon, no font. */
.machine__play{
  position: absolute;
  left: 50%; top: 50%;
  translate: -50% -50%;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(20,22,26,.62);
  box-shadow: inset 0 0 0 1px rgba(241,241,238,.55);
  display: grid;
  place-items: center;
  transition: background var(--d-row) var(--e-lay), scale var(--d-row) var(--e-lay);
}
.machine__play::before{
  content: "";
  width: 0; height: 0;
  margin-left: 3px;                       /* optical centring of a triangle */
  border-left: 11px solid var(--carbon-type);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.machine:hover .machine__play,
.machine:focus-visible .machine__play{
  background: rgba(20,22,26,.82);
  scale: 1.06;
}

.machine__label{
  padding-top: 0.5rem;
  font-family: var(--f-label);
  font-variation-settings: "wdth" 88, "wght" 600;
  font-size: var(--t-label);
  letter-spacing: 0.024em;
  text-transform: uppercase;
  color: var(--on-plate);
}
.machine__sub{
  font-family: var(--f-label);
  font-variation-settings: "wdth" 100;
  font-size: var(--t-label);
  color: var(--on-soft);
  text-transform: none;
  letter-spacing: 0;
  display: block;
}

.machine:focus-visible{
  outline: 2px solid var(--seal-blue);
  outline-offset: 4px;
  border-radius: 3px;
}


/* --- the dialog ---------------------------------------------------------- */

html.player-open{ overflow: hidden }

.player{
  position: fixed;
  inset: 0;
  z-index: 60;                       /* above the card (2) and the menu (5) */
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(12,13,16,.82);
  opacity: 0;
  transition: opacity var(--d-menu-close) var(--e-fall);
}
.player.is-open{
  opacity: 1;
  transition: opacity var(--d-menu-open) var(--e-lay);
}
.player[hidden]{ display: none }

.player__frame{
  position: relative;
  width: min(100%, 1100px);
  display: grid;
  gap: var(--s-3);
  scale: 0.985;
  transition: scale var(--d-menu-open) var(--e-lay);
}
.player.is-open .player__frame{ scale: 1 }

.player__title{
  margin: 0;
  font-family: var(--f-label);
  font-variation-settings: "wdth" 88, "wght" 600;
  font-size: var(--t-label);
  letter-spacing: 0.024em;
  text-transform: uppercase;
  color: var(--carbon-type);
}

.player__video{
  width: 100%;
  max-height: 74vh;
  background: #000;
  border-radius: 3px;
  display: block;
}

.player__close{
  justify-self: end;
  background: var(--plate-foam);
  color: var(--stencil);
  border: 0;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce){
  .player,
  .player__frame,
  .machine__still img,
  .machine__play{ transition: none }
  .player__frame{ scale: 1 }
}
