/* sanvito.tech: the 1996 desktop skinned in dried blood.
   Everything here is the DOM layer over the three.js canvas: boot screen, taskbar, comms box,
   Projects window, drone-feed overlay and the CRT layer. ui.js builds the elements; this styles them.
   Rules: 2-px pixel bevels, no rounded corners, VT323 everywhere, nothing under 12 px. */

:root {
  --face: #EFE6E8;
  --face-hi: #FFFFFF;
  --hi: #FFFFFF;
  --sh: #B48F96;
  --deep: #6E4A52;
  --text: #2A0A10;
  --dim: #9A7A80;
  --grey: #8C7F89;
  --red: #C1121F;
  --hot: #FF2A3C;
  --pink: #D9304A;
  --bone: #2A0A10;
  --white: #2A0A10;
  --sodium: #C1121F;
  --green: #C1121F;
  --panel: #FFFFFF;
  --body: #F7F2F3;
  --shadow: #E3C7CD;
  --taskbar: 56px;
  --letterbox: 0px;
  --font: 'VT323', ui-monospace, 'Lucida Console', monospace;
  --font-tiny: 'Press Start 2P', ui-monospace, monospace;
  /* Win95 title gradient, but red: 8 hard bands */
  --title-grad: linear-gradient(90deg,
    #C1121F 0 12.5%, #B01020 12.5% 25%, #9E0E1E 25% 37.5%, #8C0D1B 37.5% 50%,
    #7A0C19 50% 62.5%, #690B17 62.5% 75%, #580A14 75% 87.5%, #4A0A12 87.5% 100%);
  --cursor-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Cpath d='M1 1v12l3-3 2 5 2-1-2-5h4z' fill='%23C1121F' stroke='%23FFFFFF' stroke-width='1'/%3E%3C/svg%3E") 1 1, auto;
  --cursor-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cpath d='M12 0l2 10 10 2-10 2-2 10-2-10-10-2 10-2z' fill='%23FFFFFF' stroke='%23C1121F' stroke-width='1'/%3E%3C/svg%3E") 12 12, crosshair;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #030102;
  color: var(--text);
  font: 18px/1.2 var(--font);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  cursor: var(--cursor-arrow);
  user-select: none;
  -webkit-user-select: none;
}
html:not(.js) body { overflow: auto; }
a { color: var(--pink); }
button { font: inherit; color: inherit; cursor: var(--cursor-arrow); }
canvas.px, img.px { image-rendering: pixelated; image-rendering: crisp-edges; }
#ui img, #ui canvas, #boot img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ---------------------------------------------------------------- the scene canvas */
#scene {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none;
  z-index: 0;
}
body.armed #scene { cursor: var(--cursor-star); }
#ui { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui.glitch { animation: uiGlitch .4s steps(6) 1; }
@keyframes uiGlitch {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 2px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(4px, 0); }
  100% { transform: translate(0, 0); }
}

/* ---------------------------------------------------------------- bevels */
.bevel {
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--sh) var(--sh) var(--hi);
  box-shadow: 1px 1px 0 var(--deep);
}
.bevel:active, .bevel.pressed, .bevel.active {
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  box-shadow: inset 1px 1px 0 var(--deep);
}
.bevel.pressed > *, .bevel:active > * { transform: translate(1px, 1px); }
.inset {
  border: 2px solid;
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  box-shadow: inset 1px 1px 0 var(--deep);
}
.btn {
  display: inline-block; padding: 2px 12px; font-size: 18px; line-height: 20px;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--face-hi); }
.btn:focus-visible { outline: 1px dotted var(--text); outline-offset: -5px; }

/* ---------------------------------------------------------------- fallback (no JS / failed) */
#fallback {
  position: relative; z-index: 2;
  max-width: 640px; margin: 0 auto; padding: 64px 24px;
  font-size: 22px; line-height: 1.4;
}
html.js #fallback { display: none; }
html.js body.failed #fallback { display: block; }
body.failed #ui, body.failed #scene { display: none; }
body.failed { overflow: auto; cursor: auto; }
#fallback h1 { font-size: 40px; color: var(--pink); margin: 0 0 8px; font-weight: normal; }
#fallback h2 { font-size: 16px; color: var(--grey); letter-spacing: .1em; margin: 32px 0 8px; font-weight: normal; }
#fallback p.lead { margin: 0; color: var(--text); }
#fallback ul { list-style: none; padding: 0; margin: 0; }
#fallback li { margin: 0 0 12px; }
#fallback .blurb { display: block; color: var(--grey); font-size: 18px; }
#fallback footer { margin-top: 48px; color: var(--grey); font-size: 16px; }
#fail {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70;
  padding: 8px 12px; background: var(--face); border: 2px solid var(--red); color: var(--text);
  font-size: 16px;
}
#fail:empty { display: none; }

