/* Kiosk: a large landscape screen. Designed at 1920×1080; every size is in --u (one design pixel), so it scales to
   whatever screen it's on. */

/*
  Typefaces of momu.be: Roobert (sans, everything) and Reckless (serif titles). They are licensed and momu.be
  doesn't serve them to other sites, so they load from kiosk/fonts/ when the files are there (or when they are
  installed on the kiosk); otherwise the fallbacks are momu.be's own (Helvetica Neue) and Instrument Serif.
*/
@font-face {
  font-family: Roobert;
  src: local('Roobert'), local('Roobert Regular'), url('fonts/Roobert-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Roobert;
  src: local('Roobert Bold'), local('Roobert-Bold'), url('fonts/Roobert-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Reckless;
  src: local('Reckless'), local('Reckless Regular'), url('fonts/Reckless-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  /* One design pixel: the kiosk is designed at 1920 × 1080 and scales to the screen it's on (a TV that isn't full HD,
     or a full HD one whose system scaling makes the browser smaller). On a 1920 × 1080 browser window it's 1px. */
  --u: min(calc(100vw / 1920), calc(100vh / 1080));
  --bg: #efebe4;
  --surface: #fbfaf7;
  --surface-glass: rgb(251 250 247 / 0.3); /* --surface, frosted: the home screen's welcome panel; the studio's panels are white */
  /* the home screen's panels: clearer glass, the room shows through (less blur, a little more colour) */
  --home-glass-filter: blur(calc(5 * var(--u))) saturate(1.25);
  --ink: #000;
  --ink-2: #57534e;
  --ink-3: #8a857e;
  --line: #ddd7cd;
  --frame: #e6e1d8;
  --accent: #e32118; /* momu.be red */
  --accent-rgb: 227 33 24;
  /* momu.be buttons: a soft shadow that turns red on hover */
  /* the buttons: white with a soft grey shadow; momu.be's red drop shadow only when pointed at (and, on a
     touchscreen, while pressed) */
  --btn-shadow: calc(8 * var(--u)) calc(10 * var(--u)) calc(37 * var(--u)) rgb(0 0 0 / 0.2);
  --btn-shadow-hover: calc(8 * var(--u)) calc(10 * var(--u)) calc(37 * var(--u)) rgb(var(--accent-rgb) / 0.43);
  --btn-shadow-active: calc(8 * var(--u)) calc(10 * var(--u)) calc(37 * var(--u)) rgb(var(--accent-rgb) / 0.7);
  --banner-h: calc(50 * var(--u));
  --head-h: calc(104 * var(--u)); /* the studio's header row: the brand on the left, the moodboard's title on the right */
  --on-ink: #fff;
  --shadow: 0 calc(18 * var(--u)) calc(40 * var(--u)) calc(-20 * var(--u)) rgb(30 24 16 / 0.45);
  --serif: Reckless, 'Instrument Serif', 'Times New Roman', Times, Georgia, serif;
  --sans: Roobert, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

html {
  font-size: calc(16 * var(--u)); /* rem sizes scale with the screen too */
}

body {
  margin: 0;
  overflow: hidden;
  /* the whole page: a couture atelier in soft daylight */
  background: var(--bg) url(images/atelier.jpg) center / cover no-repeat;
  color: var(--ink);
  font: calc(16 * var(--u))/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

:focus-visible {
  outline: calc(3 * var(--u)) solid var(--ink);
  outline-offset: calc(3 * var(--u));
}

.ico {
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- type ----------
  Three groups:
  - headline  .t-heading  section names (ARCHIVE, FABRICS): sans, bold, uppercase, big
  - title     .t-title    names of things (garment titles, dialogs): serif
  - subtext   .t-small    hints, labels, fabric names, numbers. Floats above the noise effect (see fx-lab/fx.js).
  .dot puts momu.be's black dot (".o-category", e.g. "Other upcoming activities") in front of a line.
*/

.t-heading {
  margin: 0;
  font: 700 clamp(1.35rem, 1.45vw, 1.9rem) / 1.05 var(--sans); /* sized so FABRICS fits its one-swatch-wide column */
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}

.t-title {
  margin: 0;
  font: 400 clamp(1.3rem, 1.4vw, 1.6rem) / 1.08 var(--serif);
}

.t-small {
  font-family: var(--sans);
  font-size: calc(15 * var(--u));
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.dot {
  display: flex;
  align-items: baseline;
}

.dot::before {
  content: '';
  flex: none;
  width: 0.78em;
  height: 0.78em;
  margin-right: 0.4em;
  border-radius: 50%;
  background: var(--ink);
  transform: translateY(0.06em);
}

.display {
  margin: 0;
  font: 400 clamp(4.5rem, 7.4vw, 8.5rem) / 0.88 var(--serif);
  letter-spacing: -0.015em;
}

.display em {
  font-style: italic;
}

.display-m {
  margin: 0;
  font: 400 clamp(2.4rem, 3vw, 3.6rem) / 0.95 var(--serif);
  letter-spacing: -0.01em;
}

.eyebrow:not(.t-small),
.label {
  font-size: calc(12 * var(--u));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- buttons ---------- */

/* momu.be's .o-btn: a white pill; on hover / press the text turns red and the shadow glows red */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(8 * var(--u));
  min-height: calc(50 * var(--u));
  padding: 0 calc(24 * var(--u));
  border: 0;
  border-radius: calc(999 * var(--u));
  background: #fff;
  color: var(--ink);
  box-shadow: var(--btn-shadow);
  font-family: var(--sans);
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  color: var(--accent);
  box-shadow: var(--btn-shadow-hover);
}

.btn:active {
  color: var(--accent);
  box-shadow: var(--btn-shadow-active);
}

.btn:focus-visible {
  outline: calc(3 * var(--u)) solid var(--accent);
}

/* ---------- the garment model (stacked render layers) ---------- */

.model {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  aspect-ratio: 2 / 3;
  transform: translateX(-50%);
}

/* soft shadow on the floor, under the stand */
.model::before {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  top: 87.5%;
  height: 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(40 30 20 / 0.22), transparent);
}

.layer {
  position: absolute;
  inset: 0;
  transition: filter 0.2s ease;
}

.layer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* A part = its fabric, masked to the part's silhouette, multiplied with the clay render's shading. */
.part {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.fabric {
  position: absolute;
  inset: 0 -40%;
  /* nudge the pattern as the garment turns, so the fabric seems to move with it */
  transform: translateX(calc(var(--angle, 0) * -3.5%));
}

.part img.shade {
  mix-blend-mode: multiply;
}

/* the part under the pointer, or where a dragged part will land: a strong red glow */
.layer.is-hover,
.layer.is-related {
  filter: drop-shadow(0 0 calc(1.5 * var(--u)) rgb(var(--accent-rgb))) drop-shadow(0 0 calc(10 * var(--u)) rgb(var(--accent-rgb) / 0.95))
    drop-shadow(0 0 calc(32 * var(--u)) rgb(var(--accent-rgb) / 0.75));
}

/* a part just put on (or re-dressed) flares red, then fades */
.layer.pulse {
  animation: pulse 1.4s ease-out;
}

@keyframes pulse {
  20% {
    filter: drop-shadow(0 0 calc(3 * var(--u)) rgb(var(--accent-rgb))) drop-shadow(0 0 calc(18 * var(--u)) rgb(var(--accent-rgb)))
      drop-shadow(0 0 calc(48 * var(--u)) rgb(var(--accent-rgb) / 0.9));
  }
}

/* ---------- attract / pairing ---------- */

/* screens are absolute, not fixed: a fixed box would trap its subtext under the noise canvas */
.attract {
  position: absolute;
  inset: var(--banner-h) 0 0;
  display: grid;
  grid-template-columns: minmax(calc(380 * var(--u)), 1.05fr) minmax(calc(300 * var(--u)), 0.9fr) minmax(calc(340 * var(--u)), calc(440 * var(--u)));
  align-items: center;
  gap: 3vw;
  padding: 6vh 5vw;
}

/* the home screen's glass, behind the welcome text: the studio's tint (--surface-glass), clearer
   (--home-glass-filter); shaped like the QR card */
.attract-copy {
  background: var(--surface-glass);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--home-glass-filter);
  backdrop-filter: var(--home-glass-filter);
}

.attract-copy {
  display: flex;
  flex-direction: column;
  gap: calc(28 * var(--u));
  padding: calc(40 * var(--u)) calc(44 * var(--u)) calc(44 * var(--u));
}

/* "Remix / the archive." on two lines, inside the panel */
.attract-copy .display {
  font-size: calc(118 * var(--u));
}

.attract-copy .display em {
  white-space: nowrap;
}

.attract-copy > .eyebrow {
  font-size: calc(18 * var(--u));
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.steps {
  display: grid;
  gap: calc(14 * var(--u));
  margin: calc(10 * var(--u)) 0 0;
  padding: 0;
  list-style: none;
  font-size: calc(23 * var(--u));
}

.steps li {
  display: flex;
  align-items: center;
  gap: calc(14 * var(--u));
}

.steps .step-num {
  display: grid;
  place-items: center;
  width: calc(42 * var(--u));
  height: calc(42 * var(--u));
  flex: none;
  border-radius: calc(999 * var(--u));
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
  font-size: calc(18 * var(--u));
}

.attract-stage {
  position: relative;
  justify-self: center;
  width: min(100%, 84vh);
  aspect-ratio: 1;
}

/* The example mannequin on a white card cut to its size, like the QR card next to it: the doll with the widest
   garment (the kimono's sleeves) plus a margin. In the render frame (640 × 960) that's x 37–596, y 53–942. */
.attract-stage.stage-look {
  width: auto;
  max-width: 100%;
  height: min(84vh, calc(700 * var(--u)));
  aspect-ratio: 559 / 889;
  background: radial-gradient(ellipse 75% 60% at 50% 45%, #fff, var(--surface) 70%, #f0ebe3);
  box-shadow: var(--shadow);
}

.attract-stage .model {
  top: -5.96%; /* the frame's y 53 at the card's top: 53 / 889 */
  left: 50.63%; /* the garments' middle (x 316.5) in the card's middle */
  height: 107.99%; /* 960 / 889 */
}

.pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(16 * var(--u));
}

.pair-card {
  width: 100%;
  padding: calc(32 * var(--u)) calc(32 * var(--u)) calc(30 * var(--u));
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.qr {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: calc(22 * var(--u));
  padding: calc(14 * var(--u));
  background: #fff;
}

.qr svg {
  width: 100%;
  height: 100%;
}

.qr.is-loading {
  background: linear-gradient(90deg, #f0ece5, #f8f6f2, #f0ece5) 0 0 / 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.pair-title {
  font: 400 2rem/1.05 var(--serif);
}

.pair-sub {
  margin-top: calc(8 * var(--u));
  color: var(--ink-2);
}

.pair-demo {
  margin-top: calc(18 * var(--u));
}

/* on the card, under Go to demo */
.pair-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(10 * var(--u));
  min-height: calc(24 * var(--u));
  margin-top: calc(16 * var(--u));
  color: var(--ink-2);
  font-size: calc(15 * var(--u));
  line-height: 1.35;
  text-align: left;
}

.pair-status::before {
  content: '';
  width: calc(9 * var(--u));
  height: calc(9 * var(--u));
  flex: none;
  border-radius: calc(999 * var(--u));
  background: #3a9a63;
  animation: breathe 2s ease-in-out infinite;
}

.pair-status.warn {
  color: var(--accent);
}

.pair-status.warn::before {
  background: var(--accent);
  animation: none;
}

.pair-status:empty::before {
  display: none;
}

.pair-url {
  max-width: 100%;
  margin-top: calc(6 * var(--u));
  overflow: hidden;
  font: calc(13 * var(--u))/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes breathe {
  50% {
    opacity: 0.35;
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- studio ---------- */

.studio {
  position: absolute;
  inset: var(--banner-h) 0 0;
  display: grid;
  /* archive and fabrics: one card per row, so the columns are narrow and the mannequin gets the room */
  grid-template-columns: clamp(calc(200 * var(--u)), 13vw, calc(300 * var(--u))) clamp(calc(130 * var(--u)), 8.5vw, calc(200 * var(--u))) minmax(0, 1fr) clamp(calc(240 * var(--u)), 24vw, calc(520 * var(--u)));
  grid-template-rows: var(--head-h) minmax(0, 1fr);
}

/* the moodboard folded away (as the studio starts): a narrow strip on the right; the stage gets the room.
   Opening it is instant (no widening: that slid its white panel and the buttons under the mannequin across) */
.studio.board-collapsed {
  grid-template-columns: clamp(calc(200 * var(--u)), 13vw, calc(300 * var(--u))) clamp(calc(130 * var(--u)), 8.5vw, calc(200 * var(--u))) minmax(0, 1fr) calc(68 * var(--u));
}

/* left: configuration */

.studio-head {
  grid-column: 1 / 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  padding: 0 calc(14 * var(--u));
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: #fff;
}

/* MMMix: momu.be's MM, then "mix" in type on the same baseline. As wide as the header allows. */
.brand {
  flex: 1;
  min-width: 0;
  color: var(--ink);
}

.brand-mark {
  display: block;
  width: 100%;
  height: auto;
}

.brand-ix {
  font: 700 164px var(--sans);
}

.btn-sm {
  min-height: calc(42 * var(--u));
  padding: 0 calc(18 * var(--u));
  font-size: calc(15 * var(--u));
  text-transform: uppercase;
}

.col {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--ink);
  background: #fff;
}

.outfits-col {
  grid-column: 1;
}

.fabrics-col {
  grid-column: 2;
}

.col-head {
  padding: calc(20 * var(--u)) calc(14 * var(--u)) calc(14 * var(--u));
}

.col-hint {
  margin-top: calc(8 * var(--u));
}

.col-scroll {
  flex: 1;
  min-height: 0;
  padding: calc(4 * var(--u)) calc(14 * var(--u)) calc(24 * var(--u));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none; /* still scrolls by swiping, without a visible scrollbar */
  touch-action: pan-y; /* vertical swipes scroll, sideways drags pick things up */
}

.col-scroll::-webkit-scrollbar {
  display: none;
}

/* outfit mannequins */

.outfit-list {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: calc(18 * var(--u)) calc(12 * var(--u));
}

.outfit-stage {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 42%, #fff, var(--frame));
}

/* the doll (and whatever it wears) casts a soft shadow onto the card, down and to the right */
.outfit-stage .model {
  filter: drop-shadow(calc(6 * var(--u)) calc(8 * var(--u)) calc(5 * var(--u)) rgb(40 30 20 / 0.5));
}

/* liked on the phone: the MoMu Favorites heart, filled, plain (no badge) in the card's corner */
.liked {
  position: absolute;
  top: calc(10 * var(--u));
  right: calc(10 * var(--u));
  z-index: 3;
  display: grid;
  color: var(--accent);
  filter: drop-shadow(0 calc(1 * var(--u)) calc(2 * var(--u)) rgb(0 0 0 / 0.25));
  pointer-events: none; /* grabbing a part works right under it */
}

.liked svg {
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  fill: currentColor;
}

/* the hovered part's name: just red text */
.outfit-tip {
  position: absolute;
  top: calc(10 * var(--u));
  left: calc(12 * var(--u));
  right: calc(12 * var(--u));
  z-index: 2;
  color: var(--accent);
  font-size: calc(15 * var(--u));
  white-space: nowrap;
  pointer-events: none;
}

.outfit-text {
  padding: calc(8 * var(--u)) calc(4 * var(--u)) 0;
}

.outfit-title {
  margin: calc(2 * var(--u)) 0 0;
  font: 400 calc(18 * var(--u))/1.2 var(--sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outfit .eyebrow {
  font-size: calc(13 * var(--u));
  color: var(--ink);
}

.outfits-note {
  grid-column: 1 / -1;
  color: var(--ink-2);
}

.model.over-part,
.outfit-photo.over-part {
  cursor: grab;
}

.layer.is-lifted {
  opacity: 0.2;
}

/* an archive card shown as the garment's photo; its parts are regions you can grab */
.outfit-photo {
  position: absolute;
  inset: 0;
}

.outfit-photo img,
.outfit-photo svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.outfit-photo img {
  object-fit: contain; /* the whole photo in the square card; the svg uses the same fit (meet), so the regions stay on the garment */
}

.outfit-photo [data-part] {
  fill: transparent;
  stroke: transparent;
  stroke-width: 3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

/* the part under the pointer: outlined in red, like the mannequin's glow */
.outfit-photo [data-part].is-hover {
  fill: rgb(var(--accent-rgb) / 0.12);
  stroke: var(--accent);
}

/* picked up: the part fades out of the photo while it's being carried */
.outfit-photo [data-part].is-lifted {
  fill: rgb(251 250 247 / 0.75);
  stroke: transparent;
}

/* fabrics */

.fabric-list {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: calc(16 * var(--u));
}

.swatch-btn {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  cursor: grab;
}

.swatch {
  display: block;
  aspect-ratio: 1;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
  outline: calc(2 * var(--u)) solid transparent;
  outline-offset: calc(2 * var(--u));
  transition: outline-color 0.15s ease;
}

/* hovered / picked: a red outline, nothing moves */
.swatch-btn:hover .swatch,
.swatch-btn:active .swatch,
.swatch-btn.is-selected .swatch {
  outline-color: var(--accent);
}

.swatch-btn.is-selected .swatch {
  outline-width: calc(3 * var(--u));
}

.swatch-btn:focus-visible {
  outline: none;
}

.swatch-btn:focus-visible .swatch {
  outline: calc(3 * var(--u)) solid var(--accent);
}

.fabric-name {
  display: -webkit-box;
  hyphens: auto;
  overflow-wrap: break-word;
  margin-top: calc(8 * var(--u));
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.swatch-btn.is-selected .fabric-name {
  color: var(--accent);
}

/* middle: the visitor's mannequin */

.stage {
  grid-column: 3;
  grid-row: 1 / 3;
  position: relative;
  min-width: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.stage-look {
  background: radial-gradient(ellipse 60% 72% at 50% 48%, #fdfcf9 0%, #f3efe8 55%, var(--bg) 100%);
}

/* a soft light behind the mannequin: centred on it (it stands on the photo's spot, --over-bg-x), not on the stage,
   which is wider or narrower as the moodboard is folded away or open */
.studio .stage-look {
  background: radial-gradient(ellipse calc(440 * var(--u)) calc(600 * var(--u)) at var(--over-bg-x, 50%) 45%, rgb(255 255 255 / 0.55), transparent 70%);
}

.stage .model {
  /* Stands exactly over the dress form in the background photo: kiosk.js (placeOverBackground) sets these
     from the window size, as the photo covers the window. The fallbacks are for before it has run. */
  top: var(--over-bg-top, calc(28 * var(--u)));
  left: var(--over-bg-x, 50%);
  height: var(--over-bg-h, calc(100% - calc(152 * var(--u))));
}

/* Start over, then (further apart) Create pattern · Book workshop: one row, centred under the mannequin's stand */
.stage-actions {
  position: absolute;
  left: var(--over-bg-x, 50%); /* under the mannequin, wherever the moodboard leaves the stage's middle */
  bottom: calc(24 * var(--u));
  z-index: 2;
  display: flex;
  gap: calc(14 * var(--u));
  white-space: nowrap;
  transform: translateX(-50%);
}

.stage-actions [data-action="end"] {
  margin-right: calc(34 * var(--u)); /* with the gap: more room between Start over and the next steps */
}

/* What to do and what a drop will do, for screen readers only: on screen, the archive's hint says it. */
.stage-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* right: the moodboard (see below), the left bar mirrored: a rule on its inner side, its header rule level with
   the one under the brand. Frosted like the left bar, so the atelier stays visible through both. */

.context {
  grid-column: 4;
  grid-row: 1 / 3;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding-bottom: calc(24 * var(--u));
  border-left: 1px solid var(--ink);
  background: #fff;
}

/* ---------- create pattern: sizes, the pattern drafted live, the tech sheet ---------- */

.pattern {
  position: absolute;
  inset: var(--banner-h) 0 0;
  display: grid;
  /* the studio's columns: the sizes where the archive and fabrics are, the tech sheet where the moodboard is */
  grid-template-columns: clamp(calc(200 * var(--u)), 13vw, calc(300 * var(--u))) clamp(calc(130 * var(--u)), 8.5vw, calc(200 * var(--u))) minmax(0, 1fr) clamp(calc(240 * var(--u)), 24vw, calc(520 * var(--u)));
  grid-template-rows: var(--head-h) minmax(0, 1fr);
}

.sizes-col {
  grid-column: 1 / 3;
}

.sizes-body {
  display: flex;
  flex-direction: column;
  gap: calc(28 * var(--u));
  padding-top: calc(8 * var(--u));
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(10 * var(--u));
}

/* momu.be pills; the chosen size is black */
.size-btn {
  min-height: calc(48 * var(--u));
  border: 0;
  border-radius: calc(999 * var(--u));
  background: #fff;
  box-shadow: var(--btn-shadow);
  color: var(--ink);
  font: 400 calc(18 * var(--u))/1 var(--sans);
  transition: color 0.15s ease, box-shadow 0.2s ease;
}

.size-btn:hover,
.size-btn:focus-visible {
  color: var(--accent);
  box-shadow: var(--btn-shadow-hover);
}

.size-btn.is-on {
  background: var(--ink);
  color: #fff;
}

.measures {
  display: grid;
  gap: calc(20 * var(--u));
}

.measure {
  display: grid;
  gap: calc(4 * var(--u));
  font: 400 calc(15 * var(--u))/1.2 var(--sans);
}

.measure-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.measure-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* big enough to drag with a finger */
.measure input {
  width: 100%;
  height: calc(32 * var(--u));
  margin: 0;
  accent-color: var(--accent);
  touch-action: none;
}

/* the middle: a sheet of pattern paper with the pieces */
.sheet-stage {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: calc(26 * var(--u)) calc(30 * var(--u)) calc(30 * var(--u));
}

.sheet-paper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.sheet-head {
  padding: calc(18 * var(--u)) calc(22 * var(--u)) calc(12 * var(--u));
  border-bottom: 1px solid var(--line);
}

.sheet-head .t-small {
  margin-top: calc(6 * var(--u));
}

.sheet {
  flex: 1;
  min-height: 0;
  padding: calc(10 * var(--u)) calc(14 * var(--u)) calc(14 * var(--u));
}

.sheet-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* a real pattern package: its pattern sheet (the whole A3 page, in view) */
.sheet-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* with a 3D model: the garment, turning, beside its pattern sheet */
.sheet-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: calc(14 * var(--u));
  height: 100%;
}

.sheet-3d {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #fff 0%, #f1ede6 100%);
}

.sheet-3d model-viewer {
  flex: 1;
  width: 100%;
  min-height: 0;
  --poster-color: transparent;
  --progress-bar-height: 0px; /* "Loading the 3D model…" says it instead */
}

.sheet-3d figcaption {
  position: absolute;
  left: calc(14 * var(--u));
  bottom: calc(12 * var(--u));
}

.model-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--ink-2);
}

.model-loading {
  pointer-events: none;
}

/* its one size: measurements and allowances in the left column */
.package-size {
  display: grid;
  gap: calc(22 * var(--u));
  margin-top: calc(28 * var(--u));
  padding-top: calc(22 * var(--u));
  border-top: 1px solid var(--ink);
}

.package-note {
  margin-top: calc(8 * var(--u));
}

/* readable on the glass, as in the tech sheet */
.package-size .label {
  color: var(--ink);
}

/* the right: the tech sheet, as in the PDF: on white paper, not frosted glass */
.tech-col {
  padding-bottom: calc(96 * var(--u)); /* room for Back / Download PDF */
  background: #fff;
}

.tech-body {
  flex: 1;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: calc(22 * var(--u));
  padding: calc(20 * var(--u)) calc(14 * var(--u)) calc(24 * var(--u));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
}

.tech-body::-webkit-scrollbar {
  display: none;
}

.tech-design {
  display: grid;
  grid-template-columns: 36% 1fr;
  gap: calc(16 * var(--u));
  align-items: start;
}

.tech-image {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--frame);
}

/* a package's render: the whole figure, on the white sheet */
.tech-image.is-cutout {
  object-fit: contain;
  background: none;
}

.tech-name {
  margin-bottom: calc(2 * var(--u));
}

.tech-name + .t-small {
  margin-bottom: calc(12 * var(--u));
  color: var(--ink-2);
}

.tech-list a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.tech-list a:hover,
.tech-list a:focus-visible {
  color: var(--accent);
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 calc(15 * var(--u))/1.3 var(--sans);
}

.tech-table th {
  padding: 0 calc(10 * var(--u)) calc(10 * var(--u)) 0;
  font-weight: 700;
  text-align: left;
  vertical-align: top;
}

.tech-table td {
  padding: 0 0 calc(10 * var(--u));
  vertical-align: top;
}

.tech-table small {
  display: block;
  margin-top: calc(2 * var(--u));
  color: var(--ink);
  font-size: calc(13.5 * var(--u));
}

.tech-list {
  margin: calc(8 * var(--u)) 0 0;
  padding: 0;
  list-style: none;
  font: 400 calc(15 * var(--u))/1.35 var(--sans);
}

.tech-list li {
  display: flex;
  justify-content: space-between;
  gap: calc(10 * var(--u));
  padding: calc(4 * var(--u)) 0;
  border-bottom: 1px solid rgb(0 0 0 / 0.08);
}

.tech-list li > span:last-child:not(:first-child) {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tech-body .label {
  color: var(--ink);
}

.tech-fabric {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
}

.tech-swatch {
  flex: none;
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
}

.tech-list .is-estimate {
  font-style: italic;
}

/* Back / Download PDF: bottom right, on the line of the studio's buttons under the mannequin */
.tech-col .context-actions {
  position: absolute;
  left: calc(14 * var(--u));
  right: calc(14 * var(--u));
  bottom: calc(24 * var(--u));
  z-index: 2;
  display: flex;
  flex-wrap: wrap; /* Back · Plotter files · Download PDF: on two rows if they ever don't fit */
  justify-content: flex-end;
  gap: calc(10 * var(--u));
}

/* the main action of a screen: a black pill */
.btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* dragging */

.ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  pointer-events: none;
  filter: drop-shadow(0 calc(18 * var(--u)) calc(24 * var(--u)) rgb(30 24 16 / 0.28));
  transition: opacity 0.15s ease;
  will-change: transform;
}

.ghost .model {
  inset: 0;
  left: 0;
  height: 100%;
  width: 100%;
  transform: none;
}

.ghost .model::before {
  display: none;
}

.ghost.faded {
  opacity: 0.12;
}

.ghost-swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: calc(999 * var(--u));
  box-shadow: 0 0 0 calc(4 * var(--u)) #fff;
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
}

/* ---------- overlays ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(110 * var(--u));
  z-index: 40;
  padding: calc(16 * var(--u)) calc(24 * var(--u));
  border-radius: calc(999 * var(--u));
  background: #fff;
  color: var(--ink);
  font-size: calc(17 * var(--u));
  box-shadow: var(--btn-shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(16 * var(--u)));
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.idle {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgb(22 20 18 / 0.5);
  -webkit-backdrop-filter: blur(calc(6 * var(--u)));
  backdrop-filter: blur(calc(6 * var(--u)));
}

.idle-card {
  display: grid;
  justify-items: center;
  gap: calc(14 * var(--u));
  padding: calc(44 * var(--u)) calc(56 * var(--u));
  border-radius: calc(28 * var(--u));
  background: var(--surface);
  text-align: center;
  font-size: calc(18 * var(--u));
}

/* opacity only and no lasting fill: a running transform/opacity makes a stacking context, which would hold the
   subtext under the noise effect */
.screen.enter {
  animation: enter 0.5s ease backwards;
}

@keyframes enter {
  from {
    opacity: 0;
  }
}

.too-small {
  display: none;
}

@media (max-width: 699px) {
  .screen,
  .idle {
    display: none !important;
  }

  .too-small {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(16 * var(--u));
    padding: calc(32 * var(--u));
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- banner (momu.be's marquee) ---------- */

.banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5; /* over the screens; the noise effect runs over it */
  height: var(--banner-h);
  overflow: hidden;
  background: #fff;
  /* momu.be's red drop shadow under the banner, onto the screens (on its box only: the text has none) */
  box-shadow: 0.4rem 0.6rem 2rem 0 rgb(255 0 0 / 0.5);
}

.banner-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: marquee 160s linear infinite;
}

/* as on momu.be: hovering the banner pauses it */
.banner:hover .banner-track {
  animation-play-state: paused;
}

.banner-run {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: calc(107 * var(--u));
  padding-right: calc(107 * var(--u));
}

.banner-run span {
  font: 400 calc(25 * var(--u))/1.2 var(--sans);
  color: var(--accent);
  white-space: nowrap;
}

/* go fullscreen: over the banner's right end, a small round white button with the red shadow */
.fullscreen-btn {
  position: absolute;
  top: calc(7 * var(--u));
  right: calc(10 * var(--u));
  z-index: 6; /* over the banner */
  display: grid;
  place-items: center;
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--btn-shadow);
  color: var(--ink);
  transition: color 0.15s ease, box-shadow 0.2s ease;
}

.fullscreen-btn:hover,
.fullscreen-btn:focus-visible {
  color: var(--accent);
  box-shadow: var(--btn-shadow-hover);
}

.fullscreen-btn svg {
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- moodboard (right column) ----------
  The stories of the garments the visitor used: a pile of pictures each, dealt out in a row on hover / tap. Panel
  and header copy the left bar's (.studio-head, .col). The board and the story note are .fx-above
  in the markup: when the noise effect runs over the whole page (no body.fx-bg) they stay crisp over it.
*/

/* the header band: as tall as the brand's, so its rule continues the one under the brand */
/* the strip: the whole of it is the button that opens the moodboard */
.board-open {
  display: none;
}

.studio.board-collapsed .context > :not(.board-open) {
  display: none;
}

.studio.board-collapsed .board-open {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(22 * var(--u));
  padding: calc(28 * var(--u)) 0;
  border: 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.board-chevron,
.board-close {
  display: grid;
  place-items: center;
  width: calc(40 * var(--u));
  height: calc(40 * var(--u));
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--btn-shadow);
  color: var(--ink);
  transition: color 0.15s ease, box-shadow 0.2s ease;
}

.board-chevron svg,
.board-close svg {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
}

.board-open:hover .board-chevron,
.board-open:focus-visible .board-chevron,
.board-close:hover,
.board-close:focus-visible {
  color: var(--accent);
  box-shadow: var(--btn-shadow-hover);
}

.board-open-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg); /* read from the bottom up */
  font: 700 calc(24 * var(--u)) / 1 var(--sans);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.board-open:hover .board-open-label {
  color: var(--accent);
}

/* the strip's folders, as in a drawer: each shows only its last 20px (its tab, its top edge, a sliver of its first
   picture), the newest in front at the bottom; a new one slides just those 20px in */
.strip-files {
  --folder: #e9e2d3;
  --folder-front: #f2ede3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: calc(50 * var(--u));
  min-height: 0;
  margin-top: auto;
  overflow: hidden;
  padding-top: calc(6 * var(--u));
}

.strip-files:empty {
  display: none;
}

.strip-file {
  position: relative;
  flex: none;
  height: calc(20 * var(--u));
}

.strip-file:last-child {
  height: calc(54 * var(--u)); /* the one in front shows whole */
}

/* the tab */
.strip-file::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(5 * var(--u));
  width: calc(20 * var(--u));
  height: calc(6 * var(--u));
  border: 1px solid var(--ink);
  border-bottom: 0;
  background: var(--folder);
}

.strip-body {
  position: absolute;
  top: calc(5 * var(--u));
  left: 0;
  right: 0;
  height: calc(49 * var(--u));
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--folder);
}

.strip-body img {
  position: absolute;
  top: calc(4 * var(--u));
  left: calc(6 * var(--u));
  width: calc(36 * var(--u));
  height: calc(44 * var(--u));
  object-fit: cover;
  box-shadow: 0 calc(2 * var(--u)) calc(4 * var(--u)) rgb(30 24 16 / 0.35);
}

/* the front one's flap */
.strip-file:last-child .strip-body::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(16 * var(--u));
  border-top: 1px solid var(--ink);
  background: var(--folder-front);
}

/* the strip, per piece too: a little room before another piece's folders */
.strip-file.is-next-piece {
  margin-top: calc(10 * var(--u));
}

.strip-file.is-new {
  animation: file-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--k, 0) * 90ms);
}

@keyframes file-in {
  from {
    transform: translateY(calc(20 * var(--u)));
    opacity: 0;
  }
}

/* opened: the moodboard's content fades in where it stands; its head has the button to fold it away again */
.studio:not(.board-collapsed) .context > .context-head,
.studio:not(.board-collapsed) .context > .board {
  animation: board-in 0.2s ease both;
}

@keyframes board-in {
  from {
    opacity: 0;
  }
}

.board-close {
  position: absolute;
  top: calc((var(--head-h) - 40 * var(--u)) / 2);
  right: calc(14 * var(--u));
}

#context .context-head {
  position: relative;
  padding-right: calc(68 * var(--u));
}

.context-head {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: var(--head-h);
  padding: 0 calc(14 * var(--u));
  border-bottom: 1px solid var(--ink);
}

.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(150 * var(--u)), 1fr));
  align-content: start;
  gap: calc(28 * var(--u)) calc(22 * var(--u)); /* room for the pictures peeking out of the piles */
  padding: calc(24 * var(--u)) calc(22 * var(--u)) calc(28 * var(--u));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none; /* still scrolls by swiping, without a visible scrollbar */
  touch-action: pan-y;
  scroll-snap-type: y proximity; /* a scroll comes to rest at a pile */
  scroll-padding-top: calc(24 * var(--u));
  /* the last row fades out at the bottom edge: there's more below */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28 * var(--u)), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28 * var(--u)), transparent);
}

