/* ============================================================
   FORCHETTI.ORG — Mac System 1 / Finder Aesthetic
   Inspired by the original 1984 Macintosh UI
   Susan Kare's Chicago font, platinum gray, hard pixel shadows
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Palette ── */
:root {
  --black:      #000000;
  --white:      #ffffff;
  --platinum:   #c0c0c0;
  --lt-gray:    #d4d0c8;
  --med-gray:   #808080;
  --dk-gray:    #404040;
  --bg-desktop: #c8c8c8;

  /* Chicago-family font stack: real Chicago on Mac, 
     Charcoal as fallback, then Geneva-style sans */
  --font-chicago: 'Chicago', 'Charcoal', 'Geneva', 'Helvetica Neue', Arial, sans-serif;
}

/* ── Body / Desktop ── */
html, body {
  height: 100%;
  min-height: 100vh;
  background-color: var(--bg-desktop);
  /* Classic Mac desktop: subtle dither pattern */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' x='0' y='0' fill='%23b8b8b8'/%3E%3Crect width='1' height='1' x='2' y='2' fill='%23b8b8b8'/%3E%3C/svg%3E");
  font-family: var(--font-chicago);
  font-size: 13px;
  color: var(--black);
  overflow-x: hidden;
}

/* ── Menu Bar ── */
.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 22px;
  background: var(--white);
  border-bottom: 1px solid var(--black);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 0;
  z-index: 1000;
  font-size: 13px;
  font-weight: bold;
  user-select: none;
}

.menubar-apple {
  font-size: 16px;
  margin-right: 14px;
  cursor: default;
  padding: 0 4px;
}

.menubar-item {
  padding: 0 10px;
  height: 22px;
  line-height: 22px;
  cursor: default;
  white-space: nowrap;
}

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

.menubar-clock {
  margin-left: auto;
  font-size: 12px;
  font-weight: normal;
  padding-right: 4px;
}

/* ── Desktop ── */
.desktop {
  padding-top: 28px;
  min-height: 100vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: 40px;
}

/* ── Desktop Icons (right rail) ── */
.desktop-icons {
  position: fixed;
  top: 38px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  z-index: 10;
}

.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
  width: 68px;
}

.desk-icon-graphic {
  width: 32px;
  height: 32px;
  position: relative;
}

/* Floppy disk icon */
.disk { display: flex; flex-direction: column; }
.disk-body {
  width: 32px; height: 28px;
  border: 1.5px solid var(--black);
  background: var(--white);
  position: relative;
}
.disk-label {
  position: absolute;
  top: 4px; left: 3px; right: 3px;
  height: 12px;
  border: 1px solid var(--black);
  background: var(--lt-gray);
}
.disk-notch {
  position: absolute;
  top: 0; right: 5px;
  width: 6px; height: 6px;
  background: var(--bg-desktop);
  border-left: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
}

/* Document icon */
.doc { position: relative; }
.doc-body {
  width: 28px; height: 34px;
  border: 1.5px solid var(--black);
  background: var(--white);
  padding: 8px 4px 4px;
  display: flex; flex-direction: column; gap: 3px;
}
.doc-ear {
  position: absolute;
  top: -1px; right: -1px;
  width: 9px; height: 9px;
  background: var(--bg-desktop);
  border-left: 1.5px solid var(--black);
  border-bottom: 1.5px solid var(--black);
}
.doc-line {
  height: 2px;
  background: var(--black);
  width: 100%;
}
.doc-line.short { width: 60%; }

/* Trash icon */
.trash-icon { display: flex; flex-direction: column; align-items: center; }
.trash-lid {
  width: 26px; height: 5px;
  border: 1.5px solid var(--black);
  background: var(--white);
  position: relative;
}
.trash-lid::before {
  content: '';
  position: absolute;
  top: -5px; left: 7px;
  width: 10px; height: 5px;
  border: 1.5px solid var(--black);
  border-bottom: none;
  background: var(--white);
}
.trash-can {
  width: 24px; height: 26px;
  border: 1.5px solid var(--black);
  border-top: none;
  background: var(--white);
  display: flex; gap: 3px;
  padding: 4px 4px 0;
  align-items: flex-start;
  margin-top: 1px;
}
.trash-line {
  flex: 1;
  height: 16px;
  border-left: 1.5px solid var(--black);
}

