/* The lenticular button: a card of ribbed plastic on a black page. The three pictures under the lenses, the lenses
   turning and the light on their crests are drawn by script.js on the canvas, in the colours set here; the plastic
   sheet over them (its gloss and its edge) is CSS. */
:root {
  --page: #000000;          /* the page */
  --face-a: #2f3fe0;        /* the first picture, Pre-order: ultramarine */
  --ink-a: #f7f0e3;         /* its words and its icon */
  --face-b: #ff6a3d;        /* the second picture, Ships Nov 14: a warm orange */
  --ink-b: #1c0d07;         /* its words and its icon */
  --face-c: #f1eadb;        /* the third picture, Reserved: card white */
  --ink-c: #17153b;         /* its words */
  --tick: #2f3fe0;          /* the tick drawn on the third picture */
  --backing: #07070b;       /* what shows between the lenses while they turn */
  --focus: #f7f0e3;         /* the ring of the keyboard's focus */
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap */
html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink-a);
  font-family: 'Bricolage Grotesque Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

.lenti {
  display: grid;
  justify-items: center;
}

/* ---------------------------------------------------------------- the card */
.lenti__card {
  position: relative;
  display: block;
  width: min(300px, calc(100vw - 48px));
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--backing);
  color: var(--ink-a);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  /* a finger dragged across tilts the card; up and down the page still scrolls */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

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

html[data-using='pointer'] .lenti__card:focus-visible {
  outline: none;
}

.lenti__lenses {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

/* the plastic sheet the lenses are moulded in: a soft gloss along the top, a shade along the bottom, a lit rim where
   the top edge catches the lamp and the thickness of the sheet seen at the bottom */
.lenti__sheet {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.16) 0,
      rgba(255, 255, 255, 0.05) 9px,
      rgba(255, 255, 255, 0) 24px,
      rgba(0, 0, 0, 0) 40px,
      rgba(0, 0, 0, 0.16) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .lenti__card:active {
    filter: brightness(0.92);
  }
}