/* ---------------------------------------------------------------- boot screen */
#boot {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px; text-align: center;
}
#boot.hidden { display: none; }
#bios {
  position: absolute; left: 16px; top: 12px; margin: 0;
  color: var(--green); font: 18px/1.25 var(--font); text-align: left; white-space: pre;
  text-shadow: none;
}
#bios::after { content: '\2588'; animation: blink 1s steps(1) infinite; }
#bios.done::after { content: ''; }
#bootlogo {
  position: relative; width: 60vw; max-width: 520px; aspect-ratio: 560 / 273;
  opacity: 0; transition: opacity .6s;
  margin-top: 8vh;
}
#bootlogo.show { opacity: 1; }
#bootlogo img { width: 100%; height: 100%; display: block; object-fit: contain; }
#bootlogo .sweep {
  position: absolute; inset: 0;
  -webkit-mask-image: var(--logo); mask-image: var(--logo);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  background: linear-gradient(120deg, transparent 38%, rgba(255, 244, 240, 0.95) 48%, rgba(255, 244, 240, 0.95) 52%, transparent 62%);
  background-size: 300% 100%; background-position: 100% 0;
  opacity: 0;
}
#bootlogo.show .sweep { animation: sweep 1.2s ease-in-out .4s 1; }
@keyframes sweep { 0% { opacity: 1; background-position: 100% 0; } 100% { opacity: 1; background-position: 0 0; } }
#progress {
  width: 240px; height: 14px; margin: 18px auto 0;
  background: var(--panel); padding: 1px; display: flex; gap: 2px;
}
#progress i { flex: 1; background: transparent; }
#progress i.on { background: var(--red); }
#press {
  margin-top: 26px; font-size: 28px; color: var(--text); letter-spacing: .08em;
  visibility: hidden;
}
#press.show { visibility: visible; animation: pressBlink 1s steps(1) infinite; }
@keyframes pressBlink { 0%, 59% { opacity: 1; } 60%, 100% { opacity: 0; } }
#boothint { margin-top: 10px; font-size: 14px; color: var(--grey); letter-spacing: .05em; }
#bootmail { position: absolute; bottom: 14px; left: 0; right: 0; font-size: 14px; color: var(--grey); }
#bootmail a { color: var(--grey); text-decoration: none; }

/* ---------------------------------------------------------------- feed overlay (HUD) */
#feed { position: absolute; inset: 0; pointer-events: none; z-index: 10; display: none; }
body.started #feed { display: block; }
#feed .bar { display: none; }
#feed .bar.top { top: 0; }
#feed .bar.bot { bottom: 0; }
#feed .txt {
  position: absolute; font: 16px/18px var(--font); color: #2A0A10; text-shadow: 0 0 2px #fff, 0 0 4px #fff, 0 0 8px #fff, 0 0 12px #fff;
  white-space: nowrap; letter-spacing: .04em;
}
#feed .tl { left: 12px; top: 8px; }
#feed .tr { right: 12px; top: 8px; text-align: right; }
#feed .tc { left: 0; right: 0; top: 8px; text-align: center; color: var(--hot); font-size: 18px; }
#feed .br { right: 12px; bottom: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px) + 8px); text-align: right; }
#feed .rec { color: var(--text); }
#feed .rec i { display: inline-block; width: 8px; height: 8px; background: var(--green); margin-right: 6px; animation: blink 1s steps(1) infinite; }
#feed .sep { margin: 0 8px; color: var(--grey); }
#feed .mail { display: block; font-size: 12px; color: var(--grey); margin-top: 2px; }
#feed .star { color: var(--pink); }
#signal.lost { color: var(--hot); animation: blink .25s steps(1) infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
#hudline {
  position: absolute; left: 0; right: 0; top: 40%; text-align: center; pointer-events: none;
  font-size: 24px; color: var(--bone); letter-spacing: .1em; text-shadow: 0 0 8px rgba(193, 18, 31, 0.6);
  white-space: pre-wrap;
}
#renew {
  position: absolute; right: 12px; top: 34px; z-index: 11; display: none;
  font-size: 16px; letter-spacing: .06em;
}
#renew.show { display: inline-block; }
#toast {
  position: absolute; left: 50%; bottom: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%);
  padding: 4px 14px; background: var(--panel); border: 2px solid var(--red); color: var(--text);
  font-size: 20px; letter-spacing: .06em; white-space: nowrap; z-index: 40; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
