:root {
  --color-bg: #050506;
  --color-text: #f2eee8;
  --color-muted: #8b877f;
  --color-faint: #4a4741;
  --color-accent: #ff5a1f;
  --color-accent-soft: rgb(255 90 31 / 0.18);
  /* Near-white with a faint warm tint, for the headline link. */
  --color-accent-tint: #ffdfcc;
  --color-ok: #3ddc84;
  --color-screen: #07090c;
  --color-screen-bar: #141a22;
  --color-screen-text: #c9d6e3;
  --color-screen-muted: #6c7b8c;
  /* Monitor desktop ("kayrin.os"); also read by the 3D monitor texture. */
  --os-wall: #0b0c10;
  --os-grid: rgb(255 122 61 / 0.06);
  --os-window: #111318;
  --os-title: #2a1710;
  --os-line: #b8643c;
  --os-taskbar: #101217;
  /* Game viewer: night-dark stage and the PS1-menu serif for its caption. */
  --os-stage: #05070c;
  --font-caption: Georgia, 'Times New Roman', serif;
  --color-line: rgb(242 238 232 / 0.14);
  /* Language switch "lights off": text switches fully off, then fades back in
     with the room (delay/duration match ROOM_POWER_ON in scene.js). */
  --lights-off-speed: 100ms;
  --lights-on-delay: 380ms;
  --lights-on-speed: 1700ms;

  --font-sans: 'Geist', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --gutter: clamp(1rem, 3vw, 2rem);

  --radius: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 600ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Chrome ---------- */

.site-header,
.site-footer {
  position: fixed;
  inset-inline: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--gutter);
  pointer-events: none;
}

.site-header {
  top: 0;
  background: linear-gradient(var(--color-bg), transparent);
}

.site-header > *,
.site-footer > * {
  pointer-events: auto;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand span {
  color: var(--color-accent);
}

.nav {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
}

.nav a {
  position: relative;
  color: var(--color-muted);
  transition: color 200ms;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--color-text);
}

/* Placeholder link (no destination yet). */
.nav a.nav__soon {
  cursor: default;
}

.nav a[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -0.7em;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--color-accent);
  translate: 0 -50%;
}

.status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-ok);
  box-shadow: 0 0 8px var(--color-ok);
}

.site-footer {
  bottom: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-faint);
}

/* Text switches fully off with the room lights during a language switch,
   then fades back in as the room comes up (see --lights-*). */
.site-header,
.site-footer,
.panel > * {
  transition: opacity var(--lights-on-speed) ease-in-out var(--lights-on-delay);
}

body.is-lights-off :is(.site-header, .site-footer, .panel > *) {
  opacity: 0;
  transition: opacity var(--lights-off-speed) ease-out;
}

/* ---------- 3D stage ---------- */

.stage {
  position: fixed;
  inset: 0;
}

.stage canvas.webgl-layer {
  display: block;
  image-rendering: pixelated;
}

.stage.is-hovering-desk {
  cursor: pointer;
}

.css3d-layer {
  position: absolute !important;
  inset: 0;
  pointer-events: none;
}

/* Darkening at the edges so the UI text stays readable over the scene. */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 60%, rgb(0 0 0 / 0.4)),
    repeating-linear-gradient(0deg, rgb(0 0 0 / 0.12) 0 1px, transparent 1px 3px);
}

/* ---------- Overlay panels ---------- */

.panel {
  position: fixed;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  translate: 0 12px;
  transition:
    opacity var(--duration) var(--ease),
    translate var(--duration) var(--ease),
    visibility 0s var(--duration);
}

/* The headline waits until the camera has stepped through the door (.has-entered). */
body.has-entered[data-route='home'] .panel--home,
body.is-seated .panel--work {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  transition-delay: 150ms, 150ms, 0s;
}

body.is-seated .panel--work {
  transition-delay: 0s;
}

.panel--home {
  left: var(--gutter);
  bottom: calc(var(--space-8) * 2);
  max-width: 34rem;
  pointer-events: none;
}