.board::-webkit-scrollbar {
  display: none;
}

/* the board, grouped per piece: a row with the garment's name and MoMu number over its folders */
.board-piece {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(12 * var(--u));
  margin-bottom: calc(-10 * var(--u)); /* close to its folders */
  padding-bottom: calc(8 * var(--u));
  border-bottom: 1px solid var(--ink);
  scroll-snap-align: start;
}

.board-piece:not(:first-child) {
  margin-top: calc(14 * var(--u)); /* more room above it than under it: it belongs to the folders below */
}

.board-piece-name {
  font: 700 calc(18 * var(--u)) / 1.1 var(--sans);
  text-transform: uppercase;
}

.board-piece .t-small {
  color: var(--ink-2);
  white-space: nowrap;
}

.board-piece.pops {
  animation: pop-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1) backwards;
}

/* a story on the board: an archive folder with its pictures in it */
.pin-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
}

.pin-pile {
  position: relative;
  isolation: isolate; /* its pictures' and flap's z-index stay inside the folder: the open story lies over all folders */
  display: block;
  aspect-ratio: 2 / 3;
}

/* the pictures stand in the folder, the first in front, the others a little askew behind it (--tilt, from kiosk.js);
   2:3 like the folder, so they deal out into the row at full size */
.pin-pic,
.fan-pic {
  overflow: hidden;
  background: var(--frame);
}

