/* The home page: the whole room as a pixel-art diorama, and the desk's screens. Uses base.css's fonts and colours. */

body.room-page {
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: clip;
}

/* The room in the middle of the screen: it's the page. */
.room-page main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1120px;
  min-height: calc(100dvh - 40px);
}

/* For screen readers: the page's title, which the room stands in for on screen. */
.room-page h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* The whole room, in pixel art: shown at whole-number scales only, so every art pixel stays square and sharp. The
   weather icons stand beside it, drawn in the same pixels. */
.diorama {
  position: relative; /* the desk's screens are placed over the canvas */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 0;
}

.diorama-room {
  width: 840px; /* 2x the canvas */
  height: 744px;
  image-rendering: pixelated;
  cursor: grab;
  touch-action: pan-y; /* sideways drags turn the room; up and down still scrolls the page */
  -webkit-tap-highlight-color: transparent;
  opacity: 0; /* until its shaders have compiled and the first frame is drawn */
  transition: opacity 0.3s;
}

.diorama-room.is-ready {
  opacity: 1;
}

/* Diving into the books: the room fades to white as the camera arrives, before the Books page comes in. */
.diorama-room.is-ready.is-leaving {
  opacity: 0;
  transition: opacity 0.3s ease-in 0.4s;
}

.diorama-room.is-turning {
  cursor: grabbing;
}

.diorama-room:focus {
  outline: none;
}

.diorama-room:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 4px;
}

