:root {
  --fondo: #f1f1f3;
  --carta: #ffffff;
  --inchiostro: #111114;
  --grigio: #6e6e78;
  --tenue: #a3a3ad;
  --linea: rgba(17, 17, 20, 0.08);
  --accento: #4f5bd5;
  --accento-tenue: #e9ebfc;
  --verde: #2f9e6e;
  --ombra: 0 24px 60px rgba(20, 20, 40, 0.14), 0 4px 14px rgba(20, 20, 40, 0.06);
}

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

html, body { height: 100%; }

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

.palco {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(10px, 3vh, 26px) 16px clamp(12px, 3vh, 28px);
  overflow: hidden;
}

/* ---- the bar on top ---- */
.testa {
  width: min(620px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
}

.app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 640;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.app svg { width: 16px; height: 16px; fill: none; stroke: var(--accento); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.tasto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--linea);
  background: var(--carta);
  color: var(--inchiostro);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 20, 40, 0.05);
  transition: box-shadow 0.2s, background 0.2s;
}
.tasto svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tasto:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.tasto.e-premuto { transform: scale(0.95); box-shadow: none; }
.tasto[aria-pressed='true'] { background: var(--inchiostro); color: #fff; border-color: var(--inchiostro); }
@media (hover: hover) {
  .tasto:hover { box-shadow: 0 4px 12px rgba(20, 20, 40, 0.1); }
}

/* ---- the stack ---- */
.pila-box {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  perspective: 1300px;
  perspective-origin: 50% 0%;
}

.pila {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(620px, 100%);
  height: min(450px, calc(100% - 44px));
  transform: translate(-50%, calc(-50% + 18px));
  transform-style: preserve-3d;
}

.carta {
  position: absolute;
  inset: 0;
  background: var(--carta);
  border-radius: clamp(16px, 3vw, 22px);
  box-shadow: var(--ombra);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: 50% 0%;
  will-change: transform;
  cursor: default;
}
.carta.in-ventaglio { cursor: pointer; }

.velo {
  position: absolute;
  inset: 0;
  background: #1b1b24;
  opacity: 0;
  pointer-events: none;
  border-radius: inherit;
}

.carta-dentro {
  flex: 1;
  min-height: 0;
  padding: clamp(14px, 3.4vh, 24px) clamp(14px, 3.6vw, 26px) 0;
  overflow: hidden;
}

.carta-testa {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: clamp(8px, 2.2vh, 16px);
}
.carta-testa h2 { font-size: clamp(20px, 4.4vh, 28px); font-weight: 680; letter-spacing: -0.025em; }
.data { font-size: 12px; color: var(--grigio); }

/* home */
.saluto { font-size: clamp(14px, 2.6vh, 17px); font-weight: 560; letter-spacing: -0.01em; line-height: 1.3; }
.saluto span { color: var(--grigio); font-weight: 450; }
.numeri {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: clamp(10px, 2.4vh, 18px) 0;
}
.numeri div { background: #f6f6f8; border-radius: 12px; padding: clamp(7px, 1.6vh, 11px) 10px; }
.numeri b { display: block; font-size: clamp(17px, 3.4vh, 22px); font-weight: 680; font-variant-numeric: tabular-nums; }
.numeri span { font-size: 11px; color: var(--grigio); }
.oggi { list-style: none; }
.oggi li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: clamp(6px, 1.4vh, 9px) 0;
  border-top: 1px solid var(--linea);
  font-size: 13px;
}
.ora { color: var(--grigio); font-variant-numeric: tabular-nums; font-size: 12px; }
.voce { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 11px; color: var(--accento); background: var(--accento-tenue); padding: 2px 8px; border-radius: 999px; }

/* projects */
.progetti { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.8vh, 12px); }
.progetto { background: #f6f6f8; border-radius: 14px; padding: 8px 8px 10px; display: grid; grid-template-columns: 1fr auto; row-gap: 6px; align-items: center; }
.progetto .mini { grid-column: 1 / -1; height: clamp(34px, 9vh, 70px); border-radius: 9px; background: linear-gradient(135deg, var(--a), var(--b)); }
.progetto b { font-size: 13px; font-weight: 600; grid-column: 1 / -1; }
.barra { height: 4px; background: rgba(17, 17, 20, 0.08); border-radius: 4px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--inchiostro); border-radius: 4px; }
.pc { font-size: 11px; color: var(--grigio); font-variant-numeric: tabular-nums; padding-left: 8px; }

/* settings */
.conto { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--grigio); margin-bottom: clamp(6px, 1.8vh, 12px); }
.conto b { color: var(--inchiostro); font-weight: 600; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #c9d8ff, #8a96f5); color: #fff; font-weight: 640; font-size: 13px; flex: none; }
.opzioni { list-style: none; }
.opzioni li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: clamp(7px, 1.6vh, 11px) 0; border-top: 1px solid var(--linea); font-size: 12px; color: var(--grigio); line-height: 1.35; }
.opzioni b { color: var(--inchiostro); font-size: 13px; font-weight: 600; }
.interr { width: 36px; height: 21px; border-radius: 999px; background: #dcdce2; position: relative; flex: none; }
.interr i { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.interr.acceso { background: var(--verde); }
.interr.acceso i { left: 17px; }

/* the nav at the bottom of every page */
.sotto-nav {
  flex: none;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--linea);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
}
.voce-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
  padding: 5px 6px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 11px;
  font-weight: 560;
  color: var(--tenue);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
.voce-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.voce-nav[aria-current='page'] { color: var(--inchiostro); }
.voce-nav:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }
.voce-nav.e-premuto { transform: scale(0.92); background: #f1f1f4; }
@media (hover: hover) {
  .voce-nav:hover { color: var(--inchiostro); }
}

/* the fake pointer of the automatic tour */
.puntatore {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 50;
  pointer-events: none;
  visibility: hidden;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.puntatore path { fill: #111114; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

@media (max-width: 420px) {
  .tasto span { display: none; }
  .tasto { padding: 0 10px; }
  .numeri span { font-size: 10px; }
  .oggi li { grid-template-columns: 38px 1fr auto; font-size: 12px; }
  .voce-nav { min-width: 52px; }
}

@media (max-height: 460px) {
  .oggi li:nth-child(3), .opzioni li:nth-child(3) { display: none; }
  .progetto .mini { height: 26px; }
}