#toast.show { opacity: 1; }
#nosignal {
  position: absolute; inset: 0; z-index: 45; display: none; pointer-events: none;
  background: repeating-linear-gradient(0deg, #f4eef0 0 2px, #d9c9cd 2px 3px, #fbf7f8 3px 5px);
  align-items: center; justify-content: center; color: var(--red); font: 12px var(--font-tiny);
}
#nosignal.show { display: flex; animation: staticJitter .1s steps(2) infinite; }
@keyframes staticJitter { 0% { background-position: 0 0; } 100% { background-position: 0 3px; } }

/* ---------------------------------------------------------------- shield (a window is open) */
#shield { position: absolute; inset: 0; z-index: 5; display: none; }
body.window-open #shield { display: block; }

/* ---------------------------------------------------------------- taskbar */
#taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px)); z-index: 30;
  background: var(--face);
  border-top: 2px solid var(--hi);
  box-shadow: 0 -1px 0 var(--deep);
  display: none; align-items: center; gap: 6px; padding: 0 6px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
body.started #taskbar { display: flex; }
#taskbar .tile { display: flex; align-items: center; justify-content: center; height: 40px; }
#start { width: 44px; padding: 0; }
#start img { height: 30px; width: auto; filter: drop-shadow(0 0 2px var(--hot)) drop-shadow(0 0 1px var(--white)); }
#start.flash { background: var(--red); }
.folder {
  width: 140px; height: 40px; gap: 8px; padding: 0 8px; justify-content: flex-start;
  font-size: 22px; line-height: 22px; letter-spacing: .02em; position: relative;
}
.folder canvas { width: 32px; height: 32px; }
.folder:hover, .folder:focus-visible { background: var(--face-hi); }
.folder:hover::after, .folder:focus-visible::after, .folder.active::after {
  content: ''; position: absolute; inset: 3px; border: 1px dotted var(--text); pointer-events: none;
}
.folder .in { display: flex; align-items: center; gap: 8px; width: 100%; height: 100%; justify-content: center; }
.folder .lbl { white-space: nowrap; }
.folder .sub { display: none; }
#wstatus {
  flex: 1; text-align: right; padding-right: 8px; font-size: 16px; color: var(--grey);
  letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#wstatus.wiggle { animation: wiggle .5s ease-in-out 1; color: var(--hot); }