.desk-icon-label {
  font-size: 11px;
  color: var(--black);
  text-align: center;
  line-height: 1.2;
  background: var(--white);
  padding: 1px 3px;
  border: 1px solid transparent;
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desk-icon.selected .desk-icon-label {
  background: var(--black);
  color: var(--white);
}

.desk-icon.selected .disk-body,
.desk-icon.selected .doc-body,
.desk-icon.selected .trash-can {
  background: var(--dk-gray);
}

/* ── Main Window ── */
.window {
  width: min(820px, calc(100vw - 110px));
  margin: 20px auto 0;
  background: var(--white);
  border: 1px solid var(--black);
  /* Hard pixel drop shadow — the Mac signature */
  box-shadow: 3px 3px 0 0 var(--black);
  position: relative;
  z-index: 5;
}

/* ── Title Bar ── */
.titlebar {
  height: 22px;
  /* Hatched stripe pattern — the original Mac active window look */
  background: repeating-linear-gradient(
    90deg,
    var(--black) 0px, var(--black) 1px,
    var(--white) 1px, var(--white) 3px
  );
  border-bottom: 1px solid var(--black);
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 4px;
  user-select: none;
}

.titlebar-buttons { display: flex; align-items: center; }
.titlebar-zoom { display: flex; align-items: center; }

.close-box, .zoom-box {
  width: 13px; height: 13px;
  border: 1px solid var(--black);
  background: var(--white);
  cursor: default;
  flex-shrink: 0;
}

.close-box:hover { background: var(--dk-gray); }

.titlebar-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  background: var(--white);
  padding: 1px 8px;
  white-space: nowrap;
  overflow: hidden;
  line-height: 18px;
  border: none;
}

/* ── Window Body ── */
.window-body {
  display: flex;
}

.window-inner {
  flex: 1;
  padding: 16px 18px;
  overflow: hidden;
}

/* ── Window Header ── */
.win-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.bithead {
  width: 72px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
  /* natural rendering — no border, no filter */
}

.win-title {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.win-sub {
  font-size: 11px;
  color: var(--med-gray);
  margin-top: 4px;
}

/* ── Rule ── */
.win-rule {
  height: 1px;
  background: var(--black);
  margin: 12px 0;
}

/* ── Section Labels ── */
.win-section-label {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: var(--dk-gray);
}

/* ── List Items ── */
.win-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  cursor: default;
}

.win-item.hover {
  background: var(--lt-gray);
  border: 1px solid var(--black);
}

.win-item-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mini floppy in list */
.mini-disk {
  width: 22px; height: 22px;
  border: 1.5px solid var(--black);
  background: var(--white);
  position: relative;
}
.mini-disk::before {
  content: '';
  position: absolute;
  top: 3px; left: 2px; right: 2px;
  height: 8px;
  border: 1px solid var(--black);
  background: var(--lt-gray);
}
.mini-disk-notch {
  position: absolute;
  top: 0; right: 3px;
  width: 4px; height: 4px;
  background: var(--bg-desktop);
  border-left: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
}

/* Mini document in list */
.mini-doc {
  width: 20px; height: 24px;
  border: 1.5px solid var(--black);
  background: var(--white);
  position: relative;
  padding: 6px 3px 2px;
  display: flex; flex-direction: column; gap: 3px;
}
.mini-doc-ear {
  position: absolute;
  top: -1px; right: -1px;
  width: 7px; height: 7px;
  background: var(--bg-desktop);
  border-left: 1.5px solid var(--black);
  border-bottom: 1.5px solid var(--black);
}
.mini-doc-line {
  height: 1.5px;
  background: var(--black);
}

.win-item-body {
  flex: 1;
  min-width: 0;
}

.win-item-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 2px;
}

.win-item-desc {
  font-size: 11px;
  color: var(--dk-gray);
  line-height: 1.4;
}

.win-item-desc a {
  color: var(--black);
  text-decoration: underline;
}

/* ── Vic row ── */
.vic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.vic-img {
  width: 90px;   /* native pixel width — no rescaling */
  height: 70px;  /* native pixel height */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid var(--black);
  flex-shrink: 0;
}

.vic-text {
  font-size: 11px;
  color: var(--med-gray);
  font-style: italic;
}

