/* Hole 7 at Sable Pines, played as you scroll: the page of one hole of a made-up desert golf club. Warm paper, black
   ink, one flame accent for the shot (its flight, its rings, the flag and the birdie circle). In a tall section the
   stage stays still: the aerial photo of the hole on the left (on top on a phone), the hole card on the right (under
   it). Every position in the stage is written by the script. */
:root {
  --carta: #f1ede4;        /* the paper of the page */
  --luce: #fbf8f2;         /* the soft light on the paper */
  --inchiostro: #15170f;   /* the words and the figures */
  --tenue: #8a8577;        /* the small words */
  --sottile: #dcd6c8;      /* hairlines and the empty bar */
  --accento: #f0532a;      /* flame: the flight, the rings, the flag, the birdie circle */
  --gesso: #fffaf0;        /* the chalk white of the ball, the tee ring and the chips on the photo */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  background:
    radial-gradient(120% 80% at 90% -10%, var(--luce) 0%, rgba(251, 248, 242, 0) 60%),
    radial-gradient(90% 70% at 0% 110%, rgba(240, 83, 42, 0.05), rgba(240, 83, 42, 0) 70%),
    var(--carta);
  background-attachment: fixed;
  color: var(--inchiostro);
  font-family: 'Instrument Sans Variable', 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the fine grain of the paper */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.4 0 0 0 0 0.33 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------ the bar at the top, it scrolls away with the page */
.barra {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: clamp(12px, 3vh, 26px) clamp(16px, 4.4vw, 56px);
}

.marchio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  font-size: 17px;
  font-weight: 560;
  font-variation-settings: 'opsz' 40, 'SOFT' 60;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.marchio__segno {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.barra__voci {
  display: flex;
  gap: clamp(12px, 2.4vw, 30px);
  font-size: 13px;
}

.barra__voci a {
  color: var(--tenue);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.barra__voci a[aria-current] {
  color: var(--inchiostro);
}

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

/* ------------------------------------------------------------ the opening and the end */
.apertura {
  display: grid;
  align-content: center;
  gap: clamp(12px, 3vh, 22px);
  height: 100vh;
  height: 100lvh;
  padding: 64px clamp(16px, 5vw, 72px) 32px;
}

.apertura--fine {
  justify-items: start;
}

.piccolo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.piccolo--tenue {
  color: var(--tenue);
}

.giu {
  width: 10px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.titolo {
  margin: 0;
  max-width: 14ch;
  font-family: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  font-size: clamp(38px, min(9vw, 12vh), 116px);
  font-weight: 380;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.titolo em {
  font-style: italic;
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}

.titolo--medio {
  font-size: clamp(34px, min(7vw, 10vh), 84px);
}

.pulsante {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: var(--carta);
  font-size: 14px;
  font-weight: 560;
  font-stretch: 100%;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 10px 24px -12px rgba(21, 23, 15, 0.6);
  transition: font-stretch 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pulsante svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .pulsante:hover {
    font-stretch: 112%;
    transform: scale(1.03);
  }

  .pulsante:hover svg {
    transform: translateX(3px);
  }
}

.pulsante:active {
  transform: scale(0.97);
}

/* ------------------------------------------------------------ the stage */
.buca {
  position: relative;
  height: 520vh;
}

.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(14px, 5vh, 56px) clamp(16px, 4.4vw, 56px);
}

/* the photo on the left, the card on the right; the photo is measured on the width and on the height */
.scena {
  --lastra: min(720px, 58vw, calc((100vh - 120px) * 1.7778));
  display: grid;
  grid-template-columns: var(--lastra) minmax(220px, 290px);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
}

/* ------------------------------------------------------------ the photo of the hole */
.lastra {
  position: relative;
  width: var(--lastra);
  aspect-ratio: 1024 / 576;
  margin: 0;
}

/* the soft shadow lives outside the mask, or the clip-path would cut it */
.lastra__ombra {
  position: absolute;
  inset: 4% 3% 0;
  border-radius: 14px;
  box-shadow:
    0 2px 4px rgba(21, 23, 15, 0.08),
    0 14px 28px -10px rgba(21, 23, 15, 0.28),
    0 40px 70px -30px rgba(60, 40, 10, 0.35);
  opacity: 0;
}

.lastra__maschera {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 12px;
  clip-path: inset(50% 50% round 12px);
  background: #c9b48a;
}

.lastra__camera {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}

.lastra__foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* the low desert sun from the top right, and a slight vignette that holds the eye on the green */
.lastra__luce {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 70% at 92% 0%, rgba(255, 236, 200, 0.28), rgba(255, 236, 200, 0) 70%),
    radial-gradient(120% 120% at 50% 55%, rgba(0, 0, 0, 0) 55%, rgba(20, 16, 6, 0.32) 100%);
  pointer-events: none;
}

.lastra__grana {
  position: absolute;
  inset: 0;
  background-image: var(--grana, none);
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: var(--grana-forza, 0.07);
  pointer-events: none;
}

/* a one-pixel lit edge around the photo */
.lastra__bordo {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
  opacity: 0;
}

/* ------------------------------------------------------------ the shot drawn over the photo */
.tiro {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tiro path,
.tiro line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tiro__terra {
  stroke: var(--gesso);
  opacity: 0.75;
}

.tiro__alone {
  stroke: rgba(20, 14, 4, 0.34);
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.tiro__volo {
  stroke: var(--accento);
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.tiro__anello {
  fill: rgba(240, 83, 42, 0.16);
  stroke: var(--accento);
}

.tiro__anello--tee {
  fill: rgba(255, 250, 240, 0.14);
  stroke: var(--gesso);
}

.tiro__onda {
  fill: none;
  stroke: var(--gesso);
  opacity: 0;
}

.tiro__buca {
  fill: rgba(16, 14, 8, 0.78);
  stroke: rgba(255, 250, 240, 0.7);
}

.tiro__ombra {
  fill: rgba(16, 12, 4, 0.55);
}

.tiro__palla {
  fill: var(--gesso);
  stroke: rgba(30, 24, 10, 0.25);
}

.tiro__lucepalla {
  fill: #fff;
  opacity: 0.9;
}

.bandiera__asta {
  stroke: var(--gesso);
}

.tiro .bandiera__telo {
  fill: var(--accento);
  stroke: none;
}

/* the chips beside the rings: frosted glass, the name small, the figure in the accent */
.chip {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  margin: 0;
  padding: 0.42em 0.72em 0.4em;
  border-radius: 999px;
  background: rgba(22, 20, 12, 0.5);
  -webkit-backdrop-filter: blur(8px) saturate(1.3);
  backdrop-filter: blur(8px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 14px -8px rgba(0, 0, 0, 0.6);
  color: var(--gesso);
  font-size: clamp(9px, min(1.15vw, 1.9vh), 13px);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  opacity: 0.78;
}

.chip b {
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.chip b span {
  opacity: 1;
}

/* ------------------------------------------------------------ the hole card */
.scheda {
  display: grid;
  gap: clamp(10px, 2.4vh, 22px);
  min-width: 0;
}

.scheda__club {
  margin: 0;
  color: var(--tenue);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.scheda__titolo {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 0.32em;
  margin: 0;
  font-family: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  font-size: clamp(26px, min(3.4vw, 6vh), 44px);
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 40;
  letter-spacing: -0.03em;
  line-height: 1;
}

.scheda__nome {
  flex-basis: 100%;
  margin-top: 0.18em;
  font-size: 0.5em;
  font-style: italic;
  font-weight: 340;
  font-variation-settings: 'opsz' 72, 'SOFT' 100, 'WONK' 1;
  letter-spacing: -0.01em;
  color: #4b4a3f;
}

.dati {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  margin: 0;
  padding: clamp(8px, 1.8vh, 14px) 0;
  border-top: 1px solid var(--sottile);
  border-bottom: 1px solid var(--sottile);
}

.dati div {
  display: grid;
  gap: 4px;
}

.dati dt {
  color: var(--tenue);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.dati dd {
  margin: 0;
  font-size: clamp(18px, min(2vw, 3.6vh), 24px);
  font-weight: 560;
  letter-spacing: -0.02em;
}

/* the rolling figures: one window per digit, a strip of numbers inside */
.rullo-num {
  display: inline-flex;
  font-variant-numeric: tabular-nums;
}

.rullo-num__finestra {
  position: relative;
  display: inline-block;
  height: 1em;
  line-height: 1;
  overflow: hidden;
  padding: 0 0.01em;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  box-sizing: content-box;
  padding-block: 0.08em;
  margin-block: -0.08em;
}

.rullo-num__striscia {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.rullo-num__striscia span {
  display: block;
  height: 1em;
  line-height: 1;
}

.rullo-num--grande {
  font-weight: inherit;
}

.pin {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.pin__nome {
  color: var(--tenue);
  font-size: 12px;
  font-weight: 500;
}

.pin__cifre {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: clamp(18px, min(2vw, 3.6vh), 24px);
  font-weight: 560;
  letter-spacing: -0.02em;
}

.pin__cifre small {
  color: var(--tenue);
  font-size: 12px;
  font-weight: 500;
}

/* how much of the hole is left, as a hairline that empties toward the pin */
.pin__barra {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sottile);
}

.pin__barra i {
  position: absolute;
  inset: 0;
  background: var(--inchiostro);
  transform-origin: 100% 50%;
  transform: scaleX(0);
}

.consiglio {
  margin: 0;
  padding-left: 14px;
  border-left: 1px solid var(--accento);
}

.consiglio p {
  margin: 0 0 6px;
  font-family: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 340;
  font-variation-settings: 'opsz' 24, 'SOFT' 100;
  line-height: 1.32;
  color: #34342b;
}

.consiglio cite {
  color: var(--tenue);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.punteggio {
  display: flex;
  align-items: center;
  gap: 14px;
}

.punteggio__nome {
  color: var(--tenue);
  font-size: 12px;
  font-weight: 500;
}

/* the score written as on a card, and circled in the accent when it is a birdie */
.punteggio__cifra {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  font-family: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  font-size: clamp(26px, min(3vw, 5.4vh), 38px);
  font-weight: 420;
  font-variation-settings: 'opsz' 144;
}

.punteggio__giro {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  overflow: visible;
}

.punteggio__giro path {
  fill: none;
  stroke: var(--accento);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.punteggio__esito {
  display: inline-block;
  overflow: hidden;
  padding: 0.1em 0.12em 0.14em 0;
  font-family: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  font-size: clamp(20px, min(2.3vw, 4.2vh), 30px);
  font-style: italic;
  font-weight: 360;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  letter-spacing: -0.02em;
  color: var(--accento);
}

.punteggio__esito span {
  display: inline-block;
  transform: translateY(110%);
}

/* ------------------------------------------------------------ on a phone: the photo on top, the card under it */
@media (max-width: 760px) {
  .palco {
    padding: clamp(12px, 3.4vh, 32px) 16px;
  }

  .scena {
    --lastra: min(calc(100vw - 32px), 560px, calc((100vh - 230px) * 1.7778));
    grid-template-columns: var(--lastra);
    gap: clamp(12px, 3vh, 24px);
  }

  .scheda {
    gap: clamp(7px, 1.8vh, 14px);
  }

  .scheda__club,
  .consiglio {
    display: none;
  }

  .scheda__titolo {
    font-size: clamp(22px, 6.4vh, 34px);
  }

  .scheda__nome {
    flex-basis: auto;
    margin: 0 0 0 0.2em;
    font-size: 0.62em;
  }

  .dati {
    padding: clamp(6px, 1.4vh, 12px) 0;
  }

  .dati dd,
  .pin__cifre {
    font-size: clamp(16px, 4.4vh, 22px);
  }

  .pin {
    padding-bottom: 7px;
  }

  .punteggio__cifra {
    font-size: clamp(22px, 5.4vh, 32px);
  }

  .punteggio__esito {
    font-size: clamp(18px, 4.4vh, 26px);
  }
}

/* a phone held low and wide (the preview box): the tip of the pro goes, the rest tightens */
@media (min-width: 761px) and (max-height: 620px) {
  .consiglio {
    display: none;
  }
}