.pin-pic {
  position: absolute;
  top: 12%;
  left: 8%;
  width: 84%;
  height: 84%;
  box-shadow: 0 calc(4 * var(--u)) calc(10 * var(--u)) calc(-4 * var(--u)) rgb(30 24 16 / 0.45);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* the folder: a back with a tab (the story's title), and a front flap with a thumb notch over the pictures */
.folder {
  --folder: #e9e2d3;
  --folder-front: #f2ede3;
  perspective: calc(700 * var(--u)); /* for the flap, swinging open */
}

.folder-back,
.folder-front {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid var(--ink);
}

.folder-back {
  top: 9%;
  background: var(--folder);
}

.folder-tab {
  position: absolute;
  top: calc(9% - 24 * var(--u) + 1px);
  left: calc(10 * var(--u));
  box-sizing: border-box;
  min-width: 42%;
  max-width: calc(100% - 20 * var(--u)); /* a long title ends in "…" */
  height: calc(24 * var(--u));
  padding: 0 calc(10 * var(--u));
  overflow: hidden;
  border: 1px solid var(--ink);
  border-bottom: 0;
  background: var(--folder);
  font: 700 calc(12 * var(--u)) / calc(23 * var(--u)) var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-front {
  z-index: 100; /* over every picture */
  height: 26%; /* low: the front picture shows almost whole */
  background: var(--folder-front);
  box-shadow: 0 calc(-6 * var(--u)) calc(14 * var(--u)) calc(-8 * var(--u)) rgb(30 24 16 / 0.4);
  transform-origin: 50% 100%;
  transition: transform 0.4s cubic-bezier(0.3, 0.7, 0.2, 1.1);
  /* a thumb notch in the flap's top edge */
  -webkit-mask: radial-gradient(circle at 50% 0, transparent calc(12 * var(--u)), #000 calc(12 * var(--u) + 0.5px));
  mask: radial-gradient(circle at 50% 0, transparent calc(12 * var(--u)), #000 calc(12 * var(--u) + 0.5px));
}

.pin-pic img,
.fan-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* a pointer over a folder: its pictures rise a little out of it (not on touch screens, where it would stick after a tap) */
@media (hover: hover) {
  .pin-card:hover .pin-pic {
    transform: translateY(calc(min(0, var(--k, 0) * 4 - 14) * var(--u))) rotate(var(--tilt, 0deg)); /* the front one most */
  }
}

.pin-card:focus-visible {
  outline: none;
}

.pin-card:focus-visible .pin-pile {
  outline: calc(3 * var(--u)) solid var(--accent);
  outline-offset: calc(6 * var(--u));
}

/* dealt out: the folder stays, open and empty; its flap swings down towards you, the inside of the back shows */
.pin-card.is-fanned .pin-pic {
  visibility: hidden;
}

.pin-card.is-fanned .folder-front {
  transform: rotateX(-62deg);
}

.pin-card.is-fanned .folder-back {
  background: linear-gradient(to bottom, var(--folder) 55%, #dcd3c0);
}

/* a garment's new piles pop onto the board, one after another */
.pin-card.pops {
  animation: pop-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) backwards;
  animation-delay: calc(var(--i, 0) * 120ms);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(calc(14 * var(--u))) scale(0.7);
  }
}

/* a pile dealt out: its pictures in a row over the stage, leftwards from the pile (positions from kiosk.js) */
.fan {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 35;
  pointer-events: none;
}

.fan-pic {
  position: absolute;
  top: 0;
  left: 0;
  box-shadow: calc(8 * var(--u)) calc(10 * var(--u)) calc(30 * var(--u)) rgb(0 0 0 / 0.28);
  pointer-events: auto;
  transform-origin: 50% 50%;
  transition: transform 0.34s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pin-card.wiggle {
  animation: wiggle 0.7s ease;
}

@keyframes wiggle {
  20% {
    transform: rotate(-5deg);
  }
  45% {
    transform: rotate(4deg);
  }
  70% {
    transform: rotate(-2deg);
  }
}

/* the story behind a pile: a small panel like the archive and the moodboard (the same glass, rules and corners,
   col-head / col-scroll inside), on the stage just outside the moodboard (kiosk.js places it) */
.note {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 36;
  display: flex;
  flex-direction: column;
  width: calc(440 * var(--u));
  max-height: min(62vh, calc(640 * var(--u)));
  border: 1px solid var(--ink);
  background: #fff;
}

.note-head {
  flex: none;
  border-bottom: 1px solid var(--ink);
}

.note-text {
  padding-top: calc(16 * var(--u));
}

.note-text p {
  margin: 0 0 0.8em;
  font-size: calc(16.5 * var(--u));
  line-height: 1.5;
}

/* ---------- book workshop: the agenda (a demo) ----------
   Over the studio, under the banner, in the studio's own style: a white panel, 1px black rules, square corners. */

.agenda {
  position: fixed;
  inset: var(--banner-h) 0 0 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: rgb(251 250 247 / 0.12);
  -webkit-backdrop-filter: blur(calc(4 * var(--u)));
  backdrop-filter: blur(calc(4 * var(--u)));
  animation: agenda-fade 0.25s ease both;
}

.agenda[hidden] {
  display: none;
}

.agenda-panel {
  display: flex;
  flex-direction: column;
  width: min(calc(1400 * var(--u)), calc(100vw - 80 * var(--u)));
  height: min(calc(840 * var(--u)), calc(100vh - var(--banner-h) - 70 * var(--u)));
  border: 1px solid var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  animation: agenda-rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.agenda-head {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: var(--head-h);
  padding: 0 calc(24 * var(--u));
  border-bottom: 1px solid var(--ink);
}

.agenda .label {
  color: var(--ink);
}

/* the agenda's names and dates in the kiosk's sans (Roobert), as in the studio around it */
.agenda .t-title,
.agenda .display-m {
  font-family: var(--sans);
  letter-spacing: 0;
}

.agenda-body {
  flex: 1;
  display: grid;
  grid-template-columns: calc(440 * var(--u)) minmax(0, 1fr) calc(400 * var(--u));
  min-height: 0;
}

.agenda-body[hidden] {
  display: none;
}

.agenda-body > * {
  min-height: 0;
  padding: calc(24 * var(--u));
  overflow-y: auto;
  scrollbar-width: none;
}

.agenda-body > * + * {
  border-left: 1px solid var(--ink);
}

/* the month */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(18 * var(--u));
}

.cal-month {
  font-size: calc(22 * var(--u));
  font-weight: 700;
}

.cal-nav {
  display: grid;
  place-items: center;
  width: calc(40 * var(--u));
  height: calc(40 * var(--u));
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--btn-shadow);
  color: var(--ink);
  transition: color 0.15s ease, box-shadow 0.2s ease;
}

.cal-nav svg {
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
}

.cal-nav:hover:not(:disabled),
.cal-nav:focus-visible {
  color: var(--accent);
  box-shadow: var(--btn-shadow-hover);
}

.cal-nav:disabled {
  opacity: 0.3;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: calc(6 * var(--u));
}

.cal-week {
  margin-bottom: calc(8 * var(--u));
  text-align: center;
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid transparent;
  background: none;
  color: var(--ink);
  font: 500 calc(18 * var(--u)) / 1 var(--sans);
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.cal-day i {
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: calc(6 * var(--u));
  height: calc(6 * var(--u));
  border-radius: 50%;
  transform: translateX(-50%);
}

.cal-day.has-ws i {
  background: var(--accent);
}

.cal-day.is-full {
  color: var(--ink-2);
}

.cal-day.is-full i {
  box-shadow: inset 0 0 0 1px var(--ink-2);
}

.cal-day:disabled {
  color: var(--ink-3);
  opacity: 0.55;
}

.cal-day.is-today {
  border-style: dashed;
  border-color: var(--ink-2);
}

.cal-day:not(:disabled):hover {
  border-color: var(--accent);
  border-style: solid;
  color: var(--accent);
}

.cal-day.is-on,
.cal-day.is-on:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.cal-day.is-on i {
  background: #fff;
  box-shadow: none;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: calc(8 * var(--u)) calc(18 * var(--u));
  margin: calc(22 * var(--u)) 0 0;
  padding: calc(16 * var(--u)) 0 0;
  border-top: 1px solid var(--ink);
  list-style: none;
}

.cal-legend li {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
}

.cal-dot {
  width: calc(8 * var(--u));
  height: calc(8 * var(--u));
  border-radius: 50%;
  background: var(--accent);
}

.cal-dot.is-ring {
  background: none;
  box-shadow: inset 0 0 0 1px var(--ink-2);
}

.cal-dot.is-today {
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
  border: 1px dashed var(--ink-2);
  border-radius: 0;
  background: none;
}

/* the day's sessions */
.agenda-date {
  margin: calc(6 * var(--u)) 0 calc(22 * var(--u));
  font-size: calc(40 * var(--u));
  font-weight: 700;
  line-height: 1.05;
}

.session .t-title,
.agenda-design .t-title {
  font-size: calc(19 * var(--u));
  font-weight: 700;
}

.sessions {
  display: grid;
  gap: calc(12 * var(--u));
}

.sessions-none {
  color: var(--ink-2);
}

.session {
  display: grid;
  grid-template-columns: calc(96 * var(--u)) minmax(0, 1fr);
  gap: calc(18 * var(--u));
  padding: calc(18 * var(--u)) calc(20 * var(--u));
  border: 1px solid var(--ink);
  background: rgb(255 255 255 / 0.55);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  animation: session-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.session:nth-child(2) {
  animation-delay: 0.05s;
}

.session:nth-child(3) {
  animation-delay: 0.1s;
}

.session:hover:not(:disabled) {
  border-color: var(--accent);
}

.session.is-on {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #fff;
}

.session:disabled {
  opacity: 0.5;
}

.session-time {
  display: grid;
  align-content: start;
  gap: calc(2 * var(--u));
  font: 400 calc(15 * var(--u)) / 1.2 var(--sans);
  color: var(--ink-2);
}

.session-time b {
  font: 700 calc(26 * var(--u)) / 1 var(--sans);
  color: var(--ink);
}

.session.is-on .session-time b {
  color: var(--accent);
}

.session-main {
  display: grid;
  gap: calc(6 * var(--u));
}

.seats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(8 * var(--u)) calc(14 * var(--u));
  margin-top: calc(6 * var(--u));
}

/* a seat is a stitch: sewn (black) is taken, red is yours, open is free */
.stitches {
  display: flex;
  gap: calc(5 * var(--u));
}

.stitch {
  width: calc(16 * var(--u));
  height: calc(4 * var(--u));
  border-radius: calc(2 * var(--u));
  box-shadow: inset 0 0 0 1px var(--ink-3);
}

.stitch.is-taken {
  background: var(--ink);
  box-shadow: none;
}

.stitch.is-mine {
  background: var(--accent);
  box-shadow: none;
  animation: stitch-in 0.3s ease both;
}

/* the booking */
.agenda-sum {
  display: flex;
  flex-direction: column;
}

.agenda-design {
  display: grid;
  grid-template-columns: calc(110 * var(--u)) minmax(0, 1fr);
  gap: calc(16 * var(--u));
  align-items: center;
  margin: calc(12 * var(--u)) 0 calc(8 * var(--u));
}

.agenda-design:has(> p:only-child) {
  display: block;
}

.agenda-design img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #f3efe8;
}

.agenda-parts {
  margin: calc(8 * var(--u)) 0 0;
  padding: 0;
  list-style: none;
}

.agenda-parts li + li {
  margin-top: calc(6 * var(--u));
}

.agenda-parts small {
  display: block;
  color: var(--ink-2);
  font-size: calc(13 * var(--u));
}

.agenda-list li {
  align-items: center;
}

.agenda-total {
  font-weight: 700;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: calc(12 * var(--u));
}

.stepper button {
  display: grid;
  place-items: center;
  width: calc(30 * var(--u));
  height: calc(30 * var(--u));
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--btn-shadow);
  color: var(--ink);
  font: 400 calc(18 * var(--u)) / 1 var(--sans);
  transition: color 0.15s ease, box-shadow 0.2s ease;
}

.stepper button:hover:not(:disabled) {
  color: var(--accent);
  box-shadow: var(--btn-shadow-hover);
}

.stepper button:disabled {
  opacity: 0.3;
}

.agenda-note {
  margin-top: calc(16 * var(--u));
  color: var(--ink-2);
}

/* Back · Reserve, and on the ticket: Send to my phone · Done */
.agenda-actions {
  display: flex;
  justify-content: flex-end;
  gap: calc(10 * var(--u));
  margin-top: auto;
  padding-top: calc(20 * var(--u));
}

/* the ticket: white paper with a perforated stub, stitched round in red, then stamped */
.ticket-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(28 * var(--u));
  min-height: 0;
  padding: calc(24 * var(--u));
}

.ticket-view[hidden] {
  display: none;
}

.ticket-view .agenda-actions {
  margin-top: 0;
  padding-top: 0;
}

.ticket-shadow {
  filter: drop-shadow(0 calc(20 * var(--u)) calc(30 * var(--u)) rgb(30 24 16 / 0.28));
  animation: ticket-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.ticket {
  --stub: calc(270 * var(--u));
  --notch: calc(16 * var(--u));
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub);
  width: calc(940 * var(--u));
  background: #fff;
  /* two notches where the stub tears off */
  -webkit-mask: radial-gradient(circle at calc(100% - var(--stub)) 0, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) top / 100% 51% no-repeat,
    radial-gradient(circle at calc(100% - var(--stub)) 100%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle at calc(100% - var(--stub)) 0, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) top / 100% 51% no-repeat,
    radial-gradient(circle at calc(100% - var(--stub)) 100%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) bottom / 100% 51% no-repeat;
}

.ticket-stitch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stitch-line {
  stroke: var(--accent);
  stroke-linecap: round;
}

.stitch-reveal {
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  animation: stitch-run 1.4s 0.45s cubic-bezier(0.45, 0, 0.3, 1) forwards;
}

.ticket-main {
  position: relative;
  padding: calc(44 * var(--u)) calc(48 * var(--u));
}

.ticket-title {
  margin: calc(10 * var(--u)) 0 calc(26 * var(--u));
  font-size: calc(44 * var(--u));
  font-weight: 700;
  line-height: 1.05;
}

.ticket-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(18 * var(--u)) calc(28 * var(--u));
  margin: 0;
}

.ticket-facts dd {
  margin: calc(4 * var(--u)) 0 0;
  font: 400 calc(19 * var(--u)) / 1.25 var(--sans);
}

.ticket-design {
  margin-top: calc(22 * var(--u));
}

.ticket-demo {
  margin-top: calc(8 * var(--u));
  color: var(--ink-2);
}

.ticket-stamp {
  position: absolute;
  top: calc(36 * var(--u));
  right: calc(36 * var(--u));
  margin: 0;
  padding: calc(6 * var(--u)) calc(16 * var(--u));
  border: calc(3 * var(--u)) solid var(--accent);
  color: var(--accent);
  font: 700 calc(24 * var(--u)) / 1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-9deg);
  opacity: 0;
  animation: stamp 0.32s 1.85s cubic-bezier(0.3, 1.6, 0.5, 1) forwards;
}

