/* =========================================================
   AntonOS — Monochrome Matrix Desktop
   NOCShift-inspired: pure B&W, square, mono, OS shell
   ========================================================= */

:root {
  --bg: #050505;
  --bg-elevated: #0e0e0e;
  --bg-tile: #141414;
  --bg-tile-hover: #1f1f1f;
  --bg-window: #0a0a0a;
  --border: #333333;
  --border-strong: #666666;
  --border-bright: #999999;
  --text: #ffffff;
  --text-muted: #b8b8b8;
  --text-dim: #7a7a7a;
  --white: #ffffff;
  --black: #000000;
  --active: #ffffff;
  --active-fg: #000000;
  --scanline: rgba(255, 255, 255, 0.03);
  --radius: 0;
  --font: "SF Mono", "Cascadia Mono", "Segoe UI Mono", ui-monospace, Menlo, Consolas, monospace;
  --mono: "SF Mono", "Cascadia Mono", ui-monospace, Menlo, Consolas, monospace;
  --taskbar-h: 42px;
  --icon-rail: 134px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: #000;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  font-size: inherit;
  border-radius: 0;
}

/* CRT scanlines over the whole shell */
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scanline) 2px,
    var(--scanline) 4px
  );
  opacity: 0.7;
}

/* ---------------- Desktop ---------------- */

#desktop {
  position: absolute;
  inset: 0 0 var(--taskbar-h) 0;
  background: transparent;
  overflow: hidden;
  z-index: 1;
}

/* faint grid like a terminal matrix field */
#desktop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.desktop-icons {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  height: calc(100% - 24px);
  width: 116px;
  max-width: 116px;
  padding-right: 0;
  z-index: 1;
}

.desktop-icon {
  width: 100px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  text-align: center;
  padding: 8px 4px;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.04em;
}

.desktop-icon span {
  padding: 2px 4px;
  line-height: 1.25;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  word-break: break-word;
  color: var(--text-muted);
}

.desktop-icon .icon-img {
  width: 42px;
  height: 42px;
  font-size: 13px;
  border-width: 1px;
}

/* Scale glyph labels for desktop tiles */
.desktop-icon .icon-about::after,
.desktop-icon .icon-session1::after,
.desktop-icon .icon-hedroom::after,
.desktop-icon .icon-computer::after,
.desktop-icon .icon-taskman::after,
.desktop-icon .icon-resume::after {
  font-size: 13px;
}
.desktop-icon .icon-music::after,
.desktop-icon .icon-contact::after,
.desktop-icon .icon-help::after {
  font-size: 17px;
}
.desktop-icon .icon-noc::after {
  font-size: 14px;
}
.desktop-icon .icon-folder::after {
  font-size: 11px;
  letter-spacing: 0.08em;
}
.desktop-icon .icon-recycle::after,
.desktop-icon .icon-settings::after {
  font-size: 10px;
}

.desktop-icon:hover {
  background: var(--bg-tile);
  border-color: var(--border);
}

.desktop-icon.selected,
.desktop-icon:focus-visible {
  outline: none;
  background: var(--bg-tile-hover);
  border-color: var(--border-strong);
}

.desktop-icon.selected span,
.desktop-icon:focus-visible span {
  background: var(--white);
  color: var(--black);
}

.desktop-icon:active .icon-img {
  transform: translate(1px, 1px);
}

/* ---------------- Square mono icons ---------------- */

.icon-img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  position: relative;
  border: 1px solid var(--border-strong);
  background: var(--bg-tile);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--white);
  image-rendering: pixelated;
}

.title-icon {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 6px;
  border: 1px solid var(--border-bright);
  background: var(--black);
  font-size: 8px;
  font-weight: 800;
  color: var(--white);
  font-family: var(--mono);
}

/* Glyphs via ::after — pure B&W squares */
.icon-about::after { content: "AK"; }
.icon-about-sm::after { content: "AK"; font-size: 6px; }

.icon-music::after { content: "♪"; font-size: 14px; }
.icon-music-sm::after { content: "♪"; font-size: 9px; }

.icon-session1::after { content: "S1"; }
.icon-session1-sm::after { content: "S1"; font-size: 6px; }

.icon-hedroom::after { content: "HR"; }
.icon-hedroom-sm::after { content: "HR"; font-size: 6px; }

.icon-noc::after { content: ">_"; font-size: 11px; }
.icon-noc-sm::after { content: ">_"; font-size: 7px; }

