/* === Base Reset & CRT Global Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --taskbar-height: 52px;
  --app-height: 100dvh;
  --font-pixel: 'VT323', monospace;
  --font-readable: Verdana, Arial, sans-serif;
}

html, body {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  user-select: auto;
}

::selection {
  background: #ff00ff;
  color: #0a0a0a;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
  border: 1px solid #808080;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #808080 0%, #606060 100%);
  border: 1px solid #808080;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #909090 0%, #707070 100%);
}

/* === Windows 95 Classic Teal Desktop & CRT Styles === */
body {
  background-color: #008080;
  /* Subtle classic Win95 dither pattern + CRT monitor vignette */
  background-image: 
    radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.25) 100%),
    repeating-conic-gradient(#008080 0% 25%, #007979 0% 50%) 50% / 4px 4px;
  background-attachment: fixed;
  font-family: var(--font-pixel);
}

.crt-overlay {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  /* Halus & transparan: Opacity diperkecil agar tidak mengaburkan teks */
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.04),
    rgba(0, 0, 0, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  animation: scanline-flicker 4s infinite;
}

@keyframes scanline-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
}

/* Phosphor Glow Effect */
.phosphor-glow {
  text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.phosphor-glow-subtle {
  text-shadow: 0 0 5px currentColor;
}

/* Neon Box Glow */
.neon-box-cyan {
  box-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff, inset 0 0 10px rgba(0, 212, 255, 0.1);
}

.neon-box-magenta {
  box-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, inset 0 0 10px rgba(255, 0, 255, 0.1);
}

/* Vignette Effect */
.vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

/* === Windows 95 UI Components === */

/* Desktop Container Layout */
#desktop-area {
  height: calc(var(--app-height) - var(--taskbar-height));
  max-height: calc(var(--app-height) - var(--taskbar-height));
  min-height: 0 !important;
  overflow: hidden;
  position: relative;
}

#windows-workspace {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0 !important;
}

/* Window Frame */
.win95-window {
  background: #1a1a2e;
  border: 2px solid #808080;
  box-shadow: 
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000,
    4px 4px 0 rgba(0, 0, 0, 0.3);
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 32px), 900px);
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 24px);
  min-width: 0;
  transform: translate(-50%, -50%);
  transition: box-shadow 0.15s ease;
  outline: none;
}

#win-projects {
  width: min(calc(100% - 32px), 1080px);
}

#win-contact {
  width: min(calc(100% - 32px), 720px);
}

.win95-window:focus-visible {
  box-shadow:
    0 0 0 2px #ffcc00,
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000,
    4px 4px 0 rgba(0, 0, 0, 0.3);
}

.win95-window.is-inactive .win95-titlebar {
  background: linear-gradient(90deg, #707070 0%, #909090 100%) !important;
}

.win95-window.is-inactive .win95-titlebar-text {
  color: #c0c0c0 !important;
  text-shadow: none !important;
}

.win95-window.is-hidden {
  display: none !important;
}

.win95-window.is-maximized {
  position: fixed !important;
  top: 8px !important;
  left: 8px !important;
  right: 8px !important;
  bottom: calc(var(--taskbar-height) + 4px) !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  z-index: 500;
  transform: none !important;
}

.win95-window.is-maximized .win95-content {
  max-height: none !important;
  flex: 1;
}

/* Desktop Icons Grid */
.desktop-shortcuts-grid {
  display: grid;
  grid-template-columns: 76px;
  gap: 12px;
  width: 84px;
  flex: 0 0 84px;
}

.desktop-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 76px;
  padding: 6px 4px;
  cursor: pointer;
  user-select: none;
  border: 1px dotted transparent;
  border-radius: 2px;
  transition: background 0.1s;
  background: transparent;
  color: inherit;
  font: inherit;
}

.desktop-icon-item:hover, .desktop-icon-item:focus {
  background: rgba(0, 0, 128, 0.45);
  border: 1px dotted #ffffff;
}

.desktop-icon-item:active {
  background: rgba(0, 0, 128, 0.75);
}

.desktop-icon-img {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 3px;
  filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.5));
}

.desktop-icon-title {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.1;
  text-shadow: 1px 1px 2px #000000;
  word-break: break-word;
}

