/* La schermata che cambia con le funzionalità allo scroll. Colori in :root (la palette del Playground). */
:root {
  --fondo: #f6f6f4;
  --finestra: #ffffff;
  --pannello: #fbfbfa;
  --inchiostro: #111114;
  --secondario: #6b6b74;
  --tenue: #a3a3ab;
  --spento: #c9c9cf;
  --bordo: rgba(17, 17, 24, 0.08);
  --binario: #efeff1;
  --accento: #6a4cff;
  --accento-tenue: rgba(106, 76, 255, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fondo); }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* the title over the page */
.apertura {
  text-align: center;
  padding: clamp(36px, 13vh, 132px) 16px clamp(18px, 5vh, 56px);
}
.apertura__nota {
  font-size: clamp(11px, min(1.2vw, 1.8vh), 13px);
  font-weight: 560;
  color: var(--accento);
  letter-spacing: 0.01em;
  margin-bottom: clamp(4px, 1vh, 10px);
}
.apertura__titolo {
  font-size: clamp(20px, min(4vw, 5.4vh), 46px);
  font-weight: 640;
  font-stretch: 106%;
  letter-spacing: -0.03em;
  line-height: 1.06;
  max-width: 17em;
  margin: 0 auto;
  text-wrap: balance;
}
.apertura__titolo span { color: var(--tenue); }

/* the features: the text on the left scrolls, the window on the right stays put */
.funzioni { position: relative; }
.palco {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  column-gap: clamp(20px, 4vw, 64px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}
.testi { padding: 11vh 0; }
.blocco {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 400px;
}
.blocco__icona {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--finestra);
  box-shadow: 0 0 0 1px var(--bordo), 0 1px 2px rgba(17, 17, 24, 0.05);
  margin-bottom: 18px;
  transition: box-shadow 0.5s ease;
}
.blocco__icona svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--tenue);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.5s ease;
}
.blocco__titolo {
  font-size: clamp(34px, min(4.6vw, 7vh), 64px);
  font-weight: 540;
  font-stretch: 104%;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--spento);
  transition: color 0.5s ease, font-weight 0.5s ease;
}
.blocco__testo {
  margin-top: clamp(10px, 1.8vh, 16px);
  font-size: clamp(14px, min(1.3vw, 2.1vh), 17px);
  line-height: 1.5;
  color: var(--secondario);
  opacity: 0.45;
  transition: opacity 0.5s ease;
}
.blocco__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(10px, 1.8vh, 16px);
  font-size: clamp(12px, min(1.1vw, 1.8vh), 13px);
  color: var(--tenue);
  transition: color 0.5s ease;
}
.blocco__meta kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--secondario);
  background: var(--finestra);
  box-shadow: 0 0 0 1px var(--bordo), 0 1px 0 rgba(17, 17, 24, 0.08);
}
.blocco.e-attivo .blocco__titolo { color: var(--inchiostro); font-weight: 640; }
.blocco.e-attivo .blocco__testo { opacity: 1; }
.blocco.e-attivo .blocco__meta { color: var(--secondario); }
.blocco.e-attivo .blocco__icona { box-shadow: 0 0 0 1px rgba(106, 76, 255, 0.35), 0 4px 12px -4px rgba(106, 76, 255, 0.35); }
.blocco.e-attivo .blocco__icona svg { stroke: var(--accento); }

.vetrina {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9vh 0;
}
@supports (height: 100lvh) {
  .vetrina { height: 100lvh; }
}
.spazio { position: relative; flex: none; }

/* the app window, drawn at 520 x 376 and scaled to fit by the script */
.finestra {
  position: absolute;
  left: 0;
  top: 0;
  width: 520px;
  height: 376px;
  transform-origin: 0 0;
  background: var(--finestra);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--bordo), 0 2px 4px rgba(17, 17, 24, 0.04), 0 24px 60px -24px rgba(17, 17, 24, 0.22);
  font-size: 12px;
  color: var(--inchiostro);
}

