/* The loop ring of sample designs (js/ring.js). Colours come from the :root tokens in style.css. */
.ring { --cw: 340px; --cap: 96px; --gap: 18px; position: relative; margin-top: clamp(20px, 4vw, 36px); }

.ring__stage {
  position: relative; width: 100%; overflow: hidden; isolation: isolate; perspective: 1200px;
  height: calc((var(--cw) * 9 / 16 + var(--cap)) * 1.16 + 16px);
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.ring.is-dragging .ring__stage, .ring.is-dragging .rc { cursor: grabbing; }
.ring__stage::before, .ring__stage::after {
  content: ""; position: absolute; top: 0; bottom: 0; z-index: 2; width: clamp(0px, calc((100% - var(--cw) * 1.06) / 2), 160px); pointer-events: none;
}
.ring__stage::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.ring__stage::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.ring__wheel { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }

/* A card: dark glass, thin ice-blue hairline. */
.rc {
  position: absolute; left: 50%; top: 50%; display: block; width: var(--cw); height: calc(var(--cw) * 9 / 16 + var(--cap));
  margin: calc((var(--cw) * 9 / 16 + var(--cap)) / -2) 0 0 calc(var(--cw) / -2); padding: 0; text-align: left; cursor: pointer;
  border: 1px solid var(--hl2); border-radius: 16px; color: var(--tx);
  background: var(--glass), var(--s1); backface-visibility: hidden; will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent; pointer-events: auto;
}
/* Glow of the front card: one pseudo-element whose opacity follows --lit (0 to 1). */
.rc::before {
  content: ""; position: absolute; inset: -1px; z-index: 3; border-radius: inherit; pointer-events: none;
  border: 1px solid var(--accent); opacity: var(--lit, 0);
  box-shadow: 0 0 36px color-mix(in srgb, var(--accent) 38%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* Dimming of the side cards. */
.rc::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; background: var(--bg); opacity: var(--dim, 0); pointer-events: none; }
.rc:focus-visible { outline: 2px solid var(--acc-tx); outline-offset: 4px; }
.rc__pic { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 15px 15px 0 0; background: var(--s2); }
.rc__pic img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.rc__tag {
  position: absolute; left: 10px; top: 10px; z-index: 1; padding: 3px 9px; border-radius: 99px; font: 600 .75rem/1.4 var(--fb);
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border: 1px solid var(--hl2);
}
.rc__cap { display: block; padding: 14px 16px 0; }
.rc__name { display: block; font: 600 1.125rem/1.25 var(--fd); letter-spacing: -.01em; }
.rc__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rc__tags > span { padding: 2px 9px; border-radius: 99px; font: 500 .75rem/1.5 var(--fb); color: var(--mu); border: 1px solid var(--hl2); white-space: nowrap; }

/* Controls and the honest line */
.ring__ctl { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 8px; }
.ring__b, .ring__g {
  border: 1px solid var(--hl2); background: var(--glass), var(--s1); color: var(--tx); cursor: pointer; transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.ring__b { width: 44px; height: 44px; border-radius: 50%; font-size: 1.5rem; line-height: 1; }
.ring__g { min-height: 44px; padding: 0 20px; border-radius: 99px; font: 600 .875rem var(--fb); }
.ring__b:hover, .ring__g:hover { border-color: var(--acc-tx); }
.ring__note { margin-top: 16px; text-align: center; color: var(--mu); font-size: .9375rem; }

/* Plain row (reduced motion) and grid ("See all"): no 3D, no spinning. */
.ring.is-flat .ring__stage { height: auto; perspective: none; cursor: auto; overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory; padding: 8px 2px 16px; scrollbar-color: var(--hl2) transparent; }
.ring.is-flat .ring__stage::before, .ring.is-flat .ring__stage::after { display: none; }
.ring.is-flat .ring__wheel { position: static; display: flex; gap: var(--gap); width: max-content; transform: none; transform-style: flat; pointer-events: auto; }
.ring.is-flat .rc { position: relative; left: auto; top: auto; margin: 0; flex: none; scroll-snap-align: center; will-change: auto; }
.ring.is-flat .rc::before { opacity: 0; }
.ring.is-flat .rc:hover::before, .ring.is-flat .rc:focus-visible::before { opacity: 1; }
.ring.is-grid .ring__stage { overflow: visible; scroll-snap-type: none; }
.ring.is-grid .ring__wheel { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); width: 100%; }
.ring.is-grid .rc { width: auto; height: auto; padding-bottom: 16px; }
.ring.is-grid .ring__ctl .ring__b { display: none; }

/* Lightbox */
.ring__dlg {
  width: min(920px, 92vw); max-height: 92vh; overflow: auto; padding: 0; color: var(--tx);
  border: 1px solid var(--hl2); border-radius: 20px; background: var(--s2);
}
.ring__dlg::backdrop { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.ring__dlg img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--s1); }
.ring__dbody { position: relative; padding: 20px clamp(16px, 4vw, 28px) 24px; }
.ring__dbody .rc__tag { position: static; display: inline-block; margin-bottom: 10px; }
.ring__dbody h3 { font: 600 1.5rem/1.2 var(--fd); letter-spacing: -.01em; }
.ring__dbody p { margin-top: 8px; color: var(--mu); max-width: 60ch; }
.ring__dact { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

@media (max-width: 700px) {
  .ring { --cap: 92px; }
  .rc__name { font-size: 1.0625rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ring__b, .ring__g { transition: none; }
}
