/* ============================================================
   Work page - a strip of project cards in WebGL (work-ring.js).
   Default (phones, no WebGL): a column of cover cards.
   .ring--gl: full-screen canvas, the page itself does not scroll.
   ============================================================ */

.ring { position: relative; }
.ring__sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ---------- List (phones / fallback) ---------- */
.ring__list {
  list-style: none;
  margin: 0;
  padding: clamp(5.5rem, 12vh, 7rem) var(--pad-x) 5.5rem;
  display: grid;
  gap: 14px;
}
.ring__card {
  position: relative;
  display: block;
  aspect-ratio: 808 / 632;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-2);
}
.ring__card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ring__card::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent);
  pointer-events: none;
}
.ring__title {
  position: absolute;
  left: 16px;
  bottom: 14px;
  right: 64px;
  z-index: 1;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.ring__arrow {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0f0f0e;
}
.ring__arrow::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m13 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m13 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (min-width: 761px) {
  .ring__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}

/* ---------- Corner labels (Jesper-style HUD) ---------- */
.ring__corner {
  position: fixed;
  bottom: calc(clamp(1.25rem, 3.5vh, 2rem) + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ring__corner--bl { left: var(--pad-x); }
.ring__corner--br { right: var(--pad-x); }
.ring__corner .is-on { color: var(--fg); }
.ring__corner a { color: var(--muted); transition: color var(--dur) var(--ease-out); }
.ring__corner a:hover { color: var(--fg); }

/* ---------- WebGL mode ---------- */
.ring__stage { display: none; }
html.ring-gl,
html.ring-gl body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.ring-gl .ring { position: fixed; inset: 0; }
html.ring-gl .ring__stage {
  display: block;
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: grab;
}
html.ring-gl .ring__stage.is-dragging { cursor: grabbing; }
html.ring-gl .ring__stage.is-over { cursor: pointer; }
html.ring-gl .ring__stage canvas { display: block; width: 100%; height: 100%; }
/* Links stay for keyboards + screen readers, off screen */
html.ring-gl .ring__list {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
/* The nav floats over the scene: no blur strip across the canvas */
html.ring-gl .nav::before { display: none; }
html.ring-gl .nav.is-scrolled { border-color: transparent; }
/* The scene has its own pointer effect (the ball), so the site cursor steps out */
html.ring-gl .cursor,
html.ring-gl .cursor-halo { display: none; }
/* Phones: the column fades out under the header and the footer labels */
html.ring-column .ring::before,
html.ring-column .ring::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  z-index: 1;
  pointer-events: none;
}
html.ring-column .ring::before { top: 0; height: 128px; background: linear-gradient(var(--bg) 40%, transparent); }
html.ring-column .ring::after { bottom: 0; height: 96px; background: linear-gradient(transparent, var(--bg) 70%); }
html.ring-column .ring::before,
html.ring-column .ring::after { transition: opacity 0.4s var(--ease-out); }
html.ring-open .ring::before,
html.ring-open .ring::after { opacity: 0; }
/* While a project is open the HUD steps aside for the sheet */
html.ring-gl .nav,
html.ring-gl .ring__corner { transition: opacity 0.4s var(--ease-out); }
html.ring-open .nav,
html.ring-open .ring__corner { opacity: 0; pointer-events: none; }

/* ---------- Project sheet ---------- */
.sheet {
  position: fixed;
  inset: var(--sheet-inset, 2.4vh 2.4vw);
  z-index: 60;
  border-radius: 18px;
  background: #fff;
  color: #0f0f0e;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.sheet.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
/* In WebGL mode the card itself is the white sheet; the DOM only carries content */
html.ring-gl .sheet { background: transparent; }
.sheet__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(1.5rem, 3.5vw, 3rem);
  border-radius: inherit;
  scrollbar-width: none;
}
.sheet__scroll::-webkit-scrollbar { display: none; }
/* Overlay scrollbar: thin pill inside the panel, shows while scrolling */
.sheet__bar {
  position: absolute;
  top: 18px;
  bottom: 18px;
  right: 6px;
  width: 12px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.sheet__bar[hidden] { display: none; }
.sheet__bar.is-on,
.sheet__bar:hover,
.sheet__bar.is-drag { opacity: 1; transition-duration: 0.15s; }
.sheet__bar span {
  position: absolute;
  top: 0;
  right: 3px;
  width: 4px;
  border-radius: 99px;
  background: rgba(15, 15, 14, 0.32);
  cursor: grab;
  touch-action: none;
  transition: width 0.2s ease, right 0.2s ease, background-color 0.2s ease;
}
.sheet__bar:hover span,
.sheet__bar.is-drag span { width: 6px; right: 2px; background: rgba(15, 15, 14, 0.55); }
.sheet__bar.is-drag span { cursor: grabbing; }
@media (max-width: 900px) { .sheet__scroll { grid-template-columns: 1fr; } }
.sheet__info { position: sticky; top: 0; align-self: start; padding-right: 3rem; }
.sheet__info > * { opacity: 0; transform: translateY(14px); }
.sheet.is-ready .sheet__info > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out);
}
.sheet.is-ready .sheet__info > :nth-child(2) { transition-delay: 0.06s; }
.sheet.is-ready .sheet__info > :nth-child(3) { transition-delay: 0.12s; }
.sheet.is-ready .sheet__info > :nth-child(4) { transition-delay: 0.18s; }
.sheet__title {
  font-family: var(--font-sans);
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 var(--space-4);
}
.sheet__title em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: #6c6a63; }
.sheet__lede { font-size: var(--fs-sm); line-height: 1.5; color: #2a2a27; max-width: 40ch; margin: 0 0 var(--space-5); }
.sheet__pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-5); }
.sheet__pills span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: #efede7;
  color: #2a2a27;
}
.sheet__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0f0f0e;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.sheet__link:hover { color: #ff3a14; }
.sheet__slides { display: grid; gap: 14px; }
.sheet__slides img,
.sheet__slides iframe {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #efede7;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
}
.sheet__slides iframe { aspect-ratio: 16 / 10; border: 0; }
.sheet__slides .is-in { opacity: 1; transform: none; }
.sheet__close {
  position: absolute;
  top: clamp(1rem, 2.4vw, 1.75rem);
  right: clamp(1rem, 2.4vw, 1.75rem);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0f0f0e;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.4s var(--ease-out), transform 0.6s var(--ease-out), background 0.3s, box-shadow 0.3s;
}
.sheet.is-ready .sheet__close { opacity: 1; transform: none; }
@media (max-width: 760px) {
  .sheet { --sheet-inset: 12px; }
  .sheet__info { position: static; padding-right: 0; }
  .sheet__close { position: fixed; top: auto; bottom: 26px; right: 26px; }
}
.sheet__close::before,
.sheet__close::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(45deg);
  transition: background 0.3s, transform 0.5s var(--ease-out);
}
.sheet__close::after { transform: rotate(-45deg); }
/* Same hover as the card arrows: the fill hollows out, the mark turns */
.sheet__close:hover { background: transparent; box-shadow: inset 0 0 0 1.5px #0f0f0e; }
.sheet__close:hover::before { background: #0f0f0e; transform: rotate(135deg); }
.sheet__close:hover::after { background: #0f0f0e; transform: rotate(45deg); }
