:root {
  --carta: #ebe5dc;            /* the warm paper of the loader */
  --inchiostro: #141210;       /* the ink of the words and the pill */
  --tenue: rgba(20, 18, 16, .55); /* small labels */
  --linea: rgba(20, 18, 16, .18); /* thin lines */
  --accento: #b4532a;          /* the only accent: roof-tile terracotta */
  --pallido: #d6cfc4;          /* the pale dot in the pill circle */
  --curva: cubic-bezier(.645, .045, .355, 1); /* the site's curve for the slot and the pill */
  --chiusura: 1.3s;            /* set by script.js from SHUT */
  --raggio: 18px;              /* set by script.js from RADIUS */
  --stringi: .8;               /* set by script.js from SHRINK */
  --fs: 120px;                 /* the size of the two words, set by script.js */
  --mono: 'JetBrains Mono Variable', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Fraunces Variable', Georgia, serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage { position: fixed; inset: 0; overflow: hidden; }

/* ---------- the page under the loader ---------- */
.page { position: absolute; inset: 0; background: #2a1d16; }
.page__photo { position: absolute; inset: 0; }
.page__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20, 14, 10, .5), rgba(20, 14, 10, 0) 26%, rgba(20, 14, 10, 0) 70%, rgba(20, 14, 10, .45));
}
.page__bar {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: clamp(14px, min(3vw, 4vh), 32px);
  color: var(--carta);
}
.page__brand {
  font-family: 'Big Shoulders Display Variable', sans-serif;
  font-weight: 800; text-transform: uppercase; letter-spacing: .01em;
  font-size: clamp(22px, min(4vw, 6vh), 40px); line-height: 1;
}
.page__meta { font-family: var(--mono); font-size: clamp(10px, min(1.2vw, 1.8vh), 13px); letter-spacing: .04em; text-transform: uppercase; }

.spot {
  position: absolute; left: var(--x); top: var(--y);
  transform: translate(-50%, -100%);
  padding-bottom: 14px;
}
.spot::after {             /* the thin stem down to the roof */
  content: ''; position: absolute; left: 50%; bottom: 0; width: 1px; height: 14px;
  background: var(--carta); opacity: .9;
}
.spot__in {
  display: block; white-space: nowrap;
  font-family: var(--mono); font-size: clamp(10px, min(1.15vw, 1.9vh), 13px);
  background: var(--carta); color: var(--inchiostro);
  padding: 6px 11px; border-radius: 30px;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(20, 18, 16, .08);
  transform-origin: 50% 120%;
  transition: background-color .35s, color .35s;
}
@media (hover: hover) {
  .spot:hover .spot__in { background: var(--inchiostro); color: var(--carta); }
}

/* ---------- the pill with the circle (the site's ButtonWithCircle) ---------- */
.pill {
  position: relative;
  display: inline-flex; align-items: center;
  height: 37px; border-radius: 30px;
  padding: 0 46px 0 20px;
  background: var(--inchiostro); color: var(--carta);
  font-family: var(--mono); font-size: 14px; letter-spacing: .01em;
}
.pill__t { display: block; transition: transform .5s var(--curva); }
.pill__c {
  position: absolute; right: 6px; top: 6px; width: 25px; height: 25px; border-radius: 50%;
  background: var(--carta);
  display: grid; place-items: center;
  transition: transform .5s var(--curva);
}
.pill__d { width: 8px; height: 8px; border-radius: 50%; background: var(--inchiostro); transition: transform .5s var(--curva); }
.pill.is-hover .pill__c { transform: translateX(calc(var(--width, 120px) * -1 + 37px)); }
.pill.is-hover .pill__t { transform: translateX(20px); }
.pill.is-hover .pill__d { transform: scale(1.5); }
@media (hover: hover) {
  .pill:hover .pill__c { transform: translateX(calc(var(--width, 120px) * -1 + 37px)); }
  .pill:hover .pill__t { transform: translateX(20px); }
  .pill:hover .pill__d { transform: scale(1.5); }
}
.pill:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.pill--paper { background: var(--carta); color: var(--inchiostro); }
.pill--paper .pill__c { background: var(--inchiostro); }
.pill--paper .pill__d { background: var(--carta); }
.page .pill {
  position: absolute; left: 50%; bottom: clamp(16px, 4vh, 36px);
  margin-left: calc(var(--width, 180px) / -2);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .6);
}

