/* Apply consistent sizing throughout the page */
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #000;
}

body {
  margin: 0;
  padding: 12px;

  min-height: 100vh;
  min-height: 100dvh;

  display: grid;
  place-items: center;

  background: #000;
  color: #fff;
  font-family: "Courier New", monospace;
}

/* Centered grid with exactly two columns and two rows */
.film-frame {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "fern works"
    "bio surfing";

  width: min(760px, calc(100vw - 24px));
  height: min(500px, calc(100vh - 24px));
  height: min(500px, calc(100dvh - 24px));

  gap: 1px;
  padding: 1px;

  background: #555;
}

/* Explicit placement for all four panels */
.rh-fern {
  grid-area: fern;
}

.works {
  grid-area: works;
}

.bio-panel {
  grid-area: bio;
}

.surfing {
  grid-area: surfing;
}

/* Each panel stays within its assigned grid cell */
.panel {
  position: relative;
  display: block;

  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;

  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;

  overflow: hidden;
  appearance: none;

  background: #000;
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.panel:hover {
  background: #111;
}

.panel:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* Smaller graphics centered inside each panel */
.panel-art {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  display: block;
  width: 76%;
  height: 76%;
  margin: 0;

  object-fit: contain;
  pointer-events: none;
}

/* Bio artwork swaps when hovered or tapped */
.bio-header {
  visibility: visible;
}

.bio-gif {
  visibility: hidden;
}

.bio-panel.is-playing .bio-header {
  visibility: hidden;
}

.bio-panel.is-playing .bio-gif {
  visibility: visible;
}