/* ============================================
   RETRO MAC PORTFOLIO — shared styles
   System 7 / Classic Mac OS desktop vibe
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap');

:root {
  --desktop: #8a91c5;      /* lavender desktop */
  --paper: #ffffff;
  --ink: #000000;
  --shadow: rgba(0, 0, 0, 0.35);
  --accent: #8a91c5;
  --gray-light: #dddddd;
  --gray-mid: #999999;
  --pinstripe: repeating-linear-gradient(
    to bottom,
    #000 0px, #000 1px,
    #fff 1px, #fff 3px
  );
  --font-pixel: 'Silkscreen', 'Chicago', monospace;
  --font-body: Geneva, Verdana, Tahoma, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  background: var(--desktop);
  font-family: var(--font-body);
  color: var(--ink);
  overflow-x: hidden;
}

/* ---------- MENU BAR ---------- */

.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 32px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  z-index: 9999;
  font-family: var(--font-pixel);
  font-size: 14px;
}

.menubar .logo {
  font-size: 18px;
  margin-right: 10px;
  line-height: 1;
  cursor: default;
}

img.logo {
  height: 20px;
  width: auto;
  image-rendering: pixelated;
  display: block;
}

.menubar a {
  color: var(--ink);
  text-decoration: none;
  padding: 4px 10px;
  text-transform: uppercase;
}

.menubar a:hover {
  background: var(--ink);
  color: var(--paper);
}

.menubar .clock {
  margin-left: auto;
  cursor: default;
}

/* ---------- DESKTOP ---------- */

.desktop {
  position: relative;
  min-height: 100vh;
  padding-top: 32px;
  overflow: hidden;
}

/* ---------- CLASSIC WINDOW ---------- */

.mac-window {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
}

.mac-titlebar {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--ink);
  padding: 0 6px;
  background: var(--pinstripe);
  user-select: none;
  cursor: grab;
}

.mac-titlebar:active { cursor: grabbing; }

.mac-titlebar .title {
  font-family: var(--font-pixel);
  font-size: 13px;
  text-transform: uppercase;
  background: var(--paper);
  padding: 0 10px;
  margin: 0 auto;
  white-space: nowrap;
}

.mac-titlebar .box {
  width: 14px;
  height: 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  flex-shrink: 0;
  cursor: pointer;
}

.mac-titlebar .box:active { background: var(--ink); }

.mac-titlebar .box.zoom {
  position: relative;
}
.mac-titlebar .box.zoom::after {
  content: '';
  position: absolute;
  top: 1px; left: 1px;
  width: 7px; height: 7px;
  border: 1px solid var(--ink);
}

.mac-titlebar .spacer { width: 6px; flex-shrink: 0; }

/* struts of pinstripe need white gaps around boxes */
.mac-titlebar .box,
.mac-titlebar .title {
  outline: 3px solid var(--paper);
}

.mac-window .window-body {
  padding: 24px;
}

.mac-window .resize-strip {
  height: 14px;
  border-top: 2px solid var(--ink);
  background: var(--pinstripe);
  position: relative;
}

.mac-window .resize-strip .grip {
  position: absolute;
  right: 0; bottom: 0;
  width: 14px; height: 14px;
  background: var(--paper);
  border-left: 2px solid var(--ink);
  border-top: 2px solid var(--ink);
}
.mac-window .resize-strip .grip::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: repeating-linear-gradient(
    135deg,
    #000 0 1px, transparent 1px 4px
  );
}

/* ---------- DASHBOARD ---------- */

.dashboard {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 92vw);
}

.dashboard .window-body {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 20px 14px 16px;
}

.dashboard .icon { width: 80px; padding: 4px 2px; }
.dashboard .icon svg { width: 34px; height: 34px; }

/* ---------- ICONS ---------- */

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 92px;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  padding: 6px 2px;
}

.icon svg {
  width: 44px;
  height: 44px;
  shape-rendering: crispEdges;
}

.icon .label {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.25;
  background: var(--paper);
  padding: 1px 4px;
  text-transform: lowercase;
}

