/* The cable car up the mountain: a made-up ski area, Alder Crown. The stage sticks for the whole ride; the landscape,
   the cabin and the view at the top are SVG drawn by the script, their colours come from the variables below. */
:root {
  --inchiostro: #10202f;     /* the text */
  --tenue: #4d5c69;          /* the small text */
  --cielo-basso: #fbe2c2;    /* the sky near the valley */
  --cielo-alto: #94c4e8;     /* the sky above the valley */
  --cielo-quota: #2f6db3;    /* the sky up high */
  --sole: #ffd27a;           /* the sun */
  --lontano: #a9bfd8;        /* the far mountains */
  --medio: #7f9abb;          /* the nearer mountains */
  --foschia: #b9cfc6;        /* the ridge behind the slope */
  --prato: #9ccb63;          /* the valley meadow */
  --bosco: #2f6a48;          /* the woods */
  --bosco-scuro: #1f4c35;    /* the trees behind */
  --pascolo: #b6d873;        /* the high pastures */
  --roccia: #8c8f98;         /* the rocks */
  --roccia-scura: #5f636d;   /* the shaded rocks */
  --neve: #f6f9fc;           /* the snow */
  --ombra-neve: #c8d7e8;     /* the snow in the shade */
  --costa: #24423a;          /* the line of the ground */
  --muro: #f3e8d6;           /* the walls of the houses */
  --tetto: #7a3b2c;          /* the roofs */
  --legno: #a8693f;          /* the wood */
  --finestra: #ffc861;       /* the lit windows */
  --metallo: #263040;        /* pylons, cables, the carriage */
  --cabina: #e5432f;         /* the cabin */
  --cabina-scura: #a92c1e;   /* the cabin's shade and doors */
  --vetro: #d5edf8;          /* the cabin's glass */
  --dentro: #1b2430;         /* inside the cabin */
  --mucca: #fbf7ef;          /* the cows */
  --macchia: #2b2724;        /* the cows' patches */
  --nuvola: #ffffff;         /* the clouds */
  --alba: #ffe0b4;           /* the view: the sky at the horizon */
  --vista: #8fc0ea;          /* the view: the sky at the top */
  --carta-hud: rgba(255, 255, 255, 0.72); /* the cards over the landscape */
  --bottone: #10202f;        /* the button */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--inchiostro);
  color: var(--inchiostro);
  font-family: 'Albert Sans Variable', 'Albert Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.palco {
  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: hidden;
}

.cielo,
.cielo__quota {
  position: absolute;
  inset: 0;
}

.cielo {
  background: linear-gradient(180deg, var(--cielo-alto) 0%, var(--cielo-basso) 78%);
}

.cielo__quota {
  background: linear-gradient(180deg, var(--cielo-quota) 0%, var(--cielo-alto) 85%);
  opacity: 0;
}

.mondo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* the drawing */
.c-lontano { fill: var(--lontano); }
.c-medio { fill: var(--medio); }
.c-neve { fill: var(--neve); }
.c-ombra-neve { fill: var(--ombra-neve); }
.c-bosco { fill: var(--bosco); }
.c-bosco-scuro { fill: var(--bosco-scuro); }
.c-roccia { fill: var(--roccia); }
.c-roccia-scura { fill: var(--roccia-scura); }
.c-muro { fill: var(--muro); }
.c-tetto { fill: var(--tetto); }
.c-legno { fill: var(--legno); }
.c-finestra { fill: var(--finestra); }
.c-metallo { fill: var(--metallo); }
.c-cabina { fill: var(--cabina); }
.c-cabina-scura { fill: var(--cabina-scura); }
.c-vetro { fill: var(--vetro); }
.c-dentro { fill: var(--dentro); }
.c-mucca { fill: var(--mucca); }
.c-macchia { fill: var(--macchia); }
.c-nuvola { fill: var(--nuvola); }
.c-sole { fill: var(--sole); }
.c-pascolo { fill: var(--pascolo); }
.c-prato { fill: var(--prato); }

