/* Renovation timeline, phase by phase: the project page of Ashgrove Builders, a made-up renovation company */
:root {
  --carta: #f3f0ea;          /* the page, a warm off-white */
  --carta-alta: #fbfaf7;     /* cards and chips */
  --inchiostro: #17150f;     /* text */
  --tenue: #6f6a60;          /* quiet text */
  --filo: rgba(23, 21, 15, 0.12); /* thin lines */
  --accento: #d4622a;        /* site orange, used sparingly */
  --raggio: 14px;            /* the corners of the photo */
  --font: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; }
a { color: inherit; text-decoration: none; }
.nascosto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ================================================================ the bar */
.barra {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px, 2.6vh, 24px) clamp(16px, 4vw, 48px);
}
.marchio { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 640; font-stretch: 108%; font-size: 15px; letter-spacing: -0.01em; }
.marchio__segno { width: 20px; height: 20px; fill: none; stroke: var(--accento); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.barra__voci { display: flex; gap: clamp(12px, 2.4vw, 28px); font-size: 13.5px; color: var(--tenue); }
.barra__voci a[aria-current] { color: var(--inchiostro); }
.barra__voci a { transition: color 0.3s; }
@media (hover: hover) { .barra__voci a:hover { color: var(--inchiostro); } }
@media (max-width: 520px) { .barra__voci { display: none; } }

/* ================================================================ opening and closing */
.apertura {
  height: 100vh; min-height: 300px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.4vh, 20px);
  padding: 0 clamp(18px, 5vw, 64px); text-align: center;
}
.piccolo { margin: 0; font-size: clamp(12px, 1.6vh, 14px); color: var(--tenue); letter-spacing: 0.01em; display: flex; align-items: center; gap: 8px; }
.piccolo--tenue { opacity: 0.8; }
.giu { width: 10px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.titolo {
  margin: 0; max-width: 20ch;
  font-size: min(10.5vw, 11vh, 92px); line-height: 0.98; letter-spacing: -0.035em;
  font-weight: 560; font-stretch: 112%;
}
.titolo em { display: block; font-style: normal; font-weight: 380; font-stretch: 86%; color: var(--tenue); }
.titolo--medio { font-size: min(8vw, 8.5vh, 64px); max-width: 14ch; }
.pulsante {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px 13px 22px; border-radius: 999px;
  background: var(--inchiostro); color: var(--carta-alta);
  font-size: 14px; font-weight: 560; font-stretch: 104%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 8px 22px -10px rgba(23, 21, 15, 0.5);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), font-stretch 0.45s;
}
.pulsante svg { width: 15px; height: 15px; fill: none; stroke: var(--accento); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@media (hover: hover) {
  .pulsante:hover { transform: translateY(-1px); font-stretch: 112%; }
  .pulsante:hover svg { transform: translateX(3px); }
}
.pulsante:active { transform: scale(0.97); }

/* ================================================================ the stage */
.cantiere { position: relative; height: 620vh; }
.palco {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 3vh, 40px) clamp(14px, 4vw, 48px);
}
.scena {
  width: 100%; max-width: 1120px;
  display: grid; grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 64px); align-items: center;
}
.etichetta { margin: 0 0 18px; font-size: 12px; color: var(--tenue); letter-spacing: 0.04em; text-transform: uppercase; font-stretch: 112%; }

/* ---- the phases, a thin vertical timeline */
.fasi__binario { position: relative; padding-left: 22px; }
.fasi__linea { position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--filo); }
.fasi__piena { position: absolute; inset: 0; background: var(--accento); transform-origin: 50% 0; transform: scaleY(0); }
.fasi__tacca { position: absolute; left: -4px; top: 0; width: 9px; height: 2px; border-radius: 1px; background: var(--accento); }
.fasi__voci { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(12px, 3.4vh, 30px); }
.fase { display: flex; flex-direction: column; gap: 3px; cursor: pointer; opacity: 0.3; }
.fase__nome {
  display: inline-block; font-size: clamp(15px, 1.55vw, 19px); line-height: 1.15; letter-spacing: -0.01em;
  font-weight: 460; white-space: nowrap; transition: translate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fase__quando { font-size: 12px; color: var(--tenue); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .fase:hover .fase__nome { translate: 2px 0; } }
.fase:active .fase__nome { translate: 1px 0; scale: 0.98; }

/* ---- the photo */
.colonna { display: flex; flex-direction: column; align-items: stretch; gap: clamp(10px, 1.8vh, 16px); min-width: 0; width: min(100%, calc((100vh - 190px) * 1.5)); justify-self: center; }
.foto { position: relative; margin: 0; width: 100%; aspect-ratio: 3 / 2; }
.foto__vetro {
  position: absolute; inset: 0; overflow: hidden; border-radius: var(--raggio);
  background: #d9d4ca;
  box-shadow:
    0 0 0 1px rgba(23, 21, 15, 0.08),
    0 1px 2px rgba(23, 21, 15, 0.06),
    0 10px 24px -12px rgba(23, 21, 15, 0.28),
    0 40px 70px -40px rgba(23, 21, 15, 0.45);
  isolation: isolate;
}
.foto__vetro::after {
  /* a breath of light along the top edge, as on a print under glass */
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 28%);
}
.scatto { position: absolute; inset: 0; visibility: hidden; will-change: clip-path; }
.scatto__dentro { position: absolute; inset: 0; overflow: hidden; }
.scatto img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.lama {
  position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; z-index: 2;
  background: var(--accento); opacity: 0; pointer-events: none;
}
.lama::after {
  /* the soft shadow the blade casts on the photo it is about to cover */
  content: ''; position: absolute; top: 0; bottom: 0; left: 2px; width: 46px;
  background: linear-gradient(90deg, rgba(23, 21, 15, 0.28), rgba(23, 21, 15, 0));
}

