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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 12px;
  color: #000;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* === Desktop === */
.desktop {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #EAF7FF 0%, #CFEFFF 50%, #BFE6FF 100%);
  position: relative;
  overflow: hidden;
}

/* === Folder Icons === */
.folders {
  display: contents;
}

.folder {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
}

.folder:hover {
  border: 1px dotted #666;
  background: rgba(0, 0, 0, 0.04);
}

.folder:focus-visible {
  border: 1px dotted #666;
}

.folder:active {
  background: rgba(0, 0, 0, 0.08);
}

.folder-icon {
  width: 72px;
  height: 72px;
  pointer-events: none;
}

.folder-label {
  font-size: 12px;
  color: #1a1a1a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  text-align: center;
  font-weight: 500;
}

/* === Windows === */
.window {
  position: fixed;
  width: clamp(600px, 60vw, 900px);
  min-width: 240px;
  max-height: 80vh;
  background: #c0c0c0;
  border-top: 2px solid #dfdfdf;
  border-left: 2px solid #dfdfdf;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 1px 1px 0 #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Animation for folder windows */
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.window.is-visible {
  opacity: 1;
  transform: scale(1);
}

.window.is-closing {
  opacity: 0;
  transform: scale(0.95);
}

/* Title bar */
.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px;
  height: 24px;
  background: linear-gradient(90deg, #000080, #1084d0);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.window-header:active {
  cursor: grabbing;
}

.window-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  padding-left: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Close button — retro square */
.window-close {
  width: 18px;
  height: 18px;
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #000;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.window-close:hover {
  background: #d0d0d0;
}

.window-close:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
}

/* Window content */
.window-content {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: #fff;
  margin: 2px;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
  font-size: 15px;
  line-height: 1.5;
}

/* Scrollbar — retro */
.window-content::-webkit-scrollbar {
  width: 16px;
}

.window-content::-webkit-scrollbar-track {
  background: #c0c0c0;
  border-left: 1px solid #808080;
}

.window-content::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
}

/* === Photo Window === */
.window-content--photo {
  padding: 0;
  margin: 2px;
  background: url('assets/background.png') center / cover no-repeat;
  height: 420px;
  overflow: hidden;
}

.window-content--photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top;
}

.photo-carousel {
  position: relative;
  display: flex;
  align-items: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  z-index: 10;
  user-select: none;
  border-radius: 3px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.carousel-btn:hover { opacity: 1; }
.carousel-btn--prev { left: 4px; }
.carousel-btn--next { right: 4px; }

/* === Photo & About — responsive desktop positioning === */
#window-photo {
  top: 5vh;
  left: 20vw;
  width: clamp(260px, 29vw, 420px);
}

#window-about {
  top: 25vh;
  left: clamp(200px, 35vw, 60vw);
  width: 450px;
}

#window-projects {
  width: clamp(550px, 55vw, 800px);
}

#window-education,
#window-learning {
  width: clamp(450px, 45vw, 650px);
}

/* === Tabs === */
.tabs {
  display: flex;
  padding: 2px 2px 0;
  background: #c0c0c0;
  gap: 1px;
}

.tab {
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 500;
  background: #c0c0c0;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #dfdfdf;
  border-bottom: none;
  color: #444;
  position: relative;
  top: 1px;
}

.tab:hover {
  color: #000;
}

.tab.is-active {
  background: #fff;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #808080;
  color: #000;
  font-weight: 700;
}

/* === About Window === */
.window-content--about {
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  line-height: 1.6;
}

/* === Entry (Experience / Education) === */
.entry {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #c0c0c0;
}

.entry-img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: #e0e0e0;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
}

.entry-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.entry-date {
  font-size: 13px;
  color: #808080;
  margin-bottom: 2px;
}

.entry-role {
  font-size: 15px;
  font-weight: 700;
  color: #000;
}

.entry-place {
  font-size: 14px;
  color: #000080;
  margin-bottom: 4px;
}

.entry-list {
  list-style: none; 
  padding: 0;
  margin: 0.4em 0 0 0;
}

.entry-desc {
  position: relative;
  padding-left: 1.2em;
  margin: 0.25em 0;
  font-size: 14px;
  color: #333;
}

.entry-desc::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0.2em;
  font-size: 1em;
  line-height: 1;
}

/* === Learning === */
.learning-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #e0e0e0;
}

.learning-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.learning-item:last-child {
  border-bottom: none;
}

.learning-title {
  font-size: 15px;
  color: #000;
}

