/* The Men's and Women's pages (a clothing rack, then the pieces floating on the green) and the mission page.
   Both slide over the shop under the banner; site/rack.js runs them. */

/* ---------- the banner: Our mission sits just left of the bag ---------- */
.nav__end { justify-self: end; display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav__mission { position: relative; height: var(--bar-h); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500; white-space: nowrap; }
.nav__mission::after { content: ''; position: absolute; left: 0; right: .22em; bottom: calc(var(--bar-h) / 2 - 14px); height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.nav__mission:hover::after, .nav__mission[aria-pressed="true"]::after { transform: scaleX(1); }
.nav__mission[aria-pressed="true"] { font-weight: 600; }
.nav__end .nav__bag { justify-self: auto; }
html.is-rack { overflow: hidden; }

/* ---------- the two pages: they roll down from under the banner like a blind ---------- */
.gpage, .mpage { position: fixed; inset: 0; z-index: 35; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-top: var(--bar-h);
  visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path .8s cubic-bezier(.76, 0, .24, 1), visibility 0s .8s; }
.gpage.is-open, .mpage.is-open { visibility: visible; clip-path: inset(0 0 0 0); transition: clip-path .8s cubic-bezier(.76, 0, .24, 1); }

/* ---------- the rack: a chrome rail on a dark wall, lit from the front ---------- */
.gpage { background: #232426; }
.rack { --wall: #2b2c2f; --wall-end: #232426; --ink: #eeece6; --soft: #a3a09a; --e: cubic-bezier(.22, .8, .18, 1);
  position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; height: calc(100vh - var(--bar-h)); height: calc(100svh - var(--bar-h)); min-height: 520px;
  overflow: hidden; color: var(--ink); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;   /* nothing on the rack highlights when clicked */
  background: url(/shared/grain.png), linear-gradient(180deg, transparent 62%, var(--wall-end) 100%),
    radial-gradient(75% 62% at 50% 34%, #3e3f43 0%, #313235 45%, var(--wall) 70%, var(--wall-end) 100%); }
.rack__stage { position: relative; min-height: 0; touch-action: pan-y;
  transform: translateY(calc(var(--rise, 0) * 9vh)); opacity: calc(1 - var(--rise, 0) * .55); }

/* the rail: a polished chrome tube, brightest where the light falls on it and darker toward its ends, with domed end
   caps. It hangs from the ceiling on two rods, each with a plate at the ceiling and a sleeve where it holds the tube. */
.rack__rail { position: absolute; left: 50%; top: calc(var(--rod) - 5.5px); width: var(--rail, 80vw); height: 11px; translate: -50% 0; border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .34) 0%, transparent 14%, transparent 86%, rgba(0, 0, 0, .34) 100%),
    radial-gradient(42% 260% at 50% 26%, rgba(255, 255, 255, .42), transparent 70%),
    linear-gradient(180deg, #2c2f33 0%, #8a8f95 9%, #e6e8ea 20%, #ffffff 27%, #d6d9dc 35%, #8d9297 51%, #5a5e63 65%, #6c7176 75%, #b3b7bc 86%, #50545a 95%, #282b2f 100%);
  box-shadow: 0 13px 12px -8px rgba(0, 0, 0, .5); transition: opacity .6s, width .8s var(--e); }
.rack__rail i { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; translate: 0 -50%;
  background: radial-gradient(circle at 36% 30%, #fff 0%, #e6e8ea 16%, #a3a8ad 50%, #5d6166 78%, #383b3f 100%);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .35), 0 3px 5px rgba(0, 0, 0, .4); }
.rack__rail i:first-of-type { left: -10px; }
.rack__rail i:last-of-type { right: -10px; }
.rack__rail b { position: absolute; bottom: 5px; width: 5px; height: calc(var(--rod) + .5px); margin-left: -2.5px;
  background: linear-gradient(90deg, #3c3f43 0%, #a5aaaf 22%, #ffffff 38%, #c5c9cc 52%, #6b7075 78%, #36393d 100%); }
.rack__rail b:first-of-type { left: 7%; }
.rack__rail b:last-of-type { left: 93%; }
.rack__rail b::before { content: ''; position: absolute; top: 0; left: 50%; width: 30px; height: 8px; translate: -50% 0; border-radius: 0 0 5px 5px;
  background: linear-gradient(90deg, #3c3f43 0%, #b8bcc0 24%, #ffffff 40%, #c9cdd0 56%, #6b7075 84%, #3c3f43 100%); box-shadow: 0 3px 4px rgba(0, 0, 0, .35); }
.rack__rail b::after { content: ''; position: absolute; bottom: -9px; left: 50%; width: 15px; height: 17px; translate: -50% 0; border-radius: 4px;
  background: linear-gradient(90deg, #3c3f43 0%, #a5aaaf 20%, #ffffff 36%, #c5c9cc 52%, #6b7075 80%, #36393d 100%); box-shadow: 0 2px 3px rgba(0, 0, 0, .4); }

/* the garments: each hangs from the rail at its top centre; JS sets where it is and how far it is turned */
.rack__row { position: absolute; left: 50%; top: var(--rod); width: 0; height: 0; transition: translate .5s var(--e); }
.rack__ao { display: none; }
/* bringing a piece forward, and sending it back, is one slow, even glide */
.rack.is-gliding .hang, .rack.is-gliding .hang__turn { transition-duration: 1.05s; transition-timing-function: cubic-bezier(.62, .02, .22, 1); }
.rack__row.is-dragging { transition: none; }
/* phones: an invisible strip over the rack scrolls sideways and stops at each garment; the garments follow it */
.rack__scroll { position: absolute; inset: 0; z-index: 55; display: none; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-tap-highlight-color: transparent; }
.rack__scroll::-webkit-scrollbar { display: none; }
.rack__scroll > div { display: flex; height: 100%; box-sizing: content-box; }
.rack__scroll i { flex: 0 0 var(--step, 80px); scroll-snap-align: center; }
.rack.is-scrolly .rack__scroll { display: block; }
.rack.is-scrolly:not(.is-detail) .rack__stage { touch-action: auto; }
.rack.is-detail .rack__scroll { display: none; }
.rack.is-scrolling .hang, .rack.is-scrolling .hang__turn { transition: none; }
.hang { position: absolute; top: 0; left: calc(var(--W) * -.5); width: var(--W); height: calc(var(--W) * 1.32); transform-origin: 50% 0; outline: none; cursor: pointer;
  transition: transform .85s var(--e), opacity .6s ease, filter .6s ease; will-change: transform; -webkit-tap-highlight-color: transparent; }
.rack.is-entering .hang { transition-duration: 1.15s, .9s, .6s; }
.rack.is-leaving .hang { transition-duration: .5s, .4s, .4s; transition-timing-function: cubic-bezier(.5, 0, .75, 0), ease, ease; }
.hang__pivot { position: absolute; inset: 0; transform-origin: 50% 0; }
/* front and back of the garment stand a little apart, with the hanger between them, so a turned garment has depth */
.hang__turn { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% calc(var(--W) * .085); transition: transform .85s var(--e); will-change: transform; }
.hang__hanger { position: absolute; left: 0; top: calc(var(--W) * -.06); width: var(--W); height: calc(var(--W) * .66); overflow: visible; transform: translateZ(calc(var(--W) * .0045)); transition: opacity .45s; }   /* just behind the front, so a turned garment hides it */
/* chrome: a darker edge with a bright line along it */
.hang__hanger .hk { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hang__hanger .hk--edge { stroke: #6f7378; stroke-width: 1.35; }
.hang__hanger .hk--shine { stroke: #eef0f2; stroke-width: .55; }
.hang__face, .hang__shell, .hang__shade { position: absolute; left: calc(var(--W) * var(--nx, 0) * -1); right: calc(var(--W) * var(--nx, 0)); top: calc(var(--W) * .1); height: calc(var(--W) * 1.22); }   /* --nx puts the collar under the hook */
.hang__face { transform: translateZ(calc(var(--W) * .007)) scale(var(--k, 1)); transform-origin: 50% 0; transition: opacity .5s ease; }   /* --k: every garment the same size */
.hang__face--model { left: 0; right: 0; transform: translateZ(calc(var(--W) * .007)); }   /* an owner's photo: always the same size, centred */
.hang__shell { transform: translateZ(calc(var(--W) * -.005)) scale(var(--k, 1)); transform-origin: 50% 0; filter: brightness(.72) saturate(.95); transition: opacity .5s ease; }
.hang__face img, .hang__shell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 0; max-width: none; pointer-events: none; }
.hang__face img { transition: opacity .55s ease; }   /* no shadow on the hanging clothes */
.hang__face img.is-new { opacity: 0; }
.hang__shell img:not([src]) { display: none; }
/* shading in the garment's own shape: turned away from the light, its far side falls into shadow */
.hang__shade { transform: translateZ(calc(var(--W) * .0075)) scale(var(--k, 1)); transform-origin: 50% 0; pointer-events: none; opacity: 1; transition: opacity .7s ease;
  background: linear-gradient(90deg, rgba(0, 0, 0, .14) 0%, rgba(0, 0, 0, .06) 50%, rgba(0, 0, 0, 0) 85%, rgba(255, 255, 255, .04) 100%);   /* only a hint of shade on the turned side */
  -webkit-mask: var(--m) 50% 0 / contain no-repeat; mask: var(--m) 50% 0 / contain no-repeat; }
.hang:not(.has-m) .hang__shade, .hang.is-tile .hang__shade, .hang.is-tile .hang__shell { display: none; }
.hang.is-on .hang__shade, .rack.is-detail .hang__shade { opacity: 0; }
.hang.is-tile .hang__face img { inset: 4%; width: 92%; height: auto; aspect-ratio: 1; border-radius: 12px; filter: none; }
.hang__face--model img { left: 4%; right: 4%; width: 92%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: 10px; filter: none; }
.hang [data-face="back"], .hang [data-face="model"] { opacity: 0; }
.hang[data-side="back"] [data-face="front"], .hang[data-side="model"] [data-face="front"] { opacity: 0; }
.hang[data-side="back"] [data-face="back"], .hang[data-side="model"] [data-face="model"] { opacity: 1; }
.hang[data-side="model"] .hang__hanger, .hang[data-side="model"] .hang__shell { opacity: 0; }
.rack.is-detail .hang__hanger { opacity: 0; }   /* the close-up shows just the piece */
.hang:focus-visible .hang__face img { filter: drop-shadow(0 0 1px var(--ink)); }

/* under the garment facing you: its price with the + for the quick add, then its name; they glide along with it */
.rack__card { position: absolute; z-index: 70; left: 50%; top: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; white-space: nowrap; text-align: center;
  transition: transform .85s var(--e), opacity .4s; }
.rack.is-detail .rack__card { opacity: 0; pointer-events: none; }
.rack__label { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.rack__label span { color: var(--soft); letter-spacing: .06em; text-transform: none; font-weight: 400; }
.rack .piece__buy { margin: 0; color: var(--ink); }
.rack .piece__price, .rack .piece__plus { color: var(--ink); }
.rack .piece__plus:focus-visible { outline-color: var(--ink); }
.rack__state { font-size: 9.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--soft); }
.rack__state:empty { display: none; }
.rack__under { position: relative; height: 164px; }
.rack__browse, .rack__info { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 16px 0; text-align: center; transition: opacity .45s, transform .6s var(--e); }
.rack__look { padding: 10px 20px; border: 1px solid rgba(238, 236, 230, .42); border-radius: 999px; font: 600 9.5px/1 var(--body); letter-spacing: .22em; text-transform: uppercase; transition: background .25s, color .25s, border-color .25s; }
.rack__look:hover { background: var(--ink); border-color: var(--ink); color: #1d1e20; }
.rack__info { opacity: 0; transform: translateY(10px); pointer-events: none; gap: 8px; padding-top: 0; }
.rack__name { font: 700 clamp(14px, 1.2vw, 17px)/1.15 var(--body); letter-spacing: .05em; text-transform: uppercase; }
.rack__name span { color: var(--soft); font-weight: 400; letter-spacing: .03em; text-transform: none; }
.rack__colors { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; }
.rack__colors:empty { display: none; }
.swatch { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.swatch::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); transition: scale .35s var(--e); }
.swatch::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; border: 1px solid var(--ink); opacity: 0; scale: .75; transition: opacity .3s ease, scale .45s var(--e); }
.swatch[aria-pressed="true"]::after { opacity: 1; scale: 1; }
.swatch:hover::before { scale: 1.12; }
.swatch:focus-visible { outline: 1px solid var(--ink); outline-offset: 1px; }
.rack__views { display: flex; justify-content: center; gap: 8px; }
.rack__views:empty { display: none; }
.view { width: 38px; height: 46px; padding: 4px; border-radius: 5px; border: 1px solid rgba(238, 236, 230, .16); background: rgba(238, 236, 230, .05); overflow: hidden; transition: border-color .3s, background .3s; -webkit-tap-highlight-color: transparent; }
.view img { display: block; width: 100%; height: 100%; object-fit: contain; }
.view img:not([src]) { visibility: hidden; }
.view--photo { padding: 0; }
.view--photo img { object-fit: cover; }
.view:hover { border-color: rgba(238, 236, 230, .42); }
.view[aria-pressed="true"] { border-color: var(--ink); background: rgba(238, 236, 230, .1); }
.view:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

/* a piece brought forward: the rail and the browsing labels step back, the arrows come in */
.rack__x, .rack__arrow { opacity: 0; pointer-events: none; transition: opacity .45s; }
.rack__x { position: absolute; z-index: 60; right: clamp(16px, 3vw, 44px); top: clamp(14px, 2.2vw, 26px); display: flex; align-items: center; gap: 6px; padding: 6px 0; font: 600 10px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; }
.rack__x span { font-size: 17px; font-weight: 400; letter-spacing: 0; }
.rack__arrow { position: absolute; z-index: 60; top: 44%; left: clamp(12px, 4vw, 60px); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(238, 236, 230, .35); background: rgba(30, 31, 33, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .45s, background .25s, color .25s; }
.rack__arrow--next { left: auto; right: clamp(12px, 4vw, 60px); }
.rack__arrow:hover { background: var(--ink); color: #1d1e20; border-color: var(--ink); }
.rack.is-detail .rack__rail { opacity: 0; }
.rack.is-detail .rack__x, .rack.is-detail .rack__arrow { opacity: 1; pointer-events: auto; transition-delay: .25s; }
.rack.is-single .rack__arrow { display: none; }
.rack.is-detail .rack__browse { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.rack.is-detail .rack__info { opacity: 1; transform: none; pointer-events: auto; transition-delay: .18s; }


/* ---------- below the rack: the wall fades into the green, and that gender's pieces float there as in the shop ---------- */
.gshop { position: relative; padding: 22vh 0 clamp(70px, 9vw, 140px); padding-top: 22svh; transition: opacity .4s;
  background: url(/shared/grain.png), linear-gradient(180deg,
    #232426 0, color-mix(in srgb, #232426 92%, var(--bg)) 3svh, color-mix(in srgb, #232426 78%, var(--bg)) 7svh, color-mix(in srgb, #232426 58%, var(--bg)) 11svh,
    color-mix(in srgb, #232426 36%, var(--bg)) 15svh, color-mix(in srgb, #232426 17%, var(--bg)) 19svh, color-mix(in srgb, #232426 5%, var(--bg)) 23svh, var(--bg) 27svh, var(--bg) 70%, var(--bg-deep) 100%); }
.gshop.is-swapping { opacity: 0; }
/* three broad swells of green rise up the wall as you scroll, so the edge is never a straight line */
.gshop__rise { position: absolute; left: 0; right: 0; top: -14vh; height: 60vh; overflow: hidden; pointer-events: none; }
.gshop__rise i { position: absolute; bottom: 0; left: var(--x); width: var(--w); height: 70%; margin-left: calc(var(--w) / -2); border-radius: 50%; transform-origin: 50% 100%;
  background: radial-gradient(closest-side, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 35%, color-mix(in srgb, var(--bg) 30%, transparent) 65%, transparent 100%);
  opacity: calc(.1 + var(--rise, 0) * .32); transform: translateY(calc((1 - var(--rise, 0)) * 30%)) scaleY(calc(.8 + var(--rise, 0) * .5)); }
.gshop__rise i:nth-child(1) { --x: 8%; --w: 80vw; }
.gshop__rise i:nth-child(2) { --x: 52%; --w: 70vw; height: 58%; }
.gshop__rise i:nth-child(3) { --x: 94%; --w: 84vw; height: 76%; }
/* the same pools of light and depth as behind the clothes in the shop, held in place as the pieces scroll over them */
.gshop__sky { position: sticky; top: 0; height: 100vh; height: 100svh; margin: -22svh 0 calc(-100svh + 22svh); pointer-events: none;
  opacity: calc(var(--rise, 0) * .7);
  background:
    radial-gradient(44% 78% at 108% 62%, var(--zone-deep) 0%, color-mix(in srgb, var(--zone-deep) 58%, transparent) 42%, transparent 74%),
    radial-gradient(40% 46% at -6% 104%, color-mix(in srgb, var(--zone-deep) 85%, transparent) 0%, transparent 72%),
    radial-gradient(44% 50% at 58% 46%, var(--zone-light) 0%, color-mix(in srgb, var(--zone-light) 36%, transparent) 55%, transparent 78%),
    radial-gradient(36% 40% at 14% 52%, var(--zone-mid) 0%, transparent 75%); }
.gshop .field { position: relative; z-index: 1; }
.gshop .piece { opacity: 0; transform: translateY(36px); transition: opacity .9s ease, transform 1.2s var(--ease); transition-delay: calc(var(--k, 0) * 90ms); }
.gshop .piece.is-in { opacity: 1; transform: none; }

/* ---------- the mission page ---------- */
.mpage { color: #17191b; background: url(/shared/grain.png), radial-gradient(80% 60% at 80% 0%, #fbfaf6 0%, transparent 70%), #f3f0e9; }
.mpage__in { box-sizing: border-box; min-height: 100%; max-width: 760px; margin: 0 auto; padding: clamp(48px, 10vh, 120px) 24px 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }   /* one short block in the middle of the page */
.mpage__eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: #6c6a64; }
.mpage__title { max-width: 24ch; margin: 22px 0 26px; font: 500 clamp(32px, 4.2vw, 56px)/1.06 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.mpage__text p { max-width: 36em; margin: 0 auto 1em; font-size: 17px; line-height: 1.7; color: #3d3c36; text-wrap: pretty; }
.mpage__given { margin: 10px 0 0; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: #6c6a64; }
.mpage__given:empty { display: none; }
.mpage__home { display: inline-flex; align-items: center; gap: 9px; margin-top: clamp(34px, 6vh, 64px); padding-bottom: 4px; border-bottom: 1px solid currentColor; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; }
.mpage__home svg { transition: transform .35s var(--ease); }
.mpage__home:hover svg { transform: translateX(-3px); }
/* the words rise in one after another as the page rolls down */
.mpage [data-rise] { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform 1.1s var(--ease); transition-delay: calc(.32s + var(--k, 0) * .11s); }
.mpage.is-in [data-rise] { opacity: 1; transform: none; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .nav__end { gap: 12px; }
  .nav__mission { font-size: 10px; letter-spacing: .1em; }
  .rack { min-height: 480px; }
  .rack__arrow { top: auto; bottom: 10px; width: 36px; height: 36px; }
  .rack__look { padding: 9px 16px; }
  .rack__under { height: 160px; }
  .swatch { width: 30px; height: 30px; }
  .mpage__text p { font-size: 16px; }
}
@media (max-width: 520px) {
  .nav__our { display: none; }
  .nav__end { gap: 4px; }
  .nav, html.is-scrolled .nav { padding: 0 10px; }
  .nav__links { gap: 10px; }
  .nav__links button, .nav__mission { font-size: 9.5px; letter-spacing: .08em; }
  .nav__brand { font-size: 13px; letter-spacing: .15em; padding-left: .15em; }
  .rack__x { right: auto; left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .gpage, .mpage, .gpage.is-open, .mpage.is-open { transition: none; }
  .hang, .hang__turn, .rack__row, .rack__card { transition: none; }
  .rack__stage { transform: none; opacity: 1; }
  .gshop .piece { opacity: 1; transform: none; transition: none; }
  .mpage [data-rise] { opacity: 1; transform: none; transition: none; }
}