.diorama-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.diorama-weather {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diorama-side button {
  position: relative;
  display: block;
  padding: 7px;
  border: 0;
  background: none;
  color: #c4c4c4;
  cursor: pointer;
}

.diorama-side button:hover {
  color: var(--faint);
}

.diorama-side button[aria-pressed="true"] {
  color: var(--muted);
}

.diorama-side svg {
  display: block;
  width: 22px; /* 2 screen px per icon pixel */
  height: 22px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

/* A dot beside the weather whose sound is playing. */
.diorama-weather button.is-playing::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -3px;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  background: currentColor;
}

.diorama-side button:focus {
  outline: none;
}

.diorama-side button:focus-visible {
  outline: 1px solid var(--muted);
}

/* On a phone the room takes the whole width (it's the page), the icons in a row under it. */
@media (max-width: 700px) {
  .diorama {
    flex-direction: column;
    gap: 10px;
  }

  .diorama-room {
    width: 100vw; /* at 2-3x device pixels, so the pixels stay square even at an odd scale */
    height: auto;
  }

  .diorama-side,
  .diorama-weather {
    flex-direction: row;
  }

  .diorama-side {
    gap: 22px;
  }

  .diorama-weather {
    gap: 10px;
  }
}

.diorama-room.is-sittable {
  cursor: pointer;
}

/* Over a blind's cord, and pulling it. */
.diorama-room.is-cord,
.diorama-room.is-pulling {
  cursor: ns-resize;
}

/* A small card by the pointer while it's over something that can be clicked (the desk, the monitor, the laptop). */
.diorama-tag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font: 500 12px/1.2 var(--sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s, visibility 0s 0.12s;
}

.diorama-tag.is-shown {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.12s;
}

/* ------------------------------------------------------------- the "!" over the note on the floor

   A plain bar and dot in the icons' pixels, three screen px to one, in a red that's the room's (the cow wall's red
   painting), with a hard pixel shadow so it reads on the floor boards. It bobs slowly until the note has been read
   once. diorama-page.js puts its foot just over the note. */
.diorama-bang {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  margin: -38px 0 0 -9px; /* its foot, a little above the note */
  padding: 4px;
  border: 0;
  background: none;
  color: #e0402f;
  cursor: pointer;
}

.diorama-bang svg {
  display: block;
  width: 9px;
  height: 27px;
  fill: currentColor;
  shape-rendering: crispEdges;
  filter: drop-shadow(3px 3px 0 rgb(40 8 4 / 0.45));
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  50% {
    translate: 0 -6px;
  }
}

.diorama-bang:focus {
  outline: none;
}

.diorama-bang:focus-visible {
  outline: 1px solid var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .diorama-bang svg {
    animation: none;
  }
}

/* Leaving for a page, the icons and the "!" go with the room. */
.diorama.is-leaving .diorama-side,
.diorama.is-leaving .diorama-bang {
  opacity: 0;
  transition: opacity 0.25s;
}

/* ------------------------------------------------------------- notes over the room

   Small cards over the page, pinned at a slight tilt, in the reading face: the note from the floor, the résumé, me,
   say hi. The room shows faintly through around them. */
.room-pop {
  box-sizing: border-box;
  width: min(300px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 20px 22px 16px;
  border: 1px solid var(--rule);
  background: #fffefb;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 12px 32px -12px rgb(0 0 0 / 0.25);
  rotate: -1deg;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
  overscroll-behavior: contain;
}

/* It holds the focus when it opens (diorama-page.js), not its ×: no ring round the note. */
.room-pop:focus {
  outline: none;
}

.room-pop::backdrop {
  background: rgb(255 255 255 / 0.4);
}

.room-pop p {
  margin: 0 0 10px;
}

.room-note-hey {
  margin-right: 24px;
  font-size: 19px;
  color: var(--ink);
}

.room-note-close {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 6px 8px;
  border: 0;
  background: none;
  font: 18px/1 var(--sans);
  color: var(--faint);
  cursor: pointer;
}

.room-note-close:hover {
  color: var(--ink);
}

.room-note-close:focus {
  outline: none;
}

.room-note-close:focus-visible {
  outline: 1px solid var(--muted);
}

.room-pop a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.room-pop a:hover,
.room-pop a:focus-visible {
  text-decoration-color: currentColor;
  outline: none;
}

/* The note: where everything is, each line with where it is in the room after it. */
.room-welcome-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.room-welcome-list li {
  padding: 4px 0;
}

.room-welcome-list span {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--faint);
}

/* The résumé: each thing a title, its dates to the right, where under it, then a few lines. */
.room-work {
  width: min(520px, calc(100vw - 32px));
  rotate: -0.5deg;
}

.room-work h2 {
  margin: 22px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.work-item {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  margin-bottom: 16px;
}

.work-item > * {
  grid-column: 1 / -1;
}

.room-work h3 {
  grid-column: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
}

.room-work .work-when {
  grid-column: 2;
  grid-row: 1;
  align-self: baseline;
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.room-work .work-where {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.room-work .work-item p:last-child {
  margin-bottom: 0;
}

.room-work .work-item p:not([class]) {
  color: var(--text);
}

/* Me: my photos from outside, one at a time, each whole in a fixed box so nothing moves between them. */
.room-me {
  width: min(460px, calc(100vw - 32px));
  rotate: -0.6deg;
}

.me-photos {
  display: grid;
  height: min(62dvh, 560px);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.me-photos figure {
  margin: 0;
  min-height: 0;
}

.me-photos img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

.room-pop .me-caption {
  min-height: 2.8em;
  margin: 10px 0 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
}

.me-caption .caption-title {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.me-caption .caption-by {
  display: block;
  color: var(--faint);
}

.me-controls {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  font: 12px var(--sans);
  color: var(--faint);
}

.me-controls button {
  padding: 10px 14px;
  border: 0;
  background: none;
  font: 16px var(--sans);
  color: var(--muted);
  cursor: pointer;
}

.me-controls button:hover {
  color: var(--ink);
}

.me-controls button:focus {
  outline: none;
}

.me-controls button:focus-visible {
  outline: 1px solid var(--muted);
}

.me-count {
  min-width: 3.5em;
  text-align: center;
}

/* Say hi: the Contact page's words. */
.room-hi h2 {
  margin: 14px 0 2px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}

/* The desk's screens, laid over the canvas where the 3D ones are (desk.js): built at full size, scaled into place,
   and clipped to the canvas (desk.js sets this box to it). Hidden while the camera moves; the one in use takes the
   keyboard. */
.desk {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.18s, visibility 0s 0.18s;
}

.desk.is-shown {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.18s;
}

.desk-screen {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  transform-origin: 0 0;
  background: #eff1f5;
}

.desk.is-shown .desk-screen {
  pointer-events: auto;
}

.desk-screen:focus {
  outline: none;
}

.desk-screen.is-asleep {
  cursor: pointer;
}

.desk-screen.is-asleep > * {
  pointer-events: none;
}

/* On a phone the screen in use fills the window, over a white page, with a way back. */
.desk.is-full::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #fff;
}

.desk-screen.is-full {
  position: fixed;
  z-index: 21;
}

.desk-back {
  display: none;
}

.desk.is-full .desk-back {
  display: block;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 21;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}

/* The laptop's Omarchy desktop in Catppuccin Latte: Waybar, then Hyprland's tiles. Sizes in desk-theme.js. */
.omarchy {
  position: relative;
  width: 1200px;
  height: 800px;
  background: linear-gradient(135deg, #eff1f5, #d9def3);
  color: #4c4f69;
  font: 13px/1 "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

.omarchy-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: #eff1f5;
}

.omarchy-ws span {
  display: inline-block;
  width: 20px;
  color: #8c8fa1;
  text-align: center;
}

.omarchy-ws .is-on {
  color: #4c4f69;
  font-weight: 700;
}

.omarchy-clock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.omarchy-tray {
  display: flex;
  gap: 14px;
}

.omarchy-tray svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.omarchy-tray circle,
.omarchy-tray .fill {
  fill: currentColor;
  stroke: none;
}

.omarchy-tile {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  padding: 6px 8px;
  border: 2px solid #bcc0cc;
  background: #eff1f5;
}

.omarchy-tile.is-active {
  border-color: #1e66f5;
}

.omarchy-browser {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #fff;
}

.omarchy-browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  background: #e6e9ef;
  font-size: 12px;
}

.omarchy-tab {
  align-self: flex-end;
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  background: #fff;
}

.omarchy-address {
  flex: 1;
  padding: 6px 12px;
  border-radius: 14px;
  background: #fff;
  color: #6c6f85;
}

.omarchy-page {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #fff;
}

.omarchy-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Sudoku, after the New York Times' (tools/sudoku.js). */
.nyt {
  height: 100%;
  padding: 0 18px;
  color: #121212;
  font: 13px/1.2 "Helvetica Neue", Arial, sans-serif;
}

.nyt-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  height: 36px;
  padding-top: 8px;
  box-sizing: border-box;
}

.nyt-title {
  font: 700 22px/1 Georgia, "Times New Roman", serif;
}

.nyt-date {
  color: #5a5a5a;
  font-size: 12px;
}

.nyt-levels {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.nyt button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.nyt-levels button {
  padding: 4px 8px;
  border-radius: 12px;
  background: none;
  color: #5a5a5a;
}

.nyt-levels button.is-on {
  background: #121212;
  color: #fff;
}

.nyt-timer {
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.nyt-body {
  display: flex;
  gap: 22px;
  padding-top: 6px;
}

.nyt-grid {
  display: grid;
  grid-template-columns: repeat(9, 28px);
  grid-auto-rows: 28px;
  border: 2px solid #121212;
  outline: none;
}

.nyt-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #d0d0d0;
  border-bottom: 1px solid #d0d0d0;
  color: #2860d8;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
}

.nyt-cell:nth-child(9n) {
  border-right: 0;
}

.nyt-cell:nth-child(n + 73) {
  border-bottom: 0;
}

.nyt-cell.is-box-right {
  border-right: 2px solid #121212;
}

.nyt-cell.is-box-bottom {
  border-bottom: 2px solid #121212;
}

.nyt-cell.is-given {
  color: #121212;
}

.nyt-cell.is-peer {
  background: #e9eef4;
}

.nyt-cell.is-same {
  background: #f8e9a6;
}

.nyt-cell.is-selected {
  background: #f9d74a;
}

.nyt-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 170px;
}

.nyt-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.nyt-pad button {
  height: 46px;
  border-radius: 6px;
  background: #f2f2f2;
  color: #121212;
  font-size: 22px;
}

.nyt-pad button:hover,
.nyt-erase:hover {
  background: #e4e4e4;
}

.nyt-erase {
  height: 34px;
  border-radius: 6px;
  background: #f2f2f2;
}

.nyt-status {
  color: #5a5a5a;
  font-size: 12px;
}