/* Start Menu Popup */
.win95-start-menu {
  position: fixed;
  bottom: 40px;
  left: 0;
  width: 250px;
  background: #c0c0c0;
  border: 2px solid #ffffff;
  border-right-color: #000000;
  border-bottom-color: #000000;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.6);
  display: flex;
  z-index: 2500;
  font-family: 'VT323', monospace;
}

.win95-start-menu.is-hidden {
  display: none !important;
}

.win95-start-sidebar {
  background: linear-gradient(180deg, #000080 0%, #1084d0 100%);
  width: 34px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 4px;
  color: #ffffff;
  font-weight: bold;
  letter-spacing: 3px;
  font-size: 19px;
  text-shadow: 1px 1px 0 #000000;
}

.win95-start-items {
  flex: 1;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.win95-start-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  color: #000000;
  text-decoration: none;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.05s;
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
}

.win95-start-item:hover {
  background: #000080;
  color: #ffffff;
}

.win95-start-divider {
  height: 1px;
  background: #808080;
  border-bottom: 1px solid #ffffff;
  margin: 4px 6px;
}

/* Title Bar */
.win95-titlebar {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.win95-titlebar-text {
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000000;
}

.win95-titlebar-buttons {
  display: flex;
  gap: 2px;
}

/* Title Bar Buttons */
.win95-btn {
  width: 30px;
  height: 30px;
  background: #c0c0c0;
  border: 1px solid #808080;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  font-family: 'VT323', monospace;
}

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

.win95-btn:active {
  box-shadow:
    inset -1px -1px 0 #ffffff,
    inset 1px 1px 0 #000000;
  transform: translate(1px, 1px);
}

/* Window Content */
.win95-content {
  padding: 16px;
  border-top: 1px solid #808080;
  max-height: calc(var(--app-height) - var(--taskbar-height) - 72px);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.win95-content p,
.project-info,
.contact-panel,
.readable-text {
  font-family: var(--font-readable);
}

.profile-summary,
.about-copy,
.project-info p {
  color: #e5e7eb;
  font-size: 0.95rem;
  line-height: 1.65;
}

.window-divider,
.dialog-divider {
  height: 2px;
  margin: 0 0 20px;
  background: #606060;
  border-bottom: 1px solid #b8b8b8;
}

.dialog-divider {
  margin-bottom: 16px;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px;
  list-style: none;
}

.capability-item {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: #101018;
  border: 2px solid #707070;
  box-shadow: inset 1px 1px 0 #24243e, inset -1px -1px 0 #000000;
  font-family: var(--font-readable);
  color: #e5e7eb;
}

.capability-item > span {
  font-size: 1.5rem;
}

.capability-item strong,
.capability-item div > span {
  display: block;
}

.capability-item strong {
  margin-bottom: 4px;
  color: #00d4ff;
  font-family: var(--font-pixel);
  font-size: 1.15rem;
}

.capability-item div > span {
  font-size: 0.85rem;
  line-height: 1.5;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}

.project-card-header > div {
  min-width: 0;
}

.project-card-header > div > span:last-child {
  overflow-wrap: anywhere;
}

.primary-action {
  background: #ffcc00;
  border-color: #6b5600;
  box-shadow:
    inset 2px 2px 0 #fff4a3,
    inset -2px -2px 0 #5c4900,
    0 0 12px rgba(255, 204, 0, 0.35);
}

#contact-status {
  min-height: 1.4em;
  color: #000080;
  font-weight: 700;
}

/* Windows 95 Button */
.win95-action-btn {
  background: #c0c0c0;
  border: 2px solid #808080;
  box-shadow:
    inset 2px 2px 0 #ffffff,
    inset -2px -2px 0 #000000;
  padding: 8px 24px;
  font-family: 'VT323', monospace;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.1s;
  min-height: 40px;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}

.win95-action-btn:hover {
  background: #d0d0d0;
}

.win95-action-btn:active {
  box-shadow:
    inset -2px -2px 0 #ffffff,
    inset 2px 2px 0 #000000;
  transform: translate(2px, 2px);
}

/* Input Fields */
.win95-input {
  background: #ffffff;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #000000,
    inset -1px -1px 0 #808080;
  padding: 6px 8px;
  font-family: var(--font-readable);
  font-size: 16px;
  color: #000000;
  min-height: 44px;
}

.win95-input:focus {
  outline: none;
  box-shadow:
    inset 1px 1px 0 #000000,
    inset -1px -1px 0 #808080,
    0 0 0 2px #000080;
}

/* Taskbar */
.win95-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  height: var(--taskbar-height);
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
}

.win95-taskbar-btn {
  background: #c0c0c0;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000;
  min-height: 36px;
  padding: 4px 12px;
  font-family: 'VT323', monospace;
  font-size: 14px;
  cursor: pointer;
  color: #111111;
  white-space: nowrap;
}

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

.win95-taskbar-btn.active {
  box-shadow:
    inset -1px -1px 0 #ffffff,
    inset 1px 1px 0 #000000;
  background: #000080;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000000;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
}

/* === CRT Screen Effect === */
.crt-screen {
  background: #0a0a0a;
  border: 8px solid #333;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 50px rgba(0, 255, 65, 0.1),
    0 0 20px rgba(0, 255, 65, 0.2);
}

.crt-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 65, 0.03),
    rgba(0, 255, 65, 0.03) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}

