:root {
  --wall: #e8dcc4;
  --wall-shade: #d4c4a3;
  --wall-trim: #b8a37e;
  --floor: #8b6f47;
  --floor-shade: #6e5635;
  --floor-light: #a18558;
  --ink: #2a2118;
  --ink-soft: #4a3f30;
  --night: #0a1c36;
  --night-soft: #1a2f4d;
  --lamp: #ffb84d;
  --lamp-soft: #ffd58a;
  --monitor: #5cf08a;
  --paper: #f6efde;
  --accent: #c25d4a;
  --book-a: #8b3a3a;
  --book-b: #2f5d8a;
  --book-c: #4a7a4a;
  --book-d: #c08b3e;
  --book-e: #6b4a8a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'VT323', monospace;
  background: #0a0a0d;
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#root { width: 100vw; height: 100vh; }

.journey-scroll {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.journey-scroll::-webkit-scrollbar {
  display: none;
}

.journey-scroll.is-locked {
  overflow: hidden;
}

.journey-stack {
  position: relative;
  min-height: 300vh;
}

.journey {
  position: sticky;
  z-index: 2;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background: #050407;
}

.journey-snap-track {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(3, 100vh);
  pointer-events: none;
}

.journey-snap-track span {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.journey-room,
.journey-brain,
.journey-work {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.journey-room {
  z-index: 1;
}

.journey-brain {
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity, transform;
}

.journey-work {
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity;
}

.journey-veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: #050407;
}

.journey .room-wrap {
  transform-origin: var(--journey-origin-x) var(--journey-origin-y);
  transform: translate(
    var(--journey-camera-x, 0%),
    var(--journey-camera-y, 0%)
  ) scale(var(--journey-room-scale, 1));
  opacity: var(--journey-room-opacity, 1);
  will-change: transform, opacity;
}

.journey--room .room-wrap {
  filter: drop-shadow(0 30px 50px rgba(0,0,0,.6));
}

.journey .hud,
.journey .hud-right {
  opacity: var(--journey-ui-opacity, 1);
  transform: translateY(var(--journey-ui-y, 0px));
  will-change: opacity, transform;
}

.journey .journey-cue {
  opacity: var(--journey-ui-opacity, 1);
  transform: translateX(-50%) translateY(var(--journey-ui-y, 0px));
}

.journey .journey-cue--brain {
  opacity: 1;
  transform: translateX(-50%);
}

.journey .journey-brain {
  opacity: var(--journey-brain-opacity, 0);
  transform: scale(var(--journey-brain-scale, 1));
  transform-origin: 50% 21%;
}

.journey .journey-work {
  opacity: var(--journey-work-opacity, 0);
}

.journey .journey-veil {
  opacity: var(--journey-veil-opacity, 0);
}

.journey--room-brain .journey-room,
.journey--brain-work .journey-brain {
  pointer-events: none;
}

.journey--room-brain .journey-brain,
.journey--brain-work .journey-brain,
.journey--brain-work .journey-work {
  visibility: visible;
}

.journey--brain .journey-room,
.journey--brain-work .journey-room,
.journey--work .journey-room,
.journey--work .journey-brain {
  visibility: hidden;
  pointer-events: none;
}

.journey--brain .journey-brain {
  visibility: visible;
  pointer-events: auto;
}

.journey--work .journey-work {
  visibility: visible;
  pointer-events: auto;
}

.journey-cue {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
  padding: 10px 12px 9px;
  border: 1px solid rgba(246,239,222,.2);
  background: rgba(8,7,10,.7);
  color: rgba(246,239,222,.74);
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.journey-cue span {
  font-size: 8px;
}

.journey-cue small {
  color: rgba(246,239,222,.42);
  font-family: inherit;
  font-size: 6px;
}

.journey-cue:hover,
.journey-cue:focus-visible {
  border-color: rgba(246,239,222,.58);
  background: rgba(18,14,20,.9);
  color: #fff;
  outline: none;
}

.room-worker--interactive {
  cursor: zoom-in;
  transition: filter .24s ease;
}

.room-worker--interactive:hover,
.room-worker--interactive:focus {
  filter: brightness(1.12) drop-shadow(0 0 7px rgba(117,216,240,.42));
  outline: none;
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, #161620 0%, #07070a 100%);
  overflow: hidden;
}

.room-wrap {
  position: relative;
  width: min(98vw, calc(96vh * 1.8));
  aspect-ratio: 9 / 5;
  filter: drop-shadow(0 30px 50px rgba(0,0,0,0.6));
}

.room-svg {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

.hud {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--paper);
  letter-spacing: 0.5px;
  z-index: 5;
  pointer-events: none;
}
.hud .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--monitor);
  box-shadow: 0 0 8px var(--monitor);
}
.hud .dot.night { background: #6b8aff; box-shadow: 0 0 8px #6b8aff; }
.hud .dot.alarm { background: #ff5f5f; box-shadow: 0 0 8px #ff5f5f; animation: blink 0.7s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.hud-right {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: rgba(246,239,222,0.55);
  z-index: 5;
  pointer-events: none;
  text-align: right;
  line-height: 1.6;
}

.signature {
  position: absolute;
  bottom: 14px;
  left: 18px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: rgba(246,239,222,0.4);
  z-index: 5;
  letter-spacing: 0.5px;
}

/* --- phone shake --- */
@keyframes phone-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-1.5px, 0) rotate(-2deg); }
  20% { transform: translate(1.5px, 0) rotate(2deg); }
  30% { transform: translate(-2px, 0) rotate(-3deg); }
  40% { transform: translate(2px, 0) rotate(3deg); }
  50% { transform: translate(-1.5px, 0) rotate(-2deg); }
  60% { transform: translate(1.5px, 0) rotate(2deg); }
  70% { transform: translate(-1px, 0) rotate(-1deg); }
  80% { transform: translate(1px, 0) rotate(1deg); }
  90% { transform: translate(0, 0) rotate(0deg); }
}
.phone-shaking {
  transform-box: fill-box;
  transform-origin: center;
  animation: phone-shake 0.35s linear infinite;
  cursor: pointer;
}
.phone-still {
  transform-box: fill-box;
  transform-origin: center;
  cursor: pointer;
}

/* --- monitor (no flicker) --- */
.monitor-on {
  cursor: pointer;
}
.monitor-on:hover { filter: brightness(1.08); }

.monitor-screen-layer,
.mini-desktop {
  text-rendering: geometricPrecision;
  font-kerning: none;
  font-variant-ligatures: none;
  font-feature-settings: "kern" 0, "liga" 0;
}

/* --- lamp flicker --- */
@keyframes lamp-flicker {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 1; }
  53% { opacity: 0.85; }
  55% { opacity: 1; }
}
.lamp-on { animation: lamp-flicker 2.8s ease-in-out infinite; }

/* --- breath (sleeping char) --- */
@keyframes breath {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-0.5px) scaleY(1.02); }
}
.breath { transform-box: fill-box; transform-origin: center; animation: breath 3.5s ease-in-out infinite; }

/* --- sleeping Zs: queue-emit. Each Z spawns at slot 1 (bottom),
   drifts up to slot 2, then pops off. Two Zs offset by half a cycle
   so there's always one in each slot \u2014 like a bubbly queue. --- */
@keyframes sleep-z {
  0%   { opacity: 0;   transform: translate(0px,  4px)  scale(0.5); }
  15%  { opacity: 1;   transform: translate(2px,  -1px)  scale(1); }
  50%  { opacity: 1;   transform: translate(18px,-16px) scale(0.8); }
  85%  { opacity: 0.5; transform: translate(30px,-30px) scale(0.6); }
  100% { opacity: 0;   transform: translate(38px,-38px) scale(0.4); }
}
.sleep-z {
  transform-box: fill-box;
  transform-origin: center;
  animation: sleep-z 2.4s linear infinite;
}
.sleep-z.z2 { animation-delay: 1.2s; }

/* --- sun rays / star twinkle --- */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.star { animation: twinkle 2.4s ease-in-out infinite; }
.star.s2 { animation-delay: 0.6s; }
.star.s3 { animation-delay: 1.2s; }
.star.s4 { animation-delay: 1.8s; }

@keyframes cloud-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(8px); }
}
.cloud-drift { animation: cloud-drift 6s ease-in-out infinite alternate; }

/* --- typing (working char) --- */
@keyframes hand-tap {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(-2.5px); }
  40% { transform: translateY(0); }
  60% { transform: translateY(-1.5px); }
  80% { transform: translateY(0); }
}
.typing-arm-l { transform-box: fill-box; transform-origin: center; animation: hand-tap 0.42s ease-in-out infinite; }
.typing-arm-r { transform-box: fill-box; transform-origin: center; animation: hand-tap 0.42s ease-in-out infinite; animation-delay: 0.21s; }

