#desktop {
  display: none;
  width: 100%;
  height: 100%;
  background: var(--desktop-bg);
  position: relative;
  overflow: hidden;
}

#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #000080, #000000);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: var(--z-boot);
  font-family: 'Courier New', 'Press Start 2P', monospace;
}

#gb-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

#logo-container {
  text-align: center;
  animation: dropLogo 1s ease-out forwards;
  opacity: 0;
  transform: translateY(-200px);
}

@keyframes dropLogo {
  0% {
    opacity: 0;
    transform: translateY(-200px);
  }
  60% {
    opacity: 1;
    transform: translateY(10px);
  }
  80% {
    transform: translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#spectra-logo {
  font-size: 4rem;
  font-weight: bold;
  color: #c0c0c0;
  text-shadow: 4px 4px 0px #000000;
  letter-spacing: 8px;
  margin-bottom: 10px;
  animation: expandLogo 0.5s ease-out 1s forwards;
  transform: scale(0.8);
}

@keyframes expandLogo {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

#studios-text {
  font-size: 1.5rem;
  color: #c0c0c0;
  letter-spacing: 4px;
  opacity: 0;
  animation: fadeIn 0.5s ease-in 1.5s forwards;
}

#system-info {
  opacity: 0;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  text-align: center;
}

.info-line {
  font-size: 0.9rem;
  color: #c0c0c0;
  margin: 5px 0;
  font-family: 'Courier New', monospace;
}

#boot-text {
  display: none;
}

#enter-prompt {
  display: none;
  position: absolute;
  bottom: 50px;
  color: #c0c0c0;
  font-size: 1rem;
  letter-spacing: 2px;
  animation: blink 1s infinite;
  justify-content: center;
  gap: 12px;
}

/* Pac-Man loading bar: the centerpiece of the boot sequence while the page/assets load */
#loading-bar {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 1;
  transition: opacity 0.4s ease;
}

#loading-bar.is-active {
  display: flex;
}

#loading-bar.is-leaving {
  opacity: 0;
}

#loading-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  width: 220px;
  height: 64px;
}

.loading-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  background: #c0c0c0;
  box-shadow: 2px 2px 0px #000000;
  transition: opacity 0.1s ease-out;
}

.loading-dot.is-eaten {
  opacity: 0;
}

#pacman-loader {
  position: absolute;
  top: 50%;
  left: 0;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  pointer-events: none;
}

#loading-label {
  font-size: 0.8rem;
  color: #c0c0c0;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ===== Shutdown Screen ===== */
#shutdown-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #000080, #000000);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: var(--z-boot);
  font-family: 'Courier New', 'Press Start 2P', monospace;
  opacity: 1;
  transition: opacity 1s ease-out;
}

#shutdown-message {
  position: absolute;
  bottom: 50px;
  color: #c0c0c0;
  font-size: 1rem;
  letter-spacing: 2px;
  opacity: 0;
  animation: fadeIn 0.5s ease-in 1s forwards;
}

.window {
  position: absolute;
  background-color: var(--window-bg);
  border: var(--border-raised);
  border-top: var(--border-top-left);
  border-left: var(--border-top-left);
  box-shadow: var(--box-shadow);
  min-width: 300px;
  min-height: 200px;
  display: none;
  z-index: var(--z-window);
  will-change: transform;
}

.window-header {
  background-color: var(--highlight);
  color: var(--color-white);
  padding: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.window-title {
  font-weight: bold;
}

.window-controls {
  display: flex;
}

.window-control {
  width: 20px;
  height: 20px;
  margin-left: 3px;
  background-color: var(--button-bg);
  border: 2px solid var(--button-border);
  border-top: 2px solid var(--color-white);
  border-left: 2px solid var(--color-white);
  text-align: center;
  line-height: 16px;
  font-weight: bold;
  cursor: pointer;
}

.window-content {
  padding: 15px;
  height: calc(100% - 30px);
  overflow-y: auto;
  overflow-x: hidden;

  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;

}

.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--button-bg);
  border: 1px solid var(--button-border);
  border-bottom: 1px solid var(--color-white);
  border-right: 1px solid var(--color-white);
}

