/* =========================================================================
   V7c · MAC OS 9 (Platinum)
   Dotted platinum desktop. Pinstripe title bars with floating "lozenge"
   for the title. Chicago-system font fallback. Square corners. Crisp
   bitmap-era line work. Three windows: Finder + Read Me + Get Info.
   ========================================================================= */

:root {
  --plat-bg:        #C2C8D0;     /* desktop blue-grey */
  --plat-dot:       rgba(40, 50, 70, 0.18);
  --plat-1:         #DDDDDD;     /* window body */
  --plat-2:         #BBBBBB;     /* shadow */
  --plat-3:         #888888;
  --plat-hi:        #FFFFFF;
  --plat-lo:        #777777;
  --ink:            #000000;
  --soft-ink:       #444444;
  --blue-sel:       #3D88E5;
  --pinstripe-1:    #FFFFFF;
  --pinstripe-2:    #C7C7C7;

  /* Mac System font fallback chain. On Mac, Chicago/Charcoal/Geneva
     are available. On other OSes, falls back to a similar sans. */
  --sys: 'Charcoal', 'Chicago', 'Geneva', 'Lucida Grande', 'Tahoma',
         -apple-system, BlinkMacSystemFont, sans-serif;
  --geneva: 'Geneva', 'Verdana', 'Tahoma', sans-serif;
  --mono: 'Monaco', 'Andale Mono', 'Courier New', monospace;
}

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

html, body { margin: 0; padding: 0; height: 100%; }

body.mac-desktop {
  background-color: var(--plat-bg);
  background-image:
    radial-gradient(var(--plat-dot) 0.5px, transparent 0.5px);
  background-size: 2px 2px;
  font-family: var(--sys);
  font-size: 12px;
  color: var(--ink);
  cursor: default;
  min-height: 100vh;
  padding: 38px 16px 16px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ink);
  text-decoration: none;
}

p, h1, h2 { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }

/* =========================================================================
   MENU BAR
   ========================================================================= */

.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sys);
  font-size: 12px;
  z-index: 100;
  padding: 0 8px;
  box-shadow: 0 1px 0 var(--plat-2);
}

.menubar ul { display: flex; align-items: center; gap: 0; }
.menubar li {
  padding: 2px 10px;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 4px;
}
.menubar li:hover {
  background: var(--ink);
  color: #FFFFFF;
}
.menubar .apple { padding: 1px 8px 2px; }
.menubar .clock { font-family: var(--sys); font-variant-numeric: tabular-nums; }
.menubar .appicon { padding: 2px 6px; }
.menubar .qm { font-size: 14px; }

/* =========================================================================
   MAC WINDOW
   ========================================================================= */

.mac-win {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  background: var(--plat-1);
  border: 1px solid var(--ink);
  box-shadow:
    1px 1px 0 var(--ink),
    2px 2px 0 var(--plat-2),
    3px 3px 0 var(--plat-3);
  font-family: var(--geneva);
}

/* TITLE BAR with pinstripes + lozenge */
.mac-title {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--ink);
  background: repeating-linear-gradient(
    180deg,
    var(--pinstripe-1) 0,
    var(--pinstripe-1) 1px,
    var(--pinstripe-2) 1px,
    var(--pinstripe-2) 2px
  );
  cursor: grab;
  user-select: none;
}
.mac-title--inactive {
  background: #DDDDDD;
}
.mac-title__text {
  background: var(--plat-1);
  padding: 0 12px;
  font-family: var(--sys);
  font-size: 12px;
  font-weight: normal;
  color: var(--ink);
  line-height: 16px;
  letter-spacing: 0;
}
.mac-title--inactive .mac-title__text {
  color: var(--soft-ink);
}

/* Close box (top-left) and Zoom box (top-right) */
.mac-close, .mac-zoom {
  position: absolute;
  top: 3px;
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  border: 1px solid var(--ink);
  padding: 0;
  cursor: pointer;
  box-shadow: inset -1px -1px 0 var(--plat-2);
}
.mac-close { left: 6px; }
.mac-zoom  { right: 6px; }
.mac-close:hover, .mac-zoom:hover {
  background: var(--plat-2);
}
.mac-close::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: linear-gradient(45deg, transparent 45%, var(--ink) 45%, var(--ink) 55%, transparent 55%),
              linear-gradient(-45deg, transparent 45%, var(--ink) 45%, var(--ink) 55%, transparent 55%);
  opacity: 0;
}
.mac-close:hover::after { opacity: 1; }
.mac-zoom::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--ink);
  opacity: 0;
}
.mac-zoom:hover::after { opacity: 1; }

.mac-title--inactive .mac-close,
.mac-title--inactive .mac-zoom { background: var(--plat-1); }

/* WINDOW BODY */
.mac-win__inset {
  background: #FFFFFF;
  border-top: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  margin: 1px;
  position: relative;
}

