/* ═══════════════════════════════════════════════════════════════
   Portfolio OS — Classic Mac OS System 7 Stylesheet
   Black & white, crisp, authentic.
═══════════════════════════════════════════════════════════════ */

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

:root {
  --black:     #000000;
  --white:     #ffffff;
  --ltgray:    #dddddd;
  --midgray:   #aaaaaa;
  --dkgray:    #888888;
  --bar-h:     20px;   /* menu bar height */
  --win-bar-h: 20px;   /* window title bar height */
  --shadow:    3px 3px 0 var(--black);
  --font:      Chicago, Charcoal, Geneva, "Helvetica Neue", Arial, sans-serif;
  --font-sz:   12px;
  --mini-bar-h: 18px;
  /* Screen height drives the whole Mac scale */
  --mac-screen-h: clamp(420px, calc(78vh - 160px), 760px);
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font);
  font-size: var(--font-sz);
  color: var(--black);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  cursor: default;
  user-select: none;
}

a { color: var(--black); text-decoration: underline; cursor: pointer; }
a:hover { color: #444; }

.hidden { display: none !important; }

/* ─── Boot Screen (disabled) ─────────────────────────────────── */
#boot-screen {
  display: none !important;
}

#boot-content {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}


#boot-welcome {
  color: var(--white);
  font-size: 16px;
  font-family: var(--font);
  letter-spacing: 0.5px;
}

#boot-bar-wrap {
  width: 200px; height: 12px;
  background: var(--black);
  border: 1px solid var(--white);
}

#boot-bar-inner {
  height: 100%;
  width: 0;
  background: var(--white);
  animation: boot-fill 2.6s steps(20, end) forwards;
}

@keyframes boot-fill {
  0%   { width: 0%; }
  50%  { width: 60%; }
  80%  { width: 85%; }
  100% { width: 100%; }
}

/* ─── Desktop ────────────────────────────────────────────────── */
#desktop {
  position: fixed; inset: 0;
  padding-top: 0;
  /* TEST background */
  background-color: #a89880;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  overflow: hidden;
}

/* ─── Menu Bar (hidden — menu lives inside Mac screen now) ──── */
#menubar {
  display: none;
}

.menu-btn {
  background: none; border: none;
  font-family: var(--font); font-size: var(--font-sz);
  color: var(--black);
  padding: 0 10px;
  cursor: default;
  white-space: nowrap;
  display: flex; align-items: center;
  height: 100%;
  line-height: var(--bar-h);
}

#mb-apple {
  font-size: 16px;
  padding: 0 10px 0 8px;
}

.menu-btn.active,
.menu-btn:active {
  background: var(--black);
  color: var(--white);
}

#menubar-right {
  margin-left: auto;
  display: flex; align-items: center;
  padding-right: 10px;
}

#mb-clock {
  font-family: var(--font);
  font-size: 11px;
  color: var(--black);
  white-space: nowrap;
}

/* ─── Dropdown Menus ─────────────────────────────────────────── */
.dropdown {
  position: absolute;
  top: var(--mini-bar-h);
  background: var(--white);
  border: 1px solid var(--black);
  box-shadow: var(--shadow);
  z-index: 500;
  min-width: 180px;
  padding: 2px 0;
}

.dd-item {
  padding: 3px 20px 3px 20px;
  font-size: var(--font-sz);
  white-space: nowrap;
  cursor: default;
  display: flex; justify-content: space-between; align-items: center;
}
.dd-item:hover {
  background: var(--black);
  color: var(--white);
}
.dd-item:hover .shortcut { color: #aaa; }

.dd-item.dd-title {
  font-weight: bold;
  font-style: italic;
}
.dd-item.dd-title:hover { background: var(--white); color: var(--black); cursor: default; }

.dd-item.dd-disabled { color: var(--midgray); pointer-events: none; }

.dd-sep {
  height: 1px;
  background: var(--black);
  margin: 2px 4px;
}

.shortcut { font-size: 11px; color: var(--dkgray); margin-left: 20px; }

/* ─── Shared icon-svg size (used by trash) ───────────────────── */
.icon-svg {
  width: 48px; height: 48px;
  display: block;
}

/* ─── Windows ────────────────────────────────────────────────── */
.mac-win {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--black);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  min-width: 240px; min-height: 120px;
  /* Max height keeps window scrollable inside the screen */
  max-height: calc(var(--mac-screen-h) - var(--mini-bar-h) - 10px);
  z-index: 200;
  overflow: hidden;
}

