:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --testo: #15171c;
  --testo-2: #5e626c;
  --testo-3: #a4a8b1;
  --linea: #e8e9ee;
  --traccia: #f4f5f8;
  --accento: #2f6bff;        /* the single accent: a clear blue on the open arrow, the tick, the focus ring and the highlight */
  --accento-velo: rgba(47, 107, 255, .09);
  --vetro: rgba(255, 255, 255, .78);
  --ombra: 22, 26, 44;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(11px, min(2.7vw, 3.3vh), 17px); }
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; }
:focus-visible { outline: none; }

.stage { min-height: 100vh; display: grid; place-items: center; padding: 1em; }

/* ---- the card ---- */
.card {
  position: relative;
  width: min(40em, 94vw);
  padding: 1.1em 1.25em 1.35em;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 1.25em;
  box-shadow: 0 1px 2px rgba(var(--ombra), .04), 0 3px 8px -3px rgba(var(--ombra), .06), 0 30px 60px -36px rgba(var(--ombra), .4);
  isolation: isolate;
}
.card__light {
  position: absolute; left: 0; top: 0;
  width: 26em; height: 26em; margin: -13em 0 0 -13em;
  background: radial-gradient(closest-side, rgba(47, 107, 255, .06), transparent 72%);
  pointer-events: none; z-index: -1; opacity: 0;
}

/* ---- the bar with the breadcrumbs ---- */
.bar {
  display: flex; align-items: center; gap: .7em;
  padding-bottom: .9em;
  border-bottom: 1px solid var(--linea);
  margin-bottom: 1.1em;
}
.bar__app {
  flex: none;
  display: grid; place-items: center;
  width: 1.9em; height: 1.9em;
  border-radius: .6em;
  background: var(--testo); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 5px 12px -7px rgba(var(--ombra), .7);
}
.bar__app svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.crumbs { flex: 1; min-width: 0; overflow: hidden; padding: .2em; margin: -.2em; }
.crumbs__list { display: flex; align-items: center; list-style: none; white-space: nowrap; }
.crumb { display: flex; align-items: center; flex: none; }
.crumb[hidden], .crumb__sep[hidden] { display: none; }
.crumb .roll { max-width: 10em; }
/* the last crumb gives way with an ellipsis, but only after the middle ones have gathered into «…» */
.crumb--last { flex: 0 1 auto; min-width: 0; }
.crumb--last .crumb__name { min-width: 6.5em; max-width: 100%; }
.crumb--last .roll { min-width: 0; }
.misura .crumb--last { flex: none; }
.crumb .roll__line { overflow: hidden; text-overflow: ellipsis; }

.crumb__name {
  display: inline-flex; align-items: center; gap: .4em;
  height: 2em; padding: 0 .5em;
  border-radius: .55em;
  font-size: .88em; font-weight: 520; color: var(--testo-2);
  letter-spacing: -.005em;
  transition: background-color .2s, color .2s;
}
.crumb--last .crumb__name { color: var(--testo); font-weight: 600; }
.crumb__name svg { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: .8; }
.crumb__name:focus-visible, .crumb__sep:focus-visible, .menu__item:focus-visible { box-shadow: 0 0 0 2px var(--carta), 0 0 0 4px var(--accento); }

.crumb__sep {
  display: grid; place-items: center;
  width: 1.55em; height: 1.85em;
  border-radius: .5em;
  color: var(--testo-3);
  transition: background-color .2s, color .2s;
}
.crumb__sep svg { width: 1em; height: 1em; overflow: visible; }
.crumb__sep path { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.crumb__sep[aria-expanded="true"] { color: var(--accento); background: var(--accento-velo); }
@media (hover: hover) {
  .crumb__name:hover { background: var(--traccia); color: var(--testo); }
  .crumb__sep:hover { background: var(--traccia); color: var(--testo); }
  .crumb__sep[aria-expanded="true"]:hover { color: var(--accento); background: var(--accento-velo); }
}
.crumb--more .crumb__name { padding: 0 .55em; letter-spacing: .08em; }

/* text in a window: the old line leaves, the new one comes in */
.roll { display: inline-grid; overflow: hidden; vertical-align: top; }
.roll__line { grid-area: 1 / 1; white-space: nowrap; display: block; }

/* ---- the folder ---- */
.head { margin-bottom: 1em; }
.head__title { font-size: 1.6em; font-weight: 660; letter-spacing: -.025em; line-height: 1.15; font-stretch: 106%; }
.head__meta { display: flex; align-items: center; gap: .55em; margin-top: .3em; font-family: "Geist Mono Variable", ui-monospace, monospace; font-size: .74em; color: var(--testo-3); letter-spacing: .01em; }
.head__dot { width: 1em; height: 1px; background: var(--linea); }

.files { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .75em; }
.file { min-width: 0; }
.file__thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: .7em;
  border: 1px solid var(--linea);
  background: var(--traccia);
  overflow: hidden;
}
.file__thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.55), transparent 45%);
  pointer-events: none;
}
.file__shape { position: absolute; border-radius: .35em; }
.file__name { margin-top: .45em; font-size: .76em; font-weight: 520; color: var(--testo-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- the glass menu ---- */
.menu {
  position: absolute; left: 0; top: 0; z-index: 5;
  min-width: 13em;
  padding: .45em;
  border-radius: .95em;
  background: var(--vetro);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 0 0 1px rgba(var(--ombra), .07), 0 2px 6px -2px rgba(var(--ombra), .1), 0 22px 44px -22px rgba(var(--ombra), .45);
}
.menu[hidden] { display: none; }
.menu__head { padding: .35em .6em .45em; font-family: "Geist Mono Variable", ui-monospace, monospace; font-size: .64em; letter-spacing: .08em; text-transform: uppercase; color: var(--testo-3); }
.menu__list { list-style: none; position: relative; }
.menu__glow {
  position: absolute; left: .45em; right: .45em; top: 0; height: 2.2em;
  border-radius: .6em;
  background: var(--accento-velo);
  opacity: 0;
  pointer-events: none;
}
.menu__item {
  position: relative;
  display: flex; align-items: center; gap: .55em;
  width: 100%; height: 2.25em; padding: 0 .6em;
  border-radius: .6em;
  font-size: .9em; font-weight: 520; text-align: left; color: var(--testo);
}
.menu__item svg.menu__icon { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: var(--testo-2); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.menu__name { flex: 1; }
.menu__tick { width: 1em; height: 1em; flex: none; fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu__count { font-family: "Geist Mono Variable", ui-monospace, monospace; font-size: .78em; color: var(--testo-3); }

/* the pointer of the preview, drawn by us */
.pointer {
  position: absolute; left: 0; top: 0; z-index: 8;
  width: 1.35em; height: 1.35em;
  fill: var(--testo); stroke: #fff; stroke-width: 1.3; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(var(--ombra), .3));
  pointer-events: none; opacity: 0;
}

@media (max-width: 520px) {
  .card { padding: 1em 1em 1.15em; }
  .files { gap: .55em; }
  .head__title { font-size: 1.45em; }
}
