:root {
  --fondo: #ffffff;
  --carta: #fdfcfa;
  --inchiostro: #1c1a17;
  --grigio: #7a746b;
  --tenue: #bdb6ab;
  --linea: rgba(28, 26, 23, 0.08);
  --basso: #b4552f;                /* the low stock line */
  /* the colour of the jacket, tweened by the script */
  --c: #5f6b3c;
  --c-dark: #434c28;
  --c-stitch: #a3ad74;
  --c-tint: #eef0e4;
  --font: 'Mona Sans Variable', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

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

.jacket {
  position: relative;
  width: min(340px, 90vw);
  padding: clamp(8px, 1.6vh, 12px);
  border-radius: 24px;
  background: var(--carta);
  border: 1px solid var(--linea);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 2px rgba(28, 26, 23, 0.05),
    0 8px 18px -8px rgba(28, 26, 23, 0.12),
    0 30px 60px -28px rgba(28, 26, 23, 0.22);
}

/* the jacket on its hook */
.jacket__hero {
  position: relative;
  height: clamp(132px, 37vh, 214px);
  border-radius: 17px;
  overflow: hidden;
  background:
    radial-gradient(70% 70% at 50% 38%, rgba(255, 255, 255, 0.75), transparent 70%),
    var(--c-tint);
  box-shadow: 0 0 0 1px rgba(28, 26, 23, 0.04) inset;
  isolation: isolate;
}
.jacket__wall {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.16;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.jacket__floor {
  position: absolute;
  left: 50%; bottom: 7%;
  width: 46%; height: 10%;
  margin-left: -23%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(28, 26, 23, 0.2), transparent);
  filter: blur(3px);
  z-index: 0;
}
.jacket__art {
  position: absolute;
  left: 50%; top: 2%;
  height: 100%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  overflow: visible;
  z-index: 1;
}
.hook { fill: none; stroke: #8e8778; stroke-width: 1.7; stroke-linecap: round; }
.garment { filter: drop-shadow(0 6px 7px rgba(28, 26, 23, 0.16)) drop-shadow(0 1px 1px rgba(28, 26, 23, 0.1)); }
.hanger { fill: none; stroke: #a57c4f; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.cloth { fill: var(--c); }
.fold { fill: rgba(0, 0, 0, 0.12); }
.fold--soft { fill: rgba(0, 0, 0, 0.07); }
.seam, .cuff, .placket { fill: none; stroke: var(--c-dark); stroke-width: 0.9; stroke-linecap: round; opacity: 0.7; }
.placket { stroke-width: 1.1; }
.stitch { fill: none; stroke: var(--c-stitch); stroke-width: 0.55; stroke-dasharray: 1.6 1.3; stroke-linecap: round; opacity: 0.9; }
.pocket { fill: rgba(0, 0, 0, 0.03); stroke: var(--c-dark); stroke-width: 0.8; stroke-opacity: 0.75; }
.flap { fill: var(--c); stroke: var(--c-dark); stroke-width: 0.8; stroke-opacity: 0.8; filter: drop-shadow(0 1.2px 0.6px rgba(0, 0, 0, 0.22)); }
.patch rect:first-child { fill: #6b4a2e; }
.patch__stitch { fill: none; stroke: #c9a57a; stroke-width: 0.45; stroke-dasharray: 1 0.8; }
.patch__mark { fill: none; stroke: #d9bb92; stroke-width: 0.8; stroke-linecap: round; }
.sheen { mix-blend-mode: soft-light; }
.collar__band { fill: var(--c-dark); }
.collar__leaf { fill: var(--c-dark); stroke: rgba(0, 0, 0, 0.25); stroke-width: 0.6; stroke-linejoin: round; filter: drop-shadow(0 1.4px 0.8px rgba(0, 0, 0, 0.25)); }
.collar__cord { fill: url(#jk-cord); pointer-events: none; }
.stitch--collar { opacity: 0.6; }
.buttons circle { fill: #2b2620; stroke: #6d6354; stroke-width: 0.6; }

.jacket__badge {
  position: absolute;
  left: 10px; top: 10px;
  z-index: 2;
  padding: 4px 9px 4px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 560;
  letter-spacing: 0.01em;
  color: var(--inchiostro);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(28, 26, 23, 0.06), 0 2px 6px -2px rgba(28, 26, 23, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* name and price */
.jacket__info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(8px, 1.8vh, 14px) 6px 0;
}
.jacket__titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.jacket__brand { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grigio); font-stretch: 112%; }
.jacket__name { margin: 0; font-size: clamp(14px, 2.4vh, 16.5px); font-weight: 640; letter-spacing: -0.01em; white-space: nowrap; }
.jacket__price { font-size: clamp(14px, 2.4vh, 16.5px); font-weight: 560; font-variant-numeric: lining-nums tabular-nums; }

/* the colour line with the rolling name */
.jacket__colour {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: clamp(5px, 1.2vh, 9px) 6px 0;
  font-size: 12.5px;
  min-height: 1.6em;
}
.jacket__label { color: var(--grigio); }
.roll {
  position: relative;
  display: inline-block;
  height: 1.3em;
  line-height: 1.3em;
  overflow: hidden;
  vertical-align: bottom;
  font-weight: 620;
  white-space: nowrap;
  clip-path: inset(-2px -4px);
}
.roll__word { position: absolute; left: 0; top: 0; white-space: pre; }
.roll__word.is-on { position: relative; }
.roll__ch { display: inline-block; will-change: transform; }
.jacket__stock { margin-left: auto; color: var(--grigio); font-size: 11.5px; white-space: nowrap; }
.jacket__stock.is-low { color: var(--basso); font-weight: 560; }

/* the fabric swatches */
.swatches {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: clamp(8px, 1.6vh, 12px) 6px clamp(4px, 0.8vh, 6px);
}
.swatch {
  position: relative;
  width: clamp(36px, 7.6vh, 46px);
  aspect-ratio: 1;
  border-radius: 6px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.swatch__lift { position: absolute; inset: 0; display: block; }
.swatch svg {
  display: block; width: 100%; height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(28, 26, 23, 0.18)) drop-shadow(0 3px 5px rgba(28, 26, 23, 0.1));
  transition: filter 0.35s;
}
.swatch.is-hover svg { filter: drop-shadow(0 2px 1px rgba(28, 26, 23, 0.16)) drop-shadow(0 9px 10px rgba(28, 26, 23, 0.16)); }
.swatch__stitch { fill: none; stroke-width: 0.7; stroke-dasharray: 1.8 1.4; stroke-linecap: round; opacity: 0.85; }
.swatch:focus-visible .swatch__lift { outline: 2px solid var(--inchiostro); outline-offset: 7px; border-radius: 8px; }
.swatches__ring {
  position: absolute;
  left: 0; top: 0;
  border-radius: 10px;
  border: 1.6px solid var(--inchiostro);
  pointer-events: none;
  opacity: 0;
}
.swatches__ring::after {
  content: '';
  position: absolute; inset: 2px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

.pointer {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #1c1a17; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
  transform-origin: 5px 3px;
  z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  .swatch svg { transition: none; }
}
