/* Project stage, laid out from activetheory.net/work/<project> at 1440 × 900:
   slab centred at 63% width, HUD text bottom-left over the slab's corner, "Scroll to close" above it. */
.work-detail[hidden] { display: none !important; }
.work-detail {
  --wd-ice: #8ccbf2; --wd-dim: #6d8aa6; --wd-white: #eaf4ff;
  --wd-actions-height: 60px;
  position: fixed; inset: 0; z-index: 38; overflow: hidden; isolation: isolate;
  color: var(--wd-white); font-family: var(--mono, "Kode Mono", monospace);
  font-size: 14px; line-height: 1.5; letter-spacing: .03em; text-transform: uppercase;
}
.wd-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; }
.wd-no-gl { background: radial-gradient(ellipse at 100% 0, #16314d, transparent 55%), #0a0d13; }
.wd-still { position: absolute; left: var(--wd-left, 18.5%); right: var(--wd-right, 18.5%); top: var(--wd-top, 20%); width: auto; height: calc(var(--wd-bottom, 80%) - var(--wd-top, 20%)); object-fit: cover; clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% calc(100% - 22px), calc(100% - 22px) 100%, 13px 100%, 0 calc(100% - 13px)); }
.wd-no-gl .wd-still:not([hidden]) { display: block; }

.wd-fly { position: absolute; z-index: 2; pointer-events: none; margin: 0; white-space: nowrap; opacity: 0; font-weight: 400; line-height: .95; letter-spacing: -.01em; color: #f4f9ff; text-shadow: 0 0 30px #9fd2ff55; }
.wd-hint { position: absolute; left: 50%; top: calc(var(--wd-top, 178px) - 36px); transform: translate(-50%, -50%); margin: 0; font-size: 13px; letter-spacing: .08em; color: #d2e2ef; opacity: .85; white-space: nowrap; pointer-events: none; }


.wd-text { position: absolute; inset: 0; pointer-events: none; }
.wd-text > * { pointer-events: auto; }
.wd-info { position: absolute; left: clamp(20px, 4vw, 58px); bottom: calc(env(safe-area-inset-bottom, 0px) + 64px + var(--wd-actions-height)); width: min(390px, 31vw); display: grid; justify-items: start; gap: 12px; }
.wd-info > * { margin: 0; font: inherit; }
.wd-title { color: var(--wd-white); }
.wd-meta, .wd-desc { color: var(--wd-ice); }
.wd-desc { line-height: 1.55; }
.wd-info .pm-magnetic, .wd-spec .pm-magnetic { translate: none !important; }

.wd-spec { position: absolute; right: clamp(20px, 4vw, 58px); bottom: calc(env(safe-area-inset-bottom, 0px) + 64px + var(--wd-actions-height)); width: min(360px, 27vw); display: grid; gap: 8px; font-size: 12px; }
.wd-spec[hidden] { display: none; }
.wd-row { display: grid; grid-template-columns: 15ch 1fr; gap: 14px; }
.wd-k { color: var(--wd-dim); }
.wd-v { color: var(--wd-ice); line-height: 1.5; }

.wd-count { position: absolute; left: var(--wd-left, 18.5%); top: calc(var(--wd-top, 178px) - 36px); transform: translateY(-50%); margin: 0; max-width: calc(50% - var(--wd-left, 18.5%) - 110px); font-size: 10px; letter-spacing: .08em; color: var(--wd-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.wd-info, .wd-spec { text-shadow: 0 1px 14px #000d, 0 0 3px #0009; }
.wd-bottom {
  position: absolute; inset-inline: clamp(20px, 4vw, 58px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px;
  width: fit-content; min-width: min(100% - 40px, 240px); max-width: 1120px; margin-inline: auto;
}
.wd-bottom:has(> :nth-child(2)) { width: auto; }
.wd-action {
  display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 60px;
  padding: 12px 20px; border: 1px solid rgba(220, 235, 255, .25); border-radius: 14px;
  background: radial-gradient(ellipse at 25% 0, rgba(122, 173, 206, .12), transparent 70%), linear-gradient(135deg, #141921, #0b0d11);
  box-shadow: inset 0 1px 0 rgba(235, 244, 255, .13), 0 12px 35px rgba(0, 0, 0, .3);
  color: #e5f2ff; font: 500 12px/1.4 var(--mono, monospace); letter-spacing: .045em;
  text-align: center; text-decoration: none; overflow-wrap: anywhere;
  cursor: pointer; transition: background .25s, border-color .25s, box-shadow .25s;
}
.wd-action:hover { border-color: rgba(235, 244, 255, .6); background: radial-gradient(ellipse at 25% 0, rgba(122, 173, 206, .22), transparent 80%), linear-gradient(135deg, #202a35, #101720); box-shadow: inset 0 0 0 1px rgba(220, 235, 255, .14), 0 12px 35px #0006, 0 0 30px #78a0d60c; }
.wd-action:active { box-shadow: inset 0 2px 8px #0003; }
.wd-close { border-color: rgba(167, 204, 232, .3); }
.wd-close::before { content: '\00d7'; margin-inline-end: 10px; font: 22px/1 sans-serif; }

/* Text typing: the real text stays readable to assistive tech; the typed copy is decorative. */
.wd-sr-text, .wd-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wd-ty { white-space: pre-wrap; }

.detail-is-open .work-heads, .detail-is-open .work-list, .detail-is-open .work-meta { opacity: 0; translate: 0 15px; transition: opacity .4s, translate .65s; }
.work-detail:focus { outline: none; }
.work-detail :focus-visible { outline: 2px solid #c3e3ff; outline-offset: 5px; }

@media (max-width: 1100px) and (min-width: 761px) {
  .wd-info { width: min(360px, 40vw); }
  .wd-spec { width: min(300px, 34vw); }
}
@media (max-width: 760px) {
  .work-detail { font-size: 12px; }
  .wd-hint { display: none; }
  .wd-text { top: calc(var(--wd-bottom, 40%) + 44px); left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 46px + var(--wd-actions-height)); overflow: auto; overscroll-behavior: contain; scrollbar-width: none; pointer-events: auto; padding-bottom: 28px; mask-image: linear-gradient(#000 calc(100% - 36px), transparent); -webkit-mask-image: linear-gradient(#000 calc(100% - 36px), transparent); }
  .wd-info, .wd-spec { position: static; width: auto; }
  .wd-spec { margin-top: 26px; font-size: 11px; }
  .wd-count { left: auto; right: 16px; top: calc(var(--wd-bottom, 40%) + 18px); max-width: calc(100% - 32px); }
  .wd-row { grid-template-columns: 12ch 1fr; }
  .wd-bottom { inset-inline: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); gap: 8px; }
  .wd-action { padding: 10px 8px; font-size: 11px; }
}
@media (max-width: 480px) {
  .wd-bottom { gap: 6px; }
  .wd-action { padding: 10px 6px; font-size: 10px; letter-spacing: .02em; }
  .wd-close { flex-direction: column; gap: 4px; }
  .wd-close::before { margin-inline-end: 0; font-size: 18px; }
}