/* --- night overlay --- */
.night-overlay {
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* --- retro desktop modal --- */
.desktop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #2d6e8a;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 1px),
    radial-gradient(circle at 12px 12px, rgba(0,0,0,0.10) 1px, transparent 1px);
  background-size: 4px 4px, 24px 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: 'VT323', monospace;
  animation: fade-in 0.18s ease;
  image-rendering: pixelated;
}
.desk-menubar {
  background: linear-gradient(#fafafa, #d4d0c8);
  border-bottom: 2px solid #5a564f;
  padding: 4px 12px 4px 8px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 17px;
  color: #1a1a1a;
  box-shadow: 0 1px 0 #fff inset;
}
.desk-menubar .brand {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.desk-menubar .brand .logo {
  display: inline-block;
  width: 14px; height: 14px;
  background:
    linear-gradient(45deg, #c25d4a 50%, transparent 50%) top left/7px 7px no-repeat,
    linear-gradient(45deg, #5cf08a 50%, transparent 50%) top right/7px 7px no-repeat,
    linear-gradient(45deg, #ffd000 50%, transparent 50%) bottom left/7px 7px no-repeat,
    linear-gradient(45deg, #2f5d8a 50%, transparent 50%) bottom right/7px 7px no-repeat;
}
.desk-menubar .item { padding: 0 6px; cursor: default; }
.desk-menubar .item:hover { background: #1a4480; color: #fff; }
.desk-menubar .grow { flex: 1; }
.desk-menubar .clock { font-variant-numeric: tabular-nums; padding-right: 6px; }
.desk-menubar .x {
  background: #d4d0c8;
  border: 2px outset #fff;
  padding: 0 8px;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}
.desk-menubar .x:active { border-style: inset; }

.desk-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 24px;
  overflow: hidden;
}

.desk-icons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-content: start;
  padding: 4px;
}
.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 108px;
  padding: 6px 4px;
  cursor: pointer;
  border: 1px dotted transparent;
  user-select: none;
}
.desk-icon:hover { background: rgba(255,255,255,0.08); }
.desk-icon.selected {
  background: rgba(10, 36, 96, 0.55);
  border: 1px dotted rgba(255,255,255,0.6);
}
.desk-icon .glyph {
  width: 48px; height: 40px;
  display: block;
  image-rendering: pixelated;
}
.desk-icon .label {
  font-size: 16px;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.7);
  text-align: center;
  line-height: 1;
  word-break: break-word;
}

/* terminal window */
.term-window {
  background: #d4d0c8;
  border: 2px solid #1a1a1a;
  box-shadow: 2px 2px 0 #000, inset 1px 1px 0 #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}
.term-bar {
  background: linear-gradient(to right, #000080, #1084d0);
  border-bottom: 2px solid #1a1a1a;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #fff;
}
.term-bar .title-icon {
  width: 14px; height: 14px;
  background: #5cf08a;
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px #1a4a1a;
}
.term-bar .title { flex: 1; font-family: 'VT323', monospace; font-weight: 700; }
.term-bar .btn {
  width: 18px; height: 16px;
  background: #d4d0c8;
  border: 1.5px outset #fff;
  font-size: 11px;
  font-family: 'Press Start 2P', monospace;
  display: grid; place-items: center;
  color: #1a1a1a;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.term-bar .btn:active { border-style: inset; }

.term-body {
  flex: 1;
  background: #0b0f0a;
  padding: 10px 0 0 14px;
  overflow-y: auto;
  color: #b6f0c1;
  font-size: 18px;
  line-height: 1.32;
  text-shadow: 0 0 5px rgba(92, 240, 138, 0.3);
  scrollbar-color: #274827 #d4d0c8;
  scrollbar-width: auto;
}
.term-body::-webkit-scrollbar { width: 14px; }
.term-body::-webkit-scrollbar-track {
  background: #d4d0c8;
  border-left: 2px solid #1a1a1a;
  box-shadow: inset 2px 0 0 #ffffff, inset -2px 0 0 #88847c;
}
.term-body::-webkit-scrollbar-thumb {
  background: #274827;
  border: 2px solid #d4d0c8;
  box-shadow: inset 1px 1px 0 #4f7a4f, inset -1px -1px 0 #0b1a0b;
  min-height: 44px;
}
.term-body::-webkit-scrollbar-thumb:hover { background: #315c31; }

.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line.cmd { color: #fff; }
.term-line.dim { color: #6f9f78; }
.term-line.warn { color: #e8c069; }
.term-line.err { color: #e87b5d; }

.term-prompt {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: #0b0f0a;
  padding: 4px 14px 12px 0;
  font-size: 18px;
  color: #b6f0c1;
}
.term-prompt .ps { color: #5cf08a; }
.term-prompt input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font: inherit;
  caret-color: #5cf08a;
  text-shadow: 0 0 5px rgba(92, 240, 138, 0.3);
}
.dir { color: #6bb6ff; }

.desk-taskbar {
  background: linear-gradient(#fafafa, #d4d0c8);
  border-top: 2px solid #5a564f;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #1a1a1a;
  box-shadow: 0 -1px 0 #fff inset;
}
.desk-taskbar .start {
  background: #d4d0c8;
  border: 2px outset #fff;
  padding: 2px 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
}
.desk-taskbar .start:active { border-style: inset; }
.desk-taskbar .task {
  background: #d4d0c8;
  border: 2px inset #fff;
  padding: 2px 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.desk-taskbar .grow { flex: 1; }
.desk-taskbar .tray {
  border: 2px inset #d4d0c8;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}

/* file window (when opening a folder) */
.file-window {
  position: absolute;
  background: #d4d0c8;
  border: 2px solid #1a1a1a;
  box-shadow: 2px 2px 0 #000, inset 1px 1px 0 #fff;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.file-window .term-bar { background: linear-gradient(to right, #6a6a6a, #b8b4a8); }
.file-window {
  overflow: hidden;
}
.file-window .body {
  padding: 12px;
  background: #fff;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-content: start;
  font-size: 16px;
  color: #1a1a1a;
  overflow-y: auto;
}
.file-window .file-icon {
  width: 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 6px;
  border: 1px dotted transparent;
  user-select: none;
}
.file-window .file-icon:hover { background: rgba(0,80,160,0.1); }
.file-window .file-icon .glyph { width: 44px; height: 38px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.file-window .file-icon .label { font-size: 16px; text-align: center; line-height: 1.15; word-break: break-word; }

/* legacy backdrop fallback */
.term-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: grid;
  place-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.term-window {
  width: min(880px, 92vw);
  height: min(580px, 86vh);
  background: #0b0f0a;
  border: 2px solid #2c4a2c;
  border-radius: 6px;
  box-shadow: 0 0 0 4px #050805, 0 0 60px rgba(92, 240, 138, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'VT323', monospace;
}

.term-bar {
  background: #16241a;
  border-bottom: 1px solid #2c4a2c;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #8de8a3;
}
.term-bar .lights { display: flex; gap: 6px; }
.term-bar .lights span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #3a5d3a; border: 1px solid #2c4a2c;
}
.term-bar .lights span.r { background: #c25d4a; }
.term-bar .lights span.y { background: #c0a04a; }
.term-bar .lights span.g { background: #5cf08a; }
.term-bar .title { flex: 1; text-align: center; opacity: 0.7; }
.term-bar .x {
  cursor: pointer;
  border: none;
  background: transparent;
  color: #8de8a3;
  font-family: inherit;
  font-size: 16px;
}
.term-bar .x:hover { color: #fff; }

.term-body {
  flex: 1;
  padding: 14px 0 0 16px;
  overflow-y: auto;
  color: #b6f0c1;
  font-size: 19px;
  line-height: 1.35;
  text-shadow: 0 0 6px rgba(92, 240, 138, 0.35);
  scrollbar-color: #274827 #d4d0c8;
  scrollbar-width: auto;
}
.term-body::-webkit-scrollbar { width: 14px; }
.term-body::-webkit-scrollbar-track {
  background: #d4d0c8;
  border-left: 2px solid #1a1a1a;
  box-shadow: inset 2px 0 0 #ffffff, inset -2px 0 0 #88847c;
}
.term-body::-webkit-scrollbar-thumb {
  background: #274827;
  border: 2px solid #d4d0c8;
  box-shadow: inset 1px 1px 0 #4f7a4f, inset -1px -1px 0 #0b1a0b;
  min-height: 44px;
}
.term-body::-webkit-scrollbar-thumb:hover { background: #315c31; }

.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line.cmd { color: #fff; }
.term-line.dim { color: #6f9f78; }
.term-line.warn { color: #e8c069; }
.term-line.err { color: #e87b5d; }

.term-prompt {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 16px 14px 0;
  font-size: 19px;
  color: #b6f0c1;
}
.term-prompt .ps { color: #5cf08a; }
.term-prompt input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font: inherit;
  caret-color: #5cf08a;
  text-shadow: 0 0 6px rgba(92, 240, 138, 0.35);
}
.term-cursor {
  display: inline-block;
  width: 9px;
  height: 18px;
  background: #5cf08a;
  vertical-align: -3px;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}

.dir { color: #6bb6ff; }
.exe { color: #5cf08a; }
.boot { color: #5cf08a; }

/* clickable monitor hitbox indicator */
.click-hint {
  pointer-events: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  fill: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}
.monitor-on:hover ~ .click-hint { opacity: 0.9; }

/* ============================================================
   APP WINDOWS — Tools / Books
   ============================================================ */
.app-window {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #4a4a4a #4a4a4a #ffffff;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4), inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
  font-family: 'VT323', monospace;
  display: flex;
  flex-direction: column;
  color: #1a1a1a;
}
.app-titlebar {
  background: linear-gradient(to right, #1a4480, #2a64c0);
  color: #fff;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: move;
  user-select: none;
  border-bottom: 1px solid #103060;
}
.app-titlebar-icon { display: inline-flex; align-items: center; }
.app-titlebar-name {
  flex: 1;
  font-family: 'VT323', monospace;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 0.5px;
}
.app-titlebar-x {
  background: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #4a4a4a #4a4a4a #ffffff;
  color: #1a1a1a;
  cursor: pointer;
  width: 22px;
  height: 22px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.app-titlebar-x:active {
  border-color: #4a4a4a #ffffff #ffffff #4a4a4a;
}
.app-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  background: #d4d0c8;
  border-top: 1px solid #f0f0f0;
}
.app-footer {
  background: #c0c0c0;
  padding: 2px 8px;
  font-size: 13px;
  color: #2a2a2a;
  border-top: 1px solid #808080;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-resize-grip {
  display: inline-block;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background: repeating-linear-gradient(135deg, #4a4a4a 0 2px, transparent 2px 5px);
}

/* Server status badge inside apps */
.server-badge {
  font-size: 14px;
  padding: 4px 8px;
  margin-bottom: 10px;
  border: 1px solid;
  background: #e8e4dc;
}
.server-badge.online   { color: #2a6b2a; border-color: #2a6b2a; }
.server-badge.offline  { color: #8a2a2a; border-color: #8a2a2a; }
.server-badge.checking { color: #555;     border-color: #888;    }
.tool-offline {
  padding: 20px;
  background: #f0e0d0;
  border: 1px solid #b86040;
  color: #6a2a10;
  text-align: center;
  font-size: 16px;
}

/* Tool sections (HEIC / YT / GDS / Clipboard) */
.tool-section {
  background: #efece4;
  border: 1px solid;
  border-color: #4a4a4a #ffffff #ffffff #4a4a4a;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.tool-section h4 {
  margin: 0 0 8px 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #1a4480;
  letter-spacing: 0.5px;
}
.tool-section form { display: flex; flex-direction: column; gap: 6px; }
.tool-section input[type="url"],
.tool-section input[type="text"],
.tool-section input[type="number"],
.tool-section select,
.tool-section textarea {
  font-family: 'VT323', monospace;
  font-size: 16px;
  padding: 4px 6px;
  border: 2px solid;
  border-color: #4a4a4a #ffffff #ffffff #4a4a4a;
  background: #fff;
  color: #1a1a1a;
}
.tool-section input[type="number"] { width: 60px; }
.tool-radio { display: flex; gap: 14px; font-size: 16px; align-items: center; }
.tool-radio label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tool-btn {
  font-family: 'VT323', monospace;
  font-size: 16px;
  padding: 5px 14px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #4a4a4a #4a4a4a #ffffff;
  color: #1a1a1a;
  cursor: pointer;
  align-self: flex-start;
}
.tool-btn:hover { background: #d0d0d0; }
.tool-btn:active { border-color: #4a4a4a #ffffff #ffffff #4a4a4a; }
.tool-status {
  font-size: 15px;
  padding: 4px 0;
  color: #2a2a2a;
}
.tool-status.ok    { color: #2a6b2a; }
.tool-status.warn  { color: #8a6a10; }
.tool-status.err   { color: #8a2a2a; }
.file-input-label {
  display: inline-block;
  padding: 5px 10px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #4a4a4a #4a4a4a #ffffff;
  cursor: pointer;
  font-size: 16px;
}
.file-input-label input { display: none; }

.clipboard-pastearea {
  border: 2px dashed #888;
  padding: 18px;
  text-align: center;
  background: #fff;
  color: #666;
  font-size: 15px;
  min-height: 50px;
  cursor: text;
  outline: none;
}
.clipboard-pastearea:focus { border-color: #1a4480; color: #1a4480; }
.clipboard-pastearea img { max-width: 100%; max-height: 220px; display: block; margin: 0 auto; }

/* GDS results */
.gds-result {
  margin-top: 10px;
  background: #fff;
  border: 2px solid;
  border-color: #4a4a4a #ffffff #ffffff #4a4a4a;
  padding: 8px 12px;
  font-size: 15px;
}
.gds-station { margin-bottom: 8px; }
.gds-station h5 {
  margin: 0 0 4px 0;
  color: #1a4480;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
}
.gds-station ul { margin: 0 0 0 18px; padding: 0; }
.gds-station li { font-size: 15px; }

/* Books app */
.book-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 0;
  border-bottom: 2px solid #4a4a4a;
}
.book-tabs button {
  font-family: 'VT323', monospace;
  font-size: 15px;
  padding: 5px 10px;
  background: #b0b0b0;
  border: 2px solid;
  border-color: #ffffff #4a4a4a #4a4a4a #ffffff;
  border-bottom: none;
  color: #2a2a2a;
  cursor: pointer;
  margin-bottom: -2px;
}
.book-tabs button.active {
  background: #efece4;
  color: #1a4480;
  font-weight: bold;
  border-bottom: 2px solid #efece4;
  z-index: 1;
  position: relative;
}
.book-tab-body {
  background: #efece4;
  border: 2px solid;
  border-color: #4a4a4a #ffffff #ffffff #4a4a4a;
  border-top: none;
  padding: 12px;
  font-size: 15px;
}
.book-intro { margin: 0 0 10px 0; font-size: 16px; color: #2a2a2a; }
.book-section { margin-bottom: 14px; }
.book-section h5 {
  margin: 0 0 6px 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #1a4480;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #b0b0b0;
  padding-bottom: 3px;
}
.book-empty { font-size: 14px; color: #888; margin: 0; }
.book-row {
  padding: 5px 8px;
  background: #fff;
  border: 1px solid #c0c0c0;
  margin-bottom: 4px;
}
.book-row-title { font-size: 17px; font-weight: bold; color: #1a1a1a; }
.book-row-author { font-size: 14px; color: #4a4a4a; }
.book-row-subject { font-size: 13px; color: #6a6a6a; font-style: italic; }
.book-row-rating { font-size: 14px; color: #c8a040; }
.book-row-thoughts { font-size: 14px; color: #2a2a2a; font-style: italic; margin-top: 2px; }
.book-row-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: #1a4480;
  text-decoration: underline;
}
.book-form { display: flex; flex-direction: column; gap: 8px; }
.ai-controls { display: flex; gap: 12px; align-items: center; }

/* ============================================================
   BRAIN SCENE — isolated preview at ?scene=brain
   ============================================================ */
.brain-scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050407;
  color: #f6efde;
  font-family: 'VT323', monospace;
}

.brain-frame {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  flex: none;
}

.brain-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(0,0,0,.72);
}

.brain-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

.brain-screen-copy {
  fill: #17282a;
  font-family: 'Press Start 2P', monospace;
  letter-spacing: -.5px;
}

.brain-screen-copy .primary {
  font-family: 'VT323', monospace;
  font-size: 29px;
  letter-spacing: .2px;
}

.brain-screen-copy .secondary {
  font-family: 'VT323', monospace;
  font-size: 20px;
  letter-spacing: .15px;
}

.brain-arc-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  letter-spacing: 2.5px;
  paint-order: stroke fill;
  stroke: #09070b;
  stroke-width: 5px;
  stroke-linejoin: round;
}

.brain-arc-label--hobbies {
  fill: #e3aa78;
}

.brain-arc-label--interests {
  fill: #8fa9e8;
}

.brain-glyph {
  filter: drop-shadow(8px 10px 0 rgba(31,12,22,.44));
}

.brain-back,
.brain-scene-label {
  position: fixed;
  z-index: 20;
  top: 20px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.brain-back {
  appearance: none;
  left: 22px;
  color: rgba(246,239,222,.7);
  text-decoration: none;
  padding: 10px 12px;
  border: 1px solid rgba(246,239,222,.18);
  background: rgba(8,5,9,.55);
  font: inherit;
  cursor: pointer;
}

.brain-back:hover,
.brain-back:focus-visible {
  color: #fff;
  border-color: rgba(246,239,222,.55);
  outline: none;
}

.brain-scene-label {
  right: 22px;
  color: rgba(246,239,222,.38);
  padding: 11px 0;
}

.brain-hotspot {
  position: absolute;
  z-index: 8;
  height: 12%;
  border: 0;
  padding: 0;
  background: transparent;
  color: #f6efde;
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
}

.brain-hotspot span {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-width: max-content;
  padding: 7px 9px 6px;
  background: rgba(13,8,13,.78);
  color: rgba(246,239,222,.52);
  font-size: clamp(8px, .58vw, 10px);
  line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}

.brain-hotspot:hover span,
.brain-hotspot:focus-visible span,
.brain-hotspot.active span {
  color: #fff5e5;
  background: rgba(39,22,33,.94);
}

.brain-hotspot:focus-visible {
  outline: none;
}

.brain-hotspot--piano,
.brain-hotspot--books,
.brain-hotspot--basketball {
  left: 17%;
  width: 26.5%;
}

.brain-hotspot--current,
.brain-hotspot--interests {
  left: 56.5%;
  width: 26.5%;
}

.brain-hotspot--past {
  left: 54.5%;
  width: 28.5%;
}

.brain-hotspot--piano,
.brain-hotspot--current {
  top: 46.3%;
  height: 12.5%;
}

.brain-hotspot--books,
.brain-hotspot--past { top: 65%; }

.brain-hotspot--basketball,
.brain-hotspot--interests {
  top: 76%;
  height: 17%;
}

.brain-hotspot--piano span,
.brain-hotspot--books span,
.brain-hotspot--basketball span {
  left: 1%;
}

.brain-hotspot--current span,
.brain-hotspot--past span,
.brain-hotspot--interests span {
  right: 1%;
}

.brain-hotspot--piano span,
.brain-hotspot--current span { top: 25%; }

.brain-hotspot--books span,
.brain-hotspot--past span { top: 49%; }

.brain-hotspot--basketball span,
.brain-hotspot--interests span { top: 72%; }

.brain-circuits path {
  fill: none;
  stroke: #744f80;
  stroke-width: 7;
  stroke-linecap: square;
  stroke-linejoin: miter;
  transition: stroke .28s cubic-bezier(.22, 1, .36, 1), filter .28s ease;
}

.brain-surface-icons {
  filter: drop-shadow(5px 6px 0 rgba(31,12,22,.4));
}

.brain-surface-icons > g {
  transition: filter .32s cubic-bezier(.22, 1, .36, 1);
}

.brain-frame.is-piano .brain-circuits > path:nth-of-type(1),
.brain-frame.is-books .brain-circuits > path:nth-of-type(2),
.brain-frame.is-basketball .brain-circuits > path:nth-of-type(3) {
  stroke: #f0bd82;
  filter: drop-shadow(0 0 5px rgba(240,189,130,.48));
}

.brain-frame.is-current .brain-circuits > path:nth-of-type(4),
.brain-frame.is-past .brain-circuits > path:nth-of-type(5),
.brain-frame.is-interests .brain-circuits > path:nth-of-type(6) {
  stroke: #88a8ef;
  filter: drop-shadow(0 0 5px rgba(136,168,239,.5));
}

.brain-frame.is-piano .brain-surface-icons > g:nth-child(1),
.brain-frame.is-books .brain-surface-icons > g:nth-child(2),
.brain-frame.is-basketball .brain-surface-icons > g:nth-child(3) {
  filter: brightness(1.18) drop-shadow(0 0 8px rgba(240,189,130,.7));
}

.brain-frame.is-current .brain-surface-icons > g:nth-child(4),
.brain-frame.is-past .brain-surface-icons > g:nth-child(5),
.brain-frame.is-interests .brain-surface-icons > g:nth-child(6) {
  filter: brightness(1.18) drop-shadow(0 0 8px rgba(136,168,239,.72));
}

.brain-detail {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: 4%;
  width: min(24%, 390px);
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-50%);
  transform-origin: center;
  padding: 16px 18px;
  border: 2px solid #4c2938;
  background: rgba(13,8,13,.92);
  box-shadow: 8px 8px 0 rgba(0,0,0,.35);
  color: #d9ccd0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .24s ease,
    transform .32s cubic-bezier(.22, 1, .36, 1),
    border-color .28s ease,
    box-shadow .32s ease,
    visibility 0s linear .32s;
}

.brain-detail.visible {
  animation: brain-detail-in .32s cubic-bezier(.22, 1, .36, 1);
  border-color: #a95c70;
  box-shadow: 8px 8px 0 rgba(0,0,0,.3), 0 0 28px rgba(169,92,112,.13);
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

@keyframes brain-detail-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brain-detail--piano,
.brain-detail--books,
.brain-detail--basketball {
  left: 2%;
  transform: translateX(-12px) scale(.97);
  transform-origin: left center;
}

.brain-detail--current,
.brain-detail--past,
.brain-detail--interests {
  right: 2%;
  left: auto;
  transform: translateX(12px) scale(.97);
  transform-origin: right center;
}

.brain-detail.visible {
  transform: none;
}

.brain-detail--piano,
.brain-detail--current { top: 43%; bottom: auto; }
.brain-detail--books,
.brain-detail--past { top: 61%; bottom: auto; }
.brain-detail--basketball,
.brain-detail--interests { bottom: 3%; }

.brain-detail-glyph {
  width: 76px;
  max-height: 80px;
  flex: 0 0 76px;
  overflow: visible;
  image-rendering: pixelated;
}

.brain-detail-copy {
  min-width: 0;
}

.brain-detail-copy p {
  margin: 0 0 7px;
  color: #d28a9a;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  line-height: 1.5;
  text-transform: uppercase;
}

.brain-detail-copy h2 {
  margin: 0 0 6px;
  color: #f6efde;
  font-family: 'VT323', monospace;
  font-size: clamp(20px, 2vw, 31px);
  font-weight: 400;
  line-height: 1;
}

.brain-detail-copy > div {
  font-size: clamp(14px, 1.2vw, 19px);
  line-height: 1.2;
}

.brain-prompt {
  display: grid;
  min-height: 60px;
  place-items: center;
  color: rgba(246,239,222,.42);
  text-align: center;
}

/* ============================================================
   WORK SCREEN
   ============================================================ */
.work-scene {
  --work-screen: #bfd9da;
  --work-ink: #0b1215;
  --work-panel: #101a1e;
  --work-line: rgba(191,217,218,.16);
  --work-mint: #72e0bd;
  --work-coral: #ff7f93;
  width: 100vw;
  height: 100vh;
  padding: clamp(8px, 1.15vw, 18px);
  overflow: hidden;
  background: var(--work-screen);
  color: #e9f4f1;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.work-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 34px;
  overflow: hidden;
  border: 1px solid #17272c;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 70% 10%, rgba(38,87,85,.2), transparent 32%),
    #091114;
  background-size: 32px 32px, 32px 32px, auto, auto;
  box-shadow: 0 0 0 4px rgba(11,18,21,.12);
}

.work-header,
.work-footer {
  position: relative;
  z-index: 3;
  display: grid;
  align-items: center;
  border-color: var(--work-line);
  color: rgba(233,244,241,.6);
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.work-header {
  grid-template-columns: 1fr auto 1fr;
  padding: 0 20px;
  border-bottom: 1px solid var(--work-line);
  background: rgba(8,15,18,.78);
}

.work-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.work-brand__mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(114,224,189,.5);
  color: var(--work-mint);
  font-size: 8px;
}

.work-header__status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-header__status i {
  width: 6px;
  height: 6px;
  background: var(--work-mint);
  box-shadow: 0 0 12px rgba(114,224,189,.8);
}

.work-back {
  appearance: none;
  justify-self: end;
  padding: 9px 10px;
  border: 1px solid rgba(191,217,218,.18);
  background: transparent;
  color: rgba(233,244,241,.65);
  font: inherit;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.work-back:hover,
.work-back:focus-visible {
  border-color: rgba(114,224,189,.62);
  background: rgba(114,224,189,.07);
  color: #fff;
  outline: none;
}

.work-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(560px, 1.65fr);
}

.work-intro {
  position: relative;
  min-width: 0;
  padding: clamp(30px, 5vh, 66px) clamp(24px, 3.6vw, 60px);
  border-right: 1px solid var(--work-line);
}

.work-intro::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: 14%;
  width: 7px;
  height: 7px;
  background: var(--work-mint);
  box-shadow: 0 0 18px rgba(114,224,189,.55);
}

.work-kicker,
.work-record__meta,
.work-record__rail,
.work-tags,
.work-index,
.work-signal__axis {
  font-family: "Press Start 2P", monospace;
  text-transform: uppercase;
}

.work-kicker {
  margin: 0 0 clamp(22px, 4vh, 48px);
  color: var(--work-mint);
  font-size: clamp(6px, .55vw, 9px);
  letter-spacing: .08em;
}

.work-intro h1 {
  max-width: 540px;
  margin: 0;
  color: #eef8f5;
  font-size: clamp(38px, 4.3vw, 76px);
  font-weight: 520;
  letter-spacing: -.065em;
  line-height: .91;
}

.work-deck {
  max-width: 430px;
  margin: clamp(22px, 4vh, 44px) 0 0;
  color: rgba(220,237,233,.58);
  font-size: clamp(13px, 1.15vw, 18px);
  line-height: 1.55;
}

.work-index {
  position: absolute;
  left: clamp(24px, 3.6vw, 60px);
  right: clamp(24px, 3.6vw, 60px);
  bottom: clamp(22px, 4vh, 46px);
  display: grid;
  gap: 10px;
}

.work-index a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(191,217,218,.12);
  color: rgba(233,244,241,.44);
  font-size: clamp(6px, .5vw, 8px);
  line-height: 1.35;
  text-decoration: none;
}

.work-index a span {
  color: var(--work-mint);
}

.work-index a:hover {
  color: #fff;
}

.work-records {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 1.13fr .87fr;
}

.work-record {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 54px minmax(280px, 1.2fr) minmax(190px, .72fr);
  align-items: stretch;
  overflow: hidden;
  border-bottom: 1px solid var(--work-line);
  background: rgba(15,25,29,.58);
  transition: background-color .35s ease;
}

.work-record:last-child {
  border-bottom: 0;
}

.work-record:hover {
  background: rgba(21,35,39,.86);
}

.work-record::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--work-mint);
  opacity: 0;
  transition: opacity .25s ease;
}

.work-record--past::before {
  background: var(--work-coral);
}

.work-record:hover::before {
  opacity: 1;
}

.work-record__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-right: 1px solid var(--work-line);
  color: rgba(233,244,241,.26);
}

.work-record__rail span {
  color: var(--work-mint);
  font-size: 10px;
}

.work-record--past .work-record__rail span {
  color: var(--work-coral);
}

.work-record__rail small {
  font-size: 6px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.work-record__content {
  min-width: 0;
  align-self: center;
  padding: clamp(22px, 3.2vh, 42px) clamp(22px, 2.8vw, 48px);
}

.work-record__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: clamp(15px, 2.4vh, 26px);
  color: rgba(114,224,189,.78);
  font-size: clamp(6px, .48vw, 8px);
  line-height: 1.5;
}

.work-record--past .work-record__meta {
  color: rgba(255,127,147,.82);
}

.work-record__meta time {
  color: rgba(233,244,241,.36);
}

.work-record h2 {
  margin: 0;
  color: #edf7f4;
  font-size: clamp(27px, 3vw, 49px);
  font-weight: 520;
  letter-spacing: -.05em;
  line-height: .96;
}

.work-record--past h2 {
  font-size: clamp(25px, 2.5vw, 42px);
}

.work-record__content > p {
  max-width: 650px;
  margin: clamp(14px, 2.2vh, 24px) 0 0;
  color: rgba(220,237,233,.62);
  font-size: clamp(12px, 1vw, 16px);
  line-height: 1.5;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: clamp(16px, 2.5vh, 28px) 0 0;
  padding: 0;
  list-style: none;
}

.work-tags li {
  padding: 7px 8px 6px;
  border: 1px solid rgba(114,224,189,.19);
  color: rgba(185,232,218,.58);
  font-size: clamp(5px, .42vw, 7px);
  line-height: 1;
}

.work-record--past .work-tags li {
  border-color: rgba(255,127,147,.19);
  color: rgba(255,178,190,.58);
}

.work-signal {
  position: relative;
  min-width: 0;
  margin: clamp(18px, 3vw, 48px) clamp(18px, 2.6vw, 42px) clamp(18px, 3vw, 48px) 0;
  align-self: stretch;
  overflow: hidden;
  border-left: 1px solid var(--work-line);
  background:
    linear-gradient(rgba(114,224,189,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114,224,189,.045) 1px, transparent 1px);
  background-size: 18px 18px;
}

.work-signal--coral {
  background:
    linear-gradient(rgba(255,127,147,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,127,147,.04) 1px, transparent 1px);
  background-size: 18px 18px;
}

.work-signal__axis {
  position: absolute;
  inset: 14px 12px auto 14px;
  display: flex;
  justify-content: space-between;
  color: rgba(233,244,241,.22);
  font-size: 5px;
}

.work-signal__tracks {
  position: absolute;
  inset: 27% 9% 25%;
  display: grid;
  align-content: space-around;
}

.work-signal__tracks i {
  position: relative;
  display: block;
  width: calc(var(--track) * 100%);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--work-mint));
  transform-origin: left;
  animation: work-signal-pulse 3.4s ease-in-out var(--delay) infinite;
}

.work-signal--coral .work-signal__tracks i {
  background: linear-gradient(90deg, transparent, var(--work-coral));
}

.work-signal__tracks i::after {
  content: "";
  position: absolute;
  top: -2px;
  right: 0;
  width: 6px;
  height: 6px;
  background: var(--work-mint);
  box-shadow: 0 0 14px rgba(114,224,189,.65);
}

.work-signal--coral .work-signal__tracks i::after {
  background: var(--work-coral);
  box-shadow: 0 0 14px rgba(255,127,147,.58);
}

.work-signal__nodes {
  position: absolute;
  right: 9%;
  bottom: 10%;
  display: flex;
  gap: 5px;
}

.work-signal__nodes b {
  width: 4px;
  height: 4px;
  background: rgba(114,224,189,.24);
}

.work-signal--coral .work-signal__nodes b {
  background: rgba(255,127,147,.26);
}

@keyframes work-signal-pulse {
  0%, 100% { opacity: .35; transform: scaleX(.84); }
  48% { opacity: 1; transform: scaleX(1); }
}

.work-footer {
  grid-template-columns: 1fr 1fr;
  padding: 0 20px;
  border-top: 1px solid var(--work-line);
}

.work-footer span:last-child {
  justify-self: end;
}

@media (max-width: 980px) {
  .work-shell { grid-template-rows: 50px minmax(0, 1fr) 30px; }
  .work-layout { grid-template-columns: minmax(220px, .65fr) minmax(430px, 1.35fr); }
  .work-header { padding: 0 12px; }
  .work-header__status { display: none; }
  .work-intro { padding: 28px 22px; }
  .work-intro h1 { font-size: clamp(31px, 4.8vw, 48px); }
  .work-index { left: 22px; right: 22px; bottom: 24px; }
  .work-record { grid-template-columns: 42px minmax(250px, 1fr); }
  .work-signal { display: none; }
  .work-record__content { padding: 20px 24px; }
}

/* The uncropped page behind the brain's eye windows. */
.screen-page {
  --screen-paper: #c7e1df;
  --screen-ink: #17282a;
  --screen-line: rgba(23,40,42,.24);
  position: relative;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 46px minmax(245px, 35vh) minmax(0, 1fr) 30px;
  overflow: hidden;
  background:
    linear-gradient(166deg, rgba(255,255,255,.3), transparent 38%),
    linear-gradient(180deg, #d9f3ef 0%, #a8c8c8 52%, #789da0 100%);
  color: var(--screen-ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.screen-page__reflection {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(17deg, transparent 0 45%, rgba(255,255,255,.09) 45.2% 46%, transparent 46.2%),
    linear-gradient(17deg, transparent 0 63%, rgba(255,255,255,.055) 63.2% 63.8%, transparent 64%);
}

.screen-page__header,
.screen-page__footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(16px, 2vw, 32px);
  border-color: var(--screen-line);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(6px, .5vw, 8px);
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.screen-page__header {
  border-bottom: 1px solid var(--screen-line);
}

.screen-page__header > span:nth-child(2) {
  color: rgba(23,40,42,.48);
}

.screen-page__header > div {
  justify-self: end;
}

.screen-page__back {
  appearance: none;
  padding: 8px 9px 7px;
  border: 1px solid rgba(23,40,42,.26);
  background: rgba(217,243,239,.18);
  color: var(--screen-ink);
  font: inherit;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.screen-page__back:hover,
.screen-page__back:focus-visible {
  border-color: rgba(23,40,42,.72);
  background: rgba(255,255,255,.2);
  outline: none;
}

.screen-page__identity {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--screen-line);
}

.screen-page__identity::after {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, rgba(23,40,42,.2), transparent);
}

.screen-page__identity-half {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2vh clamp(28px, 6vw, 110px);
}

.screen-page__identity-half:first-child {
  align-items: flex-end;
  text-align: right;
}

.screen-page__identity-half:last-child {
  align-items: flex-start;
  text-align: left;
}

.screen-page__identity h1 {
  margin: 0;
  font-family: "VT323", monospace;
  font-size: clamp(39px, 4.7vw, 80px);
  font-weight: 400;
  line-height: .95;
}

.screen-page__identity p {
  margin: clamp(34px, 5vh, 66px) 0 0;
  font-family: "VT323", monospace;
  font-size: clamp(21px, 2.15vw, 38px);
  line-height: 1;
}

.screen-page__work {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: clamp(16px, 2.4vh, 28px) clamp(18px, 2.7vw, 48px);
}

.screen-page__work-heading {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
  padding-bottom: clamp(12px, 1.8vh, 20px);
}

.screen-page__work-heading p,
.screen-page__work-heading span {
  margin: 0;
  color: rgba(23,40,42,.52);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(5px, .48vw, 8px);
  line-height: 1.5;
  text-transform: uppercase;
}

.screen-page__work-heading span {
  justify-self: end;
}

.screen-page__work-heading h2 {
  margin: 0;
  font-size: clamp(30px, 3.3vw, 55px);
  font-weight: 520;
  letter-spacing: -.055em;
  line-height: .85;
}

.screen-page__records {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.18fr .82fr;
  border: 1px solid rgba(23,40,42,.34);
  background: rgba(218,240,237,.18);
  box-shadow: 8px 8px 0 rgba(23,40,42,.08);
}

.screen-record {
  min-width: 0;
  display: grid;
  grid-template-columns: clamp(42px, 4.3vw, 72px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  border-right: 1px solid rgba(23,40,42,.26);
  transition: background-color .25s ease;
}

.screen-record:last-child {
  border-right: 0;
}

.screen-record:hover {
  background: rgba(236,250,247,.22);
}

.screen-record__number {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(23,40,42,.22);
  color: rgba(23,40,42,.46);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(8px, .8vw, 13px);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.screen-record--current .screen-record__number {
  background: rgba(83,136,124,.12);
}

.screen-record--past .screen-record__number {
  background: rgba(166,86,106,.09);
}

.screen-record__copy {
  min-width: 0;
  align-self: center;
  padding: clamp(16px, 2.8vh, 34px) clamp(18px, 2.5vw, 42px);
}

.screen-record__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(13px, 2vh, 22px);
  color: rgba(23,40,42,.56);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(5px, .45vw, 7px);
  line-height: 1.5;
  text-transform: uppercase;
}

.screen-record h3 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(22px, 2.4vw, 42px);
  font-weight: 570;
  letter-spacing: -.045em;
  line-height: .98;
}

.screen-record__copy > p {
  max-width: 690px;
  margin: clamp(13px, 2vh, 22px) 0 0;
  color: rgba(23,40,42,.72);
  font-size: clamp(11px, 1vw, 16px);
  line-height: 1.45;
}

.screen-record__tags {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 clamp(18px, 2.5vw, 42px) clamp(14px, 2vh, 22px);
}

.screen-record__tags span {
  padding: 6px 7px 5px;
  border: 1px solid rgba(23,40,42,.25);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(4px, .38vw, 6px);
  line-height: 1;
  text-transform: uppercase;
}

.screen-page__footer {
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--screen-line);
  color: rgba(23,40,42,.48);
}

.screen-page__footer span:last-child {
  justify-self: end;
}

@media (max-width: 900px) {
  .screen-page { grid-template-rows: 42px minmax(220px, 32vh) minmax(0, 1fr) 28px; }
  .screen-page__header { grid-template-columns: 1fr auto; }
  .screen-page__header > span:nth-child(2) { display: none; }
  .screen-page__identity-half { padding-inline: 28px; }
  .screen-page__identity h1 { font-size: clamp(31px, 5vw, 47px); }
  .screen-page__identity p { margin-top: 28px; font-size: clamp(17px, 2.6vw, 25px); }
  .screen-page__work { padding: 14px; }
  .screen-page__records { grid-template-columns: 1fr 1fr; }
  .screen-record { grid-template-columns: 36px minmax(0, 1fr); }
  .screen-record__meta { display: grid; }
  .screen-record__copy { padding: 14px; }
  .screen-record__tags { padding: 0 14px 12px; }
  .screen-record h3 { font-size: clamp(19px, 3vw, 28px); }
}

@media (max-aspect-ratio: 4 / 3) {
  .brain-back,
  .brain-scene-label {
    top: 12px;
  }
  .brain-back { left: 12px; }
  .brain-scene-label { right: 12px; }
  .brain-detail {
    width: 31%;
    min-height: 74px;
    padding: 10px 12px;
  }
  .brain-detail-glyph { width: 52px; flex-basis: 52px; }
  .brain-detail-copy p { font-size: 5px; margin-bottom: 4px; }
  .brain-detail-copy h2 { font-size: clamp(13px, 2.4vw, 22px); }
  .brain-detail-copy > div { font-size: clamp(9px, 1.7vw, 15px); }
}

@media (prefers-reduced-motion: reduce) {
  .journey-room,
  .journey-brain,
  .journey-work,
  .journey-veil,
  .journey .room-wrap,
  .journey .hud,
  .journey .hud-right,
  .journey-cue,
  .brain-hotspot span,
  .brain-circuits path,
  .brain-surface-icons > g,
  .brain-detail {
    animation: none;
    transition: none;
  }
  .work-signal__tracks i { animation: none; }
}

/* ============================================================
   Recruiter-facing portfolio
   ============================================================ */

.site-app {
  --site-bg: #080b11;
  --site-surface: #0d121b;
  --site-surface-soft: #111824;
  --site-line: rgba(177, 197, 220, 0.14);
  --site-line-strong: rgba(177, 197, 220, 0.25);
  --site-text: #f1f5f7;
  --site-muted: #92a0af;
  --site-cyan: #73d9e8;
  --site-violet: #9e8cff;
  --site-amber: #ffbd66;
  --site-green: #80d7a8;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--site-bg);
  color: var(--site-text);
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

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

.site-header {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(22px, 4vw, 64px);
  border-bottom: 1px solid rgba(177, 197, 220, 0.1);
  background: rgba(8, 11, 17, 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.site-header--room {
  background: linear-gradient(180deg, rgba(5, 6, 10, 0.9), rgba(5, 6, 10, 0.64));
  border-color: rgba(255, 255, 255, 0.08);
}

.site-brand {
  appearance: none;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.site-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(115, 217, 232, 0.42);
  background: rgba(115, 217, 232, 0.07);
  color: var(--site-cyan);
  font: 600 10px/1 'JetBrains Mono', monospace;
  letter-spacing: -0.06em;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.site-brand:hover .site-brand-mark {
  border-color: rgba(115, 217, 232, 0.75);
  background: rgba(115, 217, 232, 0.13);
}

.site-brand-copy {
  display: grid;
  gap: 1px;
}

.site-brand-copy strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.site-brand-copy small {
  color: var(--site-muted);
  font: 400 9px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

.site-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 38px);
}

.site-links a {
  position: relative;
  color: #a9b5c1;
  font-size: 13px;
  text-decoration: none;
  transition: color 180ms ease;
}

.site-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -8px;
  height: 1px;
  background: var(--site-cyan);
  transition: right 180ms ease;
}

.site-links a:hover,
.site-links a:focus-visible {
  color: #fff;
}

.site-links a:hover::after,
.site-links a:focus-visible::after {
  right: 0;
}

.view-switcher {
  justify-self: end;
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.view-switcher button {
  appearance: none;
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #7f8c9a;
  font: 500 11px/1 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.view-switcher button[aria-selected='true'] {
  background: #e9eff2;
  color: #0a0e15;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.view-switcher button i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: #74d8a4;
  box-shadow: 0 0 7px rgba(116, 216, 164, 0.6);
}

.portfolio-page {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-color: rgba(146, 160, 175, 0.35) transparent;
  background: var(--site-bg);
}

.portfolio-page h1,
.portfolio-page h2,
.portfolio-page h3,
.portfolio-page p {
  margin-top: 0;
}

.portfolio-page section {
  scroll-margin-top: 72px;
}

.portfolio-container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.portfolio-hero {
  position: relative;
  min-height: 760px;
  padding: clamp(150px, 19vh, 205px) 0 0;
  border-bottom: 1px solid var(--site-line);
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 42%, rgba(82, 113, 159, 0.13), transparent 34%),
    radial-gradient(circle at 16% 78%, rgba(115, 217, 232, 0.065), transparent 31%),
    #080b11;
}

.portfolio-grid {
  position: absolute;
  inset: 72px 0 0;
  opacity: 0.34;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(141, 165, 191, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 165, 191, 0.055) 1px, transparent 1px);
  background-size: 62px 62px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 23%, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 23%, #000 72%, transparent);
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(115, 217, 232, 0.09);
  border-radius: 50%;
  pointer-events: none;
}

.hero-orbit::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--site-cyan);
  box-shadow: 0 0 12px rgba(115, 217, 232, 0.7);
}

.hero-orbit--one {
  top: 104px;
  right: -250px;
  width: 620px;
  height: 620px;
  transform: rotate(-18deg);
}

.hero-orbit--one::after { top: 109px; left: 72px; }

.hero-orbit--two {
  top: 235px;
  right: -98px;
  width: 330px;
  height: 330px;
  border-color: rgba(158, 140, 255, 0.1);
}

.hero-orbit--two::after {
  right: 27px;
  bottom: 66px;
  background: var(--site-violet);
  box-shadow: 0 0 12px rgba(158, 140, 255, 0.7);
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: clamp(64px, 8vw, 132px);
  align-items: center;
}

.portfolio-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 25px;
  color: #93a4b5;
  font: 500 10px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portfolio-eyebrow > span {
  width: 18px;
  height: 1px;
  background: var(--site-cyan);
  box-shadow: 8px 0 10px rgba(115, 217, 232, 0.38);
}

.hero-copy h1 {
  max-width: 790px;
  margin-bottom: 27px;
  color: #f3f6f8;
  font-size: clamp(48px, 5.4vw, 79px);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.hero-copy h1 span {
  display: block;
  color: #8b9aa9;
}

.hero-lede {
  max-width: 680px;
  margin-bottom: 34px;
  color: #a8b3be;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.65;
  letter-spacing: -0.01em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.portfolio-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.portfolio-button:hover { transform: translateY(-2px); }
.portfolio-button--primary { background: #eaf0f2; color: #080b11; }
.portfolio-button--primary:hover { background: #fff; }
.portfolio-button--ghost { border-color: var(--site-line-strong); color: #b8c3cc; }
.portfolio-button--ghost:hover { border-color: rgba(115, 217, 232, 0.55); color: #fff; }
.portfolio-button svg,
.project-arrow svg,
.contact-links svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.5;
}

.hero-console {
  position: relative;
  padding: 0;
  border: 1px solid rgba(130, 157, 188, 0.2);
  background: rgba(11, 16, 25, 0.78);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.hero-console::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 72px;
  height: 1px;
  background: var(--site-cyan);
  box-shadow: 0 0 17px rgba(115, 217, 232, 0.5);
}

.console-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--site-line);
  color: #6f8193;
  font: 500 9px/1.3 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.console-topline span:first-child { color: #a7b4c0; }
.console-topline i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--site-green);
  box-shadow: 0 0 7px rgba(128, 215, 168, 0.6);
}

.console-body {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 4px;
  min-height: 183px;
  padding: 26px 24px;
  font-family: 'JetBrains Mono', monospace;
}

.console-body p {
  margin: 0;
  color: #c6d0d8;
  font-size: 13px;
  line-height: 1.8;
}

.console-prompt { color: var(--site-cyan); }

.console-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--site-line);
}

.console-metrics span {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  color: #708091;
  font: 500 8px/1 'JetBrains Mono', monospace;
}

.console-metrics i {
  grid-column: 1 / -1;
  position: relative;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.console-metrics i::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--meter);
  background: linear-gradient(90deg, #6585aa, var(--site-cyan));
}

.hero-facts {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: 0.8fr 1.5fr 0.7fr;
  transform: translateX(-50%);
  border-top: 1px solid var(--site-line);
}

.hero-facts > div {
  display: grid;
  gap: 8px;
  min-height: 91px;
  padding: 22px 24px;
  border-right: 1px solid var(--site-line);
}

.hero-facts > div:first-child { border-left: 1px solid var(--site-line); }
.hero-facts span { color: #6f7e8d; font: 500 9px/1 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.09em; }
.hero-facts strong { color: #c7d0d8; font-size: 13px; font-weight: 500; }

.portfolio-section {
  padding: clamp(92px, 11vw, 150px) 0;
  border-bottom: 1px solid var(--site-line);
}

.section-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(64px, 9vw, 150px);
}

.section-heading h2 {
  margin-bottom: 0;
  color: #eef2f4;
  font-size: clamp(34px, 3.7vw, 52px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.experience-section { background: #0a0e15; }

.experience-list { border-top: 1px solid var(--site-line-strong); }

.experience-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 24px;
  padding: 34px 0 40px;
  border-bottom: 1px solid var(--site-line);
}

.experience-rail {
  position: relative;
  width: 1px;
  height: 100%;
  margin-left: 5px;
  background: rgba(177, 197, 220, 0.14);
}

.experience-rail span {
  position: absolute;
  top: 6px;
  left: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid #7d8b99;
  border-radius: 50%;
  background: #0a0e15;
}

.experience-item.is-current .experience-rail span {
  border-color: var(--site-cyan);
  background: var(--site-cyan);
  box-shadow: 0 0 10px rgba(115, 217, 232, 0.5);
}

.experience-title-row {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 19px;
}

.experience-status {
  margin-bottom: 8px;
  color: #788898;
  font: 500 9px/1.3 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.is-current .experience-status { color: var(--site-cyan); }
.experience-title-row h3 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.experience-title-row time { flex: none; padding-top: 21px; color: #788898; font: 400 10px/1.4 'JetBrains Mono', monospace; }
.experience-main > p { max-width: 700px; margin-bottom: 22px; color: #97a5b2; font-size: 15px; line-height: 1.7; }

.skill-row { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-row span {
  padding: 6px 9px;
  border: 1px solid rgba(177, 197, 220, 0.13);
  color: #8291a1;
  font: 400 9px/1 'JetBrains Mono', monospace;
}

.projects-section { background: #080b11; }
.section-heading--split { display: flex; align-items: end; justify-content: space-between; gap: 80px; margin-bottom: 64px; }
.section-heading--split > p { max-width: 390px; margin-bottom: 5px; color: #8997a5; font-size: 14px; line-height: 1.7; }
.project-list { border-top: 1px solid var(--site-line-strong); }

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(210px, 0.82fr) minmax(340px, 1.18fr) 36px;
  gap: 30px;
  align-items: start;
  padding: 34px 8px;
  border-bottom: 1px solid var(--site-line);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: background-color 220ms ease, padding-left 220ms ease, padding-right 220ms ease;
}

.project-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 0;
  background: var(--project-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--project-accent), transparent 40%);
  transition: height 220ms ease;
}

.project-row--cyan { --project-accent: var(--site-cyan); }
.project-row--violet { --project-accent: var(--site-violet); }
.project-row--amber { --project-accent: var(--site-amber); }
.project-row--green { --project-accent: var(--site-green); }
.project-row:hover { padding-right: 16px; padding-left: 16px; background: rgba(255, 255, 255, 0.025); }
.project-row:hover::before { height: 100%; }
.project-number { padding-top: 4px; color: var(--project-accent); font: 500 9px/1 'JetBrains Mono', monospace; }
.project-title h3 { margin-bottom: 10px; font-size: 21px; font-weight: 500; letter-spacing: -0.025em; }
.project-title p { margin: 0; color: #667788; font: 400 9px/1.6 'JetBrains Mono', monospace; }
.project-description > p { margin-bottom: 11px; color: #aab5bf; font-size: 14px; line-height: 1.55; }
.project-description small { display: block; color: #697989; font-size: 11px; line-height: 1.55; }
.project-arrow { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--site-line); color: #738393; transition: color 180ms ease, border-color 180ms ease, transform 180ms ease; }
.project-row:hover .project-arrow { transform: translate(2px, -2px); border-color: var(--project-accent); color: var(--project-accent); }

.about-section { background: #0b1018; }
.about-layout { display: grid; grid-template-columns: 0.78fr 1fr 0.76fr; gap: clamp(48px, 7vw, 104px); align-items: start; }
.about-copy { padding-top: 42px; }
.about-copy p { color: #8998a6; font-size: 15px; line-height: 1.75; }
.about-copy .about-lede { color: #c5ced5; font-size: 19px; line-height: 1.6; letter-spacing: -0.015em; }
.interest-map { padding: 20px 0 0 24px; border-left: 1px solid var(--site-line); }
.interest-map > p { margin-bottom: 18px; color: #6d7e8e; font: 500 9px/1 'JetBrains Mono', monospace; letter-spacing: 0.08em; }
.interest-map ol { list-style: none; margin: 0; padding: 0; }
.interest-map li { display: grid; grid-template-columns: 29px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid rgba(177, 197, 220, 0.1); color: #aab5bf; font-size: 13px; }
.interest-map li span { color: var(--site-violet); font: 400 8px/1.7 'JetBrains Mono', monospace; }

.portfolio-contact { padding: clamp(92px, 11vw, 148px) 0 92px; background: #070a0f; }
.contact-layout { display: grid; grid-template-columns: 1fr 0.85fr; gap: clamp(72px, 10vw, 160px); align-items: end; }
.contact-layout h2 { margin: 0; color: #edf2f4; font-size: clamp(42px, 5vw, 68px); font-weight: 500; line-height: 1.03; letter-spacing: -0.05em; }
.contact-layout h2 em { color: var(--site-cyan); font-style: normal; }
.contact-links { border-top: 1px solid var(--site-line-strong); }
.contact-links a { display: grid; grid-template-columns: 75px 1fr 20px; gap: 16px; align-items: center; min-height: 68px; border-bottom: 1px solid var(--site-line); color: inherit; text-decoration: none; transition: padding-left 180ms ease, background-color 180ms ease; }
.contact-links a:hover { padding-left: 10px; background: rgba(255, 255, 255, 0.02); }
.contact-links span { color: #6f8090; font: 400 9px/1 'JetBrains Mono', monospace; text-transform: uppercase; }
.contact-links strong { color: #b8c2cb; font-size: 13px; font-weight: 500; }
.contact-links svg { color: #68798a; }

.portfolio-footer { padding: 25px 0 30px; border-top: 1px solid var(--site-line); background: #070a0f; }
.portfolio-footer .portfolio-container { display: flex; justify-content: space-between; gap: 24px; color: #637383; font: 400 9px/1.5 'JetBrains Mono', monospace; }
.portfolio-footer a { color: #8293a3; text-decoration: none; }
.portfolio-footer a:hover { color: var(--site-cyan); }

/* Room lives as an alternate view, without the former scroll journey. */
.room-page {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #07070a;
}

.room-page .stage { height: 100%; }
.room-page .hud,
.room-page .hud-right { top: 88px; }
.room-page .room-wrap { filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6)); }
.room-page .room-worker { cursor: default; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-links { display: none; }
  .hero-layout { grid-template-columns: 1fr; gap: 52px; }
  .portfolio-hero { min-height: 980px; }
  .hero-console { width: min(520px, 100%); }
  .section-layout { grid-template-columns: 1fr; gap: 62px; }
  .section-heading--split { align-items: start; flex-direction: column; gap: 28px; }
  .project-row { grid-template-columns: 38px minmax(190px, 0.75fr) minmax(300px, 1.25fr) 32px; gap: 20px; }
  .about-layout { grid-template-columns: 1fr 1fr; }
  .about-layout .section-heading { grid-column: 1 / -1; }
  .about-copy { padding-top: 0; }
}

@media (max-width: 720px) {
  .site-header { height: 64px; padding: 0 16px; gap: 12px; }
  .site-brand-copy { display: none; }
  .view-switcher button { min-height: 28px; padding: 0 10px; font-size: 9px; }
  .portfolio-container { width: min(100% - 32px, 1180px); }
  .portfolio-hero { min-height: 940px; padding-top: 130px; }
  .portfolio-grid { inset: 64px 0 0; background-size: 44px 44px; }
  .hero-copy h1 { font-size: clamp(44px, 13vw, 64px); }
  .hero-lede { font-size: 16px; }
  .hero-facts { grid-template-columns: 1fr; position: relative; left: auto; bottom: auto; margin-top: 70px; transform: none; }
  .hero-facts > div { min-height: 72px; border-left: 1px solid var(--site-line); }
  .portfolio-section { padding: 88px 0; }
  .section-heading h2 { font-size: 38px; }
  .experience-title-row { flex-direction: column; gap: 4px; }
  .experience-title-row time { padding-top: 0; }
  .project-row { grid-template-columns: 32px 1fr 30px; gap: 14px; padding: 28px 4px; }
  .project-description { grid-column: 2 / -1; padding-right: 8px; }
  .project-arrow { grid-column: 3; grid-row: 1; }
  .about-layout { grid-template-columns: 1fr; gap: 42px; }
  .about-layout .section-heading { grid-column: auto; }
  .interest-map { padding-left: 18px; }
  .contact-layout { grid-template-columns: 1fr; gap: 58px; }
  .contact-layout h2 { font-size: 46px; }
  .contact-links a { grid-template-columns: 62px 1fr 16px; }
  .contact-links strong { font-size: 11px; overflow-wrap: anywhere; }
  .room-page .hud,
  .room-page .hud-right { top: 77px; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-page { scroll-behavior: auto; }
  .portfolio-button,
  .project-row,
  .project-row::before,
  .project-arrow,
  .site-links a::after { transition: none; }
}

/* ============================================================
   Simplified portfolio revision
   ============================================================ */

.site-app--portfolio {
  --site-bg: #0b0d11;
  --site-surface: #11141a;
  --site-line: rgba(255, 255, 255, 0.1);
  --site-line-strong: rgba(255, 255, 255, 0.17);
  --site-text: #f2f3f5;
  --site-muted: #9a9fa9;
  --site-cyan: #78c9d7;
}

.site-app--portfolio .site-header {
  height: 64px;
  padding: 0 max(24px, calc((100vw - 980px) / 2));
  border-bottom: 1px solid var(--site-line);
  background: rgba(11, 13, 17, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-app--portfolio .site-brand-mark {
  width: 30px;
  height: 30px;
  border-color: var(--site-line-strong);
  background: transparent;
  color: var(--site-text);
}

.site-app--portfolio .site-brand-copy strong { font-size: 12px; }
.site-app--portfolio .site-brand-copy small { display: none; }
.site-app--portfolio .site-links { gap: 26px; }
.site-app--portfolio .site-links a { color: #9298a2; font-size: 12px; }
.site-app--portfolio .site-links a::after { display: none; }
.site-app--portfolio .site-links a:hover { color: #fff; }
.site-app--portfolio .view-switcher { border-color: var(--site-line); background: transparent; }
.site-app--portfolio .view-switcher button { min-height: 27px; padding: 0 11px; }
.site-app--portfolio .view-switcher button[aria-selected='true'] { background: #e9eaec; }

.simple-portfolio {
  background: #0b0d11;
  color: #f2f3f5;
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

.simple-container {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 64px;
}

.simple-portfolio section { scroll-margin-top: 64px; }

.simple-intro {
  max-width: 850px;
  padding: clamp(96px, 14vw, 154px) 0 clamp(82px, 10vw, 116px);
}

.simple-label {
  margin-bottom: 22px;
  color: var(--site-cyan);
  font: 500 11px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}

.simple-intro h1 {
  max-width: 820px;
  margin: 0 0 25px;
  color: #f4f5f6;
  font-size: clamp(42px, 6vw, 67px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.048em;
}

.simple-summary {
  max-width: 690px;
  margin-bottom: 26px;
  color: #a6abb4;
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
}

.simple-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.simple-links a {
  color: #d8dbe0;
  font-size: 13px;
  text-decoration: none;
}

.simple-links a:hover { color: var(--site-cyan); }

.simple-section {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 58px;
  padding: 68px 0;
  border-top: 1px solid var(--site-line);
}

.simple-section h2 {
  margin: 0;
  color: #c6cad0;
  font: 500 12px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

.simple-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.simple-tags span {
  padding: 8px 11px;
  border: 1px solid var(--site-line);
  color: #c5c9cf;
  font: 400 11px/1 'JetBrains Mono', monospace;
}

.simple-interest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 42px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.simple-interest-list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #c5c9cf;
  font-size: 14px;
}

.simple-timeline article {
  padding: 0 0 32px;
}

.simple-timeline article:last-child { padding-bottom: 0; }

.simple-timeline article > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.simple-timeline strong {
  color: #eceef0;
  font-size: 15px;
  font-weight: 500;
}

.simple-timeline span {
  flex: none;
  color: #777e89;
  font: 400 10px/1.5 'JetBrains Mono', monospace;
}

.simple-timeline p {
  max-width: 660px;
  margin: 0;
  color: #969ca6;
  font-size: 14px;
  line-height: 1.6;
}

.simple-projects { padding-bottom: 36px; }
.simple-project-list { border-top: 1px solid var(--site-line); }

.simple-project-list > a {
  display: grid;
  grid-template-columns: 1fr 22px;
  gap: 26px;
  padding: 26px 0;
  border-bottom: 1px solid var(--site-line);
  color: inherit;
  text-decoration: none;
  transition: padding-left 160ms ease;
}

.simple-project-list > a:hover { padding-left: 8px; }
.simple-project-list h3 { margin: 0 0 7px; color: #eceef0; font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.simple-project-list p { max-width: 650px; margin: 0 0 9px; color: #999fa9; font-size: 14px; line-height: 1.55; }
.simple-project-list span { color: #6f7782; font: 400 9px/1.4 'JetBrains Mono', monospace; }
.simple-project-list i { color: #777e88; font-style: normal; font-size: 17px; transition: color 160ms ease, transform 160ms ease; }
.simple-project-list > a:hover i { transform: translate(2px, -2px); color: var(--site-cyan); }

.simple-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 27px 0 38px;
  border-top: 1px solid var(--site-line);
  color: #6f7680;
  font: 400 9px/1.5 'JetBrains Mono', monospace;
}

.simple-footer a { color: #868d97; text-decoration: none; }
.simple-footer a:hover { color: var(--site-cyan); }

@media (max-width: 780px) {
  .site-app--portfolio .site-header { grid-template-columns: 1fr auto; padding: 0 16px; }
  .site-app--portfolio .site-links { display: none; }
  .simple-container { width: min(100% - 32px, 980px); }
  .simple-intro { padding: 88px 0 72px; }
  .simple-intro h1 { font-size: clamp(40px, 12vw, 56px); }
  .simple-section { grid-template-columns: 1fr; gap: 28px; padding: 54px 0; }
  .simple-interest-list { grid-template-columns: 1fr; }
  .simple-timeline article > div { align-items: start; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .simple-project-list > a,
  .simple-project-list i { transition: none; }
}

/* ============================================================
   Compact two-column portfolio
   ============================================================ */

.site-app--portfolio .site-header {
  grid-template-columns: 1fr auto;
}

.compact-portfolio {
  background: #0b0d11;
  color: #f2f3f5;
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

/* Keep the view switch in the true center on both portfolio and room views. */
.site-header .view-switcher {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  justify-self: auto;
}

/* The room uses the same navigation treatment as the portfolio. */
.site-header--room {
  height: 64px;
  padding: 0 max(24px, calc((100vw - 980px) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 13, 17, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* The monitor terminal is a modal layer, so it never sits underneath the nav. */
.room-page .term-window {
  position: fixed;
  z-index: 2000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@media (max-width: 720px) {
  .site-header--room { padding: 0 16px; }
}

.compact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  width: min(1120px, calc(100% - 48px));
  min-height: 100%;
  margin: 0 auto;
  padding-top: 64px;
}

.compact-left,
.compact-right {
  padding-top: clamp(34px, 5vh, 54px);
  padding-bottom: 32px;
}

.compact-left {
  padding-right: clamp(34px, 4.5vw, 66px);
  border-right: 1px solid var(--site-line);
}

.compact-right {
  padding-left: clamp(34px, 4.5vw, 66px);
}

.compact-identity {
  margin-bottom: clamp(27px, 4vh, 40px);
}

.compact-kicker {
  margin: 0 0 7px;
  color: var(--site-cyan);
  font: 500 12px/1.4 'JetBrains Mono', monospace;
}

.compact-identity h1 {
  margin: 0 0 13px;
  color: #f4f5f6;
  font-size: clamp(37px, 4vw, 51px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}

.compact-identity > p:not(.compact-kicker) {
  max-width: 470px;
  margin: 0 0 15px;
  color: #a5abb4;
  font-size: 16px;
  line-height: 1.55;
}

.compact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.compact-links a {
  color: #d1d5da;
  font-size: 13px;
  text-decoration: none;
}

.compact-links a:hover { color: var(--site-cyan); }

.compact-block {
  margin-top: clamp(24px, 3.5vh, 34px);
}

.compact-block h2 {
  margin: 0 0 15px;
  color: #7f8792;
  font: 500 11px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-background article {
  padding: 0 0 14px;
}

.compact-background article:last-child { padding-bottom: 0; }

.compact-background article > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 3px;
}

.compact-background strong {
  color: #e1e4e8;
  font-size: 15px;
  font-weight: 500;
}

.compact-background time {
  flex: none;
  color: #686f79;
  font: 400 10px/1.4 'JetBrains Mono', monospace;
}

.compact-background p {
  margin: 0;
  color: #9097a1;
  font-size: 13.5px;
  line-height: 1.45;
}

.compact-interests ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-interests li {
  color: #b0b5bd;
  font-size: 13.5px;
}

.compact-interests li::before {
  content: '·';
  margin-right: 6px;
  color: var(--site-cyan);
}

.compact-right .compact-block:first-child { margin-top: 0; }

.compact-skills > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.compact-skills span {
  padding: 7px 9px;
  border: 1px solid var(--site-line);
  color: #c4c8ce;
  font: 400 11.5px/1 'JetBrains Mono', monospace;
}

.compact-projects {
  margin-top: clamp(28px, 4.5vh, 44px);
}

.compact-project-list {
  border-top: 1px solid var(--site-line);
}

.compact-project-list > a {
  display: block;
  padding: clamp(16px, 2.4vh, 22px) 0;
  border-bottom: 1px solid var(--site-line);
  color: inherit;
  text-decoration: none;
  transition: padding-left 160ms ease;
}

.compact-project-list > a:hover { padding-left: 7px; }

.compact-project-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 5px;
}

.compact-project-heading h3 {
  margin: 0;
  color: #e8eaed;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.compact-project-heading i {
  color: #727983;
  font-style: normal;
  font-size: 14px;
  transition: color 160ms ease, transform 160ms ease;
}

.compact-project-list > a:hover i {
  transform: translate(2px, -2px);
  color: var(--site-cyan);
}

.compact-project-list p {
  margin: 0 0 6px;
  color: #969da7;
  font-size: 14px;
  line-height: 1.45;
}

.compact-project-list span {
  color: #656d78;
  font: 400 10px/1.4 'JetBrains Mono', monospace;
}

@media (max-width: 760px) {
  .compact-layout {
    grid-template-columns: 1fr;
    width: min(100% - 32px, 620px);
  }

  .compact-left,
  .compact-right {
    padding: 42px 0 0;
  }

  .compact-left {
    border-right: 0;
  }

  .compact-right {
    padding-bottom: 38px;
  }

  .compact-identity h1 { font-size: 43px; }
  .compact-background article > div { align-items: start; flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .compact-project-list > a,
  .compact-project-heading i { transition: none; }
}
