/* Room markers belong to the same centered, cover-cropped 2304 × 1728 scene.
   Container units also follow the homepage's minimum height on short windows. */
.workshop-map,
.workshop-instruction { display: none; }

@media (min-width: 1024px) {
  .hero-content { pointer-events: none; }

  .workshop-map {
    position: absolute;
    z-index: 9;
    inset: 0;
    display: block;
    container-type: size;
    pointer-events: none;
  }

  .workshop-route {
    --scene-width: max(100cqw, calc(100cqh * 2304 / 1728));
    --scene-height: max(100cqh, calc(100cqw * 1728 / 2304));
    position: absolute;
    left: clamp(72px, calc(50% + var(--scene-width) * var(--room-x)), calc(100% - 72px));
    top: clamp(140px, calc(50% + var(--scene-height) * var(--room-y)), calc(100% - 170px));
    display: grid;
    justify-items: center;
    width: 124px;
    color: #fffaf1;
    text-decoration: none;
    /* Coordinates mark the 24px pin's center. Keep its lower 12px below
       the anchor so the sign expands upward without moving the pin. */
    transform: translate(-50%, calc(-100% + 12px));
    pointer-events: auto;
  }

  .workshop-route::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 18px;
  }

  .room-sign {
    --room-halo: 0 0 16px 4px rgba(255, 225, 124, .28), 0 0 36px 10px rgba(255, 234, 169, .12);
    position: relative;
    width: 100%;
    padding: 9px 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 250, 239, .1);
    border-top-color: rgba(255, 250, 239, .16);
    border-bottom-color: rgba(255, 250, 239, .06);
    border-radius: 10px;
    background: rgba(40, 28, 18, .055);
    -webkit-backdrop-filter: blur(6px) saturate(1.02);
    backdrop-filter: blur(6px) saturate(1.02);
    box-shadow: inset 0 1px rgba(255, 255, 255, .07), 0 2px 6px rgba(40, 28, 18, .06), var(--room-halo);
    text-shadow: 0 1px 8px rgba(40, 28, 18, .4);
    transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
  }

  .room-heading { display: flex; align-items: center; gap: 8px; }
  .room-heading strong { font-size: 13px; line-height: 1.5; font-weight: 500; letter-spacing: .05em; }
  .room-arrow { margin-left: auto; color: rgba(255, 250, 239, .7); font-size: 13px; line-height: 1; transition: translate .25s ease, color .25s ease; }
  .room-description { display: block; max-height: 0; margin-top: 0; opacity: 0; overflow: hidden; color: rgba(255, 250, 239, .85); font-size: 11px; line-height: 1.6; transition: max-height .25s ease, margin-top .25s ease, opacity .2s ease; }

  .room-stem { width: 1px; height: 18px; background: linear-gradient(rgba(255, 250, 239, .38), rgba(255, 250, 239, .1)); }
  .room-pin { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(255, 250, 239, .4); border-radius: 50%; background: rgba(40, 28, 18, .06); box-shadow: 0 2px 6px rgba(40, 28, 18, .06), inset 0 1px rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); transition: border-color .25s ease, background .25s ease, box-shadow .25s ease; }
  .room-pin > span { width: 5px; height: 5px; border-radius: 50%; background: #fff1bf; box-shadow: 0 0 8px rgba(244, 211, 94, .25); }
  /* Animate each glass surface itself so its backdrop sampling root stays stable. */
  .room-sign,
  .room-stem,
  .room-pin { animation: roomArrival .65s ease-out calc(650ms + var(--room-order) * 90ms) backwards; }

  .workshop-route:is(:hover, :focus-visible) { z-index: 1; outline: none; }
  .workshop-route:is(:hover, :focus-visible) .room-sign {
    background: rgba(255, 226, 147, .2);
    border-color: rgba(255, 239, 187, .45);
    box-shadow: inset 0 1px rgba(255, 250, 228, .3), inset 0 0 20px rgba(255, 226, 147, .3);
  }
  .workshop-route:is(:hover, :focus-visible) .room-arrow { translate: 2px -2px; color: #f4d35e; }
  .workshop-route:is(:hover, :focus-visible) .room-description { max-height: 18px; margin-top: 6px; opacity: 1; }
  .workshop-route:is(:hover, :focus-visible) .room-pin { border-color: rgba(244, 211, 94, .7); background: rgba(40, 28, 18, .12); box-shadow: 0 0 0 3px rgba(244, 211, 94, .07), 0 2px 6px rgba(40, 28, 18, .06); }

  .workshop-instruction { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; color: rgba(255, 250, 239, .84); font-size: 12px; line-height: 1.6; letter-spacing: .08em; animation: roomArrival .65s ease-out .7s backwards; }
  .workshop-instruction > span:first-child { width: 5px; height: 5px; border-radius: 50%; background: #f4d35e; box-shadow: 0 0 10px rgba(244, 211, 94, .45); }
  .workshop-instruction-rule { width: 24px; height: 1px; background: rgba(255, 250, 239, .42); }

  /* A tall window crops both side rooms: use an uncluttered entry arrangement
     instead of stacking cropped anchors on the same screen edge. */
  @media (max-aspect-ratio: 6/5) {
    .workshop-map { display: grid; grid-template-columns: repeat(2, 124px); align-content: center; justify-content: center; gap: 24px 52px; padding: 100px var(--site-edge) 190px; }
    .workshop-route { position: relative; left: auto; top: auto; transform: none; }
    .workshop-route:last-child { grid-column: 1 / -1; justify-self: center; }
    .room-stem { height: 14px; }
  }

  /* Keep all five destinations available when a short viewport crops the room. */
  @media (max-height: 560px) {
    .workshop-map { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 94px var(--site-edge) 126px; }
    .workshop-route { position: relative; left: auto; top: auto; flex: 0 1 124px; min-width: 0; transform: none; }
    .room-heading { gap: 6px; }
    .room-sign { padding: 10px; }
    .room-stem { height: 14px; }
    .room-description { display: none; }
    .workshop-instruction { margin-bottom: 8px; font-size: 11px; }
  }
}

@keyframes roomArrival {
  from { opacity: 0; }
  to { opacity: 1; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .room-sign { background: rgba(40, 28, 18, .94); }
  .workshop-route:is(:hover, :focus-visible) .room-sign { background: rgba(69, 54, 29, .94); }
}

@media (prefers-reduced-motion: reduce) {
  .workshop-instruction,
  .room-sign,
  .room-stem,
  .room-pin { animation: none; }
  .room-sign,
  .room-arrow,
  .room-description,
  .room-pin { transition: none; }
}