.resize-n {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  cursor: n-resize;
}

.resize-s {
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  cursor: s-resize;
}

.resize-e {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: e-resize;
}

.resize-w {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: w-resize;
}

.resize-ne {
  top: -5px;
  right: -5px;
  cursor: ne-resize;
}

.resize-nw {
  top: -5px;
  left: -5px;
  cursor: nw-resize;
}

.resize-se {
  bottom: -5px;
  right: -5px;
  cursor: se-resize;
}

.resize-sw {
  bottom: -5px;
  left: -5px;
  cursor: sw-resize;
}

.folder {
  position: absolute;
  width: 80px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  padding: 5px;
}

/* Default (desktop) folder positions. Overridden per-folder for smaller
   viewports in responsive.css - keep these in CSS (not inline styles) so
   that cascade/media-query overrides work without needing !important. */
#about-folder {
  top: 50px;
  left: 50px;
}

#projects-folder {
  top: 50px;
  left: 150px;
}

#art-folder {
  top: 50px;
  left: 250px;
}

#contact-folder {
  top: 50px;
  left: 350px;
}

#services-folder {
  top: 50px;
  left: 450px;
}

#themes-folder {
  top: 50px;
  left: 550px;
}

#wallpapers-folder {
  top: 150px;
  left: 50px;
}

.folder-icon {
  width: 60px;
  height: 50px;
  margin: 0 auto;
  background-color: var(--window-bg);
  border: 2px solid var(--button-border);
  border-top: 2px solid var(--color-white);
  border-left: 2px solid var(--color-white);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.folder-icon:after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 5px;
  background-color: var(--window-bg);
  border: 2px solid var(--button-border);
  border-bottom: 2px solid var(--color-white);
  border-right: 2px solid var(--color-white);
  transition: transform 0.15s ease;
  transform-origin: bottom right;
}

.folder-label {
  margin-top: 5px;
  font-size: 0.8rem;
  background-color: var(--window-bg);
  padding: 2px 5px;
  border: 1px solid var(--button-border);
  border-top: 1px solid var(--color-white);
  border-left: 1px solid var(--color-white);
  transition: border-color 0.15s ease;
}

/* Hover only applies on devices that can really hover, so touch screens never get a stuck hover state. */
@media (hover: hover) {
  .folder:hover .folder-icon {
    transform: translateY(-4px);
    box-shadow: 0 6px 0 -2px rgba(0, 0, 0, 0.35);
  }

  .folder:hover .folder-icon:after {
    transform: translateY(-3px) rotate(8deg);
  }

  .folder:hover .folder-label {
    border-color: var(--highlight);
  }

  .folder:active .folder-icon {
    transform: translateY(-1px);
  }
}

/* is-pressed is added by script.js while a finger is held on a folder, mirroring the hover animation. */
.folder:focus-visible .folder-icon,
.folder.is-pressed .folder-icon {
  transform: translateY(-4px);
  box-shadow: 0 6px 0 -2px rgba(0, 0, 0, 0.35);
}

.folder:focus-visible .folder-icon:after,
.folder.is-pressed .folder-icon:after {
  transform: translateY(-3px) rotate(8deg);
}

.folder:focus-visible .folder-label,
.folder.is-pressed .folder-label {
  border-color: var(--highlight);
}

.folder:focus-visible {
  outline: 2px dotted var(--highlight);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .folder-icon,
  .folder-icon:after,
  .folder-label {
    transition: none;
  }
}

#taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background-color: var(--window-bg);
  border-top: 2px solid var(--color-white);
  display: flex;
  align-items: center;
  padding: 0 10px;
  z-index: 1000;
}

.taskbar-item {
  padding: 3px 10px;
  margin-right: 5px;
  background-color: var(--button-bg);
  border: 2px outset var(--button-border);
  cursor: pointer;
  font-size: 0.8rem;
}

.taskbar-time {
  margin-left: auto;
  font-size: 0.8rem;
}

#start-menu {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 200px;
  background-color: var(--window-bg);
  border: 2px solid var(--button-border);
  border-top: 2px solid var(--color-white);
  border-left: 2px solid var(--color-white);
  box-shadow: 2px 2px 0px var(--shadow-dark);
  display: none;
  z-index: 40;
}