@keyframes wiggle { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
#weapons { display: flex; gap: 6px; align-items: center; }
#weapons.wiggle { animation: wiggle .5s ease-in-out 1; }
.weapon {
  position: relative; width: 48px; height: 48px; padding: 0; overflow: hidden;
  background: var(--face); opacity: .7;
}
.weapon .in {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  width: 100%; height: 100%; overflow: hidden;
}
.weapon canvas { display: block; width: 36px; height: 36px; margin: -2px 0 -4px 0; flex: 0 0 auto; }
.weapon .lbl {
  display: block; width: 100%; font-size: 14px; line-height: 12px; padding: 1px 0 2px;
  text-align: center; background: rgba(255, 255, 255, 0.65); color: var(--text); letter-spacing: .04em;
}
.weapon .heat { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--deep); display: none; }
.weapon .heat i { display: block; height: 100%; width: 0; background: var(--sodium); }
.weapon .heat.hot i { background: var(--hot); }
.weapon .heat.on { display: block; }
.weapon:hover { opacity: 1; }
#weapons.none .weapon { opacity: 1; }
.weapon.selected { opacity: 1; background: var(--red); box-shadow: 0 0 0 2px var(--hot); }
.weapon.selected canvas { outline: 1px solid var(--white); outline-offset: -3px; }
.weapon.selected .lbl::after { content: '_'; animation: blink .8s steps(1) infinite; }
.weapon.pulse { animation: pulse .12s ease-out 1; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.weapon.reload .lbl { color: var(--sodium); }
#clock { font-size: 20px; padding: 0 8px; color: var(--text); letter-spacing: .05em; }
#mute { width: 36px; padding: 0; }
#mute canvas { width: 32px; height: 32px; }
#mute.off { opacity: .6; }

/* ---------------------------------------------------------------- comms box (ABOUT) */
#comms {
  position: absolute; left: 12px; bottom: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px) + 12px); z-index: 20;
  width: 520px; min-height: 150px; max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 2px solid var(--red);
  box-shadow: inset 0 0 0 1px var(--sh);
  display: none;
  transform: translateY(0);
  padding: 8px 10px 8px 8px;
  color: var(--text);
}
#comms.open { display: block; }
#comms.burst { animation: burst .2s steps(4) 1; }
@keyframes burst {
  0% { opacity: 1; background: var(--panel); }
  25% { opacity: .6; background: #2a2226; }
  50% { opacity: 1; background: var(--panel); }
  75% { opacity: .6; background: #221a1e; }
  100% { opacity: 1; background: var(--panel); }
}
/* corner brackets */
#comms .ck { position: absolute; width: 8px; height: 8px; border: 2px solid var(--pink); pointer-events: none; }
#comms .ck.tl { left: -2px; top: -2px; border-right: 0; border-bottom: 0; }
#comms .ck.tr { right: -2px; top: -2px; border-left: 0; border-bottom: 0; }
#comms .ck.bl { left: -2px; bottom: -2px; border-right: 0; border-top: 0; }
#comms .ck.br { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
#comms .row { display: flex; gap: 12px; height: 100%; }
#comms .slot { width: 128px; flex: 0 0 128px; position: relative; }
#comms .incoming {
  position: absolute; left: 0; right: 0; top: -2px; font-size: 12px; color: var(--pink); text-align: center;
  letter-spacing: .1em; animation: blink .5s steps(1) infinite; z-index: 2;
}
#comms .incoming.hidden { display: none; }
#comms .portrait {
  position: absolute; left: 0; bottom: 0; width: 128px; height: 128px;
  border: 1px solid var(--red); overflow: hidden; background: #fff;
}
#comms .portrait canvas { width: 100%; height: 100%; display: block; }
#comms .portrait::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.12) 2px 4px);
}
#comms .portrait::after {
  content: ''; position: absolute; left: 0; right: 0; top: -4px; height: 2px; pointer-events: none; z-index: 3;
  background: rgba(193, 18, 31, 0.25); opacity: 0;
}
#comms .portrait.talking canvas { animation: talk 2s steps(1) infinite; }
#comms .portrait.talking::after { opacity: 1; animation: sweepline .7s linear infinite; }
@keyframes talk {
  0% { transform: translateY(0); } 12.5% { transform: translateY(-2px); } 25% { transform: translateY(0); }
  37.5% { transform: translateY(-2px) scaleX(0.97); } 50% { transform: translateY(0); } 62.5% { transform: translateY(-2px); }
  75% { transform: translateY(0); } 87.5% { transform: translateY(-2px) scaleX(0.97); }
}
@keyframes sweepline { from { top: -4px; } to { top: 100%; } }
#comms .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#comms .name { font-size: 16px; color: var(--pink); letter-spacing: .04em; white-space: nowrap; }
#comms .name .live { color: var(--green); font-size: 12px; margin-left: 8px; }
#comms .org { font-size: 11px; color: var(--grey); letter-spacing: .1em; margin-bottom: 4px; }
#comms .text {
  flex: 1; font-size: 22px; line-height: 22px; white-space: pre; overflow: hidden; color: var(--text);
  min-height: 88px;
}
#comms .text .cur::after { content: '\2588'; color: var(--pink); animation: blink .6s steps(1) infinite; }
#comms .text .more { color: var(--pink); animation: blink .6s steps(1) infinite; }
#comms .foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: 14px; }
#comms .foot a { color: var(--pink); text-decoration: none; }
#comms .foot .btn { font-size: 14px; line-height: 14px; padding: 1px 8px; }