.crt-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
}

/* === Skill Bars (Windows 95 Progress Bar Style) === */
.skill-bar {
  height: 20px;
  background: #1a1a2e;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #000000,
    inset -1px -1px 0 #808080;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff41 0%, #00d4ff 100%);
  box-shadow: 0 0 10px #00ff41;
  transition: width 1s ease-out;
  position: relative;
}

.skill-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 8px,
    rgba(0, 0, 0, 0.2) 8px,
    rgba(0, 0, 0, 0.2) 10px
  );
}

/* === Project Cards === */
.project-card {
  background: #0d0d0d;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #000000,
    inset -1px -1px 0 #808080;
  transition: all 0.3s ease;
}

.project-card:hover {
  box-shadow:
    0 0 15px rgba(0, 212, 255, 0.3),
    inset 1px 1px 0 #000000,
    inset -1px -1px 0 #808080;
  transform: translateY(-4px);
}

.project-preview {
  border-bottom: 2px solid #808080;
  overflow: hidden;
}

.crt-screen-mini {
  background: #0a0a0a;
  padding: 16px;
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crt-screen-mini::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 65, 0.02),
    rgba(0, 255, 65, 0.02) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}

.project-info {
  padding: 16px;
}

/* === Social Icons (Desktop Icon Style) === */
.social-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: transform 0.1s;
}

.social-icon:hover {
  transform: scale(1.1);
}

.social-icon:active {
  transform: scale(0.95);
}

.social-icon-img {
  width: 48px;
  height: 48px;
  background: #c0c0c0;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.social-icon:hover .social-icon-img {
  box-shadow:
    0 0 10px #00d4ff,
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000;
}

.social-icon-label {
  font-size: 12px;
  color: #00d4ff;
}

/* === Responsive Design === */