.panel--home .cta {
  pointer-events: auto;
}

.cta,
.back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: rgb(5 5 6 / 0.5);
  backdrop-filter: blur(6px);
  font-size: var(--text-sm);
  font-weight: 500;
  transition:
    border-color 200ms,
    background-color 200ms,
    opacity var(--lights-on-speed) ease-in-out var(--lights-on-delay);
}

.cta:hover,
.back:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.cta__arrow {
  transition: translate 200ms var(--ease);
}

.cta:hover .cta__arrow {
  translate: 3px 0;
}

/* On desktop the desk itself is the way in (hover highlight + "click to sit"),
   so the button goes. Phones keep it. "Work" in the nav still works for keyboards. */
@media (hover: hover) and (pointer: fine) {
  .panel--home .cta {
    display: none;
  }
}

.panel--work {
  top: 4.5rem;
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

kbd {
  padding: 0 var(--space-1);
  border: 1px solid var(--color-line);
  border-radius: 3px;
  font-family: inherit;
}

/* ---------- Monitor desktop "kayrin.os" (rendered in 3D via CSS3D) ----------
   Laid out at 1000x613px, then scaled onto the monitor. The wallpaper, icons
   and taskbar geometry must match js/os.js, which the 3D texture also uses. */

.monitor {
  position: relative;
  overflow: hidden;
  background-color: var(--os-wall);
  background-image:
    linear-gradient(var(--os-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--color-text);
  font-family: var(--font-mono);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms var(--ease);
}

.monitor.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Scanlines over the screen so the HTML sits with the low-fi scene. */
.monitor::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgb(0 0 0 / 0.18) 0 2px, transparent 2px 4px);
}

.monitor button {
  font: inherit;
  color: inherit;
}

/* Own stacking context and clipping: windows stay above the wallpaper and
   below the taskbar and start menu, however they are dragged. */
.os__desk {
  position: absolute;
  inset: 0 0 44px;
  z-index: 0;
  overflow: hidden;
}

