/* The AI Experiments room: a full-screen splat with a slim bar, a spot list and an info card. */
.room-page { margin: 0; height: 100svh; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--body); }
.room-bar { position: fixed; inset: 0 0 auto; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: linear-gradient(to bottom, rgba(5,7,15,.72), rgba(5,7,15,0)); }
.room-title { flex: 1; margin: 0; font: 600 .95rem/1.2 var(--display); letter-spacing: .01em; }
.room-title span { color: var(--muted); font-weight: 400; }
.room-exit { color: var(--text); text-decoration: none; font-size: .9rem; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(5,7,15,.5); }
.room-exit:hover { background: rgba(255,255,255,.1); }
.room-main { position: fixed; inset: 0; }
#room-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#room-canvas.over { cursor: pointer; }

.room-loading, .room-fail { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 16px; background: var(--bg); z-index: 4; }
.room-loading[hidden], .room-fail[hidden] { display: none; }
.room-loading-t { margin: 0; font: 600 1.1rem var(--display); }
.room-loading-n { margin: 0; color: var(--muted); font: .85rem var(--mono); }
.room-meter { width: min(320px, 70vw); height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.room-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--magenta)); transition: width .2s; }
.room-fail p { max-width: 34ch; margin: 0 0 6px; color: var(--muted); line-height: 1.5; }

.room-hint { position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); margin: 0; z-index: 3;
  padding: 6px 12px; border-radius: 99px; background: rgba(5,7,15,.6); color: var(--muted); font-size: .85rem; white-space: nowrap; pointer-events: none; }
.room-spots { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(5,7,15,.8), rgba(5,7,15,0)); }
.room-spots[hidden] { display: none; }
.room-spots button { font: 500 .88rem var(--body); color: var(--text); background: rgba(16,23,43,.78); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 10px 16px; min-height: 44px; cursor: pointer; backdrop-filter: blur(6px); }
.room-spots button:hover, .room-spots button:focus-visible { background: rgba(61,232,216,.18); border-color: var(--teal); }

.room-card { position: absolute; z-index: 4; right: 20px; top: 50%; transform: translateY(-50%); width: min(380px, calc(100% - 40px));
  padding: 22px 22px 16px; border-radius: var(--radius); background: rgba(10,15,31,.9); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.7); backdrop-filter: blur(10px); }
.room-card[hidden] { display: none; }
.room-card .eyebrow { margin: 0 0 6px; }
.room-card h2 { margin: 0 0 10px; font: 700 1.35rem/1.2 var(--display); }
.rc-sum { margin: 0 0 16px; color: var(--muted); line-height: 1.55; font-size: .95rem; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-actions .btn { min-height: 44px; }
.rc-step { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font: .8rem var(--mono); }
.rc-step button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.rc-step button:hover { background: rgba(255,255,255,.08); }

/* Phones and narrow windows: the card becomes a bottom sheet and the object stays visible above it. */
@media (max-width: 760px) {
  .room-card { left: 12px; right: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); transform: none; width: auto; padding: 16px 16px 10px; max-height: 46svh; overflow-y: auto; }
  .room-card h2 { font-size: 1.1rem; }
  .rc-sum { font-size: .9rem; margin-bottom: 12px; }
  .room-title span { display: none; }
  .room-spots { gap: 6px; }
  .room-spots button { padding: 8px 12px; font-size: .84rem; }
}
/* Short screens (phones held sideways): a compact side card that fits under the bar. */
@media (max-height: 500px) and (min-width: 600px) {
  .room-card { top: calc(56px + env(safe-area-inset-top)); bottom: 10px; transform: none; width: min(340px, 44vw); padding: 12px 14px 6px; overflow-y: auto; }
  .room-card h2 { font-size: 1rem; margin-bottom: 6px; }
  .rc-sum { font-size: .84rem; margin-bottom: 8px; line-height: 1.45; }
  .rc-step { margin-top: 6px; padding-top: 4px; }
  .rc-step button, .rc-actions .btn { min-height: 40px; }
  .rc-step button { width: 40px; height: 40px; }
  .room-hint { display: none; }
}
/* The screen's controls float under it; a YouTube player is laid over it when playing. */
.screen-ui { position: absolute; z-index: 3; transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  padding: 4px; border-radius: 999px; background: rgba(10,15,31,.82); border: 1px solid var(--line-strong); backdrop-filter: blur(6px); }
.screen-ui[hidden] { display: none; }
.screen-ui button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); font-size: 1.15rem; cursor: pointer; }
.screen-ui button:hover, .screen-ui button:focus-visible { background: rgba(61,232,216,.2); }
.screen-ui .sc-play { background: rgba(61,232,216,.22); }
.screen-ui .sc-count { font: .78rem var(--mono); color: var(--muted); padding: 0 2px; white-space: nowrap; }
.screen-ui .sc-link { color: #050814; background: var(--teal); border-radius: 999px; padding: 9px 14px; font-weight: 600; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.screen-yt { position: absolute; z-index: 2; border: 2px solid var(--teal); border-radius: 6px; background: #000; }
.room-lightbox { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; padding: 56px 16px 16px; background: rgba(5,7,15,.92); }
.room-lightbox[hidden] { display: none; }
.lb-body { width: min(1100px, 100%); max-height: 100%; display: grid; place-items: center; }
.lb-body img, .lb-body video { max-width: 100%; max-height: calc(100svh - 90px); border-radius: 12px; }
.lb-body iframe { width: 100%; aspect-ratio: 16 / 9; max-height: calc(100svh - 90px); border: 0; border-radius: 12px; }
.lb-close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: rgba(10,15,31,.8); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.reading .screen-ui, .reading .screen-yt { display: none; }

/* The reader: a case study or the project details, over the room (which stays visible behind it). */
.room-reader { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: rgba(5,7,15,.84); backdrop-filter: blur(8px); }
.room-reader[hidden] { display: none; }
.reading .room-bar { display: none; }
.rr-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.rr-bar .btn { min-height: 44px; }
.rr-page { color: var(--muted); font-size: .88rem; padding: 10px 4px; }
.rr-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rr-body { max-width: 820px; margin: 0 auto; padding: 24px 16px calc(40px + env(safe-area-inset-bottom)); }
.rr-body .case-head h1 { margin: 0; font: 800 clamp(1.5rem, 4vw, 2.3rem)/1.15 var(--display); letter-spacing: -.02em; }
.rr-body .rr-detail-h { margin: 0 0 6px; font: 800 clamp(1.4rem, 4vw, 2rem)/1.15 var(--display); }
.rr-body .ld-img { display: block; width: 100%; border-radius: 14px; margin: 16px 0; }
.rr-body .ld-embed { aspect-ratio: 16 / 9; border: 0; }
.rr-body .ld-sum { font-size: 1.05rem; line-height: 1.7; color: #dfe5f6; }
.rr-body .ld-link { margin-top: 14px; }
.rr-body .case-cover img, .rr-body .case-cover video, .rr-body .ld-img:not(.ld-embed) { max-height: 62vh; object-fit: contain; background: #04060c; }
@media (max-height: 500px) {
  .rr-bar { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .rr-bar .btn { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
  .rr-body { padding-top: 12px; }
  .rr-body .case-head h1, .rr-body .rr-detail-h { font-size: 1.3rem; }
  .rr-body .case-lede { font-size: 1rem; margin-top: 10px; }
  .rr-body .case-cover img, .rr-body .case-cover video, .rr-body .ld-img:not(.ld-embed) { max-height: 52vh; }
}
@media (prefers-reduced-motion: reduce) { .room-meter span { transition: none; } }