/* Tablet (768px - 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
  .win95-window {
    margin: 0.5rem;
  }
  
  .win95-content {
    padding: 12px;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  :root {
    --taskbar-height: 54px;
  }

  #desktop-area {
    height: calc(var(--app-height) - var(--taskbar-height));
    max-height: calc(var(--app-height) - var(--taskbar-height));
    padding: 6px;
    gap: 6px;
  }

  .desktop-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    width: 100%;
    flex: 0 0 auto;
    padding: 0;
    gap: 3px;
    flex-shrink: 0;
  }

  .desktop-icon-item {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 4px 2px;
  }

  .desktop-icon-img {
    font-size: 20px;
    margin-bottom: 1px;
  }

  .desktop-icon-title {
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  .win95-window {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    height: 100%;
    min-width: 0;
    transform: none !important;
    border: 2px solid #808080;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
  }

  .win95-window.is-maximized {
    position: absolute !important;
    inset: 0 !important;
  }
  
  /* Simplify title bar */
  .win95-titlebar {
    min-height: 44px;
    padding: 4px 6px;
    cursor: default;
    touch-action: manipulation;
  }
  
  .win95-titlebar-text {
    min-width: 0;
    max-width: calc(100% - 96px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }
  
  /* Proper mobile content padding & smooth internal scroll */
  .win95-content {
    padding: 12px 10px calc(18px + env(safe-area-inset-bottom));
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: none;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  
  /* CRT Screen sizing & centering */
  .crt-screen {
    width: 132px !important;
    height: 132px !important;
    margin: 0 auto;
    border-width: 6px;
  }
  
  /* Hero typography */
  #main-title {
    font-size: 2rem;
    line-height: 1.1;
  }
  
  /* Taskbar adjustments */
  .win95-taskbar {
    height: var(--taskbar-height);
    padding: 4px max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    gap: 3px;
  }
  
  .win95-taskbar-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 3px 5px;
    font-size: 18px;
    flex: 0 1 52px;
  }

  .taskbar-label,
  .taskbar-divider,
  .taskbar-status,
  #btn-sound {
    display: none !important;
  }

  #btn-start {
    flex-basis: 58px;
  }
  
  /* Reduce CRT effects for performance */
  .crt-overlay {
    opacity: 0.2;
    animation: none;
  }
  
  .phosphor-glow {
    text-shadow: 0 0 5px currentColor;
  }

  .project-card,
  .project-card:hover {
    transform: none;
  }

  .window-maximize {
    display: none;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card-header,
  .contact-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .win95-action-btn {
    min-height: 44px;
    width: 100%;
    padding: 10px 14px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
    margin-top: 16px;
  }

  .hero-actions .primary-action {
    grid-column: 1 / -1;
  }

  .hero-layout {
    gap: 14px;
  }

  .profile-copy {
    text-align: center;
  }

  .terminal-line {
    overflow-wrap: anywhere;
    min-height: 54px;
  }

  #win-ask .window-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    overflow-wrap: anywhere;
  }

  .win95-start-menu {
    bottom: var(--taskbar-height);
    max-height: calc(var(--app-height) - var(--taskbar-height) - 8px);
    overflow-y: auto;
  }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
  .win95-btn {
    width: 44px;
    height: 44px;
  }
  
  .win95-action-btn {
    padding: 12px 24px;
  }
  
  .social-icon-img {
    width: 56px;
    height: 56px;
  }
}

/* === Hover Effects Polish === */

/* Neon glow intensify on hover */
.project-card:hover .project-info {
  text-shadow: none;
}

/* Button glow animation */
@keyframes neon-pulse {
  0%, 100% {
    box-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
  }
  50% {
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
  }
}

.win95-action-btn:hover {
  animation: none;
}

/* Window slide-in animation */
@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

section:nth-child(odd) .win95-window {
  animation: slide-in-left 0.6s ease-out;
}

section:nth-child(even) .win95-window {
  animation: slide-in-right 0.6s ease-out;
}

/* === Custom Retro Cursor === */
body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M3 1 L3 17 L7.5 13.5 L9 17 L11 16 L9.5 12.5 L14 12 Z' fill='%23c0c0c0' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") 2 2, auto;
}

button, a, .win95-btn, .win95-action-btn, .win95-taskbar-btn, .desktop-icon-item, .win95-start-item, .social-icon, .context-menu-item, .win95-titlebar {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='13' viewBox='0 0 20 13'%3E%3Cpath d='M1 1 L13 12 L9 5 L15 5 Z' fill='%23ffffff' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") 1 1, pointer;
}

/* === Boot Screen === */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.4s ease;
  cursor: pointer;
}

.boot-screen.is-done {
  opacity: 0;
  pointer-events: none;
}

.boot-screen.is-removed {
  display: none;
}

.boot-noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.06;
}

.boot-content {
  position: relative;
  text-align: center;
  animation: boot-fade-in 0.5s ease-out;
}

.boot-logo {
  font-size: 3.5rem;
  letter-spacing: 6px;
  color: #00ff41;
  text-shadow: 0 0 15px #00ff41, 0 0 30px #00ff41;
  margin-bottom: 2rem;
  animation: boot-glow-pulse 1.2s ease-in-out infinite;
}

@keyframes boot-glow-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes boot-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.boot-progress-track {
  width: 320px;
  max-width: 80vw;
  height: 22px;
  background: #1a1a2e;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #000000,
    inset -1px -1px 0 #808080;
  overflow: hidden;
}