.icon-contact::after { content: "@"; font-size: 14px; }
.icon-contact-sm::after { content: "@"; font-size: 9px; }

.icon-computer::after { content: "PC"; }
.icon-computer-sm::after { content: "PC"; font-size: 6px; }

.icon-recycle::after { content: "BIN"; font-size: 8px; }
.icon-recycle-sm::after { content: "BIN"; font-size: 5px; }

.icon-shutdown::after { content: "OFF"; font-size: 8px; color: var(--text-dim); }

.icon-help::after { content: "?"; font-size: 14px; }
.icon-help-sm::after { content: "?"; font-size: 9px; }

.icon-resume::after { content: "CV"; font-size: 10px; }
.icon-resume-sm::after { content: "CV"; font-size: 6px; }

.icon-settings::after { content: "SET"; font-size: 8px; }
.icon-settings-sm::after { content: "SET"; font-size: 5px; }

.icon-taskman::after { content: "TM"; font-size: 10px; }
.icon-taskman-sm::after { content: "TM"; font-size: 6px; }

.icon-run::after { content: "$_"; font-size: 10px; }

.icon-folder::after { content: "DIR"; font-size: 8px; }
.icon-folder-sm::after { content: "DIR"; font-size: 5px; }

.desktop-icon.selected .icon-img,
.desktop-icon:focus-visible .icon-img,
.desktop-icon:hover .icon-img {
  border-color: var(--white);
  background: var(--black);
}

/* ---------------- Windows ---------------- */

.window {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  min-width: 280px;
  min-height: 140px;
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.65);
}

.window.active {
  border-color: var(--white);
  box-shadow:
    6px 6px 0 rgba(0, 0, 0, 0.75),
    0 0 0 1px var(--white);
}

.window.maximized {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none;
  transform: none !important;
  box-shadow: none;
  border-width: 0 0 1px 0;
}

.window.minimized {
  display: none !important;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 10px;
  height: 32px;
  cursor: default;
  flex-shrink: 0;
  background: var(--bg-tile);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.window.active .title-bar {
  background: var(--white);
  border-bottom-color: var(--white);
}

.window.active .title-bar-text {
  color: var(--black);
}

.window.active .title-icon {
  border-color: var(--black);
  background: var(--white);
  color: var(--black);
}

.window:not(.active) .title-bar-text {
  color: var(--text-muted);
}

.title-bar-text {
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding-right: 4px;
}

.title-bar-controls {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  height: 100%;
  align-items: stretch;
}

.title-bar-controls button {
  width: 32px;
  height: 100%;
  padding: 0;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  position: relative;
  cursor: default;
  color: inherit;
}

.window.active .title-bar-controls button {
  border-left-color: #ccc;
  color: var(--black);
}

.title-bar-controls button:hover {
  background: var(--bg-tile-hover);
}

.window.active .title-bar-controls button:hover {
  background: #e8e8e8;
}

.title-bar-controls button:active {
  background: var(--black);
  color: var(--white);
}

.window.active .title-bar-controls button:active {
  background: var(--black);
  color: var(--white);
}

/* Min _ */
.btn-min::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 11px;
  height: 2px;
  background: currentColor;
}

/* Max □ */
.btn-max::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 9px;
  bottom: 9px;
  border: 1px solid currentColor;
  border-top-width: 2px;
}

/* Close X */
.btn-close::before,
.btn-close::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  width: 1px;
  height: 14px;
  background: currentColor;
}
.btn-close::before { transform: rotate(45deg); }
.btn-close::after { transform: rotate(-45deg); }

.btn-close:hover {
  background: var(--white) !important;
  color: var(--black) !important;
}

.window.active .btn-close:hover {
  background: var(--black) !important;
  color: var(--white) !important;
}

.window.maximized .btn-max::before {
  left: 11px;
  right: 7px;
  top: 11px;
  bottom: 7px;
}
.window.maximized .btn-max::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 11px;
  top: 7px;
  bottom: 11px;
  border: 1px solid currentColor;
  border-top-width: 2px;
  background: transparent;
}

.window-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  background: var(--bg-window);
}

.menu-bar {
  display: flex;
  gap: 0;
  padding: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.menu-item {
  position: relative;
  padding: 6px 12px;
  cursor: default;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-family: inherit;
}

.menu-item:hover,
.menu-item.open {
  background: var(--white);
  color: var(--black);
}

.menu-item u {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* Dropdown panel — portaled to body or inside item */
.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--white);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.65);
  z-index: 50;
  padding: 2px 0;
  display: none;
}

