:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: rgba(22, 22, 30, 0.08);
  --fantasma: rgba(22, 22, 30, 0.10);  /* the outline of a ghost card */
  --riga: #efeff2;                      /* the grey lines inside a ghost */
  --testo: #18181d;
  --testo-2: #6c6c75;
  --testo-3: #a3a3ad;
  --accento: #5a55e8;                   /* the one colour: the bar of the new project */
  --inchiostro: #16161b;                /* Create project, the toast */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 3vh, 28px) 12px;
}

/* ---- the pane: a view of the app, with its head ---- */
.pane {
  --cw: 170px;   /* card size: set by the script from the pane width */
  --ch: 106px;
  position: relative;
  width: min(400px, 100%);
  background: var(--carta);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px var(--bordo),
    0 1px 2px rgba(22, 22, 30, 0.04),
    0 14px 30px -14px rgba(22, 22, 30, 0.16),
    0 40px 70px -40px rgba(22, 22, 30, 0.22);
  overflow: hidden;
}
.pane__head {
  display: flex; align-items: center; gap: 8px;
  height: clamp(40px, 10vh, 48px);
  padding: 0 clamp(14px, 4.4vw, 18px);
  border-bottom: 1px solid var(--bordo);
}
.pane__t { font-size: 13.5px; font-weight: 620; letter-spacing: -0.01em; }
.badge {
  display: inline-block; height: 18px; min-width: 18px; padding: 0 5px;
  border-radius: 6px; background: #f2f2f5; overflow: hidden;
  font-size: 11px; font-weight: 600; color: var(--testo-2); line-height: 18px; text-align: center;
}
.badge__roll { display: flex; flex-direction: column; }
.pane__ws { margin-left: auto; font-size: 12px; color: var(--testo-3); }

.pane__body {
  position: relative;
  padding: clamp(12px, 3.4vh, 18px) clamp(12px, 4.4vw, 18px);
}

/* ---- the cards: GSAP owns their transform; size from --cw / --ch ---- */
.pc {
  position: absolute; left: 0; top: 0;
  width: var(--cw); height: var(--ch);
  border-radius: 13px;
  background: var(--carta);
  box-shadow: inset 0 0 0 1px var(--fantasma);
  padding: calc(var(--ch) * 0.15) calc(var(--cw) * 0.09);
  will-change: transform;
}
.pc--back { background: #fcfcfd; }
.pc--mid { background: #fdfdfe; }
.pc--top { z-index: 2; overflow: hidden; }
.pc__edge {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(22, 22, 30, 0.13), 0 1px 2px rgba(22, 22, 30, 0.05), 0 10px 22px -10px rgba(22, 22, 30, 0.22);
  opacity: 0;
}
.pc__shine {
  position: absolute; inset: -20% auto -20% 0; width: 46%; pointer-events: none;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(90,85,232,0.07) 45%, rgba(255,255,255,0.75) 52%, rgba(255,255,255,0));
  opacity: 0;
}
.pc__ghost, .pc__real { position: absolute; inset: calc(var(--ch) * 0.15) calc(var(--cw) * 0.09); }
.pc__g { display: block; height: 7px; border-radius: 4px; background: var(--riga); }
.pc__g--a { width: 22%; height: 5px; margin-bottom: calc(var(--ch) * 0.12); }
.pc__g--b { width: 64%; margin-bottom: 7px; }
.pc__g--c { width: 40%; }
.pc--back .pc__g, .pc--mid .pc__g, .pc__ghost .pc__g { position: relative; }
.pc--back > .pc__g, .pc--mid > .pc__g { opacity: 0.8; }

.pc__real { opacity: 0; }
.pc__bar { display: block; width: 22%; height: 5px; border-radius: 3px; background: var(--accento); transform: scaleX(0); transform-origin: 0 50%; margin-bottom: calc(var(--ch) * 0.1); }
.pc__name { font-size: clamp(12.5px, 3.5vw, 14px); font-weight: 620; letter-spacing: -0.012em; white-space: nowrap; height: 1.25em; line-height: 1.25; }
.pc__caret { display: inline-block; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -0.12em; background: var(--accento); opacity: 0; }
.pc__meta { margin-top: 3px; font-size: clamp(10.5px, 2.9vw, 11.5px); color: var(--testo-2); }
.pc__foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; }
.pc__who {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(140deg, #f1f0ff, #e2e0fb);
  box-shadow: inset 0 0 0 1px rgba(90,85,232,.18);
  font-size: 8.5px; font-weight: 650; letter-spacing: .02em; color: #4a45c9;
  display: grid; place-items: center;
}
.pc__tag { font-size: 10.5px; color: var(--testo-2); padding: 2px 7px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--bordo); }

/* ---- the dashed slot next to the first project ---- */
.slot {
  position: absolute; left: 0; top: 0;
  width: var(--cw); height: var(--ch);
  border-radius: 13px;
  border: 1px dashed rgba(22, 22, 30, 0.16);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 11.5px; color: var(--testo-3);
  visibility: hidden; opacity: 0;
}
.slot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

/* ---- the empty copy ---- */
.copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.copy__room { width: 100%; height: calc(var(--ch) + clamp(30px, 7vh, 42px)); }
.copy__t { font-size: clamp(15.5px, 4.4vw, 17.5px); font-weight: 640; letter-spacing: -0.018em; font-stretch: 96%; }
.copy__s { margin-top: 5px; max-width: 26em; font-size: clamp(12.5px, 3.5vw, 13.5px); line-height: 1.42; color: var(--testo-2); text-wrap: balance; }

/* ---- Create project: the elastic pill; the + turns on its own centre ---- */
.make {
  position: relative; isolation: isolate;
  margin-top: clamp(12px, 3vh, 18px);
  height: 40px; padding: 0 18px 0 14px;
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; font-size: 13.5px; font-weight: 560;
}
.make__bg {
  position: absolute; inset: 0; z-index: -1; border-radius: 999px;
  background: linear-gradient(180deg, #2a2a31, var(--inchiostro) 60%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 2px rgba(22,22,30,.2), 0 8px 18px -8px rgba(22,22,30,.5);
}
.make__plus { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.make__label { font-stretch: 100%; transition: font-stretch .45s cubic-bezier(.34, 1.56, .64, 1); }
.make.is-over .make__label { font-stretch: 112%; }
@media (hover: hover) { .make:hover .make__label { font-stretch: 112%; } }
.make:focus-visible, .toast__undo:focus-visible { outline: 2px solid var(--testo); outline-offset: 3px; border-radius: 999px; }

/* ---- the toast with Undo ---- */
.toast {
  position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: clamp(10px, 2.8vh, 16px);
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 6px 0 12px;
  border-radius: 999px; background: var(--inchiostro); color: #fff;
  font-size: 12.5px; white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(22,22,30,.55);
  visibility: hidden;
}
.toast__ok { width: 14px; height: 14px; fill: none; stroke: #b9b6ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast__ok path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.toast__undo {
  height: 26px; padding: 0 11px; border-radius: 999px;
  background: rgba(255,255,255,.12); font-size: 12px; font-weight: 600;
  transition: background-color .2s;
}
.toast__undo.is-over { background: rgba(255,255,255,.22); }
@media (hover: hover) { .toast__undo:hover { background: rgba(255,255,255,.22); } }