.boot-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #000080, #1084d0);
  box-shadow: 0 0 10px rgba(0, 132, 208, 0.6);
  transition: width 0.15s linear;
}

.boot-status {
  margin-top: 1rem;
  color: #00d4ff;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

/* === ASCII Particle Layer === */
.particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  background: none;
}

/* === Desktop Context Menu === */
.context-menu {
  position: fixed;
  z-index: 3000;
  min-width: 180px;
  background: #c0c0c0;
  border: 2px solid #ffffff;
  border-right-color: #000000;
  border-bottom-color: #000000;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.6);
  padding: 3px;
  font-size: 14px;
}

.context-menu.is-hidden {
  display: none !important;
}

.context-menu-item {
  display: block;
  width: 100%;
  padding: 5px 12px;
  color: #000000;
  cursor: pointer;
  white-space: nowrap;
  border: 0;
  background: transparent;
  font-family: var(--font-pixel);
  font-size: 1rem;
  text-align: left;
}

.context-menu-item:hover,
.context-menu-item:focus-visible {
  background: #000080;
  color: #ffffff;
}

.context-menu-divider {
  height: 1px;
  background: #808080;
  border-bottom: 1px solid #ffffff;
  margin: 3px 2px;
}

/* === About FADEL-OS Dialog === */
.about-dialog {
  position: fixed;
  z-index: 3100;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  max-width: 90vw;
  background: #1a1a2e;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000,
    4px 4px 0 rgba(0, 0, 0, 0.3);
}

.about-dialog.is-hidden {
  display: none !important;
}

.about-dialog-titlebar {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
}

.about-dialog-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.about-dialog-logo {
  font-size: 3rem;
  filter: drop-shadow(0 0 10px #ffcc00);
}

/* === Drag State === */
.win95-window.is-dragging {
  opacity: 0.92;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.7),
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000;
  transition: none !important;
}

.win95-titlebar {
  cursor: grab;
  touch-action: none;
}

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

/* === Glitch Effect === */
.glitch-window .win95-titlebar {
  animation: glitch-bar 0.18s steps(2, end) 2;
}

@keyframes glitch-bar {
  0% { transform: translate(0, 0); filter: none; }
  25% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  50% { transform: translate(2px, -1px); filter: hue-rotate(-90deg); }
  75% { transform: translate(-1px, -1px); filter: invert(0.1); }
  100% { transform: translate(0, 0); filter: none; }
}

.hero h1,
#main-title {
  position: relative;
  display: inline-block;
}

#main-title.is-glitching {
  animation: glitch-text 0.2s steps(2, end) 2;
}

@keyframes glitch-text {
  0% { text-shadow: 0 0 10px currentColor, 2px 0 #00d4ff, -2px 0 #ff00ff; clip-path: inset(0 0 0 0); transform: translateX(0); }
  25% { text-shadow: 0 0 10px currentColor, -3px 0 #00d4ff, 3px 0 #ff00ff; clip-path: inset(20% 0 40% 0); transform: translateX(2px); }
  50% { text-shadow: 0 0 10px currentColor, 3px 0 #00d4ff, -3px 0 #ff00ff; clip-path: inset(60% 0 5% 0); transform: translateX(-2px); }
  75% { text-shadow: 0 0 10px currentColor, -2px 0 #00d4ff, 2px 0 #ff00ff; clip-path: inset(10% 0 70% 0); transform: translateX(1px); }
  100% { text-shadow: 0 0 10px currentColor, 0 0 #00d4ff, 0 0 #ff00ff; clip-path: inset(0 0 0 0); transform: translateX(0); }
}

/* === Desktop Background Drift === */
body {
  animation: bg-drift 24s ease-in-out infinite alternate;
}

@keyframes bg-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 24px 0, 0 0; }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    cursor: default;
  }

  button, a, .win95-btn, .win95-action-btn, .win95-taskbar-btn, .desktop-icon-item, .win95-start-item, .social-icon, .context-menu-item, .win95-titlebar {
    cursor: pointer;
  }

  .hero h1,
  .crt-overlay,
  .project-card,
  .win95-action-btn {
    animation: none !important;
    transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }

  .win95-window {
    animation: none !important;
  }

  .boot-logo {
    animation: none;
  }

  .phosphor-glow {
    text-shadow: none;
  }

  .particle-canvas {
    display: none;
  }
}

/* === Mobile & Touch adjustments for new components === */
@media (hover: none) and (pointer: coarse) {
  body {
    cursor: default;
  }

  button, a, .win95-btn, .win95-action-btn, .win95-taskbar-btn, .desktop-icon-item, .win95-start-item, .social-icon, .context-menu-item, .win95-titlebar {
    cursor: pointer;
  }
}

@media (max-width: 767px) {
  .boot-logo {
    font-size: 2rem;
    letter-spacing: 3px;
  }

  .boot-progress-track {
    width: 240px;
  }

  .about-dialog {
    width: 300px;
  }
}

/* === Ask About Fadel chat === */
#win-ask {
  display: flex;
  flex-direction: column;
  height: min(720px, calc(var(--app-height) - var(--taskbar-height) - 32px));
}

#win-ask .win95-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

#win-ask #ask-suggestions {
  flex: 0 0 auto;
}

