/* The layered button: a button with three copies of itself underneath, on a white page. They open into a stair of
   coloured edges on the side away from the pointer and close up under a press. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #161616;           /* the text and every edge */
  --edge: 2.5px;            /* how thick the edges are */
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

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

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

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

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px 40px;
  padding: 24px;
}

/* ---------------------------------------------------------------- a button and its copies */
.stack {
  position: relative;
  display: inline-grid;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  isolation: isolate;
}

.stack:focus-visible {
  outline: none;
}

.stack:focus-visible .stack__face {
  box-shadow: inset 0 0 0 var(--edge) var(--ink), 0 0 0 3px var(--page), 0 0 0 5px var(--ink);
}

.stack__face,
.stack__layer {
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 var(--edge) var(--ink);
}

.stack__face {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 19px 30px;
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.stack__face svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stack__layer {
  position: absolute;
  inset: 0;
}

/* the deepest copy first in the code, the nearest last */
.stack__layer:nth-child(1) {
  z-index: 1;
}

.stack__layer:nth-child(2) {
  z-index: 2;
}

.stack__layer:nth-child(3) {
  z-index: 3;
}

/* the coloured one: yellow, and under it pink, blue and ink */
.stack--colour .stack__face {
  background: #ffd84a;
}

.stack--colour .stack__layer:nth-child(3) {
  background: #ff5f8f;
}

.stack--colour .stack__layer:nth-child(2) {
  background: #3f6dff;
}

.stack--colour .stack__layer:nth-child(1) {
  background: var(--ink);
}

/* the paper one: white sheets */
.stack--paper .stack__face,
.stack--paper .stack__layer {
  background: #fff;
}