.menu-item.open > .menu-dropdown {
  display: block;
}

/* When dropdown is fixed to viewport (via JS) */
.menu-dropdown.fixed {
  position: fixed;
  display: block;
  z-index: 30000;
}

.menu-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 7px 14px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: default;
  white-space: nowrap;
}

.menu-option:hover,
.menu-option:focus-visible {
  background: var(--white);
  color: var(--black);
  outline: none;
}

.menu-option:disabled {
  color: var(--text-dim);
  pointer-events: none;
}

.menu-option .menu-accel {
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-option:hover .menu-accel,
.menu-option:focus-visible .menu-accel {
  color: #555;
}

.menu-sep {
  height: 1px;
  margin: 3px 8px;
  background: var(--border-strong);
}

.window-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg-window);
  padding: 14px 16px;
  user-select: text;
  -webkit-user-select: text;
  color: var(--text);
  line-height: 1.5;
}

.window-content.terminal {
  background: #000;
  color: #e8e8e8;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  user-select: text;
  padding: 14px 16px;
}

.term-prompt {
  color: var(--white);
  font-weight: 800;
}

.term-line {
  white-space: pre-wrap;
  color: var(--text-muted);
}

.term-line:has(.term-prompt) {
  color: var(--text);
}

.cursor {
  color: var(--white);
  animation: blink 1.05s step-end infinite;
  font-weight: 800;
}

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

.status-bar {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.status-bar-field {
  flex: 1;
  border-right: 1px solid var(--border);
  padding: 5px 10px;
  min-height: 24px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.status-bar-field:last-child {
  flex: 0 0 88px;
  text-align: center;
  border-right: none;
  color: var(--text-muted);
}

/* Resize handle — square corner */
.window:not(.maximized)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 50%, var(--border-strong) 50%, var(--border-strong) 60%, transparent 60%),
    linear-gradient(135deg, transparent 70%, var(--border-bright) 70%, var(--border-bright) 80%, transparent 80%);
}

/* ---------------- Content styles ---------------- */

.about-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.avatar {
  width: 56px;
  height: 56px;
  background: var(--white);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.06em;
  border: 1px solid var(--white);
  flex-shrink: 0;
  font-family: var(--mono);
}

