/* The desk lamp card: the card of an architect's desk lamp, white on a white page, with the lamp standing on a dark
   desk at night. Set in Jost. The light is the only warm colour. */
:root {
  --page: #ffffff;          /* the page */
  --card: #ffffff;          /* the card */
  --line: #e8e5df;          /* the card's hairline */
  --night: #1b1a19;         /* the desk at night */
  --desk: #57524b;          /* the edge of the desk */
  --light: #ffcf8a;         /* the light */
  --lamp: #e9e6e0;          /* the lamp, in the chosen finish */
  --ink: #161514;           /* the words */
  --muted: #8b867e;         /* the small print */
}

* {
  box-sizing: border-box;
}

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

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

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.lamp {
  position: relative;
  width: min(340px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(22, 21, 20, 0.04), 0 16px 34px -20px rgba(22, 21, 20, 0.28);
}

/* ---------------------------------------------------------------- the desk at night: the pointer aims the lamp */
.desk {
  position: relative;
  aspect-ratio: 300 / 214;
  background: var(--night);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

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

.desk__top {
  fill: none;
  stroke: var(--desk);
  stroke-width: 1;
}

.light {
  mix-blend-mode: screen;
}

.body__base,
.body__shade {
  fill: var(--lamp);
}

.body__post,
.body__arm {
  fill: none;
  stroke: var(--lamp);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.body__spring {
  fill: none;
  stroke: var(--lamp);
  stroke-width: 0.9;
  stroke-linejoin: round;
  opacity: 0.75;
}

.body__joint {
  fill: var(--night);
  stroke: var(--lamp);
  stroke-width: 2;
}

/* the inside of the shade: lit when the lamp is on */
.body__mouth {
  fill: var(--light);
}

/* the switch: a small round control in the corner of the desk */
.desk__switch {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #f3efe8;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.desk__switch svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.desk__switch[aria-pressed='true'] {
  border-color: rgba(255, 207, 138, 0.55);
  color: var(--light);
}

.desk__switch[aria-pressed='false'] {
  color: #a39d94;
}

@media (hover: hover) and (pointer: fine) {
  .desk__switch:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

.desk__switch:active svg {
  transform: scale(0.82);
}

.desk__switch:focus-visible {
  outline: 1.5px solid #f3efe8;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- the words */
.info {
  padding: 16px 18px 18px;
}

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

.info__name {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 520;
  letter-spacing: -0.005em;
}

.info__price {
  margin: 0;
  font-size: 18px;
  font-weight: 460;
  font-variant-numeric: tabular-nums;
}

.info__kind {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 420;
}

/* the finishes: little squares of the paint, the chosen one with a ring that slides to it */
.finishes {
  position: relative;
  display: flex;
  gap: 6px;
  margin: 14px 0 0 -6px;
}

.finish {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.finish__chip {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(22, 21, 20, 0.12);
  transition: transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@media (hover: hover) and (pointer: fine) {
  .finish:hover .finish__chip {
    transform: scale(1.1);
  }
}

.finish:active .finish__chip {
  transform: scale(0.9);
}

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

.finishes__ring {
  position: absolute;
  top: 4px;
  left: 0;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  pointer-events: none;
}

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

.glow {
  stop-color: var(--light);
}

.desk:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1.5px #f3efe8;
}
