/* The integrations orbiting the product that stop when you hover: the integrations section of a made-up workflow
   tool, Ferrule, on a near black page. A glass product tile in the middle, ten tools on two slow orbits, a line of
   light that draws to the tool under the pointer and a small card with its switch. */
:root {
  --page: #08090c;              /* the page */
  --glass: rgba(255, 255, 255, 0.045); /* the body of the tiles */
  --edge: rgba(255, 255, 255, 0.1);    /* the 1px edge of the tiles */
  --ink: #ecedf2;               /* titles and names */
  --muted: #8a8c98;             /* small words */
  --faint: rgba(255, 255, 255, 0.1);  /* the orbits */
  --accent: #9fb8ff;            /* the light: link, pulse, switch */
  --accent-2: #c7a6ff;          /* the second colour of the glow */
  --hub: #f2f0ea;               /* the product tile */
  --size: min(86vw, 54vh, 500px); /* the side of the orbit square */
}

* { box-sizing: border-box; }

html { touch-action: manipulation; }

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

body {
  min-height: 100svh;
  background:
    radial-gradient(60% 45% at 50% 56%, rgba(120, 140, 255, 0.07), transparent 70%),
    var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(8px, 2.2vh, 22px);
  padding: clamp(10px, 3vh, 32px) 12px;
  overflow: hidden;
}

/* ---------------------------------------------------------------- the heading */
.head { text-align: center; }

.head__label {
  margin: 0 0 clamp(4px, 1vh, 10px);
  font-size: clamp(10px, 1.6vh, 12px);
  font-weight: 560;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.head__title {
  margin: 0;
  font-size: clamp(19px, min(5.2vw, 4.6vh), 38px);
  font-weight: 560;
  font-stretch: 105%;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.head__title em {
  font-style: normal;
  font-weight: 420;
  font-stretch: 88%;
  color: var(--muted);
}

.foot {
  margin: 0;
  transition: opacity 0.25s ease;
  font-size: clamp(10px, 1.6vh, 13px);
  color: var(--muted);
  letter-spacing: 0.01em;
}

.foot.is-hidden { opacity: 0; }

/* ---------------------------------------------------------------- the orbit */
.orbit {
  position: relative;
  width: var(--size);
  height: var(--size);
}

.orbit__glow {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(159, 184, 255, 0.16), rgba(199, 166, 255, 0.05) 60%, transparent);
  filter: blur(6px);
  pointer-events: none;
}

.orbit__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.orbit__ring {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.orbit__link {
  stroke: rgba(159, 184, 255, 0.16);
  stroke-width: 1;
  opacity: 0;
}

.orbit__link--lit {
  stroke: var(--accent);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 4px rgba(159, 184, 255, 0.7));
}

.orbit__pulse {
  fill: #fff;
  opacity: 0;
  filter: drop-shadow(0 0 5px var(--accent)) drop-shadow(0 0 2px #fff);
}

/* ---------------------------------------------------------------- the product tile */
.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--size) * 0.2);
  height: calc(var(--size) * 0.2);
  margin: calc(var(--size) * -0.1) 0 0 calc(var(--size) * -0.1);
  z-index: 2;
}

.hub__body {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6%;
  border-radius: 28%;
  background:
    linear-gradient(160deg, #ffffff 0%, var(--hub) 45%, #d9d6cf 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 6px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 46px rgba(159, 184, 255, 0.22);
}

.hub__mark {
  width: calc(var(--size) * 0.075);
  height: calc(var(--size) * 0.075);
  fill: #14151b;
}

.hub__name {
  font-size: clamp(7px, calc(var(--size) * 0.022), 11px);
  font-weight: 640;
  letter-spacing: 0.04em;
  color: #5d5a54;
}

.hub__beat {
  position: absolute;
  inset: 0;
  border-radius: 28%;
  border: 1px solid var(--accent);
  opacity: 0;
}

/* ---------------------------------------------------------------- the tools */
.tiles {
  position: absolute;
  inset: 0;
}

.tile {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--size) * 0.115);
  height: calc(var(--size) * 0.115);
  margin: calc(var(--size) * -0.0575) 0 0 calc(var(--size) * -0.0575);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}

.tile.is-on { z-index: 3; }

.tile__body {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 30%;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 55%),
    rgba(20, 22, 30, 0.82);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 6px 14px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: box-shadow 0.35s ease;
}

.tile.is-on .tile__body {
  box-shadow:
    inset 0 0 0 1px rgba(159, 184, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 2px 3px rgba(0, 0, 0, 0.6),
    0 14px 30px rgba(0, 0, 0, 0.55),
    0 0 26px rgba(159, 184, 255, 0.28);
}

.tile.is-paused .tile__body svg { opacity: 0.4; }

.tile__body svg {
  width: 50%;
  height: 50%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.3s ease;
}

.tile__sheen {
  position: absolute;
  inset: 0;
  border-radius: 30%;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.16) 48%, transparent 62%);
  background-size: 260% 100%;
  background-position: 120% 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------- the card */
.card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 1px;
  padding: clamp(6px, 1.1vh, 8px) 9px clamp(6px, 1.1vh, 8px) clamp(9px, 1.5vh, 12px);
  border-radius: 12px;
  background: rgba(22, 24, 33, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
}

.card__name {
  grid-column: 1;
  font-size: clamp(11px, 1.7vh, 13px);
  font-weight: 620;
}

.card__kind {
  grid-column: 1;
  font-size: clamp(9px, 1.4vh, 11px);
  color: var(--muted);
}

.switch {
  grid-column: 2;
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(159, 184, 255, 0.12);
  color: var(--ink);
  font: 600 clamp(10px, 1.5vh, 11.5px) / 1 'Mona Sans Variable', system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.switch[aria-pressed='false'] { background: rgba(255, 255, 255, 0.06); }

.switch__track {
  position: relative;
  width: 24px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  transition: background-color 0.3s ease;
}

.switch[aria-pressed='false'] .switch__track { background: rgba(255, 255, 255, 0.18); }

.switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transform: translateX(10px);
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch[aria-pressed='false'] .switch__knob { transform: translateX(0); }

.switch__words {
  position: relative;
  display: grid;
}

.switch__word {
  grid-area: 1 / 1;
  transition: opacity 0.25s ease, transform 0.3s ease;
}

.switch__word--off {
  opacity: 0;
  transform: translateY(5px);
  color: var(--muted);
}

.switch[aria-pressed='false'] .switch__word--on { opacity: 0; transform: translateY(-5px); }
.switch[aria-pressed='false'] .switch__word--off { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- the drawn pointer */
.pointer {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 10;
  fill: #fff;
  stroke: #0b0c10;
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  opacity: 0;
}

@media (hover: hover) {
  .switch:hover { background: rgba(159, 184, 255, 0.2); }
}

@media (prefers-reduced-motion: reduce) {
  .switch__knob,
  .switch__word { transition: opacity 0.2s ease; }
}
