:root {
  --carta: #f3f0e8;          /* the warm paper of the light pages */
  --inchiostro: #121211;     /* the ink, and the dark pages */
  --salvia: #e4e9e5;         /* the pale grey-green of the safety page */
  --dietro: #1d1c1a;         /* what shows around the card while it travels */
  --accento: #ef6a22;        /* the only accent: our safety orange, for the button and the bore line */
  --grigio-scuro: rgba(243, 240, 232, .58); /* small labels on the dark pages */
  --grigio-chiaro: rgba(18, 18, 17, .56);   /* small labels on the light pages */
  --ombra: 0 40px 80px -30px rgba(0, 0, 0, .55), 0 12px 30px -12px rgba(0, 0, 0, .35); /* the card's soft shadow */
  --curva: cubic-bezier(.6, 0, 0, 1); /* the site's curve, M0,0 C0.6,0 0,1 1,1, for the CSS bits */
}

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

html, body { height: 100%; }

body {
  background: var(--dietro);
  color: var(--inchiostro);
  font-family: 'Inter Tight Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: clamp(9.5px, min(1vw, 1.7vh), 12px);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.solo-lettore {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.palco {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  --lato: clamp(16px, 3.4vw, 48px);
}

/* ---- the pages ---- */
.pagina {
  position: absolute;
  inset: 0;
  visibility: hidden;
  z-index: 0;
}
.pagina.is-qui { visibility: visible; z-index: 1; }

/* the card: GSAP moves and scales this one, nothing in the CSS writes its transform */
.carta {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: transform;
}
.pagina[data-tema="scuro"] .carta { background: var(--inchiostro); color: var(--carta); --piccolo: var(--grigio-scuro); }
.pagina[data-tema="chiaro"] .carta { background: var(--carta); color: var(--inchiostro); --piccolo: var(--grigio-chiaro); }
.pagina[data-pagina="safety"] .carta { background: var(--salvia); }

.carta__velo {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.fondo { position: absolute; inset: 0; overflow: hidden; }
.fondo__arte { position: absolute; inset: 0; transform-origin: 50% 50%; }

.fondo__foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fondo__foto--destra { left: 34%; width: 66%; object-position: 50% 50%; filter: grayscale(1) contrast(1.05); }

.fondo__velo { position: absolute; inset: 0; pointer-events: none; }
.fondo__velo--carta {
  background:
    linear-gradient(180deg, rgba(243, 240, 232, .7) 0%, rgba(243, 240, 232, 0) 18%, rgba(243, 240, 232, 0) 80%, rgba(243, 240, 232, .85) 100%),
    linear-gradient(90deg, var(--carta) 34%, rgba(243, 240, 232, .82) 52%, rgba(243, 240, 232, .18) 78%, rgba(243, 240, 232, 0) 100%);
}
.fondo__velo--notte {
  background:
    linear-gradient(0deg, rgba(10, 9, 8, .86) 0%, rgba(10, 9, 8, .3) 50%, rgba(10, 9, 8, .5) 100%),
    linear-gradient(90deg, rgba(10, 9, 8, .6) 0%, rgba(10, 9, 8, 0) 60%);
}
.fondo__velo--salvia {
  background: radial-gradient(120% 90% at 85% 10%, rgba(228, 233, 229, 0) 0%, rgba(228, 233, 229, .7) 70%);
}

/* home: the rock strata and the bore line */
.strati { position: absolute; inset: 0; width: 100%; height: 100%; }
.strati__righe { color: rgba(243, 240, 232, .14); }
.strati__foro { stroke: var(--accento); stroke-dasharray: 1; stroke-dashoffset: 0; }
.strati__testa { stroke: var(--accento); }

/* safety: a grid of fine crosses, like a survey sheet */
.reticolo { position: absolute; inset: 0; color: rgba(18, 18, 17, .16); }

/* ---- the content of a page ---- */
.contenuto {
  position: absolute;
  left: var(--lato);
  right: var(--lato);
  bottom: calc(min(13vh, 120px) + 26px);
  max-width: 760px;
}

.occhiello { color: var(--piccolo); margin-bottom: min(2.2vh, 18px); }

.titolo {
  font-size: clamp(32px, min(8.4vw, 12.5vh), 118px);
  line-height: .96;
  letter-spacing: -.035em;
  font-weight: 560;
  outline: none;
}
.riga { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.riga > span { display: inline-block; }

.frase {
  margin-top: min(2.6vh, 22px);
  max-width: 36ch;
  font-size: clamp(13px, min(1.4vw, 2.4vh), 18px);
  line-height: 1.42;
  color: var(--piccolo);
  font-weight: 420;
}

/* the button: content that slides 2.25em and a fill that turns orange, as on the site */
.bottone {
  position: relative;
  display: inline-flex;
  margin-top: min(3.4vh, 30px);
  height: clamp(36px, 6.4vh, 46px);
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: clamp(10.5px, min(1.05vw, 1.9vh), 12.5px);
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  color: var(--btn-ink);
  -webkit-tap-highlight-color: transparent;
}
.pagina[data-tema="scuro"] .bottone { --btn-bg: var(--carta); --btn-ink: var(--inchiostro); }
.pagina[data-tema="chiaro"] .bottone { --btn-bg: var(--inchiostro); --btn-ink: var(--carta); }
.bottone:active { transform: translateY(1px) scale(.985); }
.bottone:focus-visible { outline: 1.5px solid var(--accento); outline-offset: 3px; }

.bottone__fondo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--btn-bg);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 6px 16px -10px rgba(0, 0, 0, .6);
}
.bottone__arancio {
  position: absolute;
  inset: 0;
  background: var(--accento);
  visibility: hidden;
}
.bottone__finestra {
  position: relative;
  display: block;
  overflow: hidden;
  margin: 0 1.15em 0 1.25em;
  height: 100%;
}
.bottone__dentro {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 1.2em;
  white-space: nowrap;
}
.bottone__freccia { width: 1.05em; height: 1.05em; flex: none; }
.bottone__freccia--entra { position: absolute; left: -2.25em; top: 50%; margin-top: -.525em; }
.bottone.is-sopra { color: var(--inchiostro); }
.bottone { transition: transform .18s var(--curva), color .26s ease .2s; }

