:root {
  --platinum-0: #f5f5f5;
  --platinum-1: #dedede;
  --platinum-2: #cecece;
  --platinum-3: #b8b8b8;
  --ink: #1f1f1f;
  --accent: #1f4d7a;
}

@font-face {
  font-family: "Charcoal";
  src: url("/assets/font/Charcoal.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, #f4f4f4 0, #d6d6d6 37%, #b4b4b4 100%),
    linear-gradient(135deg, #ececec, #b8b8b8);
  text-rendering: optimizeLegibility;
}

a {
  color: #114477;
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.boot-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  z-index: 2000;
}

.boot-screen.boot-phase-color,
.boot-screen.boot-phase-loading {
  background: #63639f;
}

.boot-screen .boot-center {
  display: none;
}

.boot-screen.boot-phase-loading .boot-center {
  display: grid;
}

.boot-center {
  position: relative;
  z-index: 1;
  width: min(92vw, 430px);
  padding: 30px 32px 24px;
  display: grid;
  justify-items: center;
  gap: 8px;
  background: #c8c8c8;
  border: 1px solid #535353;
  box-shadow:
    1px 1px 0 #efefef inset,
    -1px -1px 0 #9f9f9f inset,
    1px 1px 0 rgba(0, 0, 0, 0.25);
}

.boot-logo-wrap {
  width: 100%;
  min-height: 190px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #7f7f7f;
  box-shadow:
    1px 1px 0 #efefef inset,
    -1px -1px 0 #b0b0b0 inset;
}

.boot-logo-icon {
  width: 110px;
  height: 78px;
  object-fit: cover;
  background: linear-gradient(135deg, #4f57b8, #a9bedb);
  border: 1px solid #5e5e5e;
  box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.65) inset;
  filter: grayscale(0.35) sepia(0.2) hue-rotate(164deg) saturate(1.4) contrast(1.1);
}

.boot-logo-text {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(44px, 9vw, 68px);
  line-height: 0.9;
  letter-spacing: 0.3px;
  color: #202020;
}

.boot-logo-text span {
  color: #1f1f1f;
  font-weight: normal;
}

.boot-progress-track {
  width: 196px;
  height: 14px;
  border: 1px solid #565656;
  background: #b8b8b8;
  box-shadow:
    1px 1px 0 #efefef inset,
    -1px -1px 0 #8b8b8b inset;
  padding: 0;
}

.boot-progress-fill {
  width: 0%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-image: url("/assets/boot/progress-fill-mid.svg");
  background-repeat: repeat-x;
  background-size: 1px 14px;
  image-rendering: pixelated;
  transition: width 180ms linear;
}

.boot-progress-fill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background-image: url("/assets/boot/progress-fill-left.svg");
  background-repeat: no-repeat;
  background-size: 3px 14px;
  image-rendering: pixelated;
}

.boot-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 2px;
  background-image: url("/assets/boot/progress-fill-right.svg");
  background-repeat: no-repeat;
  background-size: 2px 14px;
  image-rendering: pixelated;
}

.boot-status {
  margin: 4px 0 2px;
  min-height: 18px;
  font-size: 13px;
  line-height: 1;
  font-family: "Charcoal", "Courier New", Courier, monospace;
  font-weight: bold;
  letter-spacing: 0.1px;
  color: #292929;
  text-align: center;
}

.desktop-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 19px 1fr;
}

/* OS9-style menubar (ref: _os9_ref/css/menubar.css) */
.menu-bar {
  height: 19px;
  font-size: 12px;
  font-family: "Charcoal", system-ui, sans-serif;
  background-color: #dedede;
  border-bottom: 1px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 3px;
  z-index: 1050;
  box-shadow: inset -1px -1px #9c9c9c, inset 1px 1px #fff;
  image-rendering: pixelated;
}

.menu-left,
.menu-right {
  display: flex;
  align-items: center;
  gap: 0;
}

.apple-button {
  border: none;
  border-top: 1px solid #fff;
  background: transparent url("/assets/menu/apple.png") center no-repeat;
  min-height: 18px;
  min-width: 20px;
  padding: 1px 7px 0 8px;
  cursor: default;
  font-size: 0;
  line-height: 0;
  color: transparent;
}

.menu-button {
  border: 1px solid transparent;
  border-top: 1px solid #fff;
  background: transparent;
  min-height: 18px;
  min-width: 26px;
  font-size: 12px;
  font-family: "Charcoal", system-ui, sans-serif;
  padding: 1px 7px 0 8px;
  cursor: default;
}

