:root {
  --red: #d45054;        /* the collection page */
  --wine: #68142b;       /* text, mark and the thread along the tear */
  --paper: #fbf3ec;      /* the white fibre of the torn paper */
  --stamp: #2c2e2c40;    /* the hard stamped shadow under cards and buttons */
  --shade: #2c2e2c;      /* the soft shadow the torn page casts inside the hole */
  /* the tint of each coat: light ground and dark ink */
  --c0-bg: #e0fff8; --c0-ink: #054041;
  --c1-bg: #fffec5; --c1-ink: #855119;
  --c2-bg: #edd7ff; --c2-ink: #44008d;
  --serif: "Libre Baskerville", Georgia, serif;
  --sans: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
}

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

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

.page { position: absolute; inset: 0; overflow: hidden; }
.page[hidden] { display: block; visibility: hidden; }
.page--list { background: var(--red); color: var(--wine); z-index: 2; }
.page--item { background: var(--bg, var(--c0-bg)); color: var(--ink, var(--c0-ink)); z-index: 1; }
.page__in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(14px, 3.2vh, 32px) clamp(16px, 4vw, 56px); will-change: transform, filter; }

/* the bar on top of both pages */
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: clamp(10px, min(1.1vw, 1.9vh), 13px); letter-spacing: .06em; text-transform: uppercase; font-stretch: 112%; font-weight: 500; }
.bar__side--end { justify-self: end; }
.mark { font-family: var(--serif); font-size: clamp(15px, min(2.2vw, 3.6vh), 26px); letter-spacing: .22em; text-transform: none; padding-left: .22em; }
.bag { display: inline-block; min-width: 1ch; font-variant-numeric: lining-nums; }

/* the collection */
.lead { text-align: center; margin-top: clamp(10px, 5vh, 64px); }
.title { font-family: var(--serif); font-weight: 400; line-height: .98; font-size: clamp(30px, min(8.6vw, 12.5vh), 132px); }
.title__soft, .title__caps { display: block; }
.title__soft { font-style: italic; font-size: .72em; }
.title__caps { letter-spacing: .02em; }
.sub { font-family: var(--serif); font-style: italic; font-size: clamp(11px, min(1.4vw, 2.3vh), 18px); margin-top: clamp(6px, 1.6vh, 16px); opacity: .86; }

.cards { list-style: none; display: flex; justify-content: center; gap: clamp(10px, 2.6vw, 40px); margin: auto 0; padding-bottom: clamp(0px, 4vh, 48px); }
.card { display: flex; flex-direction: column; align-items: center; gap: clamp(3px, .8vh, 8px); text-align: center; }
.card__face { position: relative; display: grid; place-items: center; width: clamp(84px, min(15vw, 24vh), 220px); aspect-ratio: 3 / 4; background: var(--bg); border: 1px solid var(--ink); border-radius: 6px;
  filter: drop-shadow(4px 4px var(--stamp)); transition: filter .5s cubic-bezier(.215,.61,.355,1), transform .5s cubic-bezier(.215,.61,.355,1); }
.card .coat { width: 74%; height: auto; color: var(--ink); transform-origin: 50% 8%; transition: transform .7s cubic-bezier(.34,1.56,.64,1); }
.card__name { font-family: var(--serif); font-style: italic; font-size: clamp(12px, min(1.5vw, 2.5vh), 19px); }
.card__price { font-size: clamp(9px, min(1vw, 1.7vh), 12px); letter-spacing: .05em; opacity: .8; font-variant-numeric: lining-nums; }
.cards li:nth-child(1) .card { --bg: var(--c0-bg); --ink: var(--c0-ink); }
.cards li:nth-child(2) .card { --bg: var(--c1-bg); --ink: var(--c1-ink); }
.cards li:nth-child(3) .card { --bg: var(--c2-bg); --ink: var(--c2-ink); }
.card.is-down .card__face { filter: drop-shadow(0 0 transparent); transform: translate(4px, 4px); }
@media (hover: hover) {
  .card:hover .card__face { filter: drop-shadow(0 0 transparent); transform: translate(4px, 4px); }
  .card:hover .coat { transform: rotate(-2deg); }
}