/* ---------------------------------------------------------------- projects window */
#projects {
  position: absolute; left: 50%; top: 50%; z-index: 25;
  width: 560px; height: 380px; max-width: calc(100vw - 16px); max-height: calc(100vh - var(--taskbar) - 16px);
  margin: -190px 0 0 -280px;
  background: var(--face);
  border: 2px solid; border-color: var(--hi) var(--sh) var(--sh) var(--hi);
  box-shadow: 1px 1px 0 var(--deep), 6px 6px 0 rgba(0, 0, 0, 0.15);
  display: none; flex-direction: column; overflow: hidden;
  transform-origin: 50% 0;
}
#projects.open { display: flex; }
#projects .title { touch-action: none;
  height: 24px; flex: 0 0 24px; display: flex; align-items: center; gap: 6px; padding: 0 4px 0 6px;
  background: var(--title-grad); color: var(--white); font-size: 18px; letter-spacing: .03em; white-space: nowrap;
  cursor: var(--cursor-arrow);
}
#projects .title canvas { width: 16px; height: 16px; }
#projects .title .t { flex: 1; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-tiny); font-size: 9px; line-height: 24px; }
#projects .title .x { width: 32px; height: 22px; padding: 0; font-size: 16px; line-height: 14px; display: flex; align-items: center; justify-content: center; }
#projects .menu { height: 22px; flex: 0 0 22px; display: flex; gap: 14px; padding: 0 8px; font-size: 18px; line-height: 22px; }
#projects .menu span { cursor: var(--cursor-arrow); }
#projects .menu span:hover { background: var(--red); color: var(--white); }
#projects .menu span u { text-decoration: underline; }
#projects .pane { flex: 1; display: flex; min-height: 0; margin: 2px; background: var(--body); }
#projects .icons {
  flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 10px;
  overflow-y: auto; min-width: 0;
}
#projects .icons::-webkit-scrollbar { width: 16px; }
#projects .icons::-webkit-scrollbar-track { background: repeating-conic-gradient(var(--face) 0 25%, var(--sh) 0 50%) 0 0 / 4px 4px; }
#projects .icons::-webkit-scrollbar-thumb { background: var(--face); border: 2px solid; border-color: var(--hi) var(--sh) var(--sh) var(--hi); }
#projects .entry {
  width: 100px; height: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px; background: transparent; border: 1px dotted transparent; text-align: center;
}
#projects .entry canvas { width: 64px; height: 64px; }
#projects .entry .n { font-size: 16px; line-height: 18px; padding: 0 3px; word-break: break-word; }
#projects .entry:hover, #projects .entry.sel { border-color: var(--text); }
#projects .entry.sel .n { background: var(--red); color: var(--white); }
#projects .details {
  width: 220px; flex: 0 0 220px; padding: 12px; border-left: 2px solid var(--sh);
  display: none; flex-direction: column; gap: 8px; font-size: 18px; line-height: 20px;
}
#projects .details.show { display: flex; }
#projects .details h3 { margin: 0; font-size: 22px; color: var(--pink); font-weight: normal; }
#projects .details p { margin: 0; color: var(--text); }
#projects .details .st { font-size: 14px; color: var(--grey); letter-spacing: .1em; margin-top: auto; }
#projects .details .st b { color: var(--green); font-weight: normal; }
#projects .details .btn { align-self: flex-start; }
#projects .status {
  height: 22px; flex: 0 0 22px; margin: 0 2px 2px; padding: 0 6px; font-size: 14px; line-height: 18px;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .04em;
}
#projects .status .sep { color: var(--grey); margin: 0 6px; }
#zoom {
  position: absolute; border: 2px solid var(--text); pointer-events: none; z-index: 26; display: none;
}
#zoom.show { display: block; }

/* ---------------------------------------------------------------- CRT layer */
#crt {
  position: absolute; inset: 0; z-index: 60; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.12) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px 3px);
}
#crt .roll {
  position: absolute; left: 0; right: 0; bottom: -14px; height: 12px;
  background: rgba(193, 18, 31, 0.08);
  transform: translateX(3px); display: none;
}
#crt .roll.show { display: block; animation: roll .2s linear 1; }
@keyframes roll { from { bottom: -14px; } to { bottom: 100%; } }
#hints {
  position: absolute; left: 0; right: 0; top: 18%; text-align: center; pointer-events: none; z-index: 12;
  font-size: 24px; color: var(--text); letter-spacing: .1em; opacity: 0; transition: opacity .3s;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}