h1 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.bio {
  margin: 8px 0 10px;
  line-height: 1.5;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.bio strong {
  color: var(--white);
  font-weight: 800;
}

.muted {
  color: var(--text-dim);
  margin: 10px 0 0;
  font-size: 0.85rem;
}

fieldset {
  border: 1px solid var(--border-strong);
  margin: 10px 0;
  padding: 10px 12px 12px;
  background: var(--bg-elevated);
}

legend {
  padding: 0 8px;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
}

.info-grid {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 12px;
  align-items: baseline;
  font-size: 0.85rem;
}

.info-grid strong {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-online {
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  background: var(--black);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-tile);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px;
  background: var(--bg-tile);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  cursor: default;
}

.module-card:hover,
.module-card:focus-visible {
  border-color: var(--white);
  background: var(--bg-tile-hover);
  outline: none;
}

.module-card:active {
  background: var(--white);
  color: var(--black);
}

.module-card:active .module-key,
.module-card:active .module-desc {
  color: #444;
}

.module-key {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.module-name {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: default;
  text-align: left;
  font-family: inherit;
}

.link-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.link-row:first-child {
  padding-top: 0;
}

.link-row:hover .link-label,
.link-row:focus-visible .link-label {
  color: var(--white);
  text-decoration: underline;
  outline: none;
}

.link-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.link-url {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.button-row.right {
  justify-content: flex-end;
  padding: 0 14px 14px;
}

.win-btn {
  min-width: 88px;
  padding: 10px 14px;
  background: var(--bg-tile);
  border: 1px solid var(--border-strong);
  cursor: default;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.win-btn:hover {
  border-color: var(--white);
  background: var(--bg-tile-hover);
}

.win-btn:focus-visible {
  outline: 1px solid var(--white);
  outline-offset: 2px;
}

.win-btn:active {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.win-btn.primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  font-weight: 900;
}

.win-btn.primary:hover {
  background: #e0e0e0;
}

.win-btn.primary:active {
  background: var(--black);
  color: var(--white);
  border-color: var(--border-bright);
}

/* CD / now playing strip */
.cd-player {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 12px;
  margin-bottom: 14px;
}

.cd-art {
  width: 52px;
  height: 52px;
  background: var(--black);
  border: 1px solid var(--white);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}

.cd-art::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid var(--border-bright);
  background: var(--bg);
}

.cd-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.cd-title {
  font-weight: 800;
  font-size: 0.85rem;
  margin: 3px 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cd-artist {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.credit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.credit-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  color: var(--text-muted);
}

.credit-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.credit-list li strong {
  color: var(--white);
  font-weight: 800;
}

.credit-badge {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 4px 7px;
  color: var(--black);
  background: var(--white);
  flex-shrink: 0;
  border: 1px solid var(--white);
}

.credit-badge.netflix,
.credit-badge.umg,
.credit-badge.more {
  background: var(--white);
  color: var(--black);
}

/* Brand heroes */
.brand-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  background: var(--black);
}

.brand-hero .tagline {
  color: var(--text-muted);
}

.brand-logo {
  width: 48px;
  height: 48px;
  background: var(--white);
  color: var(--black);
  font-weight: 900;
  font-size: 14px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--white);
}

.brand-logo.hr {
  background: var(--black);
  color: var(--white);
  border-color: var(--white);
}

.check-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  line-height: 1.7;
  color: var(--text-muted);
}

.check-list li {
  position: relative;
  padding-left: 22px;
}

.check-list li::before {
  content: "■";
  position: absolute;
  left: 0;
  color: var(--white);
  font-size: 0.65rem;
  top: 0.35em;
}

/* Forms */
.form-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.form-row-top {
  align-items: start;
}

.form-row label {
  text-align: right;
  padding-top: 2px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.win-input {
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 9px 10px;
  border: 1px solid var(--border-strong);
  background: var(--black);
  color: var(--white);
  width: 100%;
  resize: vertical;
}

.win-input::placeholder {
  color: var(--text-dim);
}

.win-input:focus {
  outline: none;
  border-color: var(--white);
  background: #0a0a0a;
}

select.win-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--white) 50%),
    linear-gradient(135deg, var(--white) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

select.win-input option {
  background: var(--black);
  color: var(--white);
}

.contact-status {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-tile);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* Explorer */
.explorer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.explorer-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  cursor: default;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.explorer-item:hover,
.explorer-item:focus-visible {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  outline: none;
}

.explorer-item:hover .icon-img,
.explorer-item:focus-visible .icon-img {
  border-color: var(--black);
  background: var(--white);
  color: var(--black);
}

.drive-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.drive {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.drive:last-child {
  border-bottom: none;
}

.drive-icon {
  width: 28px;
  height: 20px;
  text-align: center;
  border: 1px solid var(--border-strong);
  background: var(--bg-tile);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  color: var(--white);
  font-style: normal;
}

.empty-bin {
  text-align: center;
  padding: 36px 12px;
}

.empty-bin-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-tile);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.empty-bin p {
  color: var(--text-muted);
}

.empty-bin strong {
  color: var(--white);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* Dialog */
.dialog {
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.8);
}

.dialog .window-content {
  background: var(--bg-elevated);
  border: none;
  padding: 18px;
}

.dialog .window-body {
  background: var(--bg-elevated);
}

.dialog-content {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.dialog-content p {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.dialog-content p:last-child {
  margin-bottom: 0;
}

.dialog-content strong {
  color: var(--white);
}

.dialog-icon {
  width: 36px;
  height: 36px;
  background: var(--white);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  flex-shrink: 0;
  font-family: var(--mono);
  border: 1px solid var(--white);
}

/* ---------------- Start menu ---------------- */

#start-menu {
  position: absolute;
  bottom: var(--taskbar-h);
  left: 0;
  z-index: 10000;
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--white);
  border-bottom: none;
  min-width: 260px;
  box-shadow: 4px -4px 0 rgba(0, 0, 0, 0.5);
}

#start-menu[hidden] {
  display: none;
}

.start-banner {
  width: 28px;
  background: var(--white);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  flex-shrink: 0;
}

.start-banner-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--black);
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.start-banner-text em {
  font-style: normal;
  font-weight: 700;
  opacity: 0.55;
}

.start-items {
  display: flex;
  flex-direction: column;
  padding: 4px;
  min-width: 210px;
  max-height: min(70vh, 520px);
  overflow: auto;
  background: var(--bg-elevated);
}