/* Desktop icons: positions and sizes are set inline from os.js. */
.os-icon {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.os-icon svg {
  display: block;
  margin-inline: auto;
  fill: none;
  stroke: var(--os-line);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.os-icon span {
  position: absolute;
  inset-inline: 0;
  font-size: 15px;
  line-height: 18px;
  text-align: center;
  color: var(--color-screen-muted);
}

.os-icon:hover svg,
.os-icon:focus-visible svg {
  stroke: var(--color-accent);
}

.os-icon:hover span,
.os-icon:focus-visible span {
  color: var(--color-accent-tint);
}

.os-icon:focus-visible {
  outline: none;
}

/* Taskbar (geometry matches OS_TASKBAR in os.js). */
.os__taskbar {
  z-index: 1;
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  height: 44px;
  padding: 0 12px;
  border-top: 2px solid var(--os-line);
  background: var(--os-taskbar);
  font-size: 18px;
}

.monitor .os__start {
  cursor: pointer;
  background: none;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  height: 30px;
  padding: 0 12px;
  border: 2px solid var(--os-line);
}

.os__start i {
  width: 10px;
  height: 10px;
  background: var(--color-accent);
}

.os__tasks {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.monitor .os__task {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--os-line);
  background: none;
  font-size: 14px;
  color: var(--color-screen-muted);
  cursor: pointer;
}

.monitor .os__task.is-active {
  border-color: var(--color-accent);
  background: var(--os-title);
  color: var(--color-accent-tint);
}

.monitor .os__task:hover,
.monitor .os__task:focus-visible {
  outline: none;
  color: var(--color-text);
}

/* Start menu, opened from the kayrin.os button. */
.os__menu {
  position: absolute;
  left: 12px;
  bottom: 50px;
  display: grid;
  min-width: 260px;
  padding: 6px;
  border: 2px solid var(--os-line);
  background: var(--os-window);
  box-shadow: 6px 6px 0 rgb(0 0 0 / 0.45);
}

.os__menu[hidden] {
  display: none;
}

.monitor .os__menu button {
  padding: 8px 12px;
  border: 0;
  background: none;
  font-size: 18px;
  text-align: left;
  color: var(--color-text);
  cursor: pointer;
}

.monitor .os__menu button:last-child {
  margin-top: 4px;
  border-top: 1px solid var(--os-line);
  color: var(--color-accent-tint);
}

.monitor .os__menu button:hover,
.monitor .os__menu button:focus-visible {
  outline: none;
  background: var(--color-accent);
  color: var(--os-wall);
}

.os__clock {
  flex: none;
  color: var(--color-screen-muted);
}

/* Windows: drag by the title bar; _ minimizes to the taskbar, □ maximizes. */
.win {
  position: absolute;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  border: 2px solid var(--os-line);
  background: var(--os-window);
  box-shadow: 6px 6px 0 rgb(0 0 0 / 0.45);
}

.win.is-open {
  display: flex;
  animation: win-open 180ms steps(3) both;
}

.win.is-min {
  display: none;
}

/* !important: a dragged window carries its position as inline left/top. */
.win.is-max {
  inset: 0 !important;
  width: auto !important;
  box-shadow: none;
}

.win.is-max .win__art {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.win.is-dragging {
  box-shadow: 10px 10px 0 rgb(0 0 0 / 0.5);
}

.win.is-dragging .win__bar {
  cursor: grabbing;
}

@keyframes win-open {
  from {
    opacity: 0.3;
    transform: scale(0.4);
  }
}

.win__bar {
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 6px 0 12px;
  border-bottom: 2px solid var(--os-line);
  background: var(--os-title);
  font-size: 16px;
  color: var(--color-accent-tint);
}

.win__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win__ctrl {
  display: flex;
  gap: 6px;
}

.win__ctrl button {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--os-line);
  background: none;
  font-size: 14px;
  line-height: 1;
  color: var(--color-accent-tint);
}

.win__ctrl button {
  cursor: pointer;
}

.win__ctrl button:hover,
.win__ctrl button:focus-visible {
  outline: none;
  background: var(--color-accent);
  color: var(--os-wall);
}

.win__body {
  display: grid;
  gap: 8px;
  padding: 14px 18px 18px;
}

.os-line {
  min-height: 1.3em;
  margin: 0;
  font-size: 17px;
  color: var(--color-screen-muted);
  white-space: pre;
}

.os-big {
  min-height: 1.15em;
  margin: 0;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.os-small {
  min-height: 1.3em;
  margin: 0;
  font-size: 20px;
  color: var(--color-screen-muted);
}

/* Blinking block caret on whatever is being typed. */
.is-typing::after {
  content: '▌';
  margin-left: 2px;
  color: var(--color-accent);
  animation: caret 0.9s steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.os-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.os-progress__track {
  flex: 1;
  height: 18px;
  padding: 2px;
  border: 2px solid var(--os-line);
}

.os-progress__fill {
  display: block;
  width: 0%;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--color-accent) 0 10px, transparent 10px 13px);
}

.os-progress__pct {
  width: 4ch;
  font-size: 16px;
  text-align: right;
  color: var(--color-accent-tint);
}

.monitor .os-button {
  justify-self: start;
  margin-top: 6px;
  padding: 6px 16px;
  border: 2px solid var(--os-line);
  background: none;
  font-size: 18px;
  color: var(--color-accent-tint);
  visibility: hidden;
  cursor: pointer;
}

.monitor .os-button.is-ready {
  visibility: visible;
}

.monitor .os-button:hover,
.monitor .os-button:focus-visible {
  outline: none;
  background: var(--color-accent);
  color: var(--os-wall);
}

/* Browser windows with the low-poly site previews. */
.win__toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 2px solid var(--os-line);
}

.os-nav {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--os-line);
  font-size: 12px;
  color: var(--color-screen-muted);
}

.os-address {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  border: 2px solid var(--color-line);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
}

.win__art {
  display: block;
}

