:root {
  --bg: #0c0c0d;               /* the room around the plate */
  --metal-hi: #d3d6da;         /* the aluminium, top of the plate */
  --metal-mid: #a7abb1;
  --metal-lo: #c1c4c9;
  --groove: #4a4e55;           /* the bottom of an engraved line */
  --warm: #ffb46a;             /* the one accent: the warm reflection and the spark */
  --s: min(calc(100vw / 400), calc(100vh / 330));
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage { position: relative; width: 100%; height: 100vh; max-height: 100vh; overflow: hidden; display: grid; place-items: center; perspective: calc(var(--s) * 1400); }

/* the warm light of the room on the table, and the plate's shadow */
.floor {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--s) * 520); height: calc(var(--s) * 340);
  transform: translate(-50%, -46%);
  background:
    radial-gradient(ellipse 46% 40% at 50% 62%, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0) 70%),
    radial-gradient(ellipse 60% 55% at var(--wx, 60%) 40%, rgba(255, 170, 95, 0.1), rgba(255, 170, 95, 0) 70%);
  pointer-events: none;
}

.tilt { position: relative; transform-style: preserve-3d; will-change: transform; }

.plate {
  position: relative;
  width: calc(var(--s) * 360); height: calc(var(--s) * 236);
  padding: calc(var(--s) * 24) calc(var(--s) * 26);
  border-radius: calc(var(--s) * 14);
  display: grid; grid-template-rows: auto 1fr auto auto; gap: calc(var(--s) * 8);
  background: linear-gradient(176deg, var(--metal-hi), var(--metal-mid) 56%, var(--metal-lo));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 calc(var(--s) * 2) calc(var(--s) * 3) rgba(0, 0, 0, 0.5),
    0 calc(var(--s) * 22) calc(var(--s) * 40) rgba(0, 0, 0, 0.55);
  overflow: hidden;
  isolation: isolate;
  color: var(--groove);
  user-select: none;
  touch-action: none;
}

/* the brushing: long horizontal strokes of noise, and very fine lines */
.plate__grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='300'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0018 0.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='600' height='300' filter='url(%23b)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0 1px, rgba(0, 0, 0, 0.05) 1px 2px, rgba(0, 0, 0, 0) 2px 3px);
  background-size: 100% 100%, 100% 3px;
  mix-blend-mode: overlay;
  opacity: 0.9;
}