/* ── Title Bar ─────────────────────────────────────── */
.win-bar {
  height: var(--win-bar-h);
  min-height: var(--win-bar-h);
  display: flex; align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--black);
  cursor: default;
  padding: 0 4px;
  flex-shrink: 0;
  position: relative;
}

/* Active window stripe pattern */
.mac-win.active .win-bar {
  background-image: repeating-linear-gradient(
    to bottom,
    var(--black) 0px, var(--black) 1px,
    var(--white) 1px, var(--white) 2px
  );
}

/* Title text sits on white strip in center of stripes */
.win-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* White background clears through the stripe */
  background: var(--white);
  padding: 0 6px;
  position: relative;
  z-index: 1;
  line-height: var(--win-bar-h);
  height: var(--win-bar-h);
  display: block;
}

/* Close box (left) */
.win-close, .win-zoom {
  width: 13px; height: 13px;
  border: 1px solid var(--black);
  background: var(--white);
  flex-shrink: 0;
  cursor: default;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  z-index: 2;
}
.win-close svg { display: block; }
.win-close:hover { background: var(--black); }
.win-close:hover svg line { stroke: var(--white); }
.win-close:active { background: var(--midgray); }

/* Zoom box has inner nested square */
.win-zoom::after {
  content: '';
  width: 7px; height: 7px;
  border: 1px solid var(--black);
  background: transparent;
  display: block;
}
.win-zoom:hover::after { border-color: var(--white); }
.win-zoom:hover { background: var(--black); }

/* ── Info Bar ──────────────────────────────────────── */
.win-info-bar {
  height: 16px;
  padding: 0 8px;
  font-size: 10px;
  color: var(--black);
  background: var(--white);
  border-bottom: 1px solid var(--black);
  display: flex; align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}

/* ── Window Body ───────────────────────────────────── */
.win-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--white);
  padding: 14px 16px;
  user-select: text;
  cursor: text;
}