.start-group {
  padding: 8px 12px 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  user-select: none;
}

.start-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: default;
  color: var(--text-muted);
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-item:hover,
.start-item:focus-visible {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  outline: none;
}

.start-item:hover .icon-img,
.start-item:focus-visible .icon-img {
  border-color: var(--black);
  background: var(--white);
  color: var(--black);
}

.start-item .icon-img {
  width: 24px;
  height: 24px;
  font-size: 8px;
}

.start-item u {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.start-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--border-strong);
}

/* ---------------- Taskbar ---------------- */

#taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-strong);
  display: flex;
  align-items: stretch;
  padding: 0;
  gap: 0;
  z-index: 9999;
}

#start-button {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  padding: 0 16px;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--bg-tile);
  border: none;
  border-right: 1px solid var(--border-strong);
  cursor: default;
  flex-shrink: 0;
  color: var(--white);
}

#start-button:hover {
  background: var(--bg-tile-hover);
}

#start-button:active,
#start-button.active {
  background: var(--white);
  color: var(--black);
}

#start-button.active .start-logo,
#start-button:active .start-logo {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.start-logo {
  width: 18px;
  height: 18px;
  background: var(--white);
  border: 1px solid var(--white);
  color: var(--black);
  font-size: 10px;
  font-weight: 900;
  display: grid;
  place-items: center;
  font-family: var(--mono);
}

.start-logo::after {
  content: "A";
}

.taskbar-divider {
  width: 1px;
  height: 100%;
  background: var(--border);
  margin: 0;
  flex-shrink: 0;
}

#taskbar-windows {
  display: flex;
  gap: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

.taskbar-btn {
  min-width: 110px;
  max-width: 190px;
  height: 100%;
  padding: 0 12px;
  background: var(--bg-elevated);
  border: none;
  border-right: 1px solid var(--border);
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: default;
  flex: 1 1 auto;
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.taskbar-btn:hover {
  color: var(--text);
  background: var(--bg-tile);
}

.taskbar-btn.active {
  background: var(--white);
  color: var(--black);
  font-weight: 900;
  border-right-color: var(--white);
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  padding: 0;
  border-left: 1px solid var(--border-strong);
  flex-shrink: 0;
  margin-left: auto;
  background: var(--black);
}

.tray-icons {
  display: flex;
  gap: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-right: 1px solid var(--border);
}

.tray-icon {
  width: 38px;
  height: var(--taskbar-h);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  font-family: var(--mono);
}

.tray-icon:last-child {
  border-right: none;
}

.clock {
  min-width: 90px;
  text-align: center;
  padding: 0 14px;
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--white);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------- Shutdown / BSOD ---------------- */

#shutdown-screen {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#shutdown-screen[hidden] {
  display: none;
}

.shutdown-box {
  width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--white);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.85);
}

.shutdown-box .title-bar {
  background: var(--white);
  border-bottom: 1px solid var(--white);
}

.shutdown-box .title-bar-text {
  color: var(--black);
  padding-left: 4px;
}

.shutdown-body {
  display: flex;
  gap: 16px;
  padding: 20px;
}

.shutdown-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--white);
  background: var(--black);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.shutdown-body p {
  margin: 0 0 10px;
  color: var(--text-muted);
}

.shutdown-body strong {
  color: var(--white);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  cursor: default;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.radio input {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-strong);
  background: var(--black);
  margin: 0;
  flex-shrink: 0;
}

.radio input:checked {
  background: var(--white);
  border-color: var(--white);
  box-shadow: inset 0 0 0 3px var(--black);
}

#bsod {
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  z-index: 30000;
  padding: 48px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
  cursor: none;
  letter-spacing: 0.02em;
}

#bsod[hidden] {
  display: none;
}

#bsod pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  max-width: 72ch;
}

/* ---------------- Mobile ---------------- */

@media (max-width: 640px) {
  .desktop-icons {
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    width: auto;
    max-width: 100%;
    max-height: calc(100% - 16px);
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .window {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-height: 100%;
    transform: none !important;
    box-shadow: none;
  }

  .window.dialog {
    width: calc(100% - 24px) !important;
    left: 50% !important;
    top: 40% !important;
    transform: translate(-50%, -50%) !important;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.8);
  }

  .explorer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row label {
    text-align: left;
  }

  .taskbar-btn {
    min-width: 56px;
    max-width: 100px;
    padding: 0 8px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
}

/* Scrollbars — square mono */
.window-content::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.window-content::-webkit-scrollbar-track {
  background: var(--black);
  border-left: 1px solid var(--border);
}
.window-content::-webkit-scrollbar-thumb {
  background: var(--bg-tile-hover);
  border: 1px solid var(--border-strong);
}
.window-content::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}
.window-content::-webkit-scrollbar-button {
  display: none;
}