/* ── Scrollbar ── */
.scrollbar {
  width: 16px;
  border-left: 1px solid var(--black);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.scroll-arrow {
  width: 16px; height: 16px;
  border: 1px solid var(--black);
  border-left: none;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px;
  cursor: default;
  flex-shrink: 0;
  line-height: 1;
}

.scroll-arrow:hover { background: var(--lt-gray); }

.scroll-track {
  flex: 1;
  background: repeating-linear-gradient(
    45deg,
    var(--platinum) 0px, var(--platinum) 1px,
    var(--white) 1px, var(--white) 5px
  );
  position: relative;
  min-height: 40px;
}

.scroll-thumb {
  width: 12px;
  height: 36px;
  background: var(--white);
  border: 1px solid var(--black);
  margin: 4px auto 0;
}

/* ── Status Bar ── */
.statusbar {
  height: 18px;
  border-top: 1px solid var(--black);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 10px;
  color: var(--dk-gray);
}

/* ── Footer / copyright on desktop ── */
.desktop-footer {
  position: fixed;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--dk-gray);
  white-space: nowrap;
}

/* ── Inactive / coming-soon item ── */
.win-item-inactive {
  opacity: 0.6;
  cursor: default;
}
.win-item-inactive:hover {
  background: transparent;
  border-color: transparent;
}

/* ── Coming soon badge ── */
.win-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: normal;
  border: 1px solid var(--dk-gray);
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: middle;
  color: var(--dk-gray);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Research meta line ── */
.win-meta {
  font-size: 10px;
  color: var(--med-gray);
  font-style: italic;
}

/* ── Gray mini disk (inactive) ── */
.mini-disk-gray {
  opacity: 0.4;
}

/* ── Homelab grid ── */
.homelab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

.hl-node {
  border: 1px solid var(--black);
  padding: 10px;
  background: var(--white);
}

.hl-node-label {
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 2px;
  letter-spacing: 0.3px;
}

.hl-node-sub {
  font-size: 10px;
  color: var(--med-gray);
  margin-bottom: 8px;
}

/* Proxmox server icons */
.hl-nodes-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.hl-server {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hl-server-icon {
  width: 28px;
  height: 20px;
  border: 1.5px solid var(--black);
  background: var(--white);
  position: relative;
}
/* Server "rack unit" lines */
.hl-server-icon::before {
  content: '';
  position: absolute;
  top: 5px; left: 3px; right: 3px;
  height: 2px;
  background: var(--black);
  box-shadow: 0 4px 0 var(--black);
}
/* LED dot */
.hl-server-icon::after {
  content: '';
  position: absolute;
  top: 3px; right: 4px;
  width: 3px; height: 3px;
  background: var(--black);
  border-radius: 50%;
}

.hl-server-icon.hl-server-new {
  background: var(--lt-gray);
}

.hl-server-name {
  font-size: 9px;
  text-align: center;
  font-weight: bold;
  line-height: 1.2;
}
.hl-server-addr {
  font-size: 9px;
  color: var(--med-gray);
  text-align: center;
}

/* NAS icons */
.hl-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hl-nas-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hl-nas-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 48px;
}

.hl-nas-icon {
  width: 26px;
  height: 22px;
  border: 1.5px solid var(--black);
  background: var(--white);
  position: relative;
}
/* NAS drive bay lines */
.hl-nas-icon::before {
  content: '';
  position: absolute;
  top: 4px; left: 2px; right: 2px;
  height: 1.5px;
  background: var(--black);
  box-shadow: 0 4px 0 var(--black), 0 8px 0 var(--black);
}

.hl-nas-name {
  font-size: 9px;
  font-weight: bold;
  text-align: center;
}
.hl-nas-sub {
  font-size: 8px;
  color: var(--med-gray);
  text-align: center;
  line-height: 1.3;
}

/* Misc items list */
.hl-misc {
  font-size: 10px;
}

.hl-misc-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.hl-misc-item {
  font-size: 10px;
  color: var(--dk-gray);
  line-height: 1.4;
}

.hl-dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--black);
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .desktop-icons { display: none; }
  .window { width: calc(100vw - 16px); margin: 8px auto 0; }
  .win-title { font-size: 16px; }
  .bithead { width: 60px; }
  .menubar-item { padding: 0 6px; font-size: 12px; }
  .homelab-grid { grid-template-columns: 1fr; }
}