/* PDF viewer — no padding, iframe fills the body */
.win-body-pdf {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Classic Mac scrollbar */
.win-body::-webkit-scrollbar { width: 15px; }
.win-body::-webkit-scrollbar-track {
  background: var(--white);
  border-left: 1px solid var(--black);
}
.win-body::-webkit-scrollbar-thumb {
  background: repeating-linear-gradient(
    45deg,
    var(--midgray) 0px, var(--midgray) 2px,
    var(--white) 2px, var(--white) 4px
  );
  border: 1px solid var(--black);
  border-radius: 0;
}
.win-body::-webkit-scrollbar-button {
  background: var(--white);
  border: 1px solid var(--black);
  height: 15px;
}
.win-body::-webkit-scrollbar-button:hover { background: var(--ltgray); }

/* ── Resize handle (size box) ──────────────────────── */
.mac-win::after {
  content: '';
  position: absolute; bottom: 0; right: 0;
  width: 14px; height: 14px;
  background:
    repeating-linear-gradient(
      -45deg,
      var(--black) 0px, var(--black) 1px,
      var(--white) 1px, var(--white) 3px
    );
  border-top: 1px solid var(--black);
  border-left: 1px solid var(--black);
  cursor: se-resize;
  z-index: 10;
}

/* ─── Shared content styles ──────────────────────────────────── */
.mac-divider {
  height: 1px;
  background: var(--black);
  margin: 12px 0;
}

.upload-note {
  font-size: 11px;
  color: var(--dkgray);
  border: 1px dashed var(--dkgray);
  padding: 10px;
  text-align: center;
}

.tag {
  display: inline-block;
  border: 1px solid var(--black);
  padding: 0 5px;
  font-size: 10px;
  background: var(--white);
  margin: 1px;
  white-space: nowrap;
}

.mac-btn {
  display: inline-block;
  border: 1px solid var(--black);
  padding: 3px 12px;
  background: var(--white);
  font-family: var(--font);
  font-size: var(--font-sz);
  cursor: default;
  text-decoration: none;
  color: var(--black);
  box-shadow: 2px 2px 0 var(--black);
}
.mac-btn:hover { background: var(--ltgray); }
.mac-btn:active { box-shadow: none; transform: translate(2px, 2px); }

/* ─── About Me Window ────────────────────────────────────────── */
.bio-wrap { font-size: 12px; }

.bio-top {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 0;
}
.bio-icon-wrap { flex-shrink: 0; }

.bio-name { font-size: 16px; font-weight: bold; margin-bottom: 2px; }
.bio-role { font-size: 11px; font-style: italic; margin-bottom: 4px; }
.bio-loc  { font-size: 11px; margin-bottom: 6px; }
.bio-contacts { font-size: 11px; line-height: 1.8; }
.bio-contacts a { color: var(--black); }

.bio-section { font-size: 12px; }
.bio-section p { line-height: 1.65; color: #222; }

.sec-hd {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--black);
  padding-bottom: 2px;
}

.skills-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.skills-table th {
  text-align: left; padding: 4px 8px 4px 0;
  font-weight: bold; vertical-align: top;
  white-space: nowrap; width: 80px;
}
.skills-table td { padding: 4px 0; line-height: 1.5; }
.skills-table tr { border-bottom: 1px solid var(--ltgray); }

/* ─── Resume Window ──────────────────────────────────────────── */
.resume-doc { font-size: 12px; }

.res-header { text-align: center; margin-bottom: 12px; }
.res-header h1 { font-size: 18px; font-weight: bold; margin-bottom: 3px; }
.res-header p  { font-size: 11px; color: #444; }

.res-rule { border: none; border-top: 2px solid var(--black); margin: 10px 0; }

.res-sec { margin-bottom: 12px; }
.res-sec h2 {
  font-size: 11px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--black);
  padding-bottom: 2px; margin-bottom: 8px;
}

.res-row {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 4px;
}
.res-left  { font-size: 12px; }
.res-right { font-size: 11px; color: #555; white-space: nowrap; display: flex; gap: 4px; flex-wrap: wrap; }
.res-sub   { font-size: 11px; color: #444; margin-top: 1px; }

.res-list { padding-left: 16px; margin-top: 4px; }
.res-list li { font-size: 11px; color: #222; line-height: 1.65; margin-bottom: 2px; }

.skills-row { font-size: 11px; line-height: 1.8; }
.skills-row strong { color: var(--black); }

.res-objective { font-size: 12px; line-height: 1.7; color: #222; }

.res-skills-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  font-size: 11px;
  line-height: 1.7;
}
.res-skills-2col strong { color: var(--black); }

/* ─── Projects Window ────────────────────────────────────────── */
.proj-card {
  border: 1px solid var(--black);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--white);
}

.proj-title-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 3px;
  flex-wrap: wrap;
}
.proj-title-row strong { font-size: 13px; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 2px; }

.proj-sub { font-size: 11px; font-style: italic; color: #555; margin-bottom: 6px; }

.proj-links { margin-top: 8px; }


.mac-table {
  width: 100%; border-collapse: collapse;
  font-size: 11px; margin-bottom: 6px;
}
.mac-table th {
  background: var(--ltgray);
  border: 1px solid var(--black);
  padding: 4px 8px;
  text-align: left;
  font-weight: bold;
}
.mac-table td {
  border: 1px solid var(--midgray);
  padding: 4px 8px;
  background: var(--white);
}
.mac-table tr:nth-child(even) td { background: #f8f8f8; }

.trans-note { font-size: 10px; color: #777; font-style: italic; }

/* ─── Recommendations Window ─────────────────────────────────── */
.rec-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 6px 0;
}
.rec-env  { font-size: 28px; flex-shrink: 0; line-height: 1; }
.rec-name { font-size: 13px; font-weight: bold; margin-bottom: 2px; }
.rec-role { font-size: 11px; color: #555; margin-bottom: 3px; }
.rec-note { font-size: 11px; color: #444; font-style: italic; }

/* ─── About Dialog ───────────────────────────────────────────── */
.mac-dialog .win-body { padding: 16px; }
.about-dialog { text-align: center; cursor: default; user-select: none; }
.about-name { font-size: 16px; font-weight: bold; margin-bottom: 2px; }
.about-ver  { font-size: 11px; color: #666; margin-bottom: 8px; }
.about-info { text-align: left; font-size: 11px; line-height: 1.9; }
.about-info strong { display: inline-block; width: 100px; }

/* ─── Mac Computer Illustration ─────────────────────────────── */
#mac-computer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  user-select: none;
  /* Fade in on load */
  opacity: 0;
  translate: 0 18px;
  transition: opacity 0.5s ease-out, translate 0.5s ease-out;
}
#mac-computer.visible { opacity: 1; translate: 0 0; }

/* ── Body ── */
#mac-body {
  width: min(1200px, 86vw);
  background: linear-gradient(160deg, #d8c9b0 0%, #c8b898 35%, #b8a882 70%, #a89878 100%);
  border-radius: 28px 28px 14px 14px;
  padding: 28px 28px 16px;
  box-shadow:
    inset 3px 3px 8px rgba(255,255,255,0.45),
    inset -3px -3px 8px rgba(0,0,0,0.22),
    6px 12px 32px rgba(0,0,0,0.55),
    2px 2px 0 rgba(255,255,255,0.15);
  position: relative;
}

/* ── Screen Bezel ── */
#mac-screen-bezel {
  background: linear-gradient(150deg, #2a2018 0%, #1a1408 100%);
  border-radius: 10px;
  padding: 10px;
  box-shadow:
    inset 3px 3px 10px rgba(0,0,0,0.9),
    inset -2px -2px 6px rgba(255,255,255,0.06);
  margin-bottom: 0;
}

/* ── Screen (the actual display) ── */
#mac-screen {
  width: 100%;
  height: var(--mac-screen-h);
  background-color: #c8c8c0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23fff'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E");
  background-size: 2px 2px;
  /* overflow: visible so dropdowns can appear above mini-desktop */
  overflow: visible;
  position: relative;
  border-radius: 2px;
}

/* ── Mini Menu Bar (now the real functional menu bar) ── */
#mini-menubar {
  position: relative;
  z-index: 200;
  height: var(--mini-bar-h);
  background: var(--white);
  border-bottom: 1px solid var(--black);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

/* Override .menu-btn for the compact mini bar */
#mini-menubar .menu-btn {
  font-size: 11px;
  padding: 0 8px;
  height: var(--mini-bar-h);
  line-height: var(--mini-bar-h);
}
#mini-menubar #mb-apple {
  font-size: 14px;
  padding: 0 9px 0 7px;
  line-height: 0;
}
#mini-menubar #menubar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding-right: 8px;
}
#mini-menubar #mb-clock {
  font-size: 11px;
}
#mini-menubar #dark-toggle {
  height: 13px;
  font-size: 11px;
  padding: 0 4px;
  margin-right: 6px;
  border-radius: 2px;
}

