:root {
  --bg: #0b0b0b;
  --panel: #141414;
  --panel-2: #181818;
  --line: #2a2a2a;
  --text: #e8e8e8;
  --soft: #b4b4b4;
  --dim: #9a9a9a;
  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; overflow: hidden; }

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-size: 24px 24px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
}
body[data-wp="0"] { background-image: radial-gradient(#1d1d1d 1px, transparent 1px); }
body[data-wp="1"] { background-image: linear-gradient(#171717 1px, transparent 1px), linear-gradient(90deg, #171717 1px, transparent 1px); }
body[data-wp="2"] { background-image: none; }

button { background: none; border: 0; margin: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
button:hover { background-color: #1c1c1c; }
a { color: var(--text); }
a:hover { color: #ffffff; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
p { margin: 0; color: var(--soft); }

.mono { font-family: var(--mono); font-size: 12px; }
.dim { color: var(--dim); }
.small { font-size: 12px; }

/* Custom cursor: only on devices with a real pointer */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor * { cursor: none !important; }
}
.cursor {
  position: fixed; left: 0; top: 0; width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%; border: 1.5px solid var(--text); background: var(--text);
  pointer-events: none; z-index: 50;
  transition: width 0.12s, height 0.12s, background 0.12s;
}
.cursor.hover { width: 34px; height: 34px; background: rgba(232, 232, 232, 0.12); }
.cursor.pressed { width: 8px; height: 8px; }
.cursor.hover.pressed { width: 26px; height: 26px; }

/* Menu bar */
.menubar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0 24px; padding: 0 16px;
  background: #111111; border-bottom: 1px solid #242424; font-size: 13px;
}
.menubar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.brand { font-weight: 500; padding: 0 12px 0 4px; }
.active-app { font-weight: 600; padding-right: 8px; }
.active-app:empty { display: none; }
.menu-btn { color: var(--soft); padding: 0 10px; height: 44px; border-radius: 6px; }
/* the menu bar note moved to .dock-cap */
.menubar-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; font-size: 12.5px; color: var(--soft); white-space: nowrap; pointer-events: none; }
@media (max-width: 980px) { .menubar-note { position: static; transform: none; order: 3; width: 100%; padding: 0 0 8px; text-align: center; font-size: 11.5px; white-space: normal; } }
.menubar-right { display: flex; align-items: center; gap: 16px; padding: 12px 4px; }
.hire-badge { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border: 1px solid #2f4a36; border-radius: 14px; background: rgba(40, 200, 64, 0.08); color: #cfe9d4; font-size: 12px; white-space: nowrap; }
.hire-badge:hover { border-color: #3f7a4c; color: #fff; }
.hire-badge i, .hire-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #28c840; box-shadow: 0 0 0 3px rgba(40, 200, 64, 0.18); }
@media (max-width: 720px) { .hire-badge span { display: none; } .hire-badge::after { content: 'Open to work'; } }
.hire { display: flex; flex-direction: column; gap: 12px; }
.app-actions a[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.status { display: flex; align-items: center; gap: 12px; color: var(--text); }
.wifi.off { opacity: 0.35; }
.battery { display: flex; align-items: center; gap: 5px; }
.batt-pct { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--soft, var(--text)); }
.batt-pct:empty { display: none; }
.batt-body { position: relative; width: 23px; height: 11px; padding: 1.5px; border: 1px solid currentColor; border-radius: 3.5px; opacity: 0.9; box-sizing: border-box; display: flex; }
.batt-body i { display: block; height: 100%; width: 100%; border-radius: 1.5px; background: currentColor; }
.battery.low .batt-body i { background: #ff453a; }
.battery.charging .batt-body i { background: #30d158; }
.batt-tip { width: 1.5px; height: 4px; margin-left: -4px; border-radius: 0 1px 1px 0; background: currentColor; opacity: 0.6; }
@media (max-width: 720px) { .batt-pct { display: none; } }
/* Stick's name tag: tells people they can type to him, until they have */
.buddy-tag { position: fixed; left: 0; top: 0; z-index: 44; display: flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid #3a3a3a; border-radius: 999px; background: rgba(20, 20, 20, 0.92); color: var(--text); font-size: 11.5px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.buddy-tag kbd { padding: 0 5px; border: 1px solid #555; border-radius: 4px; font: 10.5px/16px ui-monospace, Menlo, monospace; color: var(--soft); }
.clock { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Desktop */
.desktop { flex: 1; min-height: 0; position: relative; }
.icons { position: absolute; left: 24px; top: 24px; display: flex; flex-direction: column; gap: 10px; width: 124px; }
.windows { position: absolute; inset: 0 16px 8px 16px; pointer-events: none; z-index: 1; }
.icon {
  width: 124px; padding: 12px 4px; border-radius: 10px; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.icon.selected { box-shadow: inset 0 0 0 1px var(--text); }

/* Window */
.window {
  position: absolute; max-width: 100%; max-height: calc(100% - 8px);
  display: flex; flex-direction: column; pointer-events: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); overflow: hidden;
  user-select: text; -webkit-user-select: text;
}
.window.dragging { box-shadow: 0 32px 80px rgba(0, 0, 0, 0.75); user-select: none; -webkit-user-select: none; }
.titlebar { flex: 0 0 auto; touch-action: none; display: flex; align-items: center; background: var(--panel-2); border-bottom: 1px solid #242424; }
.wbtn { flex: 0 0 22px; width: 22px; height: 40px; display: flex; align-items: center; justify-content: center; }
.wbtn:first-child { margin-left: 10px; }
.wbtn i { width: 12px; height: 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: rgba(0, 0, 0, 0.6); background: #3c3c3c; }
.window.focused .wbtn.close i { background: #ff5f57; }
.window.focused .wbtn.mini i { background: #febc2e; }
.window.focused .wbtn.maxi i { background: #28c840; }
.wbtn svg { width: 8px; height: 8px; opacity: 0; }
.titlebar:hover .wbtn svg, .wbtn:focus-visible svg { opacity: 1; }
.titlebar:hover .wbtn i { background-color: var(--tl, #3c3c3c); }
.wbtn.close { --tl: #ff5f57; } .wbtn.mini { --tl: #febc2e; } .wbtn.maxi { --tl: #28c840; }
@media (pointer: coarse) { .wbtn { flex-basis: 36px; width: 36px; height: 44px; } }
.win-title { flex: 1; min-width: 0; text-align: center; padding-right: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; max-height: none !important; }
.window.max .rs { display: none; }
.rs { position: absolute; z-index: 2; touch-action: none; }
.rs-r { top: 44px; right: 0; bottom: 14px; width: 7px; cursor: ew-resize; }
.rs-b { left: 0; right: 14px; bottom: 0; height: 7px; cursor: ns-resize; }
.rs-c { right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #5a5a5a 50%, #5a5a5a 58%, transparent 58%, transparent 72%, #5a5a5a 72%, #5a5a5a 80%, transparent 80%); }
.win-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.win-body > a { align-self: flex-start; padding: 10px 0; }

/* Work folder */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.card { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 10px; text-align: left; min-width: 0; }
.card-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #0f0f0f; margin-bottom: 6px; display: flex; }
.card-title { font-size: 14px; }
.card-kind { font-size: 12px; color: var(--dim); }

/* Photos / Process switch */
.tabs { align-self: flex-start; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; }
.tab { height: 44px; padding: 0 16px; border-radius: 9px; font-size: 13px; color: var(--dim); }
.tab.on { background: var(--text); color: var(--bg); }
.tab.on:hover { background-color: #ffffff; }
.view { display: flex; flex-direction: column; gap: 16px; }
.process { display: flex; flex-direction: column; }
/* Project windows: photos and process side by side when there's room, tabs when there isn't */
.project-body { container-type: inline-size; }
.project-split > .is-off { display: none; }
@container (min-width: 760px) {
  .project-body > .tabs { display: none; }
  .project-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .project-split > .is-off { display: flex; }
  .project-split > .view { position: sticky; top: 0; }
  .project-split > .view .hero { height: min(52vh, 460px); }
}
.process-row { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 18px 0; border-top: 1px solid #242424; }
.process-row h3 { margin: 0; flex: 0 0 130px; font-weight: 400; padding-top: 3px; }
.process-content { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.process-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.process-grid img, .process-grid .placeholder { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }

/* Project window */
.doc-frame { display: block; width: 100%; height: min(70vh, 760px); border: 0; border-radius: 8px; background: #0f0f0f; }
.window.max .doc-frame { height: calc(100vh - 200px); }
.hero { width: 100%; height: min(46vh, 420px); object-fit: contain; background: #0f0f0f; border-radius: 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { width: 64px; height: 64px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); opacity: 0.55; }
.thumb.on, .thumb:hover { opacity: 1; border-color: var(--text); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
h2 { margin: 0; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; }

/* App windows: buttons that open the live apps */
.app-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.app-actions a { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.app-actions a:hover { border-color: var(--text); }
.app-actions a.primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 500; }
.app-actions a.primary:hover { background-color: #ffffff; color: var(--bg); }
.app-actions button { height: 44px; padding: 0 18px; border-radius: 8px; font-size: 14px; }
.app-actions button.primary { font-weight: 500; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.page-card { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 10px; text-align: left; font-size: 13px; color: var(--soft); min-width: 0; }
.page-card img { width: 100%; aspect-ratio: 640 / 430; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); display: block; }
.page-card:hover img { border-color: var(--text); }
.win-body:has(> .demo-frame) { padding: 0; gap: 0; }
.demo-frame { display: block; width: 100%; height: min(72vh, 760px); border: 0; background: #120c08; }
.window.max .win-body { flex: 1; }
.window.max .demo-frame { flex: 1; height: auto; }
.demo-frame.is-off { display: none; }
.deck-tabs { align-self: stretch; align-items: center; margin: 10px 12px; border: 0; padding: 0; }
.deck-tabs .tab { border: 1px solid var(--line); }
.deck-tabs .tab.on { border-color: var(--text); }
.deck-pop { margin-left: auto; padding: 0 4px; font-size: 13px; color: var(--dim); text-decoration: none; }
.deck-pop:hover { color: var(--text); }
.note { font-size: 13px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.week-live { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--soft); }
.week-live .small { flex: 1 1 260px; }

.placeholder {
  border: 1px dashed #3a3a3a; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--dim);
}
.shot { height: 260px; }

.about { display: flex; flex-wrap: wrap; gap: 28px; }
.portrait { flex: 0 0 160px; height: 200px; }
.about-text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 16px; }
h1 { margin: 0; font-size: 28px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.2; }

.list-head { display: flex; gap: 16px; padding: 0 12px 10px; border-bottom: 1px solid #242424; }
.list-head span:first-child, .row span:first-child { flex: 1; }
.kind { width: 110px; }
.row { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: 6px; text-align: left; }
.row .kind { color: var(--dim); font-size: 13px; }

a.app { text-decoration: none; }
.feedback { display: flex; flex-direction: column; gap: 14px; }
.feedback label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--soft); }
.feedback input, .feedback textarea { padding: 10px 12px; background: #0f0f0f; border: 1px solid #3a3a3a; border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
.wb-start { display: flex; flex-direction: column; gap: 10px; padding: 8px 4px 12px; }
.wb-title { margin: 0; font-size: 30px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
.wb-lead { margin: 0; max-width: 560px; color: var(--soft); }
.wb-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.wb-choice { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; text-align: left; background: #111; }
.wb-choice:hover { border-color: var(--text); }
.wb-choice b { font-weight: 500; font-size: 16px; }
.wb-choice span { font-size: 13px; color: var(--dim); }
.wb-view { display: flex; flex-direction: column; margin: -24px; }
.wb-view .frame-tabs { padding: 8px 12px 0; }
.window.max .wb-view { flex: 1 1 auto; min-height: 0; }
.window.max .wb-view .demo-frame { flex: 1 1 auto; height: auto; min-height: 0; } /* the board fills a full-screen window */
.resume { display: flex; flex-direction: column; gap: 18px; max-width: 680px; }
.resume-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.resume h1 { margin: 0 0 4px; font-size: 30px; font-weight: 400; letter-spacing: -0.02em; }
.resume-head p { margin: 0; font-size: 13px; }
.resume-pdf { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; text-decoration: none; }
.resume-pdf[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.resume-line { margin: 0; font-size: 16px; }
.resume section { display: flex; flex-direction: column; gap: 10px; }
.resume h2 { margin: 0; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 400; }
.resume-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.resume-item b { font-weight: 500; }
.resume-item span { font-size: 13px; }
.resume-item p { grid-column: 1 / -1; margin: 0; color: var(--soft); font-size: 14px; }
.resume section > p { margin: 0; color: var(--soft); }
.big-link { font-size: 28px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 0 28px; font-size: 14px; }
.links a { padding: 12px 0; }

.back { align-self: flex-start; border: 1px solid var(--line); color: var(--soft); font-size: 13px; padding: 0 14px; height: 44px; border-radius: 8px; }

/* Week Board */
.up-next { font-size: 24px; letter-spacing: -0.02em; line-height: 1.25; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.col { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.col-name { font-family: var(--mono); font-size: 12px; color: var(--dim); padding: 2px 4px 6px; }
.goal-row { display: flex; align-items: stretch; }
.goal { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 11px 4px; min-height: 44px; border-radius: 6px; font-size: 14px; text-align: left; }
.goal .box { flex: 0 0 16px; height: 16px; margin-top: 2px; border: 1.5px solid var(--dim); border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.goal .box svg { display: none; }
.goal.done { color: #8a8a8a; text-decoration: line-through; }
.goal.done .box svg { display: block; }
.remove { flex: 0 0 36px; border-radius: 6px; color: var(--dim); display: flex; align-items: center; justify-content: center; }
.empty { font-size: 13px; color: var(--dim); padding: 8px 4px; }
.add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.add label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--dim); }
.add .grow { flex: 1 1 220px; }
.add input, .add select { height: 44px; padding: 0 12px; background: #0f0f0f; border: 1px solid #3a3a3a; border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; }
.primary { height: 44px; padding: 0 18px; background: var(--text); color: var(--bg); border-radius: 8px; font-size: 14px; font-weight: 500; }
.primary:hover { background-color: #ffffff; }

/* Dock (from Ryan's dock.html): tiles swell toward the cursor on a smooth curve while the bar keeps
   its height, a description floats above an app after a moment, icons can be dragged to rearrange,
   an app bounces as it launches, and a dot marks apps that are open. Behaviour is in script.js. */
.menubar { position: relative; z-index: 5; }
.dock-wrap { position: relative; z-index: 5; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px 16px; }
.dock-cap { margin: 0; font-size: 13px; color: var(--soft); text-align: center; text-wrap: balance; }
.dock-cap b { color: var(--text); font-weight: 500; }
body.fullscreen .dock-cap { display: none; }
@media (max-width: 720px) { .dock-cap { font-size: 12px; } }
/* Full screen (a maximised window or Full Side): the dock hides like on macOS and slides back up
   when the pointer reaches the bottom edge, or when the handle is tapped on a touch screen. */
body.fullscreen .dock-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; transform: translateY(calc(100% + 8px)); transition: transform 0.25s ease; }
body.fullscreen.dock-peek .dock-wrap { transform: none; }
.dock-handle { display: none; position: fixed; left: 50%; bottom: 0; z-index: 49; width: 120px; height: 22px; margin-left: -60px; border: 0; background: none; }
.dock-handle::before { content: ''; position: absolute; left: 30px; right: 30px; bottom: 7px; height: 5px; border-radius: 3px; background: rgba(232, 232, 232, 0.35); }
@media (hover: none) { body.fullscreen:not(.dock-peek) .dock-handle { display: block; } }
@media (prefers-reduced-motion: reduce) { body.fullscreen .dock-wrap { transition: none; } }
.dock { pointer-events: auto; display: flex; align-items: flex-end; gap: 4px; height: 108px; padding: 8px; background: #141414; border: 1px solid #2a2a2a; border-radius: 20px; max-width: 100%; }
.app { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 76px; padding: 6px 6px 9px; background: none; border: 0; border-radius: 12px; color: #b4b4b4; font: inherit; font-size: 11px; white-space: nowrap; cursor: pointer; text-decoration: none; }
.app:hover { color: #e8e8e8; }
.app:focus-visible { outline: 2px solid #e8e8e8; outline-offset: 2px; }
.tile { width: calc(52px * var(--s, 1)); height: calc(52px * var(--s, 1)); border-radius: 25%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); transition: width 0.1s ease-out, height 0.1s ease-out; }
.tile svg { display: block; width: 100%; height: 100%; border-radius: 25%; }
.app.moving { opacity: 0.55; }
.app.moving .tile { outline: 1px dashed #9a9a9a; outline-offset: 3px; }
.app.launch .tile { animation: launch 0.5s ease-out; }
.app.running::after { content: ''; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #e8e8e8; }
.app[data-desc]::before { content: attr(data-desc); position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(-50%, 4px); width: max-content; max-width: 220px; padding: 8px 12px; background: #181818; border: 1px solid #3a3a3a; border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); color: #e8e8e8; font-size: 12.5px; line-height: 1.4; text-align: center; white-space: normal; pointer-events: none; opacity: 0; transition: opacity 0.12s, transform 0.12s; z-index: 2; }
.app[data-desc]:hover::before, .app[data-desc]:focus-visible::before { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.25s; }
.app.moving::before { display: none; }
@media (hover: none) { .app[data-desc]::before { display: none; } }
.dock-sep { align-self: stretch; flex: 0 0 1px; width: 1px; background: #2a2a2a; margin: 8px 6px; }
/* A minimised window waits in the dock with a plain window icon */
.app.min .tile { display: flex; align-items: center; justify-content: center; background: #1f1f1f; border: 1px solid #333; color: #e8e8e8; }
.app.min .tile svg { width: 50%; height: 50%; border-radius: 0; }
.min-label { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
@keyframes launch { 0% { translate: 0 0; } 30% { translate: 0 -14px; } 55% { translate: 0 0; } 75% { translate: 0 -5px; } 100% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .app.launch .tile { animation: none; } }
@media (max-width: 620px) { .dock { overflow-x: auto; } }

/* The stick figure */
.buddy { position: fixed; left: 0; top: 0; z-index: 45; overflow: visible; transform-origin: 16px 38px; transform: translate(-100px, -100px); touch-action: none; cursor: grab; filter: drop-shadow(0 0 1.5px #000); will-change: transform; }
.buddy-ui { position: fixed; left: 0; top: 0; z-index: 46; width: max-content; max-width: 260px; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: var(--panel-2); border: 1px solid #3a3a3a; border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); pointer-events: none; opacity: 0; transition: opacity 0.15s; user-select: text; -webkit-user-select: text; }
.buddy-link { font-size: 13px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.buddy-say { font-size: 13px; line-height: 1.4; color: var(--text); }
.buddy-you { align-self: flex-end; max-width: 100%; padding: 4px 10px; background: #262626; border-radius: 10px; font-size: 12px; color: var(--soft); overflow-wrap: anywhere; }
.buddy-chat { align-items: center; gap: 6px; margin: 2px -4px -2px; padding: 3px 3px 3px 12px; background: #0f0f0f; border: 1px solid var(--line); border-radius: 12px; }
.buddy-chat:focus-within { border-color: #6a6a6a; }
.buddy-chat input { flex: 1; min-width: 0; height: 44px; padding: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 13px; }
.buddy-chat input::placeholder { color: #8a8a8a; }
.buddy-chat button { flex: 0 0 44px; height: 44px; border-radius: 10px; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; }
.buddy-chat button:hover { background-color: #ffffff; }
.buddy-tail { position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; margin-left: -5px; background: var(--panel-2); border-right: 1px solid #3a3a3a; border-bottom: 1px solid #3a3a3a; transform: rotate(45deg); }
/* Type anywhere (from Ryan's type-anywhere design): words write large across the screen, collapse into a ball and fly into him */
.buddy-typed { position: fixed; left: 50%; top: 36%; transform: translate(-50%, -50%); z-index: 47; width: max-content; max-width: min(84vw, 920px); text-align: center; font-size: clamp(28px, 4.4vw, 58px); font-weight: 300; letter-spacing: -0.025em; line-height: 1.15; color: var(--text); text-shadow: 0 2px 28px rgba(0, 0, 0, 0.9); overflow-wrap: anywhere; pointer-events: none; opacity: 0; transition: opacity 0.12s; padding: 48px 96px; background: radial-gradient(closest-side, rgba(11, 11, 11, 0.94) 0%, rgba(11, 11, 11, 0.86) 60%, rgba(11, 11, 11, 0) 100%); }
.buddy-typed.on { opacity: 1; }
.buddy-typed.send { transform: translate(-50%, -50%) scale(0.03); letter-spacing: -0.3em; filter: blur(3px); opacity: 0; transition: transform 0.28s cubic-bezier(0.6, 0, 0.9, 0.3), letter-spacing 0.28s, filter 0.28s, opacity 0.28s ease-in; }
.buddy-typed .caret { display: inline-block; width: 2px; height: 0.9em; margin-left: 4px; vertical-align: -0.08em; background: var(--text); animation: caret 1s steps(1) infinite; }
.buddy-typed i { display: block; width: 120px; height: 2px; margin: 16px auto 0; border-radius: 1px; background: #6a6a6a; }
.buddy-typed.send .caret, .buddy-typed.send i { visibility: hidden; }
.buddy-ball { position: fixed; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 18px 4px rgba(232, 232, 232, 0.45); z-index: 47; pointer-events: none; opacity: 0; }
@keyframes caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .buddy-typed.send { transition: opacity 0.1s; transform: translate(-50%, -50%); letter-spacing: -0.025em; filter: none; } .buddy-typed .caret { animation: none; } }

/* Drag to select */
.marquee { position: fixed; border: 1px solid rgba(232, 232, 232, 0.7); background: rgba(232, 232, 232, 0.07); border-radius: 2px; pointer-events: none; z-index: 30; }

/* Right click ring */
.radial { position: fixed; width: 0; height: 0; z-index: 40; font-size: 13px; }
.ring {
  position: absolute; left: -150px; top: -150px; width: 300px; height: 300px;
  border-radius: 50%; border: 1.5px solid var(--text); background: rgba(11, 11, 11, 0.85);
  pointer-events: none; animation: ringgrow 0.18s ease-out;
}
.pill {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  height: 44px; padding: 0 16px; border-radius: 22px;
  background: var(--panel-2); border: 1px solid #3a3a3a; color: var(--text);
  white-space: nowrap; animation: pillin 0.25s ease-out;
}
.pill:hover { background-color: var(--text); color: var(--bg); }
@keyframes ringgrow { from { transform: scale(0.04); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
@keyframes pillin { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ring, .pill { animation: none; }
  .cursor { transition: none; }
}

/* Small screens: windows fill the desktop and stack on top of each other */
@media (max-width: 720px) {
  .active-app { display: none; }
  .icons { position: static; flex-direction: row; width: auto; padding: 16px; }
  .windows { inset: 0 8px 8px 8px; }
  .window { left: 0 !important; top: 0 !important; width: 100% !important; max-height: 100%; }
  .rs { display: none; }
  .win-body { padding: 18px; }
}
.window.dragging iframe { pointer-events: none; }
.app-foot { margin: 0; padding: 10px 16px; font-size: 13px; border-top: 1px solid #242424; }
.frame-tabs { display: flex; gap: 2px; padding: 6px; overflow-x: auto; border-bottom: 1px solid #242424; }
.frame-tab { flex: 0 0 auto; height: 44px; padding: 0 14px; border-radius: 8px; font-size: 13px; color: var(--dim); white-space: nowrap; }
.frame-tab.on { background: var(--text); color: var(--bg); }
.frame-tab.on:hover { background-color: #ffffff; }
.app-frame { height: min(62vh, 650px); background: #0F1113; }

/* ---- Menus: File, View, Go ---- */
.menubar { z-index: 6; }
.menu-wrap { position: relative; }
.menu-btn[aria-expanded="true"] { background-color: #1c1c1c; color: var(--text); }
.menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 2; min-width: 230px; max-height: calc(100vh - 72px); overflow: auto; display: flex; flex-direction: column; padding: 6px; background: var(--panel-2); border: 1px solid #3a3a3a; border-radius: 12px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6); }
.menu button { height: 44px; padding: 0 12px; border-radius: 8px; text-align: left; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu button:hover { background-color: #262626; }
.menu-sep { height: 1px; margin: 6px 8px; background: var(--line); }
.menu-label { padding: 12px 12px 4px; }
.menu-go { width: min(440px, calc(100vw - 32px)); }
.menu-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plain-toggle { margin-left: 8px; border: 1px solid var(--line); height: 32px; color: var(--text); }
@media (max-width: 720px) { .menu-go { position: fixed; left: 16px; top: 52px; } }

/* ---- Work leads the desktop and the dock ---- */
.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; overflow: hidden; background: #0f0f0f; border: 1px solid #3a3a3a; }
.mosaic img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; display: block; }
.icon-work { gap: 4px; padding-bottom: 10px; }
.icon-work .mosaic { width: 104px; height: 104px; border-radius: 14px; margin-bottom: 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55); }
.icon-work > span:nth-child(2) { font-size: 15px; font-weight: 500; }
.icon-sub { font-size: 11px; color: var(--dim); }
.icon-work:hover .mosaic { border-color: var(--text); }
.tile.mosaic { gap: 1px; }
@media (max-width: 720px) { .icon-work .mosaic { width: 72px; height: 72px; } .icon-sub { display: none; } }

/* ---- Work folder: heading, grid and gallery ---- */
.work-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.work-heading { display: flex; align-items: baseline; gap: 12px; }
.work-head .tabs { align-self: auto; }
.window.max .work-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card-seen { display: none; }
.card.seen .card-seen { display: inline; }
.card:focus-visible { outline-offset: -2px; }
.gallery { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.gal-stage { flex: 1; min-height: 220px; display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 8px; }
.gal-arrow { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--text); }
.gal-arrow:hover { border-color: var(--text); }
.gal-shot { height: 100%; min-height: 0; border-radius: 10px; background: #0f0f0f; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gal-shot:hover { background-color: #0f0f0f; }
.gal-img { width: 100%; height: 100%; max-height: min(58vh, 640px); object-fit: contain; display: block; }
.placeholder.gal-img { display: flex; min-height: 220px; }
.gal-info { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; }
.gal-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.gal-text .project-meta { justify-content: flex-start; }
.gal-open { height: 44px; padding: 0 20px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; white-space: nowrap; }
.gal-open:hover { background-color: #ffffff; }
.gal-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; flex: 0 0 auto; }
.gal-strip .thumb { flex: 0 0 64px; background: #0f0f0f; }
.window.max .win-body.work-body { flex: 1; }

/* ---- Quick Look ---- */
.ql { position: fixed; z-index: 48; width: 340px; display: flex; flex-direction: column; background: var(--panel-2); border: 1px solid #3a3a3a; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7); overflow: hidden; pointer-events: none; }
.ql .ql-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #0f0f0f; display: block; }
.ql .placeholder.ql-img { display: flex; }
.ql-text { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.ql-text .project-meta { justify-content: flex-start; }
.ql-text h2 { font-size: 18px; }
.ql-desc { font-size: 13.5px; }
.ql.big { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 32px); pointer-events: auto; cursor: pointer; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6), 0 24px 60px rgba(0, 0, 0, 0.7); }
.ql.big .ql-img { aspect-ratio: auto; height: min(62vh, 620px); object-fit: contain; }
.ql.big .ql-text h2 { font-size: 22px; }
.ql.big .ql-desc { font-size: 15px; }

/* ---- Previous and next in a project's title bar ---- */
.titlebar.has-nav .win-title { padding-right: 0; padding-left: 72px; }
.wnav { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; padding-right: 6px; }
.wnav > span { padding-right: 8px; white-space: nowrap; }
.wnav-btn { width: 44px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--soft); }
.wnav-btn:hover { color: var(--text); }
@media (max-width: 720px) { .wnav > span { display: none; } .titlebar.has-nav .win-title { padding-left: 0; } }

/* ---- Wallpaper 4: a slow slideshow of the work ---- */
body[data-wp="3"] { background-image: none; }
.wp-show { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.wp-show img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: grayscale(0.4) brightness(0.32); transition: opacity 1.8s ease; }
.wp-show img.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .wp-show img { transition: none; } }

/* ---- Simple view ---- */
.plain { flex: 1; min-height: 0; overflow: auto; background: var(--bg); user-select: text; -webkit-user-select: text; }
.plain-inner { max-width: 920px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 32px) 96px; display: flex; flex-direction: column; gap: 28px; }
.plain-head { display: flex; flex-direction: column; gap: 20px; }
.plain-head .about-text { display: flex; flex-direction: column; gap: 12px; }
.plain-head h1 { margin: 0; font-size: clamp(28px, 4.4vw, 44px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; }
.plain-h { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.plain-item { display: flex; flex-direction: column; gap: 12px; padding-bottom: 28px; }
.plain-item h3 { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: -0.02em; }
.plain-item p { max-width: 68ch; }
.plain-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.plain-shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #0f0f0f; display: block; }
.plain-shots img:first-child:last-child { aspect-ratio: 16 / 9; }
.plain-app { padding-bottom: 12px; }
.plain .app-actions button { border: 1px solid var(--line); }
.plain .app-actions button:hover { border-color: var(--text); }
body.plain .buddy, body.plain .buddy-ui, body.plain .buddy-tag, body.plain .buddy-typed, body.plain .buddy-ball, body.plain .menu-wrap, body.plain .active-app { display: none !important; }