#hints.show { opacity: 1; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 767px), (pointer: coarse) {
  :root { --taskbar: 64px; --letterbox: 0px; }
  #bios { font-size: 14px; left: 10px; top: 8px; }
  #bootlogo { width: 78vw; }
  #press { font-size: 26px; }
  #feed .tl, #feed .tr, #feed .br { font-size: 14px; }
  #feed .tr, #feed .br .mail, #feed .tl .cam, #feed .tl .bat, #feed .tl .sep { display: none; }
  #feed .tl .rec { margin-right: 8px; }
  #feed .tc { font-size: 16px; top: auto; bottom: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px) + 6px); left: 12px; right: auto; text-align: left; }
  #feed .br { bottom: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px) + 6px); }
  #renew { top: 8px; font-size: 14px; padding: 1px 8px; line-height: 16px; }
  #taskbar { gap: 4px; padding: 0 4px; padding-bottom: env(safe-area-inset-bottom, 0); }
  #start { width: 36px; height: 44px; }
  #start img { height: 22px; }
  #taskbar .folder { width: 48px; height: 52px; padding: 0; }
  #taskbar .weapon { width: 48px; height: 52px; }
  .folder .in { flex-direction: column; gap: 1px; justify-content: center; }
  .folder canvas { width: 26px; height: 26px; }
  .folder .lbl { display: none; }
  .folder .sub { display: block; font-family: var(--font); font-size: 14px; line-height: 12px; letter-spacing: 0; }
  #wstatus { display: none; }
  #weapons { gap: 6px; margin-left: auto; }
  .weapon .lbl { font-family: var(--font); font-size: 15px; line-height: 13px; letter-spacing: 0; }
  .weapon canvas { width: 30px; height: 30px; margin: 0 0 -1px 0; }
  .weapon .lbl { padding: 0 0 1px; }
  #clock { display: none; }
  #mute { width: 32px; }
  #comms {
    left: 0; right: 0; width: auto; max-width: none; height: 128px; bottom: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px));
    padding: 6px 8px; border-left: 0; border-right: 0;
  }
  #comms .row { gap: 8px; }
  #comms .slot { width: 96px; flex-basis: 96px; }
  #comms .portrait { width: 96px; height: 96px; }
  #comms .text { font-size: 20px; line-height: 22px; white-space: pre-wrap; min-height: 0; }
  #comms .name { font-size: 14px; }
  #comms .org { display: none; }
  #comms .foot { font-size: 13px; gap: 8px; }
  #projects {
    left: 0; right: 0; bottom: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px)); top: auto; width: auto; max-width: none;
    height: 70vh; max-height: 70vh; margin: 0;
    box-shadow: 0 -2px 0 var(--deep);
    transform-origin: 50% 100%;
  }
  #projects .pane { flex-direction: column; }
  #projects .details { width: auto; flex-basis: auto; border-left: 0; border-top: 2px solid var(--sh); }
  #projects .icons { flex: 0 0 auto; max-height: 40%; }
  #toast { font-size: 18px; bottom: calc(var(--taskbar) + env(safe-area-inset-bottom, 0px) + 44px); max-width: calc(100vw - 24px); white-space: normal; text-align: center; }
  #hints { font-size: 20px; }
}
@media (max-height: 420px) {
  #bootlogo { width: 40vh; margin-top: 2vh; }
  #press { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #press.show, #feed .rec i, #comms .portrait.talking canvas { animation: none; }
}

/* ---------------------------------------------------------------- the logo in the feed, the camera button */
#hudlogo {
  position: absolute; left: 50%; top: calc(var(--letterbox) + 8px); transform: translateX(-50%);
  width: 200px; max-width: 46vw; pointer-events: none; image-rendering: auto;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}
@media (max-width: 767px), (pointer: coarse) {
  #hudlogo { width: 132px; top: 34px; }
  #taskbar #start { display: none; }
}