/* ── Mini Desktop ── */
#mini-desktop {
  position: relative;
  z-index: 1;
  height: calc(var(--mac-screen-h) - var(--mini-bar-h));
  overflow: hidden;
}

/* ── Mini Icon Column ── */
#mini-icon-col {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.mini-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 68px;
  padding: 5px 4px;
  cursor: default;
  border: 1px solid transparent;
  border-radius: 2px;
}
.mini-icon:hover { background: rgba(0,0,0,0.1); }
.mini-icon.selected svg { filter: invert(1); }
.mini-icon.selected span { background: var(--black); color: var(--white); }

.mini-icon svg {
  width: 34px; height: 34px;
  display: block;
  margin-bottom: 3px;
}
.mini-icon span {
  font-size: 9px;
  font-family: var(--font);
  color: var(--black);
  text-align: center;
  line-height: 1.2;
  padding: 0 2px;
  white-space: nowrap;
  text-shadow: none;
}

/* ── Lower Face ── */
#mac-lower-face {
  padding: 10px 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#mac-brand-text {
  font-family: var(--font);
  font-size: 11px;
  font-style: italic;
  color: rgba(0,0,0,0.45);
  letter-spacing: 1px;
}

#mac-drive-slot {
  width: 120px;
  height: 8px;
  background: linear-gradient(to bottom, #888 0%, #bbb 40%, #999 100%);
  border-radius: 2px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
#mac-drive-inner {
  width: 80px; height: 2px;
  background: rgba(0,0,0,0.3);
  border-radius: 1px;
}

#mac-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

#mac-logo-mark {
  font-size: 16px;
  color: rgba(0,0,0,0.35);
}

