/* The room is an enhancement; the complete reading page stays underneath. */
html[data-room-pending] .wrap { visibility: hidden; }
html[data-room-pending] body::before { content: ""; position: fixed; inset: 0; z-index: 49; background: #d4d9d2; }
html[data-room-pending] body::after { content: "Opening the desk…"; position: fixed; bottom: 2rem; left: 3.5vw; z-index: 49; padding: 0.6rem 0.8rem; background: #eef0e6; color: #294750; font: 0.6875rem var(--font-mono); }
.room {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  --room-ink: #263e44;
  --room-muted: #53665f;
  --room-paper: #f0f1e8;
  --room-rule: #c6cfc1;
  --room-accent: #365f50;
  background: #d4d9d2;
  color: var(--room-ink);
  font-family: var(--font-mono);
}

.room canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.room::before { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(180deg, #e6eae1e6, #e6eae100 19%, #e6eae100 81%, #d8e0d5e6); }
.room-top, .room-bottom { position: absolute; z-index: 2; left: 3.5vw; right: 3.5vw; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.room-top { top: 2rem; }
.room-brand { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 650; letter-spacing: 0.075em; text-transform: uppercase; }
.room-nav, .room-controls { display: flex; align-items: center; gap: 2rem; }
.room-nav a, .room-controls a, .room-controls button, .room-close { font-size: 0.6875rem; letter-spacing: 0.09em; text-transform: uppercase; }
.room a, .room button { color: inherit; }
.room-nav a { position: relative; padding-block: 0.7rem; opacity: 1; transition: opacity 180ms; }
.room-nav a:hover, .room-nav a[aria-current] { color: var(--room-accent); }
.room-nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.2rem; height: 1px; background: var(--room-accent); }
.room-bottom { bottom: 1.75rem; align-items: end; }
.room-note { color: var(--room-ink); font-size: 0.625rem; line-height: 1.9; letter-spacing: 0.06em; }
.room-note span { display: block; color: var(--room-muted); }
.room-controls { gap: 0.6rem; }
.room-controls a, .room-controls button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0.6rem 0.85rem; border: 1px solid #71877a; border-radius: 2px; background: var(--room-paper); cursor: pointer; }
.room-controls a:hover, .room-controls button:hover { background: #dce5d8; border-color: var(--room-accent); }
.room :focus-visible { outline: 2px solid var(--room-accent); outline-offset: 5px; }
.room-hotspot { position: absolute; z-index: 1; padding: 0; width: 44px; height: 44px; margin: -22px; border: 0; background: transparent; cursor: pointer; }
.room-hotspot::before { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; margin: 10px; font: 16px/1 var(--font-mono); border: 1px solid #f0f1e8; border-radius: 50%; background: #294b50; color: #f0f1e8; box-shadow: 0 2px 8px #203c4330; transition: background 160ms, transform 160ms; }
.room-hotspot span { position: absolute; top: 39px; left: 50%; translate: -50% 0; padding: 6px 9px; border-radius: 2px; background: var(--room-paper); color: var(--room-ink); box-shadow: 0 2px 8px #203c4320; font: 10px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; white-space: nowrap; opacity: 0; transition: opacity 160ms; pointer-events: none; }
.room-hotspot:hover::before, .room-hotspot:focus-visible::before { background: var(--room-accent); transform: scale(1.1); }
.room-hotspot:hover span, .room-hotspot:focus-visible span { opacity: 1; }
.room[data-panel] .room-hotspot { visibility: hidden; }
.room-panel {
  position: absolute;
  inset: 6rem 2.5vw 6rem auto;
  z-index: 3;
  width: min(470px, 40vw);
  max-height: calc(100dvh - 12rem);
  margin: 0;
  padding: 0;
  border: 1px solid #a7b5a8;
  border-radius: 2px;
  background: var(--room-paper);
  color: var(--room-ink);
  font-family: var(--font-sans);
  box-shadow: 0 16px 48px #243d4426;
}
.room-panel[open] { display: flex; flex-direction: column; animation: room-card-in 280ms var(--ease); }
.room-panel::backdrop { background: rgba(37, 59, 64, 0.16); }
.room-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.6rem 1.75rem; border-bottom: 1px solid var(--room-rule); }
.room-channel { margin-bottom: 0.3rem; color: var(--room-accent); font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.12em; }
.room-panel h2 { margin: 0; font-family: var(--font-serif); font-size: 2.15rem; font-weight: 500; }
.room-close { align-self: flex-start; padding: 0.6rem; border: 1px solid #9fae9e; font-family: var(--font-mono); border-radius: 2px; background: none; cursor: pointer; }
.room-close:hover { background: #dce5d8; }
.room-panel-body { overflow-y: auto; overscroll-behavior: contain; padding: 1.4rem 1.75rem 2rem; scrollbar-width: thin; scrollbar-color: #899d8b var(--room-paper); }
.room-panel-body .section-title { display: none; }
.room-panel-body .work-rows, .room-panel-body .project-rows, .room-panel-body .post-log { border-top: 0; }
.room-panel-body .work-row, .room-panel-body .post-row { border-color: var(--room-rule); margin-inline: 0; padding-inline: 0; }
.room-panel-body .work-head { display: grid; gap: 0.35rem; }
.room-panel-body .work-title, .room-panel-body .post-row-title { color: var(--room-ink); font-size: 1.12rem; line-height: 1.4; }
.room-panel-body .work-note { color: #475b54; font-size: 0.9375rem; line-height: 1.6; }
.room-panel-body .work-years, .room-panel-body .work-tag, .room-panel-body .post-row-date, .room-panel-body .section-sub { color: var(--room-muted); }
.room-panel-body .work-tag { justify-self: start; padding: 0; border: 0; }
.room-panel-body .about-body { color: var(--room-ink); font-size: 1.05rem; }
.room-panel-body .about-body p + p { color: #475b54; margin-top: 1.2rem; }
.room-panel-body a { text-decoration-color: #819b89; text-underline-offset: 0.2em; }
.room-panel-body .elsewhere { display: grid; gap: 0; }
.room-panel-body .elsewhere a { display: flex; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--room-rule); font-family: var(--font-serif); font-size: 1.25rem; }
.room-panel-body a:hover { color: var(--room-accent); text-decoration-color: currentColor; }
.room-panel-body .stream-more { margin-top: 1.5rem; }
.room-panel-body .inline { color: var(--room-accent); font-size: 0.8rem; }
.room-panel-body .post-row { grid-template-columns: 1fr; gap: 0.35rem; }
.room-live { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
html[data-room] { overflow: hidden; }
html[data-room] body { overflow: hidden; }
html[data-room] .skip { display: none; }
@keyframes room-card-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 700px) {
  .room-top { top: 1rem; left: 1.2rem; right: 1.2rem; flex-wrap: wrap; gap: 0.25rem; }
  .room-brand { font-size: 0.75rem; }
  .room-nav { width: 100%; justify-content: space-between; gap: 0.4rem; }
  .room-nav a { font-size: 0.625rem; min-height: 44px; padding-top: 1rem; }
  .room-bottom { left: 1rem; right: 1rem; bottom: 1rem; }
  .room-note { max-width: 125px; font-size: 0.55rem; }
  .room-note span { display: none; }
  .room-controls { gap: 0.35rem; }
  .room-controls a, .room-controls button { font-size: 0.55rem; padding-inline: 0.6rem; }
  .room-panel { inset: auto 0.6rem 4.8rem; width: auto; max-height: calc(100dvh - 12rem); }
  .room-panel-head { padding: 1rem 1.2rem; }
  .room-panel-body { padding: 1rem 1.2rem 1.5rem; }
  .room-panel h2 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { .room-panel[open] { animation: none; } .room * { transition: none; } }
@media print { .room { display: none; } }
