:root {
  --night: #08080a;
  --beam: #f4f6ff;
  --ink: #f5f5f7;
  --ink-soft: #a3a3b0;
  --line: rgba(255, 255, 255, 0.1);
  --cta: #f5f5f7;
  --cta-ink: #0a0a0d;
  --font: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  /* the colour fringe on the headline, moved by the script with the tilt of the fan */
  --fringe: 0px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  /* what is left when the canvas is missing: a still fan of colour in CSS */
  background:
    conic-gradient(from 160deg at 50% 18%, transparent 0deg, rgba(255, 80, 80, 0.12) 6deg, rgba(255, 220, 90, 0.12) 14deg, rgba(90, 230, 130, 0.12) 22deg, rgba(80, 160, 255, 0.12) 30deg, rgba(160, 90, 255, 0.12) 38deg, transparent 44deg),
    var(--night);
}

.light {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
}

/* a still grain over the light, so the soft gradients do not band */
.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.hero {
  width: min(620px, 100% - 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(10px, 2.3vh, 20px);
  /* the words sit under the prism, where the fan is already open */
  margin-top: clamp(40px, 13vh, 130px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.6);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: clamp(11px, 1.6vh, 13px);
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  max-width: 100%;
}

.pill__text { overflow: hidden; text-overflow: ellipsis; }

.pill__tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--night);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pill__arrow {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title {
  font-size: clamp(30px, min(9vw, 9.5vh), 74px);
  line-height: 1;
  font-weight: 620;
  font-stretch: 104%;
  letter-spacing: -0.04em;
  color: var(--ink);
  /* the light splits on the edges of the letters too: a red fringe on one side, a blue one on the other */
  text-shadow:
    calc(var(--fringe) * -1) 0 0 rgba(255, 90, 90, 0.38),
    var(--fringe) 0 0 rgba(90, 150, 255, 0.42),
    0 0 40px rgba(8, 8, 10, 0.55);
}

.lede {
  max-width: 30em;
  font-size: clamp(13px, min(3.6vw, 2.2vh), 17px);
  line-height: 1.5;
  color: var(--ink-soft);
  text-shadow: 0 0 18px rgba(8, 8, 10, 0.8);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: clamp(2px, 0.8vh, 8px);
}

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: clamp(10px, 1.6vh, 13px) clamp(16px, 2.4vh, 20px);
  border: 0;
  border-radius: 999px;
  background: var(--cta);
  color: var(--cta-ink);
  font: 600 clamp(13px, 1.9vh, 15px) / 1 var(--font);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px -10px rgba(200, 210, 255, 0.35);
  -webkit-tap-highlight-color: transparent;
}

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

.cta__label { position: relative; }

.cta__arrow {
  position: relative;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the rainbow rim the focused light leaves around the button; GSAP fades it and turns it */
.cta__rim {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--rim, 0deg), #ff5a5a, #ffb84d, #ffe45c, #5ee08a, #4fb4ff, #6f73ff, #b066ff, #ff5a5a);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  filter: blur(0.3px);
  pointer-events: none;
}

/* the light that crosses the button when the fan focuses on it; inside its own clip */
.cta__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.cta__shine::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: translateX(var(--shine, -140%));
}

.note {
  font-size: clamp(12px, 1.7vh, 13px);
  color: var(--ink-soft);
}

/* the pointer drawn for the preview, while nobody moves the real one */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  fill: #ffffff;
  stroke: #08080a;
  stroke-width: 1.1;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

@media (max-width: 420px) {
  .note { width: 100%; }
}
