/* The mat card: the card of a print for sale in a small gallery, in a minimal style. On a pale wall the print
   hangs framed and drawn to scale, with a white mat and a thin black frame; the sizes are written around it in
   hairlines, like the dimensions of a technical drawing, and the width of the mat in vermilion. Under the wall,
   the title and the price in Fraunces, which take weight under the pointer. */
:root {
  --page: #ffffff;          /* the page */
  --wall: #f3f1ec;          /* the wall the print hangs on */
  --ink: #141414;           /* the frame, the title and the price */
  --muted: #8d8880;         /* the small print and the dimensions */
  --mat: #fdfcf8;           /* the mat */
  --bevel: #e4ddd0;         /* the bevelled cut of the mat around the print */
  --paper: #efe9dd;         /* the paper of the print */
  --accent: #e5402a;        /* the square in the print and the width of the mat */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Instrument Sans Variable', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the card stands alone in the middle of the page; in a shop it sits in the grid of the prints, same width */
.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.print {
  position: relative;
  width: min(340px, 100%);
  margin: 0;
}

/* ---------------------------------------------------------------- the wall: a button that changes the format */
.wall {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 340 / 372;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--wall);
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.wall:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
}

/* the frame: the border is the black moulding, the background the mat; the script gives both their size in
   centimetres times the scale of the wall, at every frame of the springs */
.frame {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border: 6px solid var(--ink);
  background: var(--mat);
  --lift: 0;
  box-shadow:
    0 1px 1px rgba(20, 18, 15, 0.12),
    0 calc(7px + var(--lift) * 9px) calc(14px + var(--lift) * 16px) -9px rgba(20, 18, 15, calc(0.3 + var(--lift) * 0.08));
  will-change: transform;
}

/* the window cut in the mat: a hairline of bevel around it, and the mat's thickness shading the top of the print */
.window {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--bevel);
}

.window::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 1px 1px rgba(20, 18, 15, 0.1);
  pointer-events: none;
}

.art {
  display: block;
  width: 100%;
  height: 100%;
}

.art__paper {
  fill: var(--paper);
}

.art__dome {
  fill: var(--ink);
}

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

.art__weight {
  fill: var(--accent);
}

/* the dimensions, redrawn by the script around the frame */
.quotes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.quotes__size,
.quotes__mat {
  fill: none;
  stroke-width: 1;
  stroke-linecap: butt;
}

.quotes__size {
  stroke: var(--muted);
}

.quotes__mat {
  stroke: var(--accent);
}

.quotes__label,
.quotes__mat-label {
  font-family: 'Instrument Sans Variable', 'Helvetica Neue', Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wght' 480, 'wdth' 92;
  dominant-baseline: central;
}

.quotes__label {
  fill: var(--muted);
  text-anchor: middle;
}

.quotes__mat-label {
  fill: var(--accent);
  font-size: 8.5px;
  font-variation-settings: 'wght' 560, 'wdth' 88;
}

/* ---------------------------------------------------------------- the words under the wall */
.info {
  padding: 16px 2px 0;
}

.kind {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  font-variation-settings: 'wght' 460, 'wdth' 100;
}

.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.title,
.price {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: normal;
  line-height: 1.02;
  white-space: nowrap;
}

.title {
  font-size: 27px;
  letter-spacing: -0.012em;
  font-variation-settings: 'wght' 340, 'opsz' 28, 'SOFT' 50, 'WONK' 0;
}

.price {
  font-size: 21px;
  font-variant-numeric: lining-nums tabular-nums;
  font-variation-settings: 'wght' 340, 'opsz' 24, 'SOFT' 50, 'WONK' 0;
}

.artist {
  margin: 6px 0 0;
  color: #57534d;
  font-size: 13px;
  font-variation-settings: 'wght' 420, 'wdth' 96;
}

.foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #ebe8e2;
}

.note {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  font-variation-settings: 'wght' 460, 'wdth' 100;
}

/* the three sizes: each one a little sheet drawn to scale; the chosen one has its mat drawn in */
.formats {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-left: -7px;
}

.format {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 7px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  font-variation-settings: 'wght' 460, 'wdth' 100;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.3s ease;
}

.format__sheet {
  display: block;
  overflow: visible;
}

.format__edge,
.format__mat {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.format__mat {
  transform-box: fill-box;
  transform-origin: center;
}

.format[aria-checked='true'] {
  color: var(--ink);
  font-variation-settings: 'wght' 600, 'wdth' 100;
}

@media (hover: hover) and (pointer: fine) {
  .format[aria-checked='false']:hover {
    color: #4d4a45;
  }
}

.format:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 0;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 380px) {
  .title {
    font-size: 24px;
  }

  .price {
    font-size: 19px;
  }
}