/* the bottom row */
.piede {
  position: absolute;
  left: var(--lato);
  right: var(--lato);
  bottom: min(3.4vh, 26px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--piccolo);
  border-top: 1px solid currentColor;
  border-top-color: color-mix(in srgb, currentColor 40%, transparent);
  padding-top: min(1.6vh, 12px);
}

/* ---- the bar at the top ---- */
.barra {
  position: absolute;
  top: 14px;
  left: 32px;
  right: 32px;
  z-index: 10;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 0 10px;
  color: var(--barra-ink);
  transition: color .45s var(--curva);
  --barra-ink: var(--carta);
  --barra-fondo-segno: var(--inchiostro);
  --barra-segno: rgba(243, 240, 232, .14);
}
.barra.is-chiara, .barra.is-staccata { --barra-ink: var(--inchiostro); --barra-fondo-segno: var(--carta); --barra-segno: rgba(18, 18, 17, .08); }

.barra__fondo {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(247, 245, 240, .9);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 18px 36px -18px rgba(0, 0, 0, .55), 0 0 0 1px rgba(18, 18, 17, .06);
  opacity: 0;
}

.marchio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 640;
  letter-spacing: -.01em;
  font-size: 15px;
  margin-right: auto;
}
.marchio__segno { width: 22px; height: 22px; flex: none; }
.marchio__segno rect { transition: fill .45s var(--curva); }
.marchio__segno circle, .marchio__segno path { transition: stroke .45s var(--curva); }

.voci {
  position: relative;
  display: flex;
  align-items: center;
}
.voci a {
  position: relative;
  z-index: 1;
  color: inherit;
  text-decoration: none;
  padding: 8px 11px;
  border-radius: 6px;
  opacity: .62;
  transition: opacity .3s var(--curva);
}
.voci a.is-qui { opacity: 1; }
.voci a:focus-visible { outline: 1.5px solid var(--accento); outline-offset: 1px; }
@media (hover: hover) {
  .voci a:hover { opacity: 1; }
  .indietro:hover svg { transform: rotate(180deg) translateX(2px); }
}
.voci__segno {
  position: absolute;
  left: 0;
  top: 50%;
  height: 28px;
  margin-top: -14px;
  width: 60px;
  border-radius: 6px;
  background: var(--barra-segno);
  transition: background .45s var(--curva);
}

.indietro {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 30%, transparent);
  background: none;
  color: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.indietro svg { width: 14px; height: 14px; transform: rotate(180deg); transition: transform .4s var(--curva); }
.indietro:focus-visible { outline: 1.5px solid var(--accento); outline-offset: 2px; }
.indietro:active svg { transform: rotate(180deg) translateX(3px); }

@media (max-width: 700px) {
  .fondo__foto--destra { left: 0; width: 100%; height: 62%; object-position: 50% 40%; }
  .fondo__velo--carta {
    background: linear-gradient(180deg, rgba(243, 240, 232, .88) 0%, rgba(243, 240, 232, .25) 19%, rgba(243, 240, 232, .35) 36%, var(--carta) 60%);
  }
}
@media (max-width: 560px) {
  .marchio__nome { display: none; }
  .barra { gap: 6px; padding-left: 8px; }
  .voci a { padding: 8px 7px; }
  .piede span:first-child { display: none; }
}
@media (max-width: 360px) {
  .voci a { padding: 8px 5px; letter-spacing: 0; }
}