.ticket-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(10 * var(--u));
  padding: calc(32 * var(--u)) calc(24 * var(--u));
  border-left: calc(2 * var(--u)) dashed var(--line);
  text-align: center;
}

.ticket-qr {
  width: calc(150 * var(--u));
  height: calc(150 * var(--u));
}

.ticket-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ticket-code {
  margin: calc(6 * var(--u)) 0 0;
  font: 700 calc(24 * var(--u)) / 1 var(--sans);
  letter-spacing: 0.12em;
}

@keyframes agenda-fade {
  from { opacity: 0; }
}

@keyframes agenda-rise {
  from { opacity: 0; transform: translateY(calc(24 * var(--u))); }
}

@keyframes session-in {
  from { opacity: 0; transform: translateX(calc(14 * var(--u))); }
}

@keyframes stitch-in {
  from { transform: scaleX(0); }
}

@keyframes ticket-in {
  from { opacity: 0; transform: translateY(calc(120 * var(--u))) rotate(4deg); }
}

@keyframes stitch-run {
  to { stroke-dashoffset: 0; }
}

@keyframes stamp {
  from { opacity: 0; transform: rotate(-9deg) scale(2.2); }
  to { opacity: 0.92; transform: rotate(-9deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .agenda,
  .agenda-panel,
  .session,
  .stitch.is-mine,
  .ticket-shadow {
    animation: none;
  }

  .stitch-reveal {
    animation: none;
    stroke-dashoffset: 0;
  }

  .ticket-stamp {
    animation: none;
    opacity: 0.92;
  }
}