/* ---- the chip on the photo */
.cartellino {
  position: absolute; top: 12px; left: 12px; z-index: 4;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 11px 6px 10px; border-radius: 999px;
  background: rgba(251, 250, 247, 0.78); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5) inset, 0 4px 14px -6px rgba(23, 21, 15, 0.35);
  font-size: 12px; font-weight: 560; letter-spacing: -0.005em;
}
.cartellino__luogo { color: var(--tenue); font-weight: 460; padding-right: 8px; border-right: 1px solid var(--filo); }

/* ---- the rolling values */
.rullo { display: inline-block; height: 1.3em; line-height: 1.3em; overflow: hidden; vertical-align: top; }
.striscia { display: flex; flex-direction: column; align-items: flex-start; will-change: transform; }
.striscia > span { display: block; width: max-content; height: 1.3em; white-space: nowrap; }

/* ---- the data bar */
.dati {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center;
  border-top: 1px solid var(--filo); border-bottom: 1px solid var(--filo);
}
.dato { display: flex; flex-direction: column; gap: 2px; padding: clamp(8px, 1.4vh, 12px) clamp(12px, 2vw, 22px) clamp(8px, 1.4vh, 12px) 0; }
.dato + .dato { padding-left: clamp(12px, 2vw, 22px); border-left: 1px solid var(--filo); }
.dato__nome { font-size: 11px; color: var(--tenue); letter-spacing: 0.04em; text-transform: uppercase; font-stretch: 110%; }
.dato .rullo { font-size: clamp(14px, 1.45vw, 17px); font-weight: 560; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.dato:first-child .rullo { color: var(--accento); }
.dati { position: relative; }
.dato--fine { align-items: flex-end; padding-right: 0; }
.dato--fine .rullo { text-align: right; }
.dato__barra { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; overflow: hidden; }
.dato__barra i { position: absolute; inset: 0; background: var(--accento); transform-origin: 0 50%; transform: scaleX(0); }

/* ---- the handover card */
.consegna {
  position: absolute; right: 14px; bottom: 14px; z-index: 5;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 16px 11px 12px; border-radius: 13px;
  background: var(--carta-alta);
  box-shadow:
    0 0 0 1px rgba(23, 21, 15, 0.06),
    0 2px 4px rgba(23, 21, 15, 0.06),
    0 18px 36px -14px rgba(23, 21, 15, 0.45);
  opacity: 0; visibility: hidden;
  transition: box-shadow 0.4s;
}
@media (hover: hover) { .consegna:hover { box-shadow: 0 0 0 1px rgba(212, 98, 42, 0.35), 0 2px 4px rgba(23, 21, 15, 0.06), 0 22px 40px -14px rgba(23, 21, 15, 0.5); } }
.consegna__segno { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--accento); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.consegna__segno circle { stroke: rgba(212, 98, 42, 0.3); }
.consegna__titolo { margin: 0; font-size: 14px; font-weight: 620; font-stretch: 104%; letter-spacing: -0.01em; white-space: nowrap; }
.consegna__sotto { margin: 2px 0 0; font-size: 12px; color: var(--tenue); white-space: nowrap; }

/* ================================================================ phone and narrow boxes */
@media (max-width: 719px) {
  .palco { padding: 12px 14px; }
  .scena { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
  .etichetta { display: none; }
  .fasi { min-width: 0; }
  .fasi__binario { padding: 0 0 9px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent); mask-image: linear-gradient(90deg, #000 78%, transparent); }
  .fasi__linea { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 1px; }
  .fasi__piena { transform-origin: 0 50%; transform: scaleX(0); }
  .fasi__tacca { top: auto; bottom: -4px; left: 0; width: 2px; height: 9px; }
  .fasi__voci { flex-direction: row; gap: 18px; width: max-content; }
  .fase__nome { font-size: 13px; }
  .fase__quando { display: none; }
  .colonna { width: min(100%, calc((100vh - 150px) * 1.5)); align-self: center; gap: 8px; }
  .foto { aspect-ratio: 3 / 2; }
  .cartellino { top: 8px; left: 8px; padding: 4px 9px 4px 8px; font-size: 11px; gap: 6px; }
  .cartellino__luogo { padding-right: 6px; }
  .dato { padding: 6px 10px 6px 0; }
  .dato + .dato { padding-left: 10px; }
  .dato--largo { min-width: 0; }
  .dato__nome { font-size: 9.5px; }
  .dato .rullo { font-size: 12.5px; }
  .consegna { right: 8px; bottom: 8px; padding: 8px 11px 8px 9px; gap: 8px; border-radius: 11px; }
  .consegna__segno { width: 20px; height: 20px; }
  .consegna__titolo { font-size: 12px; }
  .consegna__sotto { font-size: 10.5px; }
}