.start-menu-header {
  background-color: var(--highlight);
  color: var(--color-white);
  padding: 5px 10px;
  font-weight: bold;
}

.start-menu-item {
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--button-border);
}

.start-menu-item:hover {
  background-color: var(--highlight);
  color: var(--color-white);
}

.start-menu-item i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.start-menu-divider {
  height: 1px;
  background-color: var(--button-border);
  margin: 5px 0;
}

.crt-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      var(--scanline-color) 2px,
      var(--scanline-color) 4px);
  pointer-events: none;
  z-index: 100;
}

.about-container {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.portrait-container {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100cqh;
}

#about-window .window-content {
  container-type: size;
}

.portrait {
  width: auto;
  height: auto;
  max-width: 240px;
  max-height: 100%;
  border: 2px solid var(--button-border);
  overflow: hidden;
  background-color: var(--color-gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: crisp-edges;
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  display: block;
}

/* On wide windows the portrait grows to fill the full-height sidebar. The image is 2:3, so its width follows the
   height (with a small crop at the sides) and is capped so the text column keeps enough room. */
@container (min-width: 1100px) {
  .portrait-container {
    align-items: stretch;
    justify-content: flex-start;
    width: min(calc(100cqh * 0.64), 36cqw, 800px);
  }

  .portrait {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }

  .portrait img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center top;
  }
}

.portrait-caption {
  margin-top: 10px;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  color: var(--color-gray-dark);
}

.about-text {
  flex: 1;
  min-width: 0;
}

.about-section {
  margin-bottom: 15px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.4;
}

.about-section h3 {
  color: var(--highlight);
  margin-bottom: 5px;
  border-bottom: 1px solid var(--button-border);
}

.about-section ul {
  margin: 8px 0 8px 25px;
  list-style-type: square;
}

.about-section li {
  margin-bottom: 6px;
  padding: 4px 8px;
  line-height: 1.4;
  background-color: var(--window-bg);
  border: 1px solid var(--button-border);
  border-top: 1px solid var(--color-white);
  border-left: 1px solid var(--color-white);
  border-radius: 2px;
  transition: var(--transition-fast);
}

.about-section li:hover {
  background-color: var(--highlight);
  color: var(--color-white);
  cursor: default;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.social-link {
  font-size: 2rem;
  color: var(--highlight);
  text-decoration: none;
}

.contact-social-hub {
  margin-top: 20px;
  padding: 12px;
  border: 2px inset var(--button-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0.3) 100%);
}

.contact-social-hub h3 {
  margin-bottom: 6px;
}

.contact-social-intro {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-color);
}

.contact-social-hub .social-links {
  margin-top: 12px;
  gap: 10px;
  justify-content: flex-start;
}

.social-link-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 2px outset var(--button-border);
  background: var(--button-bg);
  color: var(--text-color);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  line-height: 1;
}

.social-link-card:hover {
  background: var(--highlight);
  color: var(--color-white);
}

.social-link-card:active {
  border: 2px inset var(--button-border);
}

.social-link-icon {
  width: 22px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.social-link-card i {
  font-size: 1.2rem;
}

.social-link-label {
  letter-spacing: 0.2px;
}

.contact-brief-panel {
  margin-top: 22px;
  padding: 12px;
  border: 2px inset var(--button-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.2) 100%);
}

.contact-brief-panel h3 {
  margin-bottom: 10px;
}

.contact-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contact-brief-card {
  padding: 10px;
  border: 2px groove var(--button-border);
  background-color: var(--window-bg);
}

.contact-brief-card h4 {
  margin-bottom: 6px;
  color: var(--highlight);
  font-size: 0.95rem;
}

.contact-brief-card p {
  margin: 0 0 6px;
  line-height: 1.4;
}

.contact-brief-timezone {
  margin-bottom: 0;
  font-size: 0.85rem;
}

.contact-brief-list {
  margin: 0;
  padding-left: 18px;
}

.contact-brief-list li {
  margin-bottom: 5px;
  line-height: 1.35;
}