.icon:hover .label,
.icon:focus .label {
  background: var(--ink);
  color: var(--paper);
}

/* Decorative icons scattered on the desktop */
.desk-icon {
  position: absolute;
  z-index: 2;
}
.desk-icon .label {
  background: transparent;
  color: var(--paper);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.desk-icon:hover .label { background: var(--ink); color: var(--paper); }

/* ---------- POPUP WINDOWS (About, easter eggs) ---------- */

.popup {
  position: absolute;
  z-index: 10;
  display: none;
  width: min(480px, 90vw);
}
.popup.open { display: block; }

.popup .window-body {
  font-size: 13px;
  line-height: 1.65;
}

.popup h2 {
  font-family: var(--font-pixel);
  font-size: 15px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.popup p + p { margin-top: 10px; }

/* ---------- STICKY NOTE ---------- */

.sticky {
  position: absolute;
  z-index: 10000;
  width: 180px;
  background: #fdf6a3;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  font-size: 12px;
  line-height: 1.5;
  transform: rotate(-2deg);
}
.sticky .sticky-bar {
  height: 12px;
  border-bottom: 1px solid var(--ink);
  background: repeating-linear-gradient(to bottom, #000 0 1px, #fdf6a3 1px 3px);
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0 3px;
}
.sticky .sticky-bar .box {
  width: 8px;
  height: 8px;
  background: #fdf6a3;
  border: 1px solid var(--ink);
  cursor: pointer;
  outline: 2px solid #fdf6a3;
}
.sticky .sticky-bar .box:active { background: var(--ink); }
.sticky .sticky-body { padding: 10px 12px; }
.sticky.collapsed .sticky-body { display: none; }
.sticky.collapsed .sticky-bar { border-bottom: none; }

/* ---------- ERROR DIALOG easter egg ---------- */

.error-dialog {
  width: min(340px, 85vw);
}
.error-dialog .window-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 12px;
  padding: 18px;
}
.error-dialog .bomb { font-size: 26px; }
.error-dialog .btn-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 14px;
}

.mac-btn {
  font-family: var(--font-body);
  font-size: 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 4px 18px;
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink);
  margin: 4px;
}
.mac-btn:active { background: var(--ink); color: var(--paper); }

/* ---------- CONTENT PAGES ---------- */

.page-window {
  width: min(760px, 94vw);
  margin: 60px auto 60px;
  position: relative;
}

.page-window .window-body {
  padding: 34px 40px;
  min-height: 50vh;
}

.page-window h1 {
  font-family: var(--font-pixel);
  font-size: 20px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.page-window .subtitle {
  font-size: 12px;
  color: #444;
  margin-bottom: 26px;
  border-bottom: 1px dotted var(--ink);
  padding-bottom: 14px;
}

.entry { margin-bottom: 28px; }

.entry h3 {
  font-family: var(--font-pixel);
  font-size: 13px;
  margin-bottom: 4px;
}

.entry .meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
}

.entry p {
  font-size: 13px;
  line-height: 1.65;
}

.entry a { color: var(--ink); }

.placeholder-box {
  border: 1px dashed var(--gray-mid);
  background: #f4f4f8;
  padding: 14px;
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 8px 0;
}

/* article thumbnails */
.entry-thumb {
  display: block;
  margin: 10px 0;
}
.entry-thumb img {
  display: block;
  width: min(340px, 100%);
  border: 2px solid var(--ink);
}
.entry-thumb:hover img {
  box-shadow: 3px 3px 0 var(--shadow);
}

/* video embeds */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--ink);
  background: #000;
  margin: 12px 0 4px;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* thumbnail grid for visual work */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.thumb {
  border: 2px solid var(--ink);
  background: var(--gray-light);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #555;
  text-align: center;
  padding: 8px;
}

@media (max-width: 640px) {
  .menubar { font-size: 11px; gap: 0; }
  .desk-icon { display: none; }  /* keep small screens tidy */
  .sticky { display: none; }
  .page-window .window-body { padding: 24px 20px; }
}