.learning-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.learning-type {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.type-course {
  border-color: #4a6fa5;
  color: #4a6fa5;
  background: #e4edf8;
}

.type-book {
  border-color: #8b5e83;
  color: #8b5e83;
  background: #f3e8f0;
}

.type-fall {
  border-color: #d2691e;
  color: #d2691e;
  background: #fdf0e2;
}

.type-spring {
  border-color: #2e8b57;
  color: #2e8b57;
  background: #e6f5ec;
}

.status-complete {
  border-color: #006000;
  color: #006000;
  background: #e0ffe0;
}

.status-ongoing {
  border-color: #b8860b;
  color: #b8860b;
  background: #fdf8e8;
}

/* === Projects === */
.project-card {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #c0c0c0;
}

.project-card:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project-screenshot {
  width: 100%;
  background: #e0e0e0;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
  overflow: hidden;
  margin-bottom: 10px;
}

.project-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.project-name {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  margin-bottom: 2px;
}

.project-desc {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.project-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border: 1px solid #000080;
  color: #000080;
  background: #e8e8ff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.project-actions {
  display: flex;
  gap: 6px;
}

.project-btn {
  font-size: 13px;
  font-family: inherit;
  padding: 5px 14px;
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  color: #000;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.project-btn:hover {
  background: #d0d0d0;
}

.project-btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
}

/* === Journal Window === */
.window-content--journal {
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  line-height: 1.6;
}

.window-content--journal h3 {
  font-size: 15px;
  font-weight: 700;
  color: #000080;
  margin: 12px 0 4px;
}

.window-content--journal h3:first-child {
  margin-top: 0;
}

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

.window-content--journal ul {
  list-style: none;
  padding: 0;
  margin: 0.4em 0;
}

.window-content--journal li {
  position: relative;
  padding-left: 1.2em;
  margin: 0.25em 0;
  font-size: 14px;
  color: #333;
}

.window-content--journal li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0.2em;
  font-size: 1em;
  line-height: 1;
}

/* === Resume Window === */
.resume-toolbar {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
}

.window-content--resume {
  padding: 0;
  margin: 2px;
}

.window-content--resume iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
  display: block;
}

/* === Taskbar === */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: #c0c0c0;
  border-top: 2px solid #dfdfdf;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 4px;
  z-index: 10000;
}

.taskbar-links {
  display: flex;
  gap: 2px;
}

.taskbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  height: 24px;
  font-size: 11px;
  font-family: inherit;
  color: #000;
  text-decoration: none;
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  cursor: pointer;
}

.taskbar-btn:hover {
  background: #d0d0d0;
}

.taskbar-btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
}

.taskbar-icon {
  width: 14px;
  height: 14px;
}

.taskbar-btn i {
  font-size: 14px;
}

/* === Responsive === */
@media (max-width: 767px) {
  .desktop {
    height: calc(100vh - 32px);
    overflow: hidden;
    padding: 12px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "folders photo"
      "about   about"
      ".       .";
    gap: 6px;
  }

  /* Folders wrapper: vertical stack, top-left */
  .folders {
    grid-area: folders;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-self: start;
  }

  .folder {
    position: static !important;
    padding: 2px;
  }

  .folder-icon {
    width: 42px;
    height: 42px;
  }

  .folder-label {
    font-size: 11px;
  }

  /* Photo: top-right, image crops from top */
  #window-photo {
    position: relative !important;
    width: auto !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    grid-area: photo;
    align-self: start;
    opacity: 1;
    transform: none;
    max-height: 60vh;
    min-height: 0;
  }

  #window-photo .window-content--photo {
    overflow: hidden;
    height: 260px;
  }

  #window-photo .window-content--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
  }

  /* Description: bottom, full width */
  #window-about {
    position: relative !important;
    width: auto !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    grid-area: about;
    align-self: start;
    margin-top: 8px;
    max-height: 34vh;
    opacity: 1;
    transform: none;
  }

  #window-about .window-content--about {
    font-size: 12px;
    line-height: 1.4;
    overflow-y: auto;
  }

  /* Folder-opened windows: full-screen overlay */
  .window:not(#window-photo):not(#window-about) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 32px !important;
    width: 100% !important;
    max-height: calc(100vh - 32px);
    z-index: 9999 !important;
    border: none;
    box-shadow: none;
  }

  .window:not(#window-photo):not(#window-about) .window-header {
    cursor: default;
  }

  .window:not(#window-photo):not(#window-about) .window-close {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .taskbar-btn span {
    display: none;
  }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