#mac-speaker-grill {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
#mac-speaker-grill span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.4);
  display: block;
}

/* ── Base / Stand ── */
#mac-base {
  width: min(1224px, calc(86vw + 24px));
  height: 22px;
  margin: 0 auto;
  background: linear-gradient(160deg, #c8b898 0%, #a89070 100%);
  border-radius: 0 0 14px 14px;
  box-shadow:
    inset 2px 0 4px rgba(255,255,255,0.2),
    inset -2px 0 4px rgba(0,0,0,0.15),
    4px 6px 14px rgba(0,0,0,0.4);
}

/* ─── Trash icon (bottom-right of desktop) ───────────────────── */
#desk-trash {
  position: absolute;
  bottom: 24px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 4px;
  cursor: default;
  user-select: none;
}
#desk-trash span {
  font-size: 11px;
  color: var(--white);
  text-shadow: 1px 1px 0 var(--black), -1px -1px 0 var(--black),
               1px -1px 0 var(--black), -1px 1px 0 var(--black);
  margin-top: 3px;
}
#desk-trash .icon-svg { width: 48px; height: 48px; }

/* ─── Dark Mode toggle button ────────────────────────────────── */
#dark-toggle {
  background: none;
  border: 1px solid var(--black);
  font-size: 12px;
  padding: 0 5px;
  height: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  margin-right: 8px;
  font-family: var(--font);
  color: var(--black);
  display: flex;
  align-items: center;
}
#dark-toggle:hover { background: var(--black); color: var(--white); }

/* ─── Dark Mode ──────────────────────────────────────────────── */
body.dark {
  --black:   #e8e8f0;
  --white:   #1a1a2e;
  --ltgray:  #2a2a40;
  --midgray: #444466;
  --dkgray:  #8888aa;
  --shadow:  3px 3px 0 rgba(0,0,0,0.8);
}

body.dark #desktop {
  background-color: #111122;
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 2px,
    rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px
  );
}

body.dark #mini-menubar {
  background: #1a1a2e !important;
  border-bottom-color: #444466 !important;
}