/* PS1-style screenshot: tiny canvas shown large with hard pixel edges. */
.win__art canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  image-rendering: pixelated;
}

.win__footer {
  padding: 10px 14px;
  border-top: 2px solid var(--os-line);
}

.os-link {
  font-size: 18px;
  color: var(--color-text);
  transition: text-shadow 150ms;
}

.os-link span {
  color: var(--color-accent);
}

.os-link:hover,
.os-link:focus-visible {
  outline: none;
  text-shadow: 0 0 12px rgb(255 90 31 / 0.6);
}

/* contact.exe: profile links (logo + name), OK underneath. */
.win--dialog .win__body {
  gap: 14px;
}

.os-contact {
  display: grid;
  gap: 6px;
}

/* Hover/focus: an accent bar sweeps left to right across the whole row. */
.os-contact__link {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 4px 8px;
  text-decoration: none;
  background: linear-gradient(var(--color-accent), var(--color-accent)) no-repeat left / 0% 100%;
  transition: background-size 260ms ease-out, color 160ms;
}

.os-contact__link svg {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  color: var(--color-accent);
  transition: color 160ms;
}

.os-contact__link:hover,
.os-contact__link:focus-visible {
  background-size: 100% 100%;
  color: var(--os-window);
  text-shadow: none;
}

.os-contact__link:hover svg,
.os-contact__link:focus-visible svg {
  color: var(--os-window);
}

.monitor .win--dialog .os-button {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 90px;
}

.os-alert {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-accent);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-accent);
}

.os-dialog-text {
  margin: 0;
  font-size: 18px;
}

/* Window placement (px in the 1000x613 desktop). Overlap is intentional. */
.win--boot { left: 130px; top: 20px; width: 390px; }
.win--like { left: 560px; top: 36px; width: 410px; }
.win--explore { left: 167px; top: 314px; width: 450px; }
.win--site-0 { left: 120px; top: 22px; width: 420px; }
.win--site-1 { left: 520px; top: 104px; width: 420px; }
.win--dialog { left: 330px; top: 190px; width: 360px; }

/* explore.exe folder view ("search ~/projects"): one folder per site. */
.win__files[hidden],
.win__body[hidden] {
  display: none;
}

.os-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  padding: 16px 18px 20px;
}

.monitor .os-folder {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
}

.os-folder svg {
  width: 56px;
  height: 46px;
  fill: none;
  stroke: var(--os-line);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.os-folder span {
  font-size: 15px;
  color: var(--color-screen-muted);
}

.monitor .os-folder:hover,
.monitor .os-folder:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  background: var(--os-title);
}

.os-folder:hover svg,
.os-folder:focus-visible svg {
  stroke: var(--color-accent);
}

.os-folder:hover span,
.os-folder:focus-visible span {
  color: var(--color-accent-tint);
}

.monitor .os-nav[data-files-back] {
  padding: 0;
  background: none;
  cursor: pointer;
}

.monitor .os-nav[data-files-back]:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Pixel-art file icons (GBA cartridge, CD): filled squares, no outlines. */
.os-folder .px-icon,
.os-folder:hover .px-icon,
.os-folder:focus-visible .px-icon {
  stroke: none;
  image-rendering: pixelated;
}

.px-icon .px-line { fill: var(--os-line); }
.px-icon .px-accent { fill: var(--color-accent-tint); }

.os-folder:hover .px-line,
.os-folder:focus-visible .px-line {
  fill: var(--color-accent);
}

/* Archive names can be long: let them wrap under the icon. */
.os-folder span {
  max-width: 120px;
  text-align: center;
  line-height: 1.25;
}

/* Game viewer: a dark, blurred, darkened copy of the cover fills the stage
   and the cover sits small in the middle, low-res and dithered like a PS1
   item screen. The caption sits below the image. */
.win--game { left: 240px; top: 6px; width: 520px; }

.os-viewer {
  --box-h: 160px;
  position: relative;
  display: grid;
  place-items: center;
  height: 220px;
  overflow: hidden;
  background: var(--os-stage);
  perspective: 700px;
}