.l-costa { fill: none; stroke: var(--costa); stroke-width: 5; stroke-linejoin: round; opacity: 0.35; }
.l-cavo { fill: none; stroke: var(--metallo); stroke-width: 4; stroke-linecap: round; }
.l-traino { fill: none; stroke: var(--metallo); stroke-width: 2.4; stroke-dasharray: 18 14; opacity: 0.75; }
.l-traliccio { fill: none; stroke: var(--metallo); stroke-width: 3; stroke-linejoin: round; }
.l-metallo { fill: none; stroke: var(--metallo); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.l-uccello { fill: none; stroke: var(--metallo); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.l-pista { fill: none; stroke: var(--ombra-neve); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 12; }
.l-recinto { fill: none; stroke: var(--legno); stroke-width: 3; }
.l-mucca { fill: none; stroke: var(--macchia); stroke-width: 4; stroke-linecap: round; }

.insegna {
  font-family: 'Big Shoulders Display Variable', 'Big Shoulders Display', sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  fill: var(--neve);
}

/* ---------------------------------------------------------------- the cards over the landscape */
.marchio,
.altimetro,
.zona {
  position: absolute;
  z-index: 2;
  background: var(--carta-hud);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  border-radius: 18px;
  box-shadow: 0 10px 30px -18px rgba(16, 32, 47, 0.55);
}

.marchio {
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 10px;
  border-radius: 999px;
}

.marchio__segno {
  width: 34px;
  height: 34px;
}

.marchio__monte { fill: var(--bosco); }
.marchio__neve { fill: var(--neve); }
.marchio__cavo { fill: none; stroke: var(--metallo); stroke-width: 2; stroke-linecap: round; }
.marchio__cabina { fill: var(--cabina); }

.marchio__nome {
  margin: 0;
  font-family: 'Big Shoulders Display Variable', 'Big Shoulders Display', sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.marchio__nome span {
  display: block;
  font-family: 'Martian Mono Variable', 'Martian Mono', monospace;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--tenue);
}

.altimetro {
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px 12px 12px;
}

.quadrante {
  width: 76px;
  height: 76px;
  flex: none;
}

.quadrante__fondo { fill: var(--inchiostro); }
.quadrante__tacca { stroke: var(--neve); stroke-width: 1.6; stroke-linecap: round; opacity: 0.55; }
.quadrante__tacca--grande { stroke-width: 2.6; opacity: 1; }
.quadrante__corta { stroke: var(--neve); stroke-width: 5; stroke-linecap: round; }
.quadrante__lunga { stroke: var(--cabina); stroke-width: 2.6; stroke-linecap: round; }
.quadrante__perno { fill: var(--neve); }

.altimetro__dati p {
  margin: 0;
}

.altimetro__etichetta {
  font-family: 'Martian Mono Variable', 'Martian Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tenue);
}

.altimetro__quota {
  font-family: 'Martian Mono Variable', 'Martian Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.altimetro__aria {
  font-family: 'Martian Mono Variable', 'Martian Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--tenue);
  white-space: nowrap;
}

.zona {
  left: 20px;
  bottom: 20px;
  width: min(380px, calc(100% - 40px));
  padding: 16px 20px 18px;
}

.zona__etichetta {
  margin: 0;
  font-family: 'Martian Mono Variable', 'Martian Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tenue);
}

.zona__nome {
  position: relative;
  margin: 4px 0 6px;
  font-family: 'Big Shoulders Display Variable', 'Big Shoulders Display', sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 3.4vw, 46px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  overflow: hidden;
  padding-bottom: 0.06em;
  height: 1.08em;
}

.zona__nome > span {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

.zona__nome .parola {
  display: inline-block;
  white-space: nowrap;
}

.zona__nome .lettera {
  display: inline-block;
  will-change: transform;
}

.zona__riga {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--tenue);
  min-height: 2.8em;
}

.cenno {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 26px;
  width: max-content;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: var(--neve);
  font-family: 'Martian Mono Variable', 'Martian Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cenno svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- the view at the top */
.panorama {
  position: absolute;
  inset: 0;
  z-index: 3;
  visibility: hidden;
  clip-path: inset(50% 50% 50% 50%);
  background: var(--alba);
}

.panorama__scena {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.panorama__testo {
  position: absolute;
  left: clamp(20px, 6vw, 96px);
  top: clamp(84px, 13vh, 150px);
  max-width: min(780px, calc(100% - 40px));
}

.panorama__quota {
  margin: 0 0 12px;
  font-family: 'Martian Mono Variable', 'Martian Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--inchiostro);
}

.panorama__titolo {
  margin: 0;
  font-family: 'Big Shoulders Display Variable', 'Big Shoulders Display', sans-serif;
  font-weight: 800;
  font-size: clamp(50px, 6.6vw, 108px);
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--inchiostro);
}

.panorama__titolo .parola {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  padding: 0.04em 0.02em 0.02em;
  margin: -0.04em -0.02em -0.02em;
  vertical-align: top;
}

.panorama__titolo .lettera {
  display: inline-block;
}

.panorama__riga {
  margin: 18px 0 24px;
  max-width: 30em;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.45;
  color: var(--inchiostro);
}

.tasto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  border-radius: 999px;
  background: var(--bottone);
  color: var(--neve);
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  will-change: transform;
}

.tasto span {
  display: inline-block;
}

.tasto:focus-visible {
  outline: 3px solid var(--cabina);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- the phone */
@media (max-width: 700px) {
  .marchio {
    top: 14px;
    left: 14px;
    padding: 6px 12px 6px 7px;
    gap: 7px;
  }

  .marchio__segno {
    width: 28px;
    height: 28px;
  }

  .marchio__nome {
    font-size: 18px;
  }

  .altimetro {
    top: 14px;
    right: 14px;
    gap: 9px;
    padding: 8px 12px 8px 8px;
    border-radius: 14px;
  }

  .quadrante {
    width: 46px;
    height: 46px;
  }

  .altimetro__etichetta {
    font-size: 8px;
  }

  .altimetro__quota {
    font-size: 17px;
  }

  .altimetro__aria {
    font-size: 10px;
  }

  .zona {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    padding: 12px 16px 14px;
  }

  .zona__nome {
    font-size: 32px;
  }

  .zona__riga {
    font-size: 13.5px;
  }

  .cenno {
    bottom: auto;
    top: 76px;
  }

  .panorama__testo {
    top: 76px;
    left: 20px;
  }
}

@media (hover: hover) {
  .tasto:hover {
    background: var(--cabina);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tasto {
    transition: background-color 0.3s;
  }
}
