:root {
  --ink: #191a1c;
  --ink-raised: #212325;
  --line: #33363a;
  --mist: #8d9095;
  --paper: #ece9e4;

  --gap: 6px;
  --bar-height: 58px;

  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  padding: calc(var(--bar-height) + var(--gap)) var(--gap) calc(var(--gap) * 8);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- header - */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
  background: rgba(25, 26, 28, 0.82);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.015em;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

.cameras {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-right: -8px;
  padding-right: 8px;
}
.cameras::-webkit-scrollbar { display: none; }

.camera {
  flex: none;
  border: 0;
  background: none;
  padding: 7px 11px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--mist);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.camera:hover { color: var(--paper); background: var(--ink-raised); }

.camera[aria-current="true"] {
  color: var(--ink);
  background: var(--paper);
}

.camera .frames {
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
  margin-left: 7px;
  font-weight: 400;
}

/* ------------------------------------------------------------------ grid - */

.grid { display: block; }

.row {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.frame {
  position: relative;
  display: block;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #202224;
  cursor: zoom-in;
  overflow: hidden;
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.frame img.ready { opacity: 1; }

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.frame:hover::after { opacity: 0.22; }

.frame:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ intro - */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 33rem) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding: 44px 10px 34px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.intro[hidden] { display: none; }

/* No writeup yet: let the plates take the room instead of an empty column. */
.intro.bare { grid-template-columns: auto minmax(0, 1fr); }
.intro.text-only { grid-template-columns: minmax(0, 40rem); }

.intro h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -0.022em;
  line-height: 1.1;
}

.specs {
  margin: 20px 0 0;
  display: grid;
  gap: 5px 0;
  font-size: 13.5px;
}

.specs > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid #2a2c2f;
}

.specs dt { margin: 0; color: var(--mist); }
.specs dd { margin: 0; color: var(--paper); }

.prose {
  margin-top: 22px;
  color: #bdbab5;
  font-size: 15px;
  line-height: 1.68;
}

.prose p { margin: 0 0 0.9em; max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }

.plates {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.plate {
  height: 190px;
  width: auto;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #202224;
  cursor: zoom-in;
  overflow: hidden;
}

.plate img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.plate img.ready { opacity: 1; }
.plate:hover { outline: 1px solid #4a4d52; outline-offset: 0; }

.plate:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

/* --------------------------------------------------------------- notices - */

.note {
  max-width: 46ch;
  margin: 22vh auto 0;
  text-align: center;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--mist);
}

.note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: var(--paper);
  background: var(--ink-raised);
  padding: 2px 6px;
  border-radius: 3px;
}

/* -------------------------------------------------------------- lightbox - */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #0f1011;
  display: grid;
  place-items: center;
  padding: 46px 64px 52px;
  cursor: zoom-out;
}

.viewer[hidden] { display: none; }

.viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: default;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.viewer-image.ready { opacity: 1; }

.viewer-note {
  position: absolute;
  margin: 0;
  font-size: 13px;
  color: var(--mist);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease 0.25s;
}

.viewer.busy .viewer-note { opacity: 1; }

.viewer-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

.viewer-close,
.viewer-step {
  position: absolute;
  border: 0;
  background: none;
  color: var(--paper);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.viewer-close:hover,
.viewer-step:hover { opacity: 1; }

.viewer-close:focus-visible,
.viewer-step:focus-visible {
  opacity: 1;
  outline: 2px solid var(--paper);
  outline-offset: 3px;
  border-radius: 3px;
}

.viewer-close { top: 10px; right: 12px; width: 44px; height: 44px; z-index: 3; }

/* Sized and centred rather than full-height, so the rest of the backdrop
   stays clickable and nothing sits on top of the close button. */
.viewer-step {
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 120px;
  z-index: 2;
}
.viewer-step.prev { left: 2px; }
.viewer-step.next { right: 2px; }

.viewer svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viewer-close svg { width: 20px; height: 20px; }

.viewer.single .viewer-step { display: none; }

/* ---------------------------------------------------------------- small - */

@media (max-width: 860px) {
  .intro,
  .intro.bare,
  .intro.text-only {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 30px 6px 26px;
  }

  .intro h1 { font-size: 27px; }
  .specs > div { grid-template-columns: 7rem minmax(0, 1fr); }
  .plate { height: 140px; }
}

@media (max-width: 720px) {
  :root { --bar-height: 52px; }

  .bar { padding: 0 12px; gap: 12px; }
  .wordmark { font-size: 17px; }
  .camera { padding: 6px 9px; font-size: 12.5px; }
  .camera .frames { display: none; }

  .viewer { padding: 44px 10px 46px; }
  .viewer-step { width: 46px; height: 92px; }
  .viewer-caption { bottom: 14px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
  .frame img, .viewer-image { opacity: 1; }
}
