/* Ratio: a minimal gallery. A warm white room, one hairline frame in the middle and five pictures drawn by the
   script (flat shapes and soft gradients). The pictures stay still behind the frame: when the picture changes,
   the frame springs to a new shape and crops them in a new way. */
:root {
  --paper: #f3f0ea;     /* the room */
  --ink: #1c1b19;       /* the frame, the titles */
  --muted: #8b867c;     /* the small print */
  --sky: #ece6d9;       /* the pictures: pale sky */
  --sand: #e7c39c;      /* the pictures: sand and warm light */
  --clay: #c65f3d;      /* the pictures: sun, arch, terracotta */
  --sage: #7d886a;      /* the pictures: hills and grass */
  --slate: #6a8494;     /* the pictures: water */
  --night: #222737;     /* the pictures: night and shade */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Instrument Sans Variable', 'Instrument Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.room {
  position: fixed;
  inset: 0;
  overflow: hidden;
  outline: none;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.room:focus-visible .frame__line {
  stroke-width: 2;
}

/* the wordmark and the line beside it */
.top {
  position: absolute;
  top: 26px;
  left: 48px;
  right: 48px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  pointer-events: none;
}

.top p {
  margin: 0;
}

.mark {
  font-size: 19px;
  font-weight: 640;
  font-variation-settings: 'wdth' 88;
  letter-spacing: -0.01em;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

.mark span {
  display: inline-block;
}

.sub {
  font-size: 13px;
  font-weight: 420;
  color: var(--muted);
}

/* the pictures fill the whole room: the script cuts the window with clip-path */
.pictures {
  position: absolute;
  inset: 0;
  clip-path: inset(50% 50% 50% 50%);
  pointer-events: none;
}

.pictures svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.frame__line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  vector-effect: non-scaling-stroke;
}

/* the caption under the frame: as wide as the frame, title on the left, shape and ratio on the right */
.caption {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  pointer-events: none;
  will-change: transform;
}

.caption p {
  margin: 0;
  white-space: nowrap;
}

.caption__title {
  font-size: 21px;
  font-weight: 520;
  letter-spacing: -0.012em;
}

.caption__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 440;
  color: var(--muted);
}

.slot--ratio {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* a slot keeps its lines on top of each other, cut at the bottom so the letters rise out of nothing */
.slot {
  display: inline-grid;
  overflow: hidden;
  padding: 0 0.04em 0.16em;
  margin: 0 -0.04em -0.16em;
  vertical-align: bottom;
}

.slot__line {
  grid-area: 1 / 1;
  white-space: pre;
}

.slot__ch {
  --w: 100;
  display: inline-block;
  font-variation-settings: 'wdth' var(--w);
}

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 430;
  color: var(--muted);
  pointer-events: none;
}

.hint span {
  display: inline-block;
}

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

@media (max-width: 640px) {
  .top {
    top: 20px;
    left: 20px;
    right: 20px;
  }

  .mark {
    font-size: 17px;
  }

  .sub {
    font-size: 12px;
  }

  .caption__title {
    font-size: 17px;
  }

  .caption__meta {
    font-size: 12px;
    gap: 6px;
  }

  .hint {
    bottom: 22px;
  }
}
