/* The submarine in the deep */
:root {
  --cielo-alto: #f6dcb0;        /* the sky at the top of the page */
  --cielo-basso: #d6ece8;       /* the sky on the horizon */
  --acqua-alta: #2b9fb8;        /* the water just under the waves */
  --acqua-media: #136a8f;       /* the water at 200 m */
  --acqua-fonda: #0b2f55;       /* the water at 1,000 m */
  --abisso: #050c18;            /* the water at 4,000 m and below */
  --buio: #01050b;              /* the dark that swallows everything outside the beam */
  --sottomarino: #ffc629;       /* the hull of the sub */
  --sottomarino-ombra: #e3961a;
  --oblo: #9fe3ef;              /* the big window of the sub */
  --faro: #fff0b8;              /* the colour of the beam */
  --pesce: #d8f1ef;             /* the fish of the sunlight zone */
  --pesce-scuro: #7e9fb3;       /* the fish of the twilight zone */
  --medusa: #f4a3c8;            /* the jellyfish */
  --polpo: #f08a6c;             /* the dumbo octopus */
  --calamaro: #c9503f;          /* the squid */
  --relitto: #9a5b3a;           /* the rusty wreck */
  --fondale: #2a2c33;           /* the seabed */
  --testo-scuro: #0d2a3a;       /* the words on the sky */
  --testo-chiaro: #f3f0e6;      /* the words on the water */
  --alto-grande: 100vh;
}
/* the still stage is as tall as the screen with the Safari bar pulled back */
@supports (height: 100lvh) {
  :root { --alto-grande: 100lvh; }
}

* { box-sizing: border-box; }
html,
body {
  margin: 0;
  background: var(--abisso);
}
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  color: var(--testo-chiaro);
  font-family: 'Bricolage Grotesque Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }

/* ---------------------------------------------------------------- the header */
.testata {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(16px, 4vw, 40px);
  pointer-events: none;
}
.testata > * { pointer-events: auto; }
.marchio,
.testata__link {
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 26, 40, 0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--testo-chiaro);
  font-size: 15px;
  line-height: 1.1;
}
.marchio {
  font-weight: 760;
  font-variation-settings: 'wdth' 90;
  letter-spacing: -0.01em;
}
.marchio span {
  font-weight: 420;
  opacity: 0.78;
}
.testata__link {
  display: inline-block;
  position: relative;
  overflow: hidden;
  font-weight: 620;
  text-decoration: none;
  transition: color 0.35s ease;
}
.testata__link span { position: relative; z-index: 1; }
/* on hover a yellow tide rises inside the link */
.testata__link::before {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  top: 100%;
  height: 160%;
  border-radius: 45% 55% 0 0 / 22% 22% 0 0;
  background: var(--sottomarino);
  transition: top 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (hover: hover) {
  .testata__link:hover { color: var(--testo-scuro); }
  .testata__link:hover::before { top: -30%; }
}

/* ---------------------------------------------------------------- the dive */
.discesa {
  position: relative;
  height: calc(var(--alto-grande) * 10);
}
.palco {
  position: sticky;
  top: 0;
  height: var(--alto-grande);
  overflow: hidden;
  background: var(--acqua-alta);
}
.mondo,
.buio,
.sotto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.buio { pointer-events: none; }
.sotto { pointer-events: none; overflow: visible; }

/* ---------------------------------------------------------------- the opening */
.apertura {
  position: absolute;
  top: clamp(78px, 13vh, 130px);
  left: clamp(16px, 6vw, 88px);
  right: clamp(16px, 6vw, 88px);
  color: var(--testo-scuro);
  pointer-events: none;
}
.apertura__etichetta {
  margin: 0 0 12px;
  font-family: 'Martian Mono Variable', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.apertura__titolo {
  margin: 0;
  font-size: clamp(46px, 8.6vw, 128px);
  line-height: 0.9;
  font-weight: 780;
  font-variation-settings: 'wdth' 82, 'opsz' 96;
  letter-spacing: -0.035em;
}
.apertura__titolo em {
  font-style: normal;
  color: var(--acqua-media);
}
.riga {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}
.riga > span { display: inline-block; }
.apertura__testo {
  max-width: 30ch;
  margin: 16px 0 0;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.4;
  font-weight: 460;
}
.cenno {
  position: absolute;
  left: 50%;
  bottom: clamp(22px, 5vh, 46px);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  font-family: 'Martian Mono Variable', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--testo-chiaro);
  pointer-events: none;
}
.cenno svg {
  width: 16px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- the captions */
.didascalie {
  position: absolute;
  left: clamp(16px, 5vw, 64px);
  bottom: clamp(28px, 7vh, 72px);
  width: min(400px, calc(100% - 32px));
  pointer-events: none;
}
.didascalia {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  visibility: hidden;
}
.didascalia > * {
  margin: 0;
  overflow: hidden;
}
.didascalia > * > span { display: inline-block; }
.didascalia__quota {
  font-family: 'Martian Mono Variable', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sottomarino);
}
.didascalia__nome {
  margin-top: 6px;
  font-size: clamp(30px, 3.6vw, 50px);
  line-height: 1;
  font-weight: 760;
  font-variation-settings: 'wdth' 84, 'opsz' 72;
  letter-spacing: -0.025em;
  padding-bottom: 0.08em;
}
.didascalia__testo {
  margin-top: 10px;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.45;
  font-weight: 440;
  color: rgba(243, 240, 230, 0.86);
}

/* ---------------------------------------------------------------- the gauge */
.strumento {
  position: absolute;
  top: clamp(72px, 11vh, 104px);
  right: clamp(16px, 4vw, 40px);
  min-width: 168px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  background: rgba(4, 18, 30, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: 'Martian Mono Variable', ui-monospace, monospace;
}
.strumento__nome {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}
.strumento__metri {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 8px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}
.strumento__unita {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.8;
}
/* the counter: every figure is a column of numbers that rolls like a mechanical counter */
.contatore {
  display: inline-flex;
  height: 1em;
  overflow: hidden;
}
.cifra {
  display: inline-block;
  height: 1em;
  overflow: hidden;
}
.cifra__colonna {
  display: flex;
  flex-direction: column;
}
.cifra__colonna span {
  display: block;
  height: 1em;
  line-height: 1;
  text-align: center;
}
.cifra--virgola {
  width: 0.45em;
  text-align: center;
}
.strumento__dati {
  margin: 0;
  display: grid;
  gap: 3px;
  font-size: 11px;
}
.strumento__dati div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.strumento__dati dt { opacity: 0.66; }
.strumento__dati dd { margin: 0; }

/* the scale on the right edge with the little sub that goes down it */
.scala {
  position: absolute;
  right: clamp(16px, 4vw, 40px);
  top: calc(clamp(72px, 11vh, 104px) + 150px);
  bottom: clamp(28px, 7vh, 72px);
  width: 40px;
}
.scala__binario {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 19px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--acqua-alta), var(--acqua-media) 30%, var(--acqua-fonda) 60%, rgba(243, 240, 230, 0.25));
}
.scala__tacca {
  position: absolute;
  right: 46px;
  font-family: 'Martian Mono Variable', ui-monospace, monospace;
  font-size: 10px;
  white-space: nowrap;
  transform: translateY(-50%);
  opacity: 0.7;
}
.scala__tacca::after {
  content: '';
  position: absolute;
  right: -24px;
  top: 50%;
  width: 18px;
  height: 1px;
  background: currentColor;
}
.scala__segno {
  position: absolute;
  right: 0;
  top: 0;
  width: 40px;
  height: 20px;
  margin-top: -10px;
  fill: var(--sottomarino);
}

