:root {
  --bg: #ece7df;
  --ink: #1c1f1d;
  --soft: #7c7a72;
  --faint: #b3afa6;
  --accent: #1f6b5c;
  --accent-deep: #134a3f;
  --cream: #fbf8f1;
  --steel-hi: #fbfbfa;
  --steel: #c3c5c8;
  --steel-lo: #8e9196;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(90% 70% at 50% 18%, #f6f2ec 0%, rgba(246, 242, 236, 0) 70%),
    radial-gradient(120% 90% at 50% 110%, #e2dcd2 0%, rgba(226, 220, 210, 0) 60%),
    var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
/* a fine grain over the wall, like a plastered surface */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.27  0 0 0 0 0.22  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 12px;
  overflow: hidden;
  touch-action: pan-y;
}

/* the wall: every measure inside is in em, and the em follows both the width and the height of the window */
.wall {
  position: relative;
  font-size: clamp(8px, min(3vw, 4.4vh), 24px);
  width: 30em;
  height: 19.6em;
}

.head {
  position: absolute;
  left: 0.4em;
  right: 0.4em;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1em;
}
.head__who { display: flex; align-items: center; gap: 0.7em; }
.head__mark {
  display: grid;
  place-items: center;
  width: 2.3em;
  height: 2.3em;
  border-radius: 50%;
  background: linear-gradient(160deg, #2a8270 0%, var(--accent) 45%, var(--accent-deep) 100%);
  box-shadow:
    0 0 0 1px rgba(19, 74, 63, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 3px rgba(0, 0, 0, 0.2),
    0 4px 10px -4px rgba(19, 74, 63, 0.5);
}
.head__mark svg { width: 1.25em; height: 1.25em; fill: rgba(251, 248, 241, 0.94); }
.head__brand {
  font-size: 0.74em;
  font-weight: 560;
  letter-spacing: 0.01em;
  color: var(--soft);
  font-variation-settings: "wdth" 100;
}
.head__title {
  font-size: 1.5em;
  line-height: 1.05;
  font-weight: 640;
  letter-spacing: -0.02em;
  font-variation-settings: "wdth" 92;
}
.head__hours {
  font-size: 0.7em;
  line-height: 1.35;
  text-align: right;
  color: var(--soft);
}
.head__hours b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* the gallery rail: a satin steel bar on two wall brackets */
.rail { position: absolute; left: 0; right: 0; top: 4.5em; height: 0; }
.rail__bar {
  position: absolute;
  left: 0.3em;
  right: 0.3em;
  top: -0.25em;
  height: 0.5em;
  border-radius: 0.25em;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 30%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, var(--steel-hi) 0%, #e4e5e7 22%, var(--steel) 50%, var(--steel-lo) 82%, #a9acb0 100%);
  box-shadow:
    0 0 0 0.5px rgba(60, 60, 60, 0.35),
    0 0.5em 0.8em -0.3em rgba(50, 40, 30, 0.32),
    0 0.15em 0.2em rgba(50, 40, 30, 0.18);
  transform-origin: 50% 50%;
}
.rail__bracket {
  position: absolute;
  top: -0.72em;
  width: 0.9em;
  height: 1.44em;
  border-radius: 0.32em;
  background: linear-gradient(180deg, #f2f2f1 0%, #c9cacc 55%, #a3a6aa 100%);
  box-shadow: 0 0 0 0.5px rgba(60, 60, 60, 0.3), 0 0.3em 0.6em -0.2em rgba(50, 40, 30, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.rail__bracket::after {
  /* the screw: a slotted head */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.34em;
  height: 0.34em;
  margin: -0.17em 0 0 -0.17em;
  border-radius: 50%;
  background: linear-gradient(135deg, #8c8f94, #e9eaeb);
  box-shadow: inset 0 0 0 0.04em rgba(0, 0, 0, 0.25);
}
.rail__bracket--l { left: 0; }
.rail__bracket--r { right: 0; }

/* the shadows on the wall, one per tag: they swing a little wider, as if the tag left the wall */
.shades { position: absolute; inset: 0; pointer-events: none; }
.shade {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 1.15em;
  background: rgba(58, 44, 28, 0.3);
  filter: blur(0.5em);
  will-change: transform;
}

/* the sliding hooks on the rail */
.hooks { position: absolute; inset: 0; pointer-events: none; }
.hook {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.hook__sleeve {
  position: absolute;
  left: -0.62em;
  top: 4.02em;
  width: 1.24em;
  height: 0.96em;
  border-radius: 0.34em;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, rgba(255, 255, 255, 0) 22%, rgba(255, 255, 255, 0.55) 46%, rgba(255, 255, 255, 0) 66%, rgba(0, 0, 0, 0.14) 100%),
    linear-gradient(180deg, #fafafa 0%, #d6d7d9 45%, #a4a7ab 100%);
  box-shadow:
    0 0 0 0.5px rgba(50, 50, 50, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0.35em 0.5em -0.2em rgba(50, 40, 30, 0.45);
}
.hook__eye {
  position: absolute;
  left: -0.19em;
  top: 4.86em;
  width: 0.38em;
  height: 0.46em;
  border-radius: 0 0 0.19em 0.19em;
  border: 0.1em solid #9ea1a5;
  border-top: 0;
  background: transparent;
}

/* the tags: each li is the pendulum, its origin is the pivot under the hook */
.tags { list-style: none; position: absolute; inset: 0; pointer-events: none; }
.pend {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  will-change: transform;
}
.ring {
  position: absolute;
  left: -0.6em;
  top: -0.1em;
  width: 1.2em;
  height: 1.2em;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  pointer-events: none;
}
.ring path { stroke-width: 0.62; }
.ring--back { z-index: 0; }
.ring--front { z-index: 2; }

.tag {
  position: absolute;
  left: 0;
  top: 0.48em;
  translate: -50% 0;
  width: 5.8em;
  height: 7em;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.tag__body {
  position: absolute;
  inset: 0;
  border-radius: 1.15em;
  /* the satin rim: the highlight turns against the swing, so the light stays where it is */
  background: linear-gradient(calc(150deg + var(--a, 0deg)), var(--steel-hi) 0%, #b6b9bd 26%, #f1f2f3 48%, #969a9f 74%, #e4e5e7 100%);
  -webkit-mask: radial-gradient(circle 0.19em at 50% 0.42em, transparent 96%, #000 100%);
  mask: radial-gradient(circle 0.19em at 50% 0.42em, transparent 96%, #000 100%);
  box-shadow: 0 0 0 0.5px rgba(60, 60, 60, 0.35);
  transition: scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
  transform-origin: 50% 0;
}
.face {
  position: absolute;
  inset: 0.2em;
  border-radius: 0.97em;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 30% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, var(--cream) 0%, #f1ece2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 0.5px rgba(80, 70, 50, 0.22),
    inset 0 -0.3em 0.6em -0.3em rgba(80, 64, 40, 0.18);
}
/* the green enamel of an open tag, faded in over the cream one */
.face::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(110% 50% at 25% 0%, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(170deg, #2a8270 0%, var(--accent) 40%, var(--accent-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -0.4em 0.8em -0.3em rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.45s ease;
}
/* the light that slides over the enamel as the tag swings */
.face::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 60%);
  translate: calc(var(--g, 0) * 1em) 0;
  opacity: 0.55;
  pointer-events: none;
}
/* the grommet around the hole */
.tag__grommet {
  position: absolute;
  left: 50%;
  top: 0.42em;
  width: 0.62em;
  height: 0.62em;
  margin: -0.31em 0 0 -0.31em;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 0.18em, #7f8388 0.19em, #e9eaeb 0.24em, #a2a5aa 0.31em);
  box-shadow: 0 0.05em 0.06em rgba(0, 0, 0, 0.25);
  z-index: 3;
}

.face__top {
  position: absolute;
  left: 50%;
  top: 0.82em;
  width: 5.2em;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 0.36em;
  text-align: center;
  z-index: 1;
}
.face__icon {
  width: 1.55em;
  height: 1.55em;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0.5px 0 rgba(255, 255, 255, 0.9));
  transition: stroke 0.45s ease, filter 0.45s ease;
}
.face__name {
  font-size: 0.78em;
  line-height: 1.12;
  font-weight: 640;
  letter-spacing: -0.01em;
  font-variation-settings: "wdth" 80;
  color: var(--ink);
  transition: color 0.45s ease, font-variation-settings 0.5s ease;
}
.face__more {
  position: absolute;
  left: 0.6em;
  top: 4.75em;
  width: 6.8em;
  z-index: 1;
  color: var(--cream);
  opacity: 0;
  visibility: hidden;
}
.more__line { height: 1px; background: linear-gradient(90deg, rgba(251, 248, 241, 0), rgba(251, 248, 241, 0.4) 20%, rgba(251, 248, 241, 0.4) 80%, rgba(251, 248, 241, 0)); margin-bottom: 0.6em; }
.more__row { display: flex; align-items: center; justify-content: space-between; gap: 0.4em; }
.more__label { display: flex; align-items: center; gap: 0.3em; font-size: 0.64em; color: rgba(251, 248, 241, 0.68); letter-spacing: 0.02em; }
.more__label svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.more__value { font-size: 0.8em; font-weight: 600; font-variant-numeric: tabular-nums; }
.more__price { margin-top: 0.45em; align-items: baseline; }
.more__amount { font-size: 1.85em; font-weight: 660; letter-spacing: -0.03em; font-variation-settings: "wdth" 88; font-variant-numeric: tabular-nums; line-height: 1; }
.more__note { margin-top: 0.55em; font-size: 0.64em; line-height: 1.25; color: rgba(251, 248, 241, 0.78); }

.face__paw {
  position: absolute;
  left: 50%;
  bottom: 0.5em;
  width: 0.95em;
  height: 0.95em;
  translate: -50% 0;
  fill: none;
  stroke: rgba(90, 80, 62, 0.42);
  stroke-width: 1.3;
  filter: drop-shadow(0 0.6px 0 rgba(255, 255, 255, 0.85));
  z-index: 1;
  transition: stroke 0.45s ease, filter 0.45s ease;
}

/* open: the green enamel */
.pend.is-open .face::before { opacity: 1; }
.pend.is-open .face__icon { stroke: var(--cream); filter: drop-shadow(0 -0.5px 0 rgba(0, 0, 0, 0.25)); }
.pend.is-open .face__name { color: var(--cream); font-variation-settings: "wdth" 96; }
.pend.is-open .face__paw { stroke: rgba(251, 248, 241, 0.42); filter: drop-shadow(0 -0.5px 0 rgba(0, 0, 0, 0.3)); }

/* hover and press: one element for the pendulum (JS), its child for the CSS */
.pend.is-hover .tag__body { scale: 1.025; filter: brightness(1.03); }
.pend.is-press .tag__body { scale: 0.965; transition-duration: 0.12s; }
.tag:focus-visible .tag__body { box-shadow: 0 0 0 0.5px rgba(60, 60, 60, 0.35), 0 0 0 0.18em rgba(31, 107, 92, 0.45); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #1c1f1d;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(28, 31, 29, 0.35));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
  .tag__body, .face::before, .face__icon, .face__name, .face__paw { transition-duration: 0.01s; }
  .face::before { transition: opacity 0.4s ease; }
}