/* SCROLL BARS — visual only */
.mac-scroll {
  position: absolute;
  background:
    repeating-linear-gradient(
      45deg,
      #E5E5E5 0,
      #E5E5E5 2px,
      #FFFFFF 2px,
      #FFFFFF 4px
    );
  border: 1px solid var(--ink);
}
.mac-scroll--v { right: 0; top: 18px; bottom: 14px; width: 14px; }
.mac-scroll--h { bottom: 0; left: 0; right: 14px; height: 14px; }
.thumb {
  position: absolute;
  background: var(--plat-1);
  border: 1px solid var(--ink);
}
.mac-scroll--v .thumb { left: 0; right: 0; top: 4px; height: 60px; }
.mac-scroll--h .thumb { top: 0; bottom: 0; left: 4px; width: 80px; }

.mac-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(135deg, transparent 50%, var(--plat-1) 50%) no-repeat,
    repeating-linear-gradient(45deg, var(--ink) 0, var(--ink) 1px, transparent 1px, transparent 3px);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

/* =========================================================================
   FINDER WINDOW
   ========================================================================= */

.finder-tabs {
  background: var(--plat-1);
  padding: 4px 8px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--sys);
  font-size: 11px;
}
.tab--on { color: var(--ink); }

.finder-body {
  padding: 16px;
  min-height: 260px;
  background: #FFFFFF;
  background-image:
    radial-gradient(rgba(0,0,0,0.04) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

.finder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 16px 12px;
  padding-right: 14px;
  padding-bottom: 14px;
}

.fi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.fi__ico { width: 40px; height: 40px; }
.fi__ico svg { width: 100%; height: 100%; }
.fi__name {
  font-family: var(--geneva);
  font-size: 11px;
  text-align: center;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 2px;
  max-width: 90px;
  word-wrap: break-word;
}
.fi:hover .fi__name {
  background: rgba(0,0,0,0.08);
}
.fi--selected .fi__ico svg { filter: brightness(0.7); }
.fi--selected .fi__name {
  background: var(--ink);
  color: #FFFFFF;
}
.fi--disabled { opacity: 0.4; }

.finder-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--plat-1);
  border-top: 1px solid var(--ink);
  font-family: var(--sys);
  font-size: 11px;
  height: 18px;
}

/* =========================================================================
   READ ME (SimpleText) WINDOW
   ========================================================================= */

.text-body {
  padding: 12px 14px 18px;
  background: #FFFFFF;
  font-family: 'Geneva', 'Verdana', sans-serif;
  font-size: 12px;
  line-height: 1.45;
  min-height: 200px;
  padding-right: 18px;
  padding-bottom: 18px;
}
.text-body pre {
  margin: 0;
  font-family: 'Geneva', 'Verdana', sans-serif;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* =========================================================================
   GET INFO WINDOW
   ========================================================================= */

.mac-win__inset--info { padding: 0; }

.info-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--plat-2);
}
.info-head__ico { width: 36px; height: 36px; }
.info-head__ico svg { width: 100%; height: 100%; }
.info-head__name {
  font-family: var(--sys);
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 2px;
}
.info-head__kind {
  font-family: var(--geneva);
  font-size: 10.5px;
  color: var(--soft-ink);
}

.info-meta {
  padding: 10px 14px;
  display: grid;
  gap: 4px;
  font-family: var(--geneva);
  font-size: 11px;
  border-bottom: 1px solid var(--plat-2);
}
.info-meta > div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
}
.info-meta dt { color: var(--soft-ink); text-align: right; }
.info-meta dd { color: var(--ink); margin: 0; }

.info-comments { padding: 10px 14px 14px; }
.info-comments__hd {
  font-family: var(--geneva);
  font-size: 11px;
  color: var(--soft-ink);
  margin-bottom: 4px;
}
.info-comments__box {
  font-family: var(--geneva);
  font-size: 11px;
  line-height: 1.45;
  padding: 6px 8px;
  background: #FFFFFF;
  border: 1px solid var(--ink);
  box-shadow: inset 1px 1px 0 var(--plat-2);
  color: var(--ink);
}

/* =========================================================================
   APPS STRIP (right side floating, like classic Mac app switcher)
   ========================================================================= */

.apps-strip {
  position: fixed;
  top: 38px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}
.appbtn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--plat-1);
  border: 1px solid var(--ink);
  box-shadow:
    inset -1px -1px 0 var(--plat-2),
    1px 1px 0 var(--plat-2);
  cursor: pointer;
  padding: 0;
}
.appbtn:hover { background: var(--plat-2); }
.appbtn--active {
  background: #FFFFFF;
  box-shadow: inset 1px 1px 0 var(--plat-2);
}

/* =========================================================================
   RESPONSIVE — stack windows vertically on small screens
   ========================================================================= */

@media (max-width: 1000px) {
  .mac-win {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 540px;
    margin: 0 auto 16px;
  }
  .apps-strip { display: none; }
  body.mac-desktop { padding: 30px 12px 30px; }
}