/* ---------------------------------------------------------------- the close */
.fine {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  padding: 90px clamp(16px, 6vw, 88px);
  background: var(--buio);
}
.fine__frase {
  margin: 0;
  font-size: clamp(42px, 7vw, 104px);
  line-height: 0.92;
  font-weight: 780;
  font-variation-settings: 'wdth' 82, 'opsz' 96;
  letter-spacing: -0.035em;
}
.fine__frase em {
  font-style: normal;
  color: var(--sottomarino);
}
.fine__testo {
  max-width: 34ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  opacity: 0.82;
}
/* the button: on hover the yellow fills it like water, with a small bounce of the label */
.fine__bottone {
  position: relative;
  display: inline-block;
  overflow: hidden;
  margin-top: 8px;
  padding: 16px 28px;
  border-radius: 999px;
  border: 2px solid var(--sottomarino);
  font-size: 17px;
  font-weight: 680;
  text-decoration: none;
  color: var(--sottomarino);
  transition: color 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fine__bottone span {
  position: relative;
  z-index: 1;
  display: inline-block;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fine__bottone::before {
  content: '';
  position: absolute;
  left: -15%;
  right: -15%;
  top: 105%;
  height: 170%;
  border-radius: 42% 58% 0 0 / 20% 20% 0 0;
  background: var(--sottomarino);
  transition: top 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (hover: hover) {
  .fine__bottone:hover { color: var(--testo-scuro); transform: scale(1.04); }
  .fine__bottone:hover span { transform: translateY(-1px); }
  .fine__bottone:hover::before { top: -35%; }
}
.fine__bottone:active { transform: scale(0.97); }

/* ---------------------------------------------------------------- the phone */
@media (max-width: 700px) {
  .marchio span { display: none; }
  .strumento {
    min-width: 0;
    padding: 10px 12px 9px;
    border-radius: 12px;
  }
  .strumento__metri { font-size: 22px; }
  .strumento__dati { font-size: 10px; }
  .scala { width: 26px; top: calc(clamp(72px, 11vh, 104px) + 118px); bottom: 42%; }
  .scala__binario { right: 12px; }
  .scala__tacca { display: none; }
  .scala__segno { width: 26px; height: 13px; margin-top: -6.5px; }
  .didascalie { bottom: 28px; }
}
