:root {
  --sign: #ffc915;
  --sign-hi: #ffd84d;
  --sign-lo: #efb300;
  --ink: #121315;
  --night: #0b0c0e;
  --text: #ebe7de;
  --muted: #a09c92;
  --font-sign: "Overpass", "Arial Narrow", Arial, sans-serif;
  --font-mono: "Overpass Mono", ui-monospace, Consolas, monospace;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* Width of the hanging sign assembly; every board measurement derives from it. */
  --rig: min(760px, 92vw, 88svh);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--font-sign);
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- scene ---------- */

.scene {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
  background:
    radial-gradient(70% 60% at 50% 24%, rgba(255, 186, 40, .15), transparent 68%),
    radial-gradient(140% 70% at 50% 125%, #1d1f24 0%, transparent 70%),
    var(--night);
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--noise);
  opacity: .07;
  pointer-events: none;
}

/* ---------- beam + rig ---------- */

.hang {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: hang-in 1.1s cubic-bezier(.3, 1.3, .55, 1) both;
}

@keyframes hang-in {
  from { transform: translateY(-105%); }
}

.beam {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 20px;
  margin-top: 28px;
  background: linear-gradient(#4a5057, #ccd1d6 30%, #8c949c 56%, #393e44);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .55);
}

.beam::before,
.beam::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 26px;
  height: 28px;
  border-radius: 4px;
  background: linear-gradient(90deg, #2b2f34, #61686f 50%, #2b2f34);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .45);
}

.beam::before { left: 14%; }
.beam::after { right: 14%; }

.clamp {
  position: absolute;
  left: 50%;
  top: -5px;
  width: 46px;
  height: 30px;
  translate: -50% 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #24282c, #596067 50%, #24282c);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .5);
}

.clamp::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #dde1e5, #6b737b);
}

.rig-wrap {
  position: relative;
  z-index: 1;
  width: var(--rig);
  margin-top: -10px;
}

.rig {
  transform-origin: 50% 0;
  will-change: transform;
}

.chains {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ---------- the board ---------- */

.board {
  --u: calc(var(--rig) / 100);
  --rim: max(5px, calc(var(--u) * 1.3));
  --line: max(3.5px, calc(var(--u) * .8));
  --sheen: 0%;
  position: relative;
  width: 88%;
  margin-inline: auto;
  padding: calc(var(--rim) + var(--line) + max(10px, calc(var(--u) * 2.4)));
  border-radius: max(12px, calc(var(--u) * 2.6));
  color: var(--ink);
  background:
    linear-gradient(112deg, transparent calc(28% + var(--sheen)), rgba(255, 255, 255, .34) calc(40% + var(--sheen)), transparent calc(52% + var(--sheen))),
    linear-gradient(175deg, var(--sign-hi), var(--sign) 45%, var(--sign-lo));
  box-shadow:
    inset 0 0 0 var(--rim) var(--sign),
    inset 0 0 0 calc(var(--rim) + var(--line)) var(--ink),
    0 0 0 1.5px #9c7400,
    0 3px 0 1.5px #5c4500,
    0 50px 70px -18px rgba(0, 0, 0, .75);
  container: board / inline-size;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.board.is-grabbed { cursor: grabbing; }

.board::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--noise);
  background-size: 240px;
  mix-blend-mode: multiply;
  opacity: .26;
  pointer-events: none;
}

.eye {
  position: absolute;
  top: 0;
  width: max(10px, calc(var(--u) * 1.9));
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: max(2.5px, calc(var(--u) * .45)) solid #a9b0b7;
  background: #2a2d31;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.eye--l { left: 4%; }
.eye--r { left: 96%; }

.board__face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5cqi;
  padding: 4cqi 2cqi;
}

.caution {
  display: block;
  flex: none;
  width: 23cqi;
  height: auto;
  overflow: visible;
}

.board h1 {
  margin: 0;
  font-size: clamp(24px, 8.6cqi, 60px);
  font-weight: 900;
  line-height: .92;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.board h1 span { display: block; }

.board h1 .l2 {
  margin-top: .14em;
  font-size: .705em;
  letter-spacing: .012em;
}

@container board (max-width: 360px) {
  .board__face { flex-direction: column; padding-block: 6cqi; text-align: center; }
  .caution { width: 34cqi; }
  .board h1 { font-size: 12.4cqi; }
}

/* ---------- name under the sign ---------- */

.name {
  position: relative;
  z-index: 1;
  /* Auto margins centre the name in the space between the sign and the tape (the 170px bottom padding). */
  margin: auto 0;
  padding: 30px 16px 170px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .32em;
  /* Offsets the trailing letter-spacing so the name sits truly centred. */
  text-indent: .32em;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
}

a.name { transition: color .2s; }
a.name:hover { color: var(--sign); }
a.name:focus-visible { outline: 2px solid var(--sign); outline-offset: 6px; }

/* ---------- caution tape ---------- */

.cordon {
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: 150px;
  overflow: hidden;
  pointer-events: none;
}

.tape {
  position: absolute;
  left: -6%;
  display: flex;
  align-items: center;
  width: 112%;
  height: 38px;
  overflow: hidden;
  background: linear-gradient(var(--sign-hi), var(--sign) 50%, var(--sign-lo));
  box-shadow: 0 12px 26px rgba(0, 0, 0, .55);
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tape::before,
.tape::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, .2);
}

.tape::before { top: 0; }
.tape::after { bottom: 0; }

.tape--a { bottom: 62px; rotate: -3deg; }
.tape--b { bottom: 22px; rotate: 2.2deg; }

.tape__track {
  display: flex;
  flex: none;
  padding-top: .2em;
}

.tape__track span { padding-inline: 1.1em; }
.tape__track i { padding-inline: .9em; font-size: .8em; font-style: normal; }

.js .tape__track { animation: tape-run 70s linear infinite; }
.js .tape--b .tape__track { animation-direction: reverse; animation-duration: 85s; }

@keyframes tape-run { to { transform: translateX(-50%); } }

@media (max-width: 640px) {
  .tape--a { bottom: 64px; rotate: -6deg; }
  .tape--b { bottom: 20px; rotate: 5deg; }
  .name { font-size: 14px; }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .board { cursor: default; }
}
