/* Crosshair rings that regroup on scroll: a made-up maker of carbon wheels, Raggio, in the minimal style. The stage
   sticks while you scroll; the rings are placed by the script, their colours come from the variables below. */
:root {
  --argento: #e5e5e5;        /* the page */
  --luce: #f4f4f5;           /* the light in the middle of the page */
  --ombra: #c6c7cf;          /* the shade at the edges */
  --linea: #717170;          /* the rings and the crosshairs */
  --inchiostro: #191919;     /* the titles */
  --tenue: #717170;          /* the small text */
  --accento: #e2452f;        /* the index line and the tick on the rings */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--argento);
  color: var(--inchiostro);
  font-family: 'Hanken Grotesk Variable', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* ---------------------------------------------------------------- the stage */
.corsa {
  position: relative;
  height: 500lvh; /* the script sets the real height from RIDE */
}

.palco {
  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 46%, var(--luce) 0%, var(--argento) 62%, var(--ombra) 130%);
}

/* ---------------------------------------------------------------- the rings */
.anelli {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.anello {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--linea) 42%, transparent);
  will-change: transform;
}

/* the tick that runs along the rim: a full-size box turned by the script, with a short mark on its top */
.anello__tacca {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
}

.anello__tacca::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -4px;
  width: 1px;
  height: 9px;
  margin-left: -0.5px;
  background: var(--accento);
}

.mirino {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
}

.mirino--a {
  left: 0;
}

.mirino--b {
  left: 100%;
}

.mirino svg,
.angolo svg,
.cenno svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mirino path,
.angolo path {
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* the four crosshairs in the corners of the stage */
.angolo {
  position: absolute;
  width: 11px;
  height: 11px;
  opacity: 0.55;
}

.angolo--ns { left: clamp(10px, 2vw, 22px); top: clamp(10px, 2vw, 22px); }
.angolo--ne { right: clamp(10px, 2vw, 22px); top: clamp(10px, 2vw, 22px); }
.angolo--ss { left: clamp(10px, 2vw, 22px); bottom: clamp(10px, 2vw, 22px); }
.angolo--se { right: clamp(10px, 2vw, 22px); bottom: clamp(10px, 2vw, 22px); }

/* ---------------------------------------------------------------- the brand */
.marchio {
  position: absolute;
  top: clamp(10px, 2vw, 22px);
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 640;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--inchiostro);
  text-decoration: none;
  line-height: 11px;
}

/* ---------------------------------------------------------------- the index */
.indice {
  position: absolute;
  left: clamp(26px, 3.4vw, 52px);
  top: 50%;
  height: min(44vh, 380px);
  transform: translateY(-50%);
  display: flex;
  gap: clamp(10px, 1.1vw, 16px);
}

.indice__binario {
  position: relative;
  width: 1px;
  height: 100%;
  background: color-mix(in srgb, var(--linea) 30%, transparent);
}

.indice__pieno {
  position: absolute;
  inset: 0;
  background: var(--accento);
  transform-origin: 50% 0;
  transform: scaleY(0);
}

.indice ul {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.indice a {
  display: block;
  font-size: clamp(10px, 0.95vw, 13px);
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 420;
  color: var(--tenue);
  text-decoration: none;
  padding: 6px 6px 6px 0;
  margin: -6px 0;
  transition: color 0.4s ease, font-weight 0.4s ease;
}

.indice a.attiva {
  color: var(--inchiostro);
  font-weight: 640;
}

@media (hover: hover) {
  .indice a:hover {
    color: var(--inchiostro);
  }
}

/* ---------------------------------------------------------------- the titles */
.titoli {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80vw, 620px);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.titolo {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  visibility: hidden;
}

.titolo__nota {
  margin: 0 0 clamp(8px, 1.2vh, 14px);
  font-size: clamp(9px, 0.85vw, 11px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--tenue);
}

.titolo h2 {
  margin: 0;
  font-size: clamp(22px, min(4.2vw, 6.4vh), 58px);
  line-height: 1.02;
  font-weight: 380;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.titolo h2 .parola {
  display: inline-block;
}

/* ---------------------------------------------------------------- the hint and the footer */
.cenno {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 3vh, 30px);
  transform: translateX(-50%);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--tenue);
}

.cenno svg {
  width: 12px;
  height: 12px;
}

.cenno path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.piede {
  min-height: 40vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--argento);
  color: var(--tenue);
  font-size: 13px;
  text-align: center;
}

.piede p {
  margin: 0;
}

/* on a phone the index goes low and flat, under the titles */
@media (max-width: 640px) {
  .indice {
    left: 50%;
    top: auto;
    bottom: clamp(38px, 9vh, 64px);
    height: auto;
    width: min(84vw, 320px);
    transform: translateX(-50%);
    flex-direction: column;
    gap: 9px;
  }

  .indice__binario {
    width: 100%;
    height: 1px;
  }

  .indice__pieno {
    transform-origin: 0 50%;
    transform: scaleX(0);
  }

  .indice ul {
    flex-direction: row;
    height: auto;
  }

  .indice a {
    font-size: 9px;
    letter-spacing: 0.06em;
    padding: 6px 0;
  }

  .cenno {
    bottom: 12px;
  }
}