/* brushed metal lights up in a band across the brushing: a tall narrow streak where the light is */
.plate__sheen {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse calc(var(--band, 1) * 7%) 90% at var(--lx, 30%) var(--ly, 40%), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse calc(var(--band, 1) * 22%) 120% at var(--lx, 30%) var(--ly, 40%), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 70%);
  mix-blend-mode: soft-light;
  opacity: var(--sheen, 1);
}
.plate__warm {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 16% 110% at var(--wx, 70%) 45%, rgba(255, 170, 90, 0.55), rgba(255, 170, 90, 0) 72%);
  mix-blend-mode: soft-light;
}
/* the chamfer of the edge catches the light near the pointer */
.plate__rim {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  padding: 1px;
  background: radial-gradient(ellipse 30% 90% at var(--lx, 30%) var(--ly, 40%), rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.15) 60%, rgba(0, 0, 0, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* the screws: a small dome with a hex socket */
.screw {
  position: absolute; width: calc(var(--s) * 9); height: calc(var(--s) * 9); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #eef0f2, #9a9ea4 60%, #6f737a);
  box-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.6), inset 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 1px 1.5px rgba(0, 0, 0, 0.3);
  display: grid; place-items: center;
}
.screw i {
  width: 46%; height: 46%;
  background: #4d5157;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6);
}
.screw--tl { left: calc(var(--s) * 9); top: calc(var(--s) * 9); }
.screw--tr { right: calc(var(--s) * 9); top: calc(var(--s) * 9); }
.screw--bl { left: calc(var(--s) * 9); bottom: calc(var(--s) * 9); }
.screw--br { right: calc(var(--s) * 9); bottom: calc(var(--s) * 9); }

/* every engraved line: the colour of the groove, a lit lip on the side away from the light, a shadow on the other */
.engr {
  color: var(--groove);
  text-shadow:
    calc(var(--hx, 0) * 1px) calc(var(--hy, 1) * 1px) 0 rgba(255, 255, 255, 0.55),
    calc(var(--hx, 0) * -0.7px) calc(var(--hy, 1) * -0.7px) 0 rgba(0, 0, 0, 0.32);
}

.plate__head { display: flex; justify-content: space-between; align-items: center; padding: 0 calc(var(--s) * 6); }
.brand {
  display: inline-flex; align-items: center; gap: calc(var(--s) * 5);
  font-size: calc(var(--s) * 10); font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  font-stretch: 118%;
}
.brand svg {
  width: calc(var(--s) * 13); height: calc(var(--s) * 13);
  fill: none; stroke: var(--groove); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(calc(var(--hx, 0) * 0.8px) calc(var(--hy, 1) * 0.8px) 0 rgba(255, 255, 255, 0.55));
}
.spec { font-size: calc(var(--s) * 8.5); font-weight: 560; letter-spacing: 0.06em; }

.title {
  align-self: end;
  display: flex; flex-direction: column;
  font-size: calc(var(--s) * 44); line-height: 0.98; font-weight: 760; font-stretch: 112%;
  letter-spacing: -0.018em;
  padding: 0 calc(var(--s) * 4);
}
.title__line { display: block; white-space: nowrap; }
.title .w { display: inline-block; white-space: nowrap; }
.title .l {
  position: relative;
  display: inline-block;
  color: transparent;
  clip-path: inset(-20% calc((1 - var(--cut, 1)) * 100%) -20% -20%);
}
/* the groove, on top: the wall near the light is in shadow, the bottom catches the light that slips in, the brushing goes on inside */
.title .l::after {
  content: attr(data-ch);
  position: absolute; left: 0; top: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, rgba(0, 0, 0, 0.07) 1px 2px),
    linear-gradient(calc(180deg + var(--hx, 0) * 40deg),
      hsl(214 9% calc(17% + var(--lit, 0) * 10% + var(--fresh, 0) * 45%)) 0%,
      hsl(214 7% calc(29% + var(--lit, 0) * 26% + var(--fresh, 0) * 48%)) 58%,
      hsl(214 6% calc(40% + var(--lit, 0) * 34% + var(--fresh, 0) * 42%)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* the lip of the cut, behind the letter: lit on the side away from the light, dark on the other; warm while the cut is fresh */
.title .l::before {
  content: attr(data-ch);
  position: absolute; left: 0; top: 0;
  -webkit-text-fill-color: transparent;
  text-shadow:
    calc(var(--hx, 0) * 1.6px) calc(var(--hy, 1) * 1.6px) 0 rgba(255, 255, 255, calc(0.6 + var(--lit, 0) * 0.35)),
    calc(var(--hx, 0) * -1.2px) calc(var(--hy, 1) * -1.2px) 0 rgba(30, 33, 38, calc(0.45 + var(--depth, 0) * 0.25)),
    0 0 calc(var(--s) * 10) rgba(255, 180, 106, calc(var(--fresh, 0) * 0.75));
}

.lamp {
  position: absolute;
  right: calc(var(--s) * 30); top: calc(var(--s) * 50);
  width: calc(var(--s) * 62); height: calc(var(--s) * 124);
  fill: none; stroke: var(--groove); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
  filter:
    drop-shadow(calc(var(--hx, 0) * 1px) calc(var(--hy, 1) * 1px) 0 rgba(255, 255, 255, 0.6))
    drop-shadow(calc(var(--hx, 0) * -0.6px) calc(var(--hy, 1) * -0.6px) 0 rgba(0, 0, 0, 0.3));
}
.lamp .lamp__thin { stroke-width: 0.9; opacity: 0.8; }

.sub {
  font-size: calc(var(--s) * 10); line-height: 1.38; font-weight: 520;
  max-width: calc(var(--s) * 220);
  padding: 0 calc(var(--s) * 4);
}

.plate__foot { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--s) * 4) calc(var(--s) * 4) 0; }
.serial { font-size: calc(var(--s) * 8); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

/* the pill is cut into the plate: an engraved outline that deepens under a press */
.pill {
  display: inline-flex; align-items: center; gap: calc(var(--s) * 8);
  font: inherit; font-size: calc(var(--s) * 9.5); font-weight: 680; font-stretch: 108%;
  padding: calc(var(--s) * 6) calc(var(--s) * 12);
  border: 0; border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  box-shadow:
    inset calc(var(--hx, 0) * -1px) calc(var(--hy, 1) * -1px) 1px rgba(0, 0, 0, calc(0.32 + var(--press, 0) * 0.25)),
    calc(var(--hx, 0) * 1px) calc(var(--hy, 1) * 1px) 0 rgba(255, 255, 255, 0.55);
  cursor: pointer;
}
.pill__price { font-weight: 560; opacity: 0.85; }
.pill:focus-visible { outline: 2px solid var(--warm); outline-offset: 3px; }

.sparks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }

.ghost {
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px;
  fill: #111; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  pointer-events: none;
  opacity: 0;
  z-index: 8;
}
