:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: rgba(17, 17, 19, 0.08);
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --logo: #a6a6ae;
  --nero: #111113;
}

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

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: relative;
  height: 100vh;
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(12px, 4vmin, 40px) 0;
}

/* the band */
.band {
  width: min(1180px, 100%);
  display: grid;
  justify-items: center;
  gap: clamp(14px, 3.4vmin, 30px);
}

.eyebrow {
  font-size: clamp(12px, 1.8vmin + 5px, 19px);
  color: var(--testo-2);
  transition: opacity .3s ease;
  letter-spacing: 0.005em;
  text-align: center;
  padding: 0 16px;
}
.eyebrow b { color: var(--testo); font-weight: 600; font-variant-numeric: tabular-nums; }

.rows {
  width: 100%;
  display: grid;
  gap: clamp(10px, 2.6vmin, 22px);
}

/* each row fades at both ends, so the logos are born and die softly */
.row {
  position: relative;
  overflow: hidden;
  padding: 10px 0 12px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.row.is-drag { cursor: grabbing; }

.track {
  display: flex;
  width: max-content;
  will-change: transform;
}

/* a logo: the item is moved by the track, its child lifts and colours itself (an element for GSAP, the child for the CSS) */
.logo {
  flex: none;
  padding: 0 calc(var(--gap, 56px) / 2);
}
.logo__in {
  display: flex;
  align-items: center;
  gap: 9px;
  height: clamp(30px, 7vmin, 56px);
  color: var(--logo);
  transition: color .45s ease, transform .5s cubic-bezier(.2, 1.4, .4, 1), opacity .45s ease;
}
.logo__in svg { width: clamp(18px, 4vmin, 32px); height: clamp(18px, 4vmin, 32px); flex: none; overflow: visible; }
.logo__word {
  font-size: clamp(15px, 3.4vmin + 4px, 33px);
  font-weight: 640;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo[data-style="wide"] .logo__word { font-stretch: 118%; font-weight: 560; letter-spacing: 0.01em; }
.logo[data-style="narrow"] .logo__word { font-stretch: 84%; font-weight: 720; letter-spacing: 0; }
.logo[data-style="light"] .logo__word { font-weight: 430; letter-spacing: 0.02em; text-transform: lowercase; }
.logo[data-style="caps"] .logo__word { font-weight: 680; text-transform: uppercase; letter-spacing: 0.08em; font-size: clamp(12px, 2.6vmin + 3px, 24px); }

.row.is-dim .logo__in { opacity: 0.55; }
.logo.is-on .logo__in {
  color: var(--tinta);
  opacity: 1;
  transform: translateY(-3px);
}

.band.is-quoting .eyebrow { opacity: 0.25; }

.hint {
  font-size: clamp(11px, 1.4vmin + 4px, 15px);
  color: var(--testo-3);
  text-align: center;
  padding: 0 16px;
}

/* the small card that follows the hovered logo */
.quote {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 11px 14px 12px;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05), 0 14px 34px -12px rgba(17, 17, 19, 0.22);
  pointer-events: none;
  visibility: hidden;
}
.quote__arrow {
  position: absolute;
  left: var(--ax, 50%);
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-right: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}
.quote.is-below .quote__arrow { top: -6px; }
.quote.is-above .quote__arrow { bottom: -6px; transform: rotate(225deg); }
.quote__name { font-size: 12px; font-weight: 600; color: var(--tinta, var(--testo)); }
.quote__metric { font-size: 14px; font-weight: 600; color: var(--testo); letter-spacing: -0.005em; }
.quote__note { font-size: 12px; color: var(--testo-2); }

/* the fake pointer of the autopilot */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
}
.ghost path { fill: #111113; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

:focus-visible { outline: 2px solid #6d5efc; outline-offset: 3px; border-radius: 8px; }

@media (max-width: 520px) {
  .logo { padding: 0 calc(var(--gap, 56px) / 3); }
}