/* the coats */
.coat__body { fill: currentColor; }
.coat__seam { fill: none; stroke: var(--bg, #fff); stroke-opacity: .42; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.coat__btn circle, .coat__buckle { fill: none; stroke: var(--bg, #fff); stroke-opacity: .7; stroke-width: 1; }

/* the page of one coat */
.item { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 5vw, 80px); min-height: 0; }
.item__look { flex: none; height: min(66vh, 46vw); aspect-ratio: 3 / 4; display: grid; place-items: center; }
.coat--big { width: 92%; height: auto; color: var(--ink); }
.item__text { width: min(40vw, 440px); min-width: 0; }
.item__kind { font-size: clamp(9px, min(1vw, 1.8vh), 12px); text-transform: uppercase; letter-spacing: .08em; font-stretch: 112%; font-weight: 500; }
.item__name { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, min(7vw, 11vh), 112px); line-height: 1; margin-top: .12em; }
.item__say { font-family: var(--serif); font-style: italic; font-size: clamp(11px, min(1.4vw, 2.3vh), 17px); margin-top: .5em; opacity: .85; }
.item__def { font-family: var(--serif); font-size: clamp(11px, min(1.35vw, 2.2vh), 17px); line-height: 1.5; margin-top: .7em; }
.sizes { display: flex; gap: 6px; margin-top: clamp(8px, 2.4vh, 24px); }
.size { min-width: clamp(28px, min(3.4vw, 5.6vh), 42px); height: clamp(24px, min(3vw, 4.8vh), 36px); border: 1px solid var(--line, rgba(0,0,0,.25)); border-radius: 999px; font-size: clamp(9px, min(1vw, 1.7vh), 12px); letter-spacing: .04em; transition: border-color .3s, background-color .3s, transform .4s cubic-bezier(.34,1.56,.64,1); }
.size.is-on { border-color: currentColor; background: var(--soft, rgba(0,0,0,.06)); }
.size:active { transform: scale(.94); }
.buy { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); margin-top: clamp(8px, 2.4vh, 24px); }
.buy__price { font-family: var(--serif); font-size: clamp(13px, min(1.7vw, 2.8vh), 22px); font-variant-numeric: lining-nums; }
.add { position: relative; height: clamp(30px, min(3.8vw, 6vh), 46px); padding: 0 clamp(14px, 2vw, 26px); border-radius: 999px; background: var(--ink); color: var(--bg); font-size: clamp(10px, min(1.1vw, 1.9vh), 13px); letter-spacing: .06em; text-transform: uppercase; font-stretch: 112%; font-weight: 600;
  filter: drop-shadow(4px 4px var(--stamp)); transition: filter .5s cubic-bezier(.215,.61,.355,1), transform .5s cubic-bezier(.215,.61,.355,1); overflow: hidden; }
.add__label { display: inline-block; }
.add:active { filter: drop-shadow(0 0 transparent); transform: translate(4px, 4px); }
@media (hover: hover) { .add:hover { filter: drop-shadow(0 0 transparent); transform: translate(4px, 4px); } }

.back { display: inline-flex; align-items: center; gap: 6px; justify-self: start; height: clamp(26px, min(3.2vw, 5vh), 36px); padding: 0 12px 0 8px; border: 1px solid currentColor; border-radius: 999px; background: var(--bg); text-transform: uppercase; letter-spacing: .06em; font-weight: 500;
  filter: drop-shadow(3px 3px var(--stamp)); transition: filter .5s cubic-bezier(.215,.61,.355,1), transform .5s cubic-bezier(.215,.61,.355,1); }
.back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.back.is-down { filter: drop-shadow(0 0 transparent); transform: translate(3px, 3px); }
@media (hover: hover) { .back:hover { filter: drop-shadow(0 0 transparent); transform: translate(3px, 3px); } }

/* the tear: fibre on a canvas, thread as a vector line */
.fibre, .thread { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.thread { overflow: visible; }
.thread path { fill: none; stroke: var(--wine); stroke-width: 1.2; stroke-linejoin: round; }

/* the drawn pointer of the autopilot */
.hand { position: absolute; left: 0; top: 0; width: 22px; height: 22px; z-index: 8; pointer-events: none; opacity: 0; filter: drop-shadow(1px 2px 2px rgba(44,46,44,.3)); }
.hand path { fill: #fff; stroke: #1c1c1c; stroke-width: 1.3; stroke-linejoin: round; }

/* the phone: the coat page stacks */
@media (max-width: 560px) {
  .bar__side:first-child { visibility: hidden; }
  .item { gap: 12px; }
  .item__look { height: min(44vh, 46vw); }
  .item__text { width: auto; flex: 1; }
  .item__def { display: none; }
}
@media (max-height: 460px) and (max-width: 560px) { .item__say { display: none; } }