.os-viewer__bg {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  object-fit: cover;
  filter: blur(14px) brightness(0.3) saturate(0.6);
}

/* Vignette and a soft scanline haze over the stage. */
.os-viewer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 35%, rgb(0 0 0 / 0.75)),
    repeating-linear-gradient(0deg, rgb(0 0 0 / 0.2) 0 1px, transparent 1px 3px);
}

/* The cover as a slowly rotating box. --ratio (cover width/height), --d
   (thickness), --spine and --cover (PS1-rendered art) are set from js. */
.os-box {
  --w: calc(var(--box-h) * var(--ratio, 0.75));
  position: relative;
  z-index: 1;
  width: var(--w);
  height: var(--box-h);
  transform-style: preserve-3d;
  animation: box-spin 9s linear infinite;
}

@keyframes box-spin {
  from { transform: rotateX(-10deg) rotateY(0deg); }
  to { transform: rotateX(-10deg) rotateY(360deg); }
}

.os-box__face {
  position: absolute;
  backface-visibility: hidden;
}

/* Front cover and back cover. */
.os-box__front,
.os-box__back {
  inset: 0;
  background: var(--cover) center / 100% 100% no-repeat, var(--spine);
  image-rendering: pixelated;
  filter: blur(0.4px) brightness(0.8) contrast(1.05) saturate(0.9);
}

.os-box__back {
  background-image: var(--cover-back, var(--cover));
}

.os-box__front { transform: translateZ(calc(var(--d) / 2)); }
.os-box__back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }

/* Spine sides, a touch darker than the art so the box reads as solid. */
.os-box__right,
.os-box__left {
  top: 0;
  left: calc(50% - var(--d) / 2);
  width: var(--d);
  height: 100%;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 0.35), rgb(255 255 255 / 0.06) 50%, rgb(0 0 0 / 0.35)),
    var(--spine-art, none) center / 100% 100% no-repeat,
    var(--spine);
  image-rendering: pixelated;
}

.os-box__right { transform: rotateY(90deg) translateZ(calc(var(--w) / 2)); }
.os-box__left { transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }

.os-box__top,
.os-box__bottom {
  left: 0;
  top: calc(50% - var(--d) / 2);
  width: 100%;
  height: var(--d);
  background: linear-gradient(rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.45)), var(--spine);
}

.os-box__top { transform: rotateX(90deg) translateZ(calc(var(--box-h) / 2)); }
.os-box__bottom { transform: rotateX(-90deg) translateZ(calc(var(--box-h) / 2)); }

@media (prefers-reduced-motion: reduce) {
  .os-box {
    animation: none;
    transform: rotateX(-10deg) rotateY(-28deg);
  }
}

.monitor .os-viewer__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  padding: 4px 10px;
  border: 0;
  background: none;
  font-family: var(--font-caption);
  font-size: 44px;
  line-height: 1;
  color: var(--color-text);
  text-shadow: 0 0 8px rgb(0 0 0 / 0.8);
  transform: translateY(-50%);
  cursor: pointer;
}

.os-viewer__arrow--prev { left: 6px; }
.os-viewer__arrow--next { right: 6px; }

.monitor .os-viewer__arrow:hover,
.monitor .os-viewer__arrow:focus-visible {
  outline: none;
  color: var(--color-accent);
}

.os-caption {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 18px 16px;
  border-top: 2px solid var(--os-line);
  text-align: center;
}

.os-caption p {
  margin: 0;
}

/* Title and description share the serif italic; the title is bold caps. */
.os-caption__title span {
  font-family: var(--font-caption);
  font-size: 18px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text);
}

.os-caption__meta {
  font-family: var(--font-caption);
  font-size: 15px;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--color-screen-muted);
}

/* Project details under the platform line; scrolls if long. */
.os-caption__details {
  display: grid;
  gap: 8px;
  justify-self: stretch;
  max-height: 196px;
  margin: 4px 0 0;
  padding: 0 4px 0 20px;
  overflow-y: auto;
  font-family: var(--font-caption);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  color: var(--color-screen-text);
  scrollbar-color: var(--os-line) transparent;
  scrollbar-width: thin;
}

