/* ================================================================
   Windows 98 Portfolio - Stylesheet
   Classic grey UI, pixel/retro feel, no external dependencies
   ================================================================ */

/* --- Reset & base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Tahoma", "MS Sans Serif", "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  color: #000;
  -webkit-font-smoothing: none;
}

body.booting .desktop {
  visibility: hidden;
}

/* --- Boot screen --- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.boot-screen--done {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.boot-phase {
  position: absolute;
  inset: 0;
}

.boot-phase[hidden] {
  display: none !important;
}

.boot-phase--dos {
  display: flex;
  align-items: flex-start;
  padding: 24px;
  font-family: "Courier New", "MS Sans Serif", monospace;
  font-size: 14px;
  color: #c0c0c0;
  background: #000;
}

.boot-dos-line {
  margin: 0;
  white-space: pre-wrap;
}

.boot-phase--splash {
  display: flex;
  flex-direction: column;
  background: #000;
}

.boot-phase--splash[hidden] {
  display: none !important;
}

.boot-sky {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, #7ec8ff 0%, #4a9ee8 35%, #2b7fd4 65%, #1a5fb0 100%);
}

/* Pixelated cloud clusters */
.boot-clouds {
  position: absolute;
  inset: 0;
  opacity: 0.95;
  background-image:
    /* cloud 1 - top left */
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    /* cloud 2 - top right */
    linear-gradient(#eef6ff, #eef6ff),
    linear-gradient(#eef6ff, #eef6ff),
    linear-gradient(#eef6ff, #eef6ff),
    linear-gradient(#eef6ff, #eef6ff),
    linear-gradient(#eef6ff, #eef6ff),
    linear-gradient(#eef6ff, #eef6ff),
    /* cloud 3 - bottom */
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff);
  background-size:
    32px 8px, 48px 8px, 64px 8px, 80px 8px, 96px 8px, 112px 8px,
    32px 8px, 48px 8px, 64px 8px, 80px 8px, 96px 8px, 112px 8px,
    40px 8px, 56px 8px, 72px 8px, 88px 8px, 104px 8px, 120px 8px,
    48px 8px, 64px 8px, 80px 8px, 96px 8px, 112px 8px, 128px 8px;
  background-position:
    8% 18%, 6% 26%, 4% 34%, 6% 42%, 8% 50%, 10% 58%,
    12% 22%, 10% 30%, 8% 38%, 10% 46%, 12% 54%, 14% 62%,
    72% 12%, 70% 20%, 68% 28%, 70% 36%, 72% 44%, 74% 52%,
    30% 72%, 28% 80%, 26% 88%, 28% 96%, 30% 84%, 32% 76%;
  background-repeat: no-repeat;
  filter: contrast(1.1);
}

.boot-logo {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
  user-select: none;
}

.boot-logo p {
  margin: 0;
  line-height: 1.1;
}

.boot-logo-name {
  font-size: clamp(40px, 11vw, 72px);
  font-weight: bold;
  letter-spacing: 0.5px;
  line-height: 1.05;
}

.boot-logo-sub {
  margin-top: 8px;
  font-size: clamp(11px, 2vw, 14px);
  font-weight: normal;
  font-style: normal;
  letter-spacing: 1px;
  opacity: 0.85;
}

.boot-footer {
  flex-shrink: 0;
  padding: 12px 16px 10px;
  background: linear-gradient(180deg, #1a5fb0 0%, #0d3d7a 100%);
}

.boot-progress-track {
  height: 16px;
  padding: 2px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.boot-progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    #000080 0px,
    #000080 12px,
    transparent 12px,
    transparent 14px
  );
  transition: width 0.15s steps(4);
}

.boot-status {
  margin: 8px 0 0;
  min-height: 14px;
  color: #fff;
  font-size: 11px;
  text-align: center;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

img {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* --- Desktop --- */
.desktop {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Teal wallpaper with subtle pattern (classic Win98 default vibe) */
.wallpaper {
  position: absolute;
  inset: 0;
  background-color: #008080;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.06) 0%, transparent 40%);
  z-index: 0;
}

/* --- Desktop icons --- */
.desktop-icons {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  padding: 12px;
  max-height: calc(100% - 36px);
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  padding: 4px;
  border: 1px dotted transparent;
  background: none;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  text-align: center;
}

.desktop-icon:hover {
  background: rgba(0, 0, 128, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.desktop-icon:focus,
.desktop-icon.selected {
  background: rgba(0, 0, 128, 0.5);
  border: 1px dotted #fff;
  outline: none;
}

.icon-label {
  font-size: 11px;
  line-height: 1.2;
  word-break: break-word;
}

/* --- Windows 98 window chrome --- */
.win98-window {
  position: absolute;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 52px);
  max-height: calc(100dvh - 52px);
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: 1px 1px 0 #000;
}

.win98-window[hidden] {
  display: none !important;
}

.win98-window.active {
  z-index: 100;
}

.win98-window--wide {
  width: 520px;
}

.win98-window--small {
  width: 320px;
}

.win98-window--browser {
  width: 600px;
  height: 420px;
}

/* Title bar */
.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-weight: bold;
  font-size: 11px;
  cursor: default;
  user-select: none;
  flex-shrink: 0;
}

.win98-window:not(.active) .title-bar {
  background: linear-gradient(90deg, #808080, #b0b0b0);
  color: #c0c0c0;
}

.title-bar-text {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.title-icon {
  flex-shrink: 0;
}

.title-bar-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.title-btn {
  width: 16px;
  height: 14px;
  padding: 0;
  line-height: 12px;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  color: #000;
}

.title-btn:active:not(:disabled) {
  border-color: #000 #fff #fff #000;
}

.title-btn:disabled {
  color: #808080;
  cursor: default;
}

.title-btn.close {
  font-size: 12px;
  line-height: 11px;
}

/* Window body */
.window-body {
  padding: 4px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  margin: 0 2px 2px;
  background: #c0c0c0;
}

/* --- Win98 buttons --- */
.win98-btn {
  padding: 4px 12px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  color: #000;
  text-decoration: none;
  display: inline-block;
}

.win98-btn:active:not(:disabled) {
  border-color: #000 #fff #fff #000;
  padding: 5px 11px 3px 13px;
}

.win98-btn:disabled {
  color: #808080;
  cursor: default;
}

/* --- About section --- */
.about-content {
  display: flex;
  gap: 12px;
  padding: 4px;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.about-photo img {
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.about-text h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.about-text p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.about-details {
  margin: 8px 0 0;
  padding-left: 18px;
}

.about-details li {
  margin-bottom: 4px;
}

/* --- Timeline (Education & Jobs) --- */
.explorer-toolbar {
  padding: 4px 6px;
  margin-bottom: 4px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
  font-size: 11px;
}

.toolbar-address {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #c0c0c0;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-info strong {
  font-size: 12px;
}

.timeline-role {
  color: #000080;
}

.timeline-date {
  color: #606060;
  font-size: 10px;
}

/* --- File Explorer (Projects) --- */
.explorer-layout {
  display: flex;
  gap: 4px;
  min-height: 200px;
}

.explorer-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 120px;
  flex-shrink: 0;
  padding: 4px;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.folder-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  text-align: left;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
}

.folder-tab.active {
  border-color: #000 #fff #fff #000;
  background: #a0a0a0;
}

.explorer-files {
  flex: 1;
  position: relative;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  min-height: 180px;
}

.file-grid {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  align-content: flex-start;
}

.file-grid.active {
  display: flex;
}

.file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  padding: 4px;
  border: 1px dotted transparent;
  background: none;
  text-align: center;
  font-size: 10px;
  word-break: break-word;
}

.file-item:hover {
  background: #000080;
  color: #fff;
}

.file-item:focus {
  background: #000080;
  color: #fff;
  outline: 1px dotted #fff;
}

.explorer-status {
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
  font-size: 10px;
}

/* --- Links --- */
.links-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.links-list li {
  margin-bottom: 2px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: #000;
  text-decoration: none;
  border: 1px dotted transparent;
}

.link-item:hover,
.link-item:focus {
  background: #000080;
  color: #fff;
  outline: none;
}

/* --- Fake browser --- */
.browser-body {
  display: flex;
  flex-direction: column;
  padding: 2px !important;
}

.browser-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin-bottom: 2px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
}

.browser-address-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.browser-address-bar label {
  white-space: nowrap;
}

.browser-url {
  flex: 1;
  padding: 2px 4px;
  font-family: inherit;
  font-size: 11px;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  background: #fff;
}

.browser-content {
  flex: 1;
  position: relative;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  min-height: 200px;
}

.browser-content iframe {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: none;
}

.browser-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fff;
  text-align: center;
  padding: 20px;
}

/* --- Dialog --- */
.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

#project-info-desc {
  margin: 8px 4px;
  line-height: 1.5;
  background: #fff;
  padding: 8px;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* --- Taskbar --- */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  height: 28px;
  padding: 2px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  box-shadow: 0 -1px 0 #808080;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-weight: bold;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
}

.start-btn:active,
.start-btn.active {
  border-color: #000 #fff #fff #000;
}

.taskbar-windows {
  display: flex;
  flex: 1;
  gap: 2px;
  padding: 0 4px;
  overflow: hidden;
}

.taskbar-window-btn {
  max-width: 140px;
  padding: 2px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  font-size: 11px;
}

.taskbar-window-btn.active {
  border-color: #000 #fff #fff #000;
  background: #a0a0a0;
  font-weight: bold;
}

.taskbar-clock {
  padding: 2px 8px;
  border: 1px inset #808080;
  background: #c0c0c0;
  font-size: 11px;
  flex-shrink: 0;
}

/* --- Start menu --- */
.start-menu {
  position: fixed;
  bottom: 28px;
  left: 2px;
  z-index: 1001;
  display: flex;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: 2px 2px 0 #000;
}

.start-menu[hidden] {
  display: none !important;
}

.start-menu-sidebar {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: linear-gradient(0deg, #000080, #1084d0);
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
}

.start-menu-sidebar span {
  font-size: 22px;
  margin-top: 4px;
}

.start-menu-items {
  list-style: none;
  margin: 0;
  padding: 2px;
  min-width: 180px;
}

.start-menu-items button {
  display: block;
  width: 100%;
  padding: 6px 24px;
  text-align: left;
  background: none;
  border: none;
}

.start-menu-items button:hover {
  background: #000080;
  color: #fff;
}

.start-menu-divider {
  height: 2px;
  margin: 2px 4px;
  background: #808080;
  border-top: 1px solid #fff;
}

/* --- Clippy (Office Assistant) --- */
.clippy {
  position: absolute;
  right: 12px;
  bottom: 36px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}

.clippy:not([hidden]) {
  pointer-events: auto;
}

.clippy[hidden] {
  display: none !important;
}

.clippy-bubble[hidden] {
  display: none !important;
}

.clippy-bubble {
  position: relative;
  max-width: 260px;
  padding: 10px 28px 10px 12px;
  background: #ffffe1;
  border: 1px solid #000;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #fff;
  animation: clippy-pop 0.25s ease-out;
}

.clippy-bubble::after {
  content: "";
  position: absolute;
  right: 42px;
  bottom: -10px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #ffffe1;
  filter: drop-shadow(0 1px 0 #000);
}

.clippy-bubble-close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #fff #404040 #404040 #fff;
  cursor: pointer;
}

.clippy-bubble-close:active {
  border-color: #404040 #fff #fff #404040;
}

.clippy-bubble-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.clippy-character {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.15s ease;
}

.clippy-character:hover {
  transform: scale(1.03);
}

.clippy-character:active {
  transform: scale(0.98);
}

.clippy-character img {
  display: block;
  width: 110px;
  height: auto;
}

@keyframes clippy-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Shutdown overlay --- */
.shutdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #000080;
  color: #fff;
  font-size: 16px;
}

.shutdown-overlay p {
  margin: 0;
}

/* ================================================================
   RESPONSIVE - Mobile & small screens
   ================================================================ */
@media (max-width: 640px) {
  .desktop-icons {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    padding-bottom: 40px;
  }

  .desktop-icon {
    width: 64px;
  }

  /* Stack windows full-width on mobile */
  .win98-window {
    position: fixed !important;
    top: auto !important;
    bottom: 32px !important;
    left: 4px !important;
    right: 4px !important;
    width: auto !important;
    max-width: none;
    max-height: calc(100dvh - 80px);
  }

  .win98-window--wide,
  .win98-window--browser {
    width: auto !important;
    height: auto !important;
  }

  .explorer-layout {
    flex-direction: column;
  }

  .explorer-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-details {
    text-align: left;
  }

  .browser-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .browser-address-bar {
    width: 100%;
  }

  .clippy {
    right: 4px;
    bottom: 36px;
  }

  .clippy-bubble {
    max-width: calc(100vw - 90px);
  }

  .clippy-character img {
    width: 88px;
  }
}

@media (max-width: 400px) {
  .title-btn.minimize,
  .title-btn.maximize {
    display: none;
  }
}