#win-ask #ask-form {
  flex: 0 0 auto;
}

.ask-messages {
  flex: 1;
  min-height: 0;
  min-width: 0;
  background: #000000;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #000000,
    inset -1px -1px 0 #808080;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.ask-msg {
  max-width: 90%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ask-msg-user {
  align-self: flex-end;
  background: #000080;
  color: #ffffff;
  border: 1px solid #00d4ff;
  text-align: left;
}

.ask-msg-ai {
  align-self: flex-start;
  background: #0a0a0a;
  color: #00ff41;
  border: 1px solid #808080;
}

.ask-msg .readable-text,
.ask-msg .ask-markdown {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ask-markdown p,
.ask-markdown h1,
.ask-markdown h2,
.ask-markdown h3,
.ask-markdown ul,
.ask-markdown ol,
.ask-markdown pre {
  margin: 0 0 0.65em;
}

.ask-markdown > :last-child {
  margin-bottom: 0;
}

.ask-markdown h1,
.ask-markdown h2,
.ask-markdown h3 {
  color: #00d4ff;
  line-height: 1.2;
}

.ask-markdown ul,
.ask-markdown ol {
  padding-left: 1.35rem;
}

.ask-markdown a {
  color: #00d4ff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ask-markdown code {
  font-family: var(--font-pixel);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ask-markdown pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 8px;
  background: #161616;
  color: #f3f3f3;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.ask-markdown pre code {
  overflow-wrap: normal;
  word-break: normal;
}

.ask-typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.ask-typing span {
  width: 8px;
  height: 8px;
  background: #00ff41;
  animation: ask-blink 1s infinite;
}

.ask-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.ask-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

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

.ask-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  align-items: center;
}

.ask-suggestion-chip,
.ask-ref-chip {
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  background: #c0c0c0;
  color: #000000;
  border: 2px solid #808080;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #000000;
  padding: 4px 10px;
  min-height: 36px;
  cursor: pointer;
}

.ask-suggestion-chip:active {
  box-shadow:
    inset -1px -1px 0 #ffffff,
    inset 1px 1px 0 #000000;
}

.ask-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ask-ref-chip button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.ask-ref-chip a {
  color: #000080;
  text-decoration: none;
}

.ask-form {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex: 0 0 auto;
}

.ask-form .win95-input {
  flex: 1;
  min-width: 0;
}

.ask-send-btn {
  padding: 8px 16px;
  white-space: nowrap;
}

@media (max-width: 767px) {
  #win-ask {
    height: 100%;
    min-height: 0;
    overflow: visible;
  }

  #win-ask .win95-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: visible;
    padding: 6px;
  }

  .window-meta {
    margin-bottom: 2px !important;
    font-size: 0.75rem;
  }

  .ask-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .ask-suggestions {
    flex-shrink: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    margin: 6px 0;
    -webkit-overflow-scrolling: touch;
  }

  #win-ask .ask-form {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
    margin-top: 0;
  }

  #win-ask .ask-form .win95-input {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  #win-ask .ask-send-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 8px 12px;
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ask-typing span {
    animation: none;
    opacity: 1;
  }
}