.menu-group {
  position: relative;
}

.menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  min-width: 190px;
  background-color: #dedede;
  border: 1px solid #000;
  box-shadow: 1px 1px #111, inset 1px 1px #fff, inset -1px -1px #999;
  padding: 4px;
}

.menu-group.open .menu-panel {
  display: block;
}

/* OS9-style active menu (ref: siddhartha77/os9 menubar) */
.menu-group.open .menu-button {
  background-color: #31319c;
  color: #fff;
  border-top-color: #6262cd;
  border-bottom: 1px solid #00008b;
}

.menu-panel button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 4px 8px 4px 20px;
  font-size: 12px;
  font-family: "Charcoal", system-ui, sans-serif;
  color: #000;
}

.menu-status {
  font-size: 12px;
  font-family: "Charcoal", system-ui, sans-serif;
}

.desktop {
  position: relative;
  overflow: hidden;
  min-height: 0;
  /* allow grid 1fr to size this row */
  background-color: #bdbdbd;
  background-image: url("/macos9_bg.jpg");
  background-repeat: repeat;
  background-size: auto;
}

.desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  gap: 8px;
  max-width: 180px;
  z-index: 6;
}

.desktop-icon {
  width: 130px;
  display: grid;
  justify-items: center;
  gap: 1px;
  background: transparent;
  border: 1px solid transparent;
  color: #111;
  font-size: 12px;
  text-align: center;
  padding: 4px 3px;
}

.desktop-icon-label {
  display: inline-block;
  padding: 1px 2px;
  border: 1px dotted transparent;
  border-radius: 1px;
  color: #111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.5);
}

/* OS9-style icon selection: black bg, white text (ref: siddhartha77/os9 icon.css) */
.desktop-icon.selected .desktop-icon-label {
  color: #fff;
  background: #000;
  border-color: #fff;
  text-shadow: none;
}

.icon-pixel {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.desktop-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.35));
}

.windows-layer {
  position: absolute;
  inset: 10px 10px 10px 176px;
}

/* OS9-style close: ghost flies from window to desktop icon – transparent, dotted border only */
.window-transfer-ghost {
  border: 2px dotted #000;
  background: transparent;
  box-sizing: border-box;
}

.desktop-window {
  position: absolute;
  min-width: 260px;
  min-height: 170px;
  max-width: min(94vw, 940px);
  max-height: calc(100vh - 38px);
}

.desktop-window .title-bar {
  cursor: grab;
  user-select: none;
}

/* Right-side controls (zoom, windowshade): 3rd child in title bar */
.desktop-window .title-bar .title-bar-controls:nth-child(3) {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 2px;
  flex-shrink: 0;
}

.desktop-window .title-bar .title-bar-controls:nth-child(3) .control-box {
  display: inline-block;
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  border: 1px solid #222;
  background: linear-gradient(to bottom right, #999, #aaa, #bbb, #ccc, #ddd, #eee, #fff, #fff);
  box-shadow: inset 1px 1px #ccc, inset -1px -1px #888;
  position: relative;
  padding: 0;
  box-sizing: border-box;
  margin-left: 4px;
}

.desktop-window .title-bar .title-bar-controls:nth-child(3) .control-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  background: #fff;
}

.desktop-window .title-bar .title-bar-controls:nth-child(3) .control-box.windowshade-box {
  cursor: pointer;
}

.desktop-window.dragging .title-bar {
  cursor: grabbing;
}

/* Window body: flex column so toolbars + content can fill height */
.desktop-window .window-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100% - 22px);
  overflow: hidden;
}

.desktop-window .window-body:not(:has(.acrobat-reader)) {
  overflow: auto;
}

.desktop-window .window-content {
  padding: 10px;
  min-height: 100%;
}