.barra {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-bottom: 1px solid var(--bordo);
  font-size: 11.5px;
}
.barra svg { fill: none; stroke: var(--secondario); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.barra__lato { width: 14px; height: 14px; }
.barra__marchio { font-weight: 640; }
.barra__sep { color: var(--spento); }
.barra__pagina { color: var(--secondario); }
.barra__cerca {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  height: 22px;
  padding: 0 10px 0 8px;
  border-radius: 7px;
  background: var(--binario);
  color: var(--tenue);
  font-size: 11px;
}
.barra__cerca svg { width: 11px; height: 11px; stroke: var(--tenue); }
.barra__team { display: inline-flex; margin-left: 6px; }
.barra__team .avatar + .avatar { margin-left: -3px; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 7.5px;
  font-weight: 640;
  letter-spacing: 0.02em;
  color: #4a4a52;
  background: #ececef;
  box-shadow: 0 0 0 1.5px var(--finestra);
  flex: none;
}
.avatar--b { background: #e4e4e8; }
.avatar--c { background: #f1f1f3; }

/* the panels: the script swaps data-passo and FLIP slides them to their new places */
.corpo {
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  bottom: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.corpo[data-passo="plan"] {
  grid-template-columns: minmax(0, 1fr) 150px;
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "lista grafico";
}
.corpo[data-passo="track"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 150px minmax(0, 1fr);
  grid-template-areas: "grafico" "lista";
}
.corpo[data-passo="ship"] {
  grid-template-columns: minmax(0, 1fr) 176px;
  grid-template-rows: minmax(0, 1.3fr) minmax(0, 0.7fr);
  grid-template-areas: "lista rilascio" "lista grafico";
}
.pannello {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--pannello);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--bordo);
}
.lista { grid-area: lista; }
.grafico { grid-area: grafico; }
.rilascio { grid-area: rilascio; }
.corpo:not([data-passo="ship"]) .rilascio {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 176px;
  /* where it lands on Ship: the first of the two rows, 1.3 parts of 306 */
  height: 199px;
  opacity: 0;
  pointer-events: none;
}

.pannello__testa {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  flex: none;
}
.pannello__titolo { font-weight: 620; font-size: 12px; white-space: nowrap; }
.pannello__nota { margin-left: auto; font-size: 10.5px; color: var(--tenue); white-space: nowrap; }

/* the task list */
.righe { list-style: none; padding: 0 6px 6px; }
.riga {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 8px;
  height: 31px;
  padding: 0 6px;
  border-top: 1px solid rgba(17, 17, 24, 0.05);
  background: var(--pannello);
}
.riga__nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; font-weight: 500; }
.spunta { display: block; width: 14px; height: 14px; }
.spunta svg { display: block; width: 14px; height: 14px; overflow: visible; }
.spunta rect { fill: var(--finestra); stroke: var(--spento); stroke-width: 1.2; transition: fill 0.3s ease, stroke 0.3s ease; }
.spunta path { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.riga.e-spuntata .spunta rect { fill: var(--accento); stroke: var(--accento); }
.riga--nuova { color: var(--tenue); grid-template-columns: 16px minmax(0, 1fr); }
.riga--nuova svg { width: 14px; height: 14px; fill: none; stroke: var(--tenue); stroke-width: 1.3; stroke-linecap: round; }
.riga--nuova span { font-size: 11.5px; }
@media (hover: hover) {
  .riga:not(.riga--nuova):hover { background: #f4f4f2; }
  .spedisci:hover { box-shadow: 0 1px 2px rgba(17, 17, 24, 0.2), 0 10px 18px -8px rgba(17, 17, 24, 0.55); }
}
.riga.e-spuntata .riga__nome { color: var(--secondario); }

.riga__meta { display: grid; justify-items: end; align-items: center; }
.meta {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--tenue);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.meta--barra i { position: relative; display: block; width: 52px; height: 4px; border-radius: 4px; background: var(--binario); overflow: hidden; }
.meta--barra b { position: absolute; inset: 0; border-radius: 4px; background: var(--accento); transform-origin: 0 50%; transform: scaleX(0); }
.meta--barra em { font-style: normal; min-width: 27px; text-align: right; color: var(--secondario); }
.meta--stato { padding: 2px 7px; border-radius: 999px; background: var(--binario); color: var(--secondario); }
.meta--fatto { background: var(--accento-tenue); color: var(--accento); }
.corpo[data-passo="plan"] .meta--data,
.corpo[data-passo="track"] .meta--barra,
.corpo[data-passo="ship"] .meta--stato { opacity: 1; transform: none; transition-delay: 0.25s; }

/* the progress chart */
.kpi { margin-left: auto; font-size: 11px; color: var(--secondario); }
.kpi b { font-size: 15px; font-weight: 640; color: var(--inchiostro); letter-spacing: -0.02em; }
.grafico__area { position: relative; flex: 1; min-height: 0; margin: 2px 12px 0; }
.grafico__area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grafico__griglia { fill: none; stroke: rgba(17, 17, 24, 0.06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.grafico__ideale { fill: none; stroke: var(--spento); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.grafico__fondo { fill: url(#sotto-linea); }
.grafico__linea { fill: none; stroke: var(--accento); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.grafico__oggi { fill: none; stroke: var(--accento); stroke-opacity: 0.35; stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.grafico__oggi-nome {
  position: absolute;
  left: 74%;
  top: -2px;
  transform: translateX(-50%) translateY(-100%);
  font-size: 9px;
  font-weight: 600;
  color: var(--accento);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.corpo[data-passo="track"] .grafico__oggi-nome { opacity: 1; transition-delay: 0.4s; }
.grafico__assi {
  display: flex;
  justify-content: space-between;
  height: 22px;
  align-items: center;
  padding: 0 12px;
  flex: none;
  font-size: 9.5px;
  color: var(--tenue);
}
.corpo:not([data-passo="track"]) .grafico__assi span:nth-child(2),
.corpo:not([data-passo="track"]) .grafico__assi span:nth-child(3) { display: none; }

/* the release card */
.versione {
  font-size: 10px;
  font-weight: 640;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--accento);
  background: var(--accento-tenue);
}
.controlli { list-style: none; padding: 2px 12px 0; display: grid; gap: 7px; flex: 1; align-content: start; }
.controlli li { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--secondario); white-space: nowrap; }
.controlli svg { width: 13px; height: 13px; flex: none; fill: none; stroke: var(--accento); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.spedisci {
  position: relative;
  appearance: none;
  border: 0;
  margin: 0 12px 12px;
  height: 30px;
  border-radius: 8px;
  background: var(--inchiostro);
  color: #fff;
  font: inherit;
  font-size: 11.5px;
  font-weight: 580;
  cursor: pointer;
  overflow: hidden;
  flex: none;
  box-shadow: 0 1px 2px rgba(17, 17, 24, 0.2), 0 6px 14px -8px rgba(17, 17, 24, 0.5);
}
.spedisci__fondo { position: absolute; inset: 0; background: var(--accento); transform-origin: 0 50%; transform: scaleX(0); }
.spedisci__testo { position: relative; display: grid; height: 100%; place-items: center; overflow: hidden; }
.spedisci__testo > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 5px; }
.spedisci__testo svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.spedisci__testo svg path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.spedisci:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* the selection outline that slides onto the part the text is about */
.evidenzia {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 12px;
  border: 1.5px solid var(--accento);
  box-shadow: 0 0 0 4px rgba(106, 76, 255, 0.08);
  pointer-events: none;
  z-index: 5;
}
.evidenzia__nome {
  position: absolute;
  right: 12px;
  top: 0;
  transform: translateY(-55%);
  display: block;
  height: 17px;
  overflow: hidden;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--accento);
  color: #fff;
  font-size: 10px;
  font-weight: 620;
  line-height: 17px;
  white-space: nowrap;
}
.evidenzia__nome span { display: block; }
.evidenzia__maniglia {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--finestra);
  border: 1px solid var(--accento);
  border-radius: 1.5px;
}
.evidenzia__maniglia--a { left: -4px; top: -4px; }
.evidenzia__maniglia--b { right: -4px; top: -4px; }
.evidenzia__maniglia--c { left: -4px; bottom: -4px; }
.evidenzia__maniglia--d { right: -4px; bottom: -4px; }

.piede {
  min-height: 34vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  text-align: center;
  color: var(--tenue);
  font-size: 13px;
}

/* on a phone the text sits on top and the window under it, both on one stage that stays put */
@media (max-width: 720px) {
  .funzioni { height: 300vh; }
  .palco {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 16px;
  }
  @supports (height: 100lvh) {
    .palco { height: 100lvh; }
  }
  .testi {
    position: relative;
    flex: none;
    height: 36%;
    padding: 0;
  }
  .blocco {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 0;
    max-width: none;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
  }
  .blocco__icona { display: none; }
  .blocco__titolo { font-size: clamp(26px, min(8vw, 6.5vh), 40px); }
  .blocco__testo { margin-top: 8px; font-size: clamp(12.5px, min(3.6vw, 3.2vh), 15px); line-height: 1.45; opacity: 1; }
  .blocco__meta { display: none; }
  .vetrina {
    position: relative;
    top: auto;
    align-self: stretch;
    flex: 1;
    min-height: 0;
    height: auto;
    padding: 12px 0 14px;
  }
}
@media (max-width: 720px) and (min-height: 600px) {
  .blocco__meta { display: flex; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .meta { transform: none; transition: opacity 0.35s ease; }
  .corpo[data-passo] .meta { transform: none; }
}