.os-caption__details[hidden] {
  display: none;
}

.os-caption__details li::marker {
  color: var(--color-accent);
}

.os-caption__more {
  font-size: 15px;
}

/* "more info" / "less info" toggle. */
.monitor .os-caption__more {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.os-caption__more[hidden] {
  display: none;
}

.os-caption__link {
  list-style: none;
}

/* Seated: the screen is a preview, and any click zooms in to use it. */
.monitor.is-active:not(.is-fullscreen),
.monitor.is-active:not(.is-fullscreen) * {
  cursor: zoom-in !important;
}

/* Exit button on the taskbar, shown only in full screen. */
.monitor .os__exit {
  display: none;
  flex: none;
  height: 30px;
  padding: 0 12px;
  border: 2px solid var(--os-line);
  background: none;
  font-size: 16px;
  color: var(--color-accent-tint);
  cursor: pointer;
}

.monitor.is-fullscreen .os__exit {
  display: inline-flex;
  align-items: center;
}

.monitor .os__exit:hover,
.monitor .os__exit:focus-visible {
  outline: none;
  background: var(--color-accent);
  color: var(--os-wall);
}

/* Full screen (desktop): the same 1000x613 desktop scaled up to fit the window. */
.monitor.is-fullscreen {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 40;
  transform: translate(-50%, -50%) scale(var(--os-scale, 1)) !important;
  box-shadow: 0 0 0 100vmax var(--os-wall);
  animation: fs-in 260ms var(--ease) both;
}

.monitor.is-fullscreen:focus {
  outline: none;
}

@keyframes fs-in {
  from {
    opacity: 0;
  }
}

/* The page's own buttons step aside while zoomed in. */
body.is-zoomed .panel--work {
  opacity: 0;
  visibility: hidden;
}

/* Follows the cursor while it's over the desk (desktop only). */
.cursor-hint {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 15;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  background: rgb(5 5 6 / 0.7);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(16px, 16px) scale(0.9);
  transition:
    opacity 200ms var(--ease),
    transform 200ms var(--ease);
}

.cursor-hint.is-visible {
  opacity: 1;
  transform: translate(16px, 16px) scale(1);
}

.cursor-hint.is-flipped {
  transform: translate(calc(-100% - 16px), 16px) scale(0.9);
}

.cursor-hint.is-flipped.is-visible {
  transform: translate(calc(-100% - 16px), 16px) scale(1);
}

.cursor-hint span {
  color: var(--color-accent);
}

/* ---------- Loader & fallback ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  transition: opacity 1200ms var(--ease), visibility 0s 1200ms;
}

body.is-loaded .loader,
body.no-webgl .loader {
  opacity: 0;
  visibility: hidden;
}

.fallback {
  display: none;
}

body.no-webgl .fallback {
  display: block;
  padding: 6rem var(--gutter);
}

body.no-webgl .fallback a {
  color: var(--color-accent);
}

@media (max-width: 640px) {
  .status {
    display: none;
  }

  .nav {
    gap: var(--space-4);
  }

  .panel--work {
    top: auto;
    bottom: 3rem;
  }

  .hint {
    display: none;
  }

  /* The monitor is small on a phone: bigger type and roomier windows.
     Icons and taskbar stay as on desktop so they match the 3D monitor texture. */
  .win__bar { height: 44px; font-size: 24px; }

  .win__ctrl button { width: 30px; height: 30px; font-size: 20px; }

  .os-line { font-size: 24px; }
  .os-big { font-size: 46px; }
  .os-small { font-size: 28px; }
  .monitor .os-button { font-size: 26px; }
  .monitor .os__menu button { font-size: 24px; }
  .os-address { height: 36px; font-size: 22px; }
  .os-nav { width: 32px; height: 32px; font-size: 16px; }
  .os-link { font-size: 28px; }
  .os-dialog-text { font-size: 26px; }

  .win--boot { left: 120px; top: 12px; width: 460px; }
  .win--like { left: 470px; top: 30px; width: 510px; }
  .win--explore { left: 130px; top: 250px; width: 580px; }
  .win--site-0 { left: 110px; top: 10px; width: 430px; }
  .win--site-1 { left: 540px; top: 80px; width: 440px; }
  .win--dialog { left: 270px; top: 170px; width: 470px; }

  .os-folder span { font-size: 24px; }

  /* Full screen on a phone: a vertical desktop sized to the phone itself.
     Icons in a row at the top, full-width stacked windows, taskbar at the bottom.
     Windows can still be dragged (inline left/top beat these starting spots). */
  .monitor.is-fullscreen {
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    box-shadow: none;
  }

  .monitor.is-fullscreen .os-icon:nth-of-type(1) { left: 8px !important; top: 8px !important; }
  .monitor.is-fullscreen .os-icon:nth-of-type(2) { left: 92px !important; top: 8px !important; }
  .monitor.is-fullscreen .os-icon:nth-of-type(3) { left: 176px !important; top: 8px !important; }
  .monitor.is-fullscreen .os-icon:nth-of-type(4) { left: 260px !important; top: 8px !important; }

  .monitor.is-fullscreen .win { left: 10px; width: calc(100% - 20px); }
  .monitor.is-fullscreen .win--boot { top: 100px; }
  .monitor.is-fullscreen .win--like { top: 290px; }
  .monitor.is-fullscreen .win--explore { top: 490px; }
  .monitor.is-fullscreen .win--site-0 { top: 100px; }
  .monitor.is-fullscreen .win--site-1 { top: 380px; }
  .monitor.is-fullscreen .win--dialog { top: 260px; }
  /* Game viewer fits between the icons and the taskbar (44px). With details
     open the box shrinks and only the list scrolls, so "less info" stays visible. */
  .monitor.is-fullscreen .win--game { top: 90px; max-height: calc(100% - 90px - 44px - 10px); }
  .monitor.is-fullscreen .os-viewer { flex: none; --box-h: 150px; height: 210px; }
  .monitor.is-fullscreen .win--game:has(.os-caption__details:not([hidden])) .os-viewer { --box-h: 96px; height: 130px; }
  .monitor.is-fullscreen .win--game .os-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    padding: 10px 14px 12px;
  }
  .monitor.is-fullscreen .os-caption__title span { font-size: 16px; }
  .monitor.is-fullscreen .os-caption__meta,
  .monitor.is-fullscreen .os-caption__more { flex: none; font-size: 14px; }
  .monitor.is-fullscreen .os-caption__details {
    align-self: stretch;
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    font-size: 13px;
  }

  .monitor.is-fullscreen .win__bar { height: 34px; font-size: 14px; }
  .monitor.is-fullscreen .win__ctrl button { width: 26px; height: 26px; font-size: 14px; }
  .monitor.is-fullscreen .os-line { font-size: 13px; }
  .monitor.is-fullscreen .os-big { font-size: 26px; }
  .monitor.is-fullscreen .os-small { font-size: 15px; }
  .monitor.is-fullscreen .os-button { font-size: 16px; }
  .monitor.is-fullscreen .os-address { height: 30px; font-size: 14px; }
  .monitor.is-fullscreen .os-nav { width: 26px; height: 26px; font-size: 13px; }
  .monitor.is-fullscreen .os-link { font-size: 16px; }
  .monitor.is-fullscreen .os-dialog-text { font-size: 16px; }
  .monitor.is-fullscreen .os-folder span { font-size: 15px; }
  .monitor.is-fullscreen .os__menu button { font-size: 17px; }
  .monitor.is-fullscreen .os__taskbar { font-size: 15px; gap: 8px; padding: 0 8px; }
  .monitor.is-fullscreen .os__exit { font-size: 14px; padding: 0 8px; }
  .monitor.is-fullscreen .os__clock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    transition-delay: 0s !important;
  }
}