/* selection */
::selection {
  background: var(--white);
  color: var(--black);
}

/* =========================================================
   v2 features — boot, matrix, settings, run, taskman, toast
   ========================================================= */

body.booting #desktop,
body.booting #taskbar,
body.booting #start-menu {
  visibility: hidden;
}

body.no-scanlines::after {
  display: none;
}

body.no-grid #desktop::before {
  display: none;
}

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 60000;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--mono);
}

#boot-screen.hidden {
  display: none;
}

.boot-inner {
  width: min(520px, 100%);
}

.boot-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-strong);
}

.boot-mark {
  width: 40px;
  height: 40px;
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--black);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
}

.boot-title {
  font-weight: 900;
  letter-spacing: 0.22em;
  font-size: 1.1rem;
}

.boot-sub {
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.boot-log {
  margin: 0 0 16px;
  min-height: 160px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.boot-bar {
  height: 8px;
  border: 1px solid var(--border-strong);
  background: #0a0a0a;
  margin-bottom: 12px;
}

#boot-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--white);
  transition: width 0.15s linear;
}

.boot-skip {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
  display: block;
  background: transparent;
}

.folder-lead {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

body.no-matrix #matrix-canvas {
  display: none;
}

#desktop,
#taskbar,
#start-menu {
  z-index: 1;
}

#desktop {
  z-index: 1;
}

#toast {
  position: fixed;
  bottom: calc(var(--taskbar-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 25000;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--white);
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

#toast[hidden] {
  display: none;
}

/* Contact email bar */
.contact-email-bar {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  min-height: 44px;
}

.contact-direct-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1;
  text-align: right;
  padding-right: 0;
}

.email-chip {
  display: block;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.contact-copy-btn {
  min-width: 72px;
  padding: 8px 12px;
  line-height: 1;
  align-self: center;
}

@media (max-width: 520px) {
  .contact-email-bar {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .contact-copy-btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* Resume */
.resume-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Settings toggles */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
}

.toggle-row:last-of-type {
  border-bottom: none;
}

.toggle-row strong {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.toggle-desc {
  display: block;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  width: 36px;
  height: 18px;
  border: 1px solid var(--border-strong);
  background: var(--black);
  position: relative;
  flex-shrink: 0;
  cursor: default;
}

.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--border-strong);
}

.toggle-row input[type="checkbox"]:checked {
  border-color: var(--white);
  background: var(--bg-tile);
}

.toggle-row input[type="checkbox"]:checked::after {
  left: 20px;
  background: var(--white);
}

/* Task Manager */
.tm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tm-meta {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.tm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.tm-table th,
.tm-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.tm-table th {
  background: var(--black);
  color: var(--text-dim);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  position: sticky;
  top: 0;
}

.tm-table td {
  color: var(--text-muted);
}

.tm-table tr:hover td {
  background: var(--bg-tile);
  color: var(--white);
}

.tm-table td:first-child {
  color: var(--white);
  font-weight: 700;
}

.tm-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Run dialog */
#run-dialog {
  position: fixed;
  inset: 0;
  z-index: 22000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#run-dialog[hidden] {
  display: none;
}

.run-box {
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--white);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.85);
}

.run-box .title-bar {
  background: var(--white);
}

.run-box .title-bar-text {
  color: var(--black);
}

.run-box .title-bar-controls button {
  border-left-color: #ccc;
  color: var(--black);
}

.run-body {
  display: flex;
  gap: 14px;
  padding: 16px;
}

.run-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--white);
  background: var(--black);
  color: var(--white);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.run-fields {
  flex: 1;
  min-width: 0;
}

.run-fields p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.tray-icon.hot {
  color: var(--white);
  background: var(--bg-tile-hover);
}

@media (prefers-reduced-motion: reduce) {
  /* Matrix rain is opt-in via Settings / FX tray — do not force-hide the canvas.
     Only calm boot bar transitions here. */
  #boot-bar-fill {
    transition: none;
  }
}