.contact-brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.contact-brief-action,
.contact-brief-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px outset var(--button-border);
  background-color: var(--button-bg);
  color: var(--color-black);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 6px 10px;
  min-height: 34px;
}

.contact-brief-action:active,
.contact-brief-link:active {
  border: 2px inset var(--button-border);
}

#thank-you-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-dark);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#thank-you-page .window {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate3d(-50%, -50%, 0) !important;
  display: block !important;
  will-change: transform;
}

#thank-you-page .window-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100%;
  padding: 30px;
}

#thank-you-page h2 {
  color: var(--highlight);
  margin-bottom: 15px;
  font-size: 1.5rem;
}

#thank-you-page p {
  margin-bottom: 10px;
  line-height: 1.5;
}

@keyframes checkmarkBounce {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#thank-you-page .fa-check-circle {
  animation: checkmarkBounce 0.6s ease-out;
}

#pikachu {
  position: fixed;
  width: 64px;
  height: 64px;
  z-index: 100;
  pointer-events: none;
  transition: transform 0.1s ease;
  image-rendering: pixelated;
  display: none;
}

/* Wallpaper Grid */
.wallpaper-preview {
  width: 100%;
  height: 80px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--button-border);
  margin-bottom: 5px;
}

.wallpaper-preview-large {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  margin: 15px auto;
  border: 2px solid var(--button-border);
  position: relative;
}

.wallpaper-preview-large .preview-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.wallpaper-preview-large .preview-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--overlay-dark);
  color: var(--color-white);
  padding: 2px 5px;
  font-size: 0.8rem;
}

.wallpaper-section {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid var(--button-border);
  border-top: 1px solid var(--color-white);
  border-left: 1px solid var(--color-white);
}

.wallpaper-upload-btn,
.wallpaper-reset-btn {
  width: 100%;
  margin: 5px 0;
  padding: 8px;
}

.custom-wallpaper-upload {
  text-align: center;
}

.window-content p,
.window-content h1,
.window-content h2,
.window-content h3,
.window-content li,
.window-content span {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Thank You Page Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-dark);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#thank-you-page .window {
  z-index: 3000 !important;
}

/* Checkmark animation */
@keyframes checkmarkBounce {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#thank-you-page .fa-check-circle {
  animation: checkmarkBounce 0.6s ease-out;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-notice {
  margin: 0 0 18px;
  padding: 12px;
  border: 2px solid var(--button-border);
  border-top-color: var(--color-white);
  border-left-color: var(--color-white);
  background: linear-gradient(180deg, var(--window-bg) 0%, var(--content-bg) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.project-notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border: 1px solid var(--button-border);
  border-top-color: var(--color-white);
  border-left-color: var(--color-white);
  background: var(--button-bg);
  color: var(--text-color);
}

.project-notice-badge i {
  font-size: 12px;
  color: var(--highlight);
}

.project-notice-text {
  margin: 0;
  line-height: 1.5;
  color: var(--text-color);
}

.tech-item i {
  font-size: 28px;
  line-height: 1;
}

.repo-embed-card {
  margin-bottom: 14px;
  padding: 12px;
  border: 2px inset var(--button-border);
  background: var(--content-bg);
}

.repo-embed-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.repo-embed-badge,
.repo-embed-host {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.repo-embed-host {
  opacity: 0.85;
}

.repo-embed-meta {
  margin: 0 0 10px 0;
  font-size: 13px;
  line-height: 1.45;
}

.repo-embed-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 2px solid var(--button-border);
  border-top-color: var(--color-white);
  border-left-color: var(--color-white);
  background: var(--button-bg);
  color: var(--text-color);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.repo-embed-link:hover {
  background: var(--highlight);
  color: var(--color-white);
}

.art-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 14px 0;
  font-weight: 700;
  line-height: 1.5;
}

.art-credit-note {
  margin: 0 0 14px 0;
  line-height: 1.5;
}

.art-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
  gap: 14px;
  margin-bottom: 20px;
}

.art-item {
  margin: 0;
  padding: 6px;
  border: 2px inset var(--button-border);
  background: var(--content-bg);
}

.art-item img,
.art-item video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.art-caption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}