/* ---------- the loader ---------- */
.loader { position: absolute; inset: 0; background: var(--carta); }

.shot {
  position: absolute; inset: 0; overflow: hidden;
  clip-path: inset(0 0 0 0 round 0);
  transition: clip-path var(--chiusura) var(--curva);
}
.shot.is-shut { clip-path: inset(var(--t, 40%) var(--r, 30%) var(--b, 40%) var(--l, 30%) round var(--raggio)); }
.shot__in { position: absolute; inset: 0; transition: transform var(--chiusura) var(--curva); }
.shot.is-shut .shot__in { transform: scale(var(--stringi)); }
.shot__in img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot__grain {                 /* a thin film of grain over the photo */
  position: absolute; inset: -50%; pointer-events: none; opacity: var(--grana, .12); mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mark {                        /* the name in paper, rising at the bottom of the photo */
  position: absolute; left: 0; right: 0; bottom: 5vh;
  display: flex; justify-content: center; overflow: hidden;
  font-family: 'Big Shoulders Display Variable', sans-serif; font-weight: 800; text-transform: uppercase;
  font-size: min(22vw, 26vh); line-height: .86; color: var(--carta);
  padding-top: .04em;
}
.mark span { display: block; }

.row {
  position: absolute; left: 3vw; right: 3vw; top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: center; justify-content: space-between;
  gap: calc(var(--fs) * .3);
  pointer-events: none;
}
.word {
  position: relative;
  font-family: 'Big Shoulders Display Variable', sans-serif;
  font-weight: 800; text-transform: uppercase;
  font-size: var(--fs); line-height: .8; letter-spacing: -.005em;
  white-space: nowrap; flex: none;
}
.word__in { display: block; font-variation-settings: 'wght' var(--w, 800); font-weight: inherit; }
.tag {
  position: absolute; left: 0; bottom: 100%; margin-bottom: calc(var(--fs) * .12);
  font-family: var(--mono); font-weight: 400; font-size: clamp(8px, calc(var(--fs) * .075), 12px);
  letter-spacing: .04em; color: var(--inchiostro); white-space: nowrap;
}
.slot {
  position: relative; flex: 1 1 auto;
  height: calc(var(--fs) * .78);
  min-width: 18vw;
}
.slot__ring {                  /* our hairline and soft shadow on the closed strip */
  position: absolute; inset: 0; border-radius: var(--raggio); opacity: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 22px 40px -26px rgba(20, 18, 16, .55);
}

.foot {
  position: absolute; left: 0; right: 0; bottom: clamp(18px, 6vh, 56px);
  display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 6vh, 64px);
}
.desc {
  text-align: center; font-size: clamp(13px, min(1.7vw, 2.6vh), 22px); line-height: 1.3;
  font-variation-settings: 'opsz' 24; letter-spacing: -.009em;
}

.help {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 3vh, 26px);
  width: max-content; max-width: 92vw; pointer-events: none;
}
.help__row { display: flex; gap: clamp(28px, 6vw, 80px); }
.help__item { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.help svg { width: clamp(34px, min(4vw, 6vh), 48px); height: auto; overflow: visible; }
.help__trail { fill: none; stroke: var(--tenue); stroke-width: 1.2; stroke-dasharray: 2 3; }
.help__arrow { fill: var(--carta); stroke: var(--inchiostro); stroke-width: 1.4; stroke-linejoin: round; }
.help__arrow--open { fill: none; }
.help__wheel { stroke: var(--inchiostro); stroke-width: 2; stroke-linecap: round; }
.help__sq { fill: var(--inchiostro); }
.help__t, .help__more { font-family: var(--mono); font-size: clamp(10px, min(1.2vw, 2vh), 13px); letter-spacing: .03em; text-transform: uppercase; text-align: center; }
.help__more span { display: inline-block; }
.help__line { display: block; width: clamp(60px, 10vw, 120px); height: 1px; background: var(--linea); transform-origin: 50% 50%; }
.only-touch { display: none; }
.no-hover .only-touch { display: block; }
.no-hover .only-mouse { display: none; }

/* ---------- portrait: the words above and below the slot ---------- */
.is-tall .row { flex-direction: column; justify-content: center; left: 6vw; right: 6vw; gap: calc(var(--fs) * .18); top: 46%; }
.is-tall .slot { flex: none; width: 100%; height: min(20vh, 28vw); min-width: 0; }
.is-tall .tag { display: none; }
.is-tall .help__row { gap: 28px; }