/* Toolbar layout: content fills remaining space (e.g. Acrobat PDF viewer) */
.window-content:has(.acrobat-reader) {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.desktop-window.active {
  filter: saturate(1.03);
}

/* Collapsed to title bar only (windowshade) */
.desktop-window.windowshade {
  min-height: 0;
  height: 25px;
}

/* Acrobat Reader 3.0–style CV window */
.window-content:has(.acrobat-reader) {
  padding: 0;
}

.acrobat-reader {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #c8c8c8;
}

.acrobat-toolbar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(180deg, #e0e0e0, #c0c0c0);
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
  gap: 6px;
}

.acrobat-download-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 60px;
  height: 60px;
  margin: 0;
  padding: 5px;
  border: 2px solid #555;
  border-radius: 4px;
  background: linear-gradient(180deg, #e8e8e8, #c8c8c8);
  box-shadow: 1px 1px 0 #fff inset, -1px -1px 0 #888 inset;
  color: #222;
  text-decoration: none;
  font-size: 11px;
  font-weight: bold;
  font-family: "Charcoal", "Courier New", Courier, monospace;
  cursor: pointer;
  transition: background 0.15s ease;
}

.acrobat-download-btn:hover {
  background: linear-gradient(180deg, #f0f0f0, #d8d8d8);
}

.acrobat-download-btn:active {
  box-shadow: -1px -1px 0 #fff inset, 1px 1px 0 #888 inset;
}

.acrobat-download-btn .acrobat-download-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: contain;
}

.acrobat-doc-area {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.acrobat-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* About Me: photo centered on top, text below, no section boxes */
.about-me-layout {
  padding: 0;
}

.about-me-photo-wrap {
  text-align: left;
  margin-bottom: 12px;
}

.about-me-photo {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid #666;
}

.about-me-text {
  margin: 0;
}

.about-me-text p {
  margin: 0 0 8px;
}

.window-content {
  font-size: 13px;
  line-height: 1.45;
}

.window-content h2,
.window-content h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.window-content p {
  margin: 0 0 8px;
}

.window-content ul {
  margin: 0 0 10px;
  padding-left: 18px;
  list-style: square;
}

.window-content li {
  margin-bottom: 5px;
}

.window-section {
  border: 1px solid #8d8d8d;
  background: #e4e4e4;
  padding: 8px;
  margin-bottom: 8px;
  box-shadow: 1px 1px 0 #fff inset;
}

.small-muted {
  font-size: 11px;
  color: #4e4e4e;
}

.system-specs {
  font-family: "Courier New", Courier, monospace;
  white-space: pre-wrap;
  background: #111;
  color: #a5f0bf;
  border: 1px solid #3d3d3d;
  padding: 10px;
  font-size: 12px;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.repo-card {
  display: grid;
  gap: 6px;
  border: 1px solid #898989;
  background: linear-gradient(180deg, #efefef, #dbdbdb);
  text-decoration: none;
  color: inherit;
  padding: 9px;
}

.repo-card:hover {
  border-color: #1a4a79;
  background: linear-gradient(180deg, #ffffff, #d5e0ec);
}

.repo-meta {
  font-size: 11px;
  color: #4a4a4a;
  display: flex;
  gap: 10px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* OS9-style buttons (ref: siddhartha77/os9 button.css) */
.retro-button {
  font-family: "Charcoal", "Courier New", Courier, monospace;
  font-size: 12px;
  height: 20px;
  min-width: 58px;
  border-radius: 3px;
  border: 1px solid #000;
  background: #dedede;
  padding: 4px 8px;
  box-shadow:
    inset -1px -1px #777,
    inset -2px -2px #aaa,
    inset 1px 1px #ddd,
    inset 2px 2px #fff;
}

.retro-button:active {
  color: #fff;
  background: #666;
  box-shadow:
    inset -1px -1px #888,
    inset -2px -2px #777,
    inset 1px 1px #444,
    inset 2px 2px #555;
}

.checklist {
  max-height: 165px;
  overflow: auto;
  border: 1px solid #8d8d8d;
  background: #f1f1f1;
  padding: 8px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 12px;
}

.blink-soft {
  animation: blink 1.8s steps(2, start) infinite;
}

.under-construction {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.under-construction img {
  height: 26px;
  border: 1px solid #666;
}

.mobile-fallback {
  min-height: 100%;
  overflow: auto;
  background-color: #bebebe;
  background-image: url("/macos9_bg.jpg");
  background-repeat: repeat;
  padding: 12px;
}

.mobile-card {
  border: 1px solid #505050;
  box-shadow: 2px 2px 0 #a5a5a5;
  background: #e6e6e6;
  margin-bottom: 10px;
}

.mobile-card header {
  border-bottom: 1px solid #858585;
  background: linear-gradient(180deg, #f6f6f6, #d8d8d8);
  font-weight: bold;
  font-size: 13px;
  padding: 6px 8px;
}

.mobile-card .mobile-body {
  padding: 8px;
  font-size: 12px;
}

.mobile-title {
  margin: 0 0 8px;
  font-size: 15px;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .desktop-shell {
    display: none;
  }

  .mobile-fallback {
    display: block !important;
  }
}