/* The neon sign button: a neon sign on a black page, shining back from under it as from wet ground. The tubes, their
   light and the reflection are drawn by the script; here are the colours, the sign and the words. */
:root {
  --page: #000000;          /* the page */
  --pink: #ff3f9e;          /* the first sign: words */
  --blue: #3ec5ff;          /* the first sign: frame and glass */
  --amber: #ffa63a;         /* the second sign: words */
  --red: #ff4b3e;           /* the second sign: frame and glass */
  --mint: #4dffb8;          /* the third sign: words */
  --violet: #a77bff;        /* the third sign: frame and glass */
  --glass: rgba(225, 232, 245, 0.2);   /* the tubes when they are off */
  --ink: #f4eee6;           /* the words under the sign */
}

/* which colours the sign has: the script moves from one to the next */
[data-scheme='0'] {
  --tube: var(--pink);
  --frame: var(--blue);
}

[data-scheme='1'] {
  --tube: var(--amber);
  --frame: var(--red);
}

[data-scheme='2'] {
  --tube: var(--mint);
  --frame: var(--violet);
}

* {
  box-sizing: border-box;
}

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

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

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

/* ---------------------------------------------------------------- the sign */
/* the sign, its reflection under it and the line of words, one under the other */
.piece {
  display: grid;
  justify-items: center;
}

.sign {
  position: relative;
  display: block;
  width: min(600px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.sign__body {
  position: relative;
  display: block;
  will-change: transform;
}

/* the plate and the glass, then one layer per tube for its light and one for its halo: a flicker only changes
   their opacity, so the browser never draws the glow again */
.sign__art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.sign__layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.sign__layer--halo {
  filter: blur(11px);
}

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

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

/* the drawing */
.plate {
  fill: rgba(255, 255, 255, 0.025);
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

.plate__shine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
  stroke-linecap: round;
}

.screw {
  fill: url(#neon-steel);
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 0.6;
}

.screw__top {
  fill: rgba(255, 255, 255, 0.5);
}

.steel-a {
  stop-color: #c9ccd4;
}

.steel-b {
  stop-color: #4a4d56;
}

.block {
  fill: none;
  stroke: #050406;
  stroke-width: 4.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.glass {
  fill: none;
  stroke-width: 4.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* off, the glass keeps a hint of its colour */
.glass--tube {
  stroke: color-mix(in srgb, var(--tube) 20%, var(--glass));
}

.glass--frame {
  stroke: color-mix(in srgb, var(--frame) 20%, var(--glass));
}

.glass__shine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(-0.8px, -1px);
}

.lit {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lit__bloom {
  stroke-width: 8;
  opacity: 0.85;
}

.lit__colour {
  stroke-width: 4.6;
}

.lit__core {
  stroke-width: 1.8;
}

.halo {
  fill: none;
  stroke-width: 15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-tube .lit__bloom,
.is-tube .lit__colour,
.is-tube .halo,
.is-tube .ends {
  stroke: var(--tube);
}

.is-frame .lit__bloom,
.is-frame .lit__colour,
.is-frame .halo,
.is-frame .ends {
  stroke: var(--frame);
}

.is-tube .lit__core {
  stroke: color-mix(in srgb, var(--tube) 28%, #ffffff);
}

.is-frame .lit__core {
  stroke: color-mix(in srgb, var(--frame) 28%, #ffffff);
}

/* the glow at the electrodes, before a tube strikes and after it dies */
.ends {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: 0;
  filter: url(#neon-soft);
}

.cap {
  fill: #17151a;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.6;
}

/* ---------------------------------------------------------------- the reflection */
/* the sign upside down under it, as on wet ground: the script sizes the canvas to the sign and draws it row by row.
   The gap above it is the room between the sign and the water */
.mirror {
  display: block;
  margin-top: 10px;
  pointer-events: none;
}

/* ---------------------------------------------------------------- the words under the sign */
.status {
  display: inline-flex;
  align-items: center;
  margin: 6px 0 0;
  color: rgba(244, 238, 230, 0.72);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* booked: the line takes the colour of the words on the sign */
.status.is-done {
  color: color-mix(in srgb, var(--tube) 70%, var(--ink));
}

@media (max-width: 600px) {
  .status {
    font-size: 13.5px;
    letter-spacing: 0.12em;
  }
}