body.dark .menu-btn { color: #e8e8f0; }
body.dark .menu-btn.active { background: #e8e8f0; color: #1a1a2e; }

body.dark .dropdown {
  background: #1a1a2e;
  border-color: #444466;
}
body.dark .dd-item { color: #e8e8f0; }
body.dark .dd-item:hover { background: #e8e8f0; color: #1a1a2e; }
body.dark .dd-sep { background: #444466; }

body.dark .mac-win {
  background: #1e1e32;
  border-color: #444466;
}
body.dark .win-bar {
  background: #1e1e32;
  border-bottom-color: #444466;
}
body.dark .mac-win.active .win-bar {
  background-image: repeating-linear-gradient(
    to bottom,
    #e8e8f0 0px, #e8e8f0 1px,
    #1e1e32 1px, #1e1e32 2px
  );
}
body.dark .win-title { background: #1e1e32; color: #e8e8f0; }
body.dark .win-info-bar { background: #1e1e32; color: #aaaacc; border-bottom-color: #444466; }
body.dark .win-body { background: #1e1e32; color: #e8e8f0; }

body.dark .win-close  { background: #2a1a1a; border-color: #444466; }
body.dark .win-close svg line { stroke: #e94560; }
body.dark .win-close:hover svg line { stroke: #1a1a2e; }
body.dark .win-zoom   { background: #1a2a1a; border-color: #444466; }
body.dark .win-zoom::after { border-color: #e8e8f0; }

body.dark .mac-divider { background: #444466; }
body.dark .mac-table th { background: #2a2a44; color: #aaaacc; border-color: #444466; }
body.dark .mac-table td { background: #1e1e32; border-color: #333355; color: #ccccee; }
body.dark .mac-table tr:nth-child(even) td { background: #242438; }

body.dark .proj-card { background: #1e1e32; border-color: #444466; }
body.dark .proj-card:hover { background: #252542; border-color: #6666aa; }
body.dark .rec-item { color: #e8e8f0; }
body.dark .upload-note { border-color: #444466; color: #aaaacc; }
body.dark .tag { background: #2a2a44; border-color: #555577; color: #aaaacc; }
body.dark .mac-btn { background: #2a2a44; border-color: #555577; color: #e8e8f0; }
body.dark .mac-btn:hover { background: #3a3a5a; }

body.dark .res-sec h2 { border-bottom-color: #444466; }
body.dark .res-rule { border-top-color: #444466; }
body.dark .sec-hd { border-bottom-color: #444466; }
body.dark .skills-table tr { border-bottom-color: #2a2a44; }

/* Fix all hardcoded dark text colors that don't respond to CSS vars */
body.dark .res-header p,
body.dark .res-sub,
body.dark .res-right,
body.dark .res-list li,
body.dark .res-objective,
body.dark .bio-section p,
body.dark .bio-role,
body.dark .bio-loc,
body.dark .bio-contacts,
body.dark .bio-contacts a,
body.dark .bio-contacts div,
body.dark .proj-sub,
body.dark .rec-role,
body.dark .rec-note,
body.dark .shortcut,
body.dark .skills-table th,
body.dark .skills-table td,
body.dark .res-left,
body.dark .about-ver,
body.dark .about-info { color: #ccccee; }

body.dark a { color: #8899ff; }
body.dark a:hover { color: #aabbff; }
body.dark .win-body a { color: #8899ff; }

/* Scrollbar in dark mode */
body.dark .win-body::-webkit-scrollbar-track { background: #1a1a2e; }
body.dark .win-body::-webkit-scrollbar-thumb {
  background: repeating-linear-gradient(
    45deg,
    #444466 0px, #444466 2px,
    #1e1e32 2px, #1e1e32 4px
  );
}
body.dark .win-body::-webkit-scrollbar-button { background: #1e1e32; border-color: #444466; }

body.dark #dark-toggle { border-color: #e8e8f0; color: #e8e8f0; }
body.dark #dark-toggle:hover { background: #e8e8f0; color: #1a1a2e; }

body.dark #mb-clock { color: #aaaacc; }

/* Mac body stays warm regardless of dark mode — it's a physical object */
body.dark #mac-screen {
  background-color: #1a1a2e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%231e1e36'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%231e1e36'/%3E%3C/svg%3E");
}
body.dark .mini-icon span { color: #e8e8f0; }
body.dark .mini-icon:hover { background: rgba(255,255,255,0.08); }
body.dark .mini-icon.selected svg { filter: invert(0.8); }
body.dark .mini-icon.selected span { background: #e8e8f0; color: #1a1a2e; }

/* ─── Terminal Window ────────────────────────────────────────── */
.terminal-body {
  flex: 1;
  background: #0d0d0d;
  color: #00cc44;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  padding: 6px 8px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  user-select: text;
  cursor: text;
}

.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-track { background: #0d0d0d; }
.terminal-body::-webkit-scrollbar-thumb { background: #1a5c1a; }

.terminal-body div { color: #00cc44; }
.terminal-body .t-cmd { color: #88ff88; }
.terminal-body .t-err { color: #ff5555; }
.terminal-body .t-info { color: #55aaff; }

.terminal-input-row {
  display: flex;
  align-items: center;
  background: #0d0d0d;
  padding: 4px 8px;
  border-top: 1px solid #1a5c1a;
  flex-shrink: 0;
}

.terminal-prompt {
  color: #00cc44;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  white-space: nowrap;
  margin-right: 5px;
  flex-shrink: 0;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #00cc44;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  caret-color: #00cc44;
  user-select: text;
}

/* Terminal stays dark in both modes */
body.dark .terminal-body { background: #0d0d0d; color: #00cc44; }
body.dark .terminal-input-row { background: #0d0d0d; border-top-color: #1a5c1a; }

/* ─── Mobile View (hidden on desktop) ───────────────────────── */
#mobile-view {
  display: none;
}

/* ─── Desktop fade-in ────────────────────────────────────────── */
#desktop.visible {
  animation: fadein 0.4s ease-out forwards;
}
@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE — Portfolio scrollable layout, Mac OS aesthetic
   (max-width: 768px)
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Base ──────────────────────────────────────────────── */
  html, body {
    overflow: auto;
    height: auto;
    min-height: 100%;
    background: #d4d0c8;
  }

  body.dark { background: #111118; }

  #mac-computer { display: none !important; }

  #desktop {
    position: relative !important;
    inset: auto !important;
    display: block;
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    background: #d4d0c8;
  }

  body.dark #desktop { background: #111118; }

  /* ── Mobile view container ─────────────────────────────── */
  #mobile-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    background: #d4d0c8;
    font-family: var(--font);
  }

  body.dark #mobile-view { background: #111118; }

  /* ── Status Bar ────────────────────────────────────────── */
  #mob-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #000;
    color: #fff;
    font-size: 10px;
    letter-spacing: 0.08em;
    position: sticky;
    top: 0;
    z-index: 200;
  }

  body.dark #mob-status-bar { background: #0a0a12; }

  #mob-avail-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #999;
    flex-shrink: 0;
    animation: mob-pulse 2s ease-in-out infinite;
  }

  @keyframes mob-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
  }

  #mob-avail-text { flex: 1; font-weight: bold; }

  #mob-status-clock {
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: 0.05em;
  }

  /* ── Profile Card ──────────────────────────────────────── */
  #mob-profile-card {
    margin: 12px;
    padding: 16px;
    background: #fff;
    border: 1.5px solid #000;
    box-shadow: 3px 3px 0 #000;
  }

  body.dark #mob-profile-card {
    background: #1e1e2a;
    border-color: #444466;
    box-shadow: 3px 3px 0 #444466;
    color: #e0e0f0;
  }

  #mob-avatar-wrap {
    margin-bottom: 12px;
  }

  #mob-avatar {
    width: 52px;
    height: 52px;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    background: #000;
    color: #fff;
    font-family: var(--font);
  }

  body.dark #mob-avatar {
    border-color: #888;
    background: #333;
  }

  #mob-pname {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: -0.01em;
    margin-bottom: 3px;
  }

  #mob-ptitle {
    font-size: 11px;
    color: #444;
    margin-bottom: 2px;
    line-height: 1.4;
  }

  body.dark #mob-ptitle { color: #aaa; }

  #mob-psub {
    font-size: 10px;
    color: #777;
    font-style: italic;
    margin-bottom: 12px;
  }

  body.dark #mob-psub { color: #777; }

  #mob-link-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .mob-link-btn {
    display: inline-block;
    padding: 5px 12px;
    border: 1.5px solid #000;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.06em;
    color: #000;
    text-decoration: none;
    font-family: var(--font);
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-link-btn:active {
    background: #000;
    color: #fff;
  }

  body.dark .mob-link-btn {
    border-color: #aaa;
    color: #ddd;
  }

  body.dark .mob-link-btn:active {
    background: #ddd;
    color: #000;
  }

  /* ── Sections ──────────────────────────────────────────── */
  .mob-section {
    margin: 0 12px 16px;
  }

  .mob-sec-label {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.12em;
    color: #000;
    border-bottom: 1.5px solid #000;
    padding-bottom: 4px;
    margin-bottom: 10px;
  }

  body.dark .mob-sec-label {
    color: #ddd;
    border-color: #555;
  }

  /* ── Education Info Cards ──────────────────────────────── */
  .mob-info-card {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #000;
    box-shadow: 2px 2px 0 #000;
    margin-bottom: 8px;
  }

  body.dark .mob-info-card {
    background: #1e1e2a;
    border-color: #444;
    box-shadow: 2px 2px 0 #444;
  }

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

  body.dark .mob-info-title { color: #e0e0f0; }

  .mob-info-sub {
    font-size: 11px;
    color: #333;
    margin-bottom: 3px;
  }

  body.dark .mob-info-sub { color: #bbb; }

  .mob-info-meta {
    font-size: 10px;
    color: #666;
  }

  body.dark .mob-info-meta { color: #888; }

  /* ── Skills ────────────────────────────────────────────── */
  .mob-skill-group {
    margin-bottom: 8px;
  }

  .mob-skill-cat {
    font-size: 9px;
    letter-spacing: 0.1em;
    color: #555;
    margin-bottom: 5px;
    font-weight: bold;
  }

  body.dark .mob-skill-cat { color: #888; }

  .mob-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .mob-chip {
    display: inline-block;
    padding: 3px 9px;
    border: 1px solid #000;
    font-size: 10px;
    font-family: var(--font);
    background: #fff;
    color: #000;
    white-space: nowrap;
  }

  body.dark .mob-chip {
    background: #1e1e2a;
    border-color: #555;
    color: #ddd;
  }

  /* ── 2-column card grid ────────────────────────────────── */
  .mob-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mob-card-block {
    padding: 12px;
    background: #fff;
    border: 1px solid #000;
    box-shadow: 2px 2px 0 #000;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  body.dark .mob-card-block {
    background: #1e1e2a;
    border-color: #444;
    box-shadow: 2px 2px 0 #444;
  }

  .mob-card-block:active {
    background: #000;
    color: #fff;
    box-shadow: none;
    transform: translate(2px, 2px);
  }

  body.dark .mob-card-block:active {
    background: #333;
  }

  .mob-card-company {
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
  }

  body.dark .mob-card-company { color: #e0e0f0; }

  .mob-card-role {
    font-size: 10px;
    color: #444;
  }

  body.dark .mob-card-role { color: #aaa; }

  .mob-card-date {
    font-size: 9px;
    color: #777;
    line-height: 1.3;
  }

  body.dark .mob-card-date { color: #777; }

  .mob-view-more {
    font-size: 9px;
    font-weight: bold;
    margin-top: auto;
    padding-top: 6px;
    color: #000;
    letter-spacing: 0.02em;
  }

  body.dark .mob-view-more { color: #bbb; }

  .mob-card-block:active .mob-card-company,
  .mob-card-block:active .mob-card-role,
  .mob-card-block:active .mob-card-date,
  .mob-card-block:active .mob-view-more { color: #fff; }

  /* ── Project card expand ───────────────────────────────── */
  .mob-card-detail {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ccc;
  }

  .mob-card-detail .mac-btn {
    margin-top: auto;
    align-self: flex-start;
  }

  .mob-card-tags {
    font-size: 9px;
    color: #555;
    margin-bottom: 5px;
  }

  .mob-card-bullets {
    font-size: 9px;
    color: #444;
    padding-left: 13px;
    margin: 0 0 7px 0;
  }

  .mob-card-bullets li { margin-bottom: 3px; }

  body.dark .mob-card-detail { border-top-color: #444; }
  body.dark .mob-card-tags { color: #888; }
  body.dark .mob-card-bullets { color: #aaa; }

  /* ── Documents Grid ────────────────────────────────────── */
  .mob-docs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .mob-doc-btn {
    padding: 10px 6px;
    background: #fff;
    border: 1px solid #000;
    box-shadow: 2px 2px 0 #000;
    font-size: 10px;
    font-family: var(--font);
    text-align: center;
    cursor: pointer;
    color: #000;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
  }

  body.dark .mob-doc-btn {
    background: #1e1e2a;
    border-color: #444;
    box-shadow: 2px 2px 0 #444;
    color: #ccc;
  }

  .mob-doc-btn:active {
    background: #000;
    color: #fff;
    box-shadow: none;
    transform: translate(2px, 2px);
  }

  body.dark .mob-doc-btn:active {
    background: #555;
  }

  /* ── Footer ────────────────────────────────────────────── */
  #mob-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #000;
    color: #fff;
    margin-top: auto;
    font-family: var(--font);
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  body.dark #mob-footer { background: #0a0a12; }

  #mob-footer-name {
    flex: 1;
    font-weight: bold;
  }

  #mob-footer-contact {
    color: #fff;
    text-decoration: underline;
    font-size: 10px;
  }

  #mob-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #mob-footer-gh {
    color: #fff;
    border: 1px solid #fff;
    padding: 3px 7px;
    font-size: 10px;
    text-decoration: none;
    font-family: var(--font);
    font-weight: bold;
  }

  #mob-footer-dark {
    background: none;
    border: 1px solid #fff;
    color: #fff;
    font-size: 14px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
  }

  /* ── Full-screen window overlay ────────────────────────── */
  .mac-win.mobile-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 9999 !important;
    border-radius: 0;
    box-shadow: none;
    display: flex !important;
  }

  .mac-win.mobile-open .win-bar {
    height: 44px;
    padding: 0 12px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .mac-win.mobile-open .win-close {
    width: 32px;
    height: 32px;
  }

  .mac-win.mobile-open .win-close svg {
    width: 14px;
    height: 14px;
  }

  .mac-win.mobile-open .win-body,
  .mac-win.mobile-open .win-body-pdf {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

}

