:root {
  --fondo: #f7f4ee;
  --carta: #fffdf9;
  --inchiostro: #1c1a17;
  --grigio: #77726a;
  --linea: rgba(28, 26, 23, 0.09);
  --accento: #c4552f;
  --sand: #eee2d2;
  --sage: #dde6da;
  --mist: #e2e2ec;
}

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

html, body { height: 100%; overflow: hidden; }

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* the screen is drawn in pixels and the wrapper scales it to fit the box, height included */
.fit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 360px;
  height: 436px;
  transform-origin: 50% 50%;
}

.screen {
  position: relative;
  width: 360px;
  height: 436px;
  background: var(--carta);
  border-radius: 24px;
  border: 1px solid var(--linea);
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.04), 0 18px 44px -16px rgba(28, 26, 23, 0.2);
  overflow: hidden;
}

/* the top bar stays above the colour, so the bag count lives through both pages */
.bar {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: 0;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; font-size: 14px; font-weight: 640; font-variation-settings: "wdth" 104; letter-spacing: -0.01em; }
.brand svg { width: 18px; height: 18px; fill: none; stroke: var(--inchiostro); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bag { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; transition: background 0.2s; }
.bag svg { width: 21px; height: 21px; fill: none; stroke: var(--inchiostro); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.bag__count {
  position: absolute;
  right: 1px;
  top: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accento);
  color: #fff;
  font-size: 10px;
  font-weight: 640;
  line-height: 16px;
  text-align: center;
  overflow: hidden;
  transform: scale(0);
}
.bag__count span { display: block; }

.list { position: absolute; inset: 56px 0 0 0; padding: 6px 16px 0; }
.list__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.list__title { font-size: 26px; font-weight: 640; font-variation-settings: "wdth" 96; letter-spacing: -0.02em; }
.list__meta { font-size: 12px; color: var(--grigio); }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 10px 10px 12px;
  border-radius: 16px;
  background: var(--tint);
  height: 196px;
  will-change: transform;
}
.item__pic { display: block; width: 82px; height: 118px; align-self: center; margin-bottom: 10px; }
.item__pic { position: relative; border-radius: 12px; overflow: hidden; background: rgba(28, 26, 23, 0.06); box-shadow: 0 1px 1px rgba(28, 26, 23, 0.06), 0 8px 18px -10px rgba(28, 26, 23, 0.35); }
.hero__pic { border-radius: 18px; overflow: hidden; background: rgba(28, 26, 23, 0.06); box-shadow: 0 1px 2px rgba(28, 26, 23, 0.08); }
.item__pic img, .hero__pic img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); user-select: none; -webkit-user-drag: none; }
/* a hairline and a soft sheen on the glass of the photo, like a print under light */
.item__pic::after, .hero__pic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 42%); }
.item__name { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em; transform-origin: 0 0; white-space: nowrap; }
.item__price { font-size: 11.5px; color: var(--grigio); margin-top: 3px; }
@media (hover: hover) {
  .item:hover .item__pic { transform: translateY(-3px); }
  .item:hover .item__pic img { transform: scale(1.04); }
  .bag:hover { background: rgba(28, 26, 23, 0.05); }
}
.item__pic { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }

.list__note { margin-top: 18px; font-size: 12px; color: var(--grigio); }

.flood {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 16px;
  visibility: hidden;
}

.detail { position: absolute; z-index: 3; inset: 0; padding: 56px 18px 18px; }
.detail[hidden] { display: none; }
.back {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 6;
  height: 32px;
  padding: 0 12px 0 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
  font-weight: 600;
}
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hero { position: relative; height: 176px; display: grid; place-items: center; }
.hero__pic { position: relative; z-index: 1; display: block; width: 126px; height: 182px; transform-origin: 50% 50%; }
.hero__shadow {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 120px;
  height: 14px;
  margin-left: -60px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(28, 26, 23, 0.22), rgba(28, 26, 23, 0));
}

.detail__name { margin-top: 12px; font-size: 26px; font-weight: 640; font-variation-settings: "wdth" 96; letter-spacing: -0.02em; transform-origin: 0 0; white-space: nowrap; }
.detail__line { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.detail__price { font-size: 17px; font-weight: 600; }
.detail__made { font-size: 12px; color: var(--grigio); }

.sizes { display: flex; gap: 8px; margin-top: 16px; }
.size {
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(28, 26, 23, 0.1);
  font-size: 12.5px;
  font-weight: 560;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.size.is-on { background: var(--inchiostro); border-color: var(--inchiostro); color: #fff; }

.add {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 48px;
  border-radius: 24px;
  background: var(--inchiostro);
  color: #fff;
  font-size: 14px;
  font-weight: 620;
  overflow: hidden;
  transform-origin: 50% 50%;
}
.add__fill { position: absolute; inset: 0; background: var(--accento); transform: scaleX(0); transform-origin: 0 50%; }
.add__a, .add__b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.add__b { opacity: 0; }
.add__b svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pointer {
  position: absolute;
  z-index: 50;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -5px;
  fill: var(--inchiostro);
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}
