/* ============================
   FONT
   ============================ */
@font-face {
  font-family: 'Microgramma D Bold Extended';
  src: local('Microgramma D Bold Extended Italic'),
       local('Microgramma D Extended Bold Italic'),
       local('MicrogrammaDBolExt'),
       local('Microgramma D Ext Bold Italic');
  font-weight: bold;
  font-style: italic;
}

/* ============================
   CSS VARIABLES — WIN95 PALETTE
   ============================ */
:root {
  --win-bg: #008080;
  --win-gray: #c0c0c0;
  --win-dark: #808080;
  --win-darker: #404040;
  --win-light: #dfdfdf;
  --win-white: #ffffff;
  --win-title: #000080;
  --win-title-end: #1084d0;
  --win-title-text: #ffffff;
  --win-btn-face: #c0c0c0;
  --win-black: #000000;
  --viewer-bg: #0a0a1e;
  --viewer-glow: #00c8ff;
}

/* ============================
   RESET
   ============================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tahoma', 'MS Sans Serif', 'Arial', sans-serif;
  font-size: 12px;
  background: var(--win-bg);
  color: var(--win-black);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
  user-select: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================
   SELECTION RECTANGLE (desktop drag)
   ============================ */
.selection-rect {
  position: fixed;
  border: 1px solid rgba(0, 0, 128, 0.8);
  background: rgba(0, 0, 128, 0.12);
  pointer-events: none;
  z-index: 5;
  display: none;
}

/* ============================
   DESKTOP ICONS
   ============================ */
.desktop-icons {
  position: fixed;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 4px;
  cursor: pointer;
  color: white;
  border: 1px solid transparent;
}

.desktop-icon:hover {
  background: rgba(0, 0, 128, 0.3);
  border: 1px dotted rgba(255, 255, 255, 0.7);
}

.desktop-icon .icon-img {
  font-size: 30px;
  margin-bottom: 2px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.desktop-icon .icon-img img {
  width: 32px;
  height: 32px;
  image-rendering: auto;
}

.desktop-icon span {
  font-size: 10px;
  text-align: center;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
  line-height: 1.2;
  word-break: break-word;
  color: white;
}

/* ============================
   DESKTOP AREA
   ============================ */
.desktop {
  min-height: 100vh;
  padding: 16px 20px 54px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

/* ============================
   WIN95 WINDOW
   ============================ */
.win-window {
  background: var(--win-gray);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  box-shadow: 1px 1px 0 var(--win-black);
  width: 100%;
  max-width: 820px;
}

.win-titlebar {
  background: linear-gradient(90deg, var(--win-title), var(--win-title-end));
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.win-titlebar-text {
  color: var(--win-title-text);
  font-weight: bold;
  font-size: 12px;
  padding-left: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-titlebar-text img {
  width: 16px;
  height: 16px;
  image-rendering: auto;
}

.win-titlebar-buttons {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.win-titlebar-btn {
  width: 16px;
  height: 14px;
  background: var(--win-btn-face);
  border-top: 1px solid var(--win-white);
  border-left: 1px solid var(--win-white);
  border-right: 1px solid var(--win-darker);
  border-bottom: 1px solid var(--win-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
}

.win-titlebar-btn:active {
  border-top: 1px solid var(--win-darker);
  border-left: 1px solid var(--win-darker);
  border-right: 1px solid var(--win-white);
  border-bottom: 1px solid var(--win-white);
}

.win-content {
  padding: 8px;
  background: var(--win-gray);
}

/* ============================
   WIN95 BUTTON
   ============================ */
.win-btn {
  background: var(--win-btn-face);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  padding: 5px 20px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--win-black);
  display: inline-block;
  text-align: center;
  min-width: 80px;
}

.win-btn:active {
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 6px 19px 4px 21px;
}

.win-btn:hover {
  color: var(--win-black);
}

.win-btn.x-btn {
  background: #000;
  color: #fff;
  border: 2px solid #333;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
}

.win-btn.x-btn:hover {
  background: #1a1a1a;
  color: #fff;
}

.win-btn.x-btn:active {
  background: #333;
  border: 2px solid #000;
  padding: 9px 23px 7px 25px;
}

.win-btn.pump-btn {
  background: #00c853;
  color: #fff;
  border: 2px solid #00a844;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: bold;
}

.win-btn.pump-btn:hover {
  background: #00b848;
  color: #fff;
}

.win-btn.pump-btn:active {
  background: #009a3e;
  border: 2px solid #007830;
  padding: 9px 23px 7px 25px;
}

.x-taskbar-item {
  font-weight: bold !important;
}

/* ============================
   HERO SECTION
   ============================ */
.hero-content {
  text-align: center;
  padding: 20px 16px 16px;
}

.hero-logo {
  width: 100px;
  height: auto;
  margin: 0 auto 10px;
}

.hero-title {
  font-family: 'Microgramma D Bold Extended', 'Eurostile Extended', 'Impact', 'Arial Black', sans-serif;
  font-size: 48px;
  font-weight: bold;
  font-style: italic;
  color: var(--win-title);
  letter-spacing: 3px;
  margin-bottom: 6px;
  text-shadow: 2px 2px 0 var(--win-dark);
}

.hero-subtitle {
  font-size: 13px;
  color: #333;
  margin-bottom: 14px;
  line-height: 1.6;
}

.hero-ca {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  background: var(--win-white);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 6px 12px;
  display: inline-block;
  word-break: break-all;
  max-width: 100%;
  cursor: text;
  user-select: all;
}

.hero-links {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================
   MARQUEE TICKER
   ============================ */
.marquee-bar {
  background: var(--win-title);
  color: var(--win-title-text);
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 4px 0;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  max-width: 820px;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
}

.marquee-inner {
  display: inline-block;
  animation: marquee 30s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ============================
   3D VIEWER WINDOW
   ============================ */
.viewer-content {
  padding: 0 !important;
}

.viewer-wrapper {
  position: relative;
  background: var(--viewer-bg);
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  margin: 8px;
}

.viewer-canvas {
  width: 100%;
  height: 420px;
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.viewer-canvas:active {
  cursor: grabbing;
}

.viewer-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* CRT scanline overlay */
.viewer-canvas::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Loading state */
.viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 3;
  background: var(--viewer-bg);
}

.loading-text {
  color: var(--viewer-glow);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  animation: blink 1.2s step-end infinite;
}

.loading-bar-track {
  width: 200px;
  height: 18px;
  background: var(--win-gray);
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 2px;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--win-title);
  transition: width 0.3s;
}

/* Overlay info — single stacked block, top-left */
.viewer-overlay {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 3;
  pointer-events: none;
  background: rgba(10, 10, 30, 0.7);
  padding: 8px 12px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.viewer-mcap-label {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.viewer-growth {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: bold;
  color: var(--viewer-glow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}

.viewer-mcap-value {
  font-family: 'Microgramma D Bold Extended', 'Eurostile Extended', 'Impact', 'Arial Black', sans-serif;
  font-style: italic;
  font-size: 20px;
  font-weight: bold;
  color: var(--viewer-glow);
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.4);
  line-height: 1.2;
  margin-top: 2px;
}

.viewer-controls-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  z-index: 3;
  pointer-events: none;
  white-space: nowrap;
}

/* Scale indicator */
.viewer-scale {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px 6px;
  background: var(--win-gray);
}

.scale-item {
  font-size: 9px;
  color: var(--win-darker);
  text-align: center;
  padding: 3px 8px;
  border-top: 1px solid var(--win-white);
  border-left: 1px solid var(--win-white);
  border-right: 1px solid var(--win-dark);
  border-bottom: 1px solid var(--win-dark);
  line-height: 1.3;
  flex: 1;
  max-width: 90px;
  transition: all 0.3s;
}

.scale-item.active {
  background: var(--win-title);
  color: var(--win-title-text);
  font-weight: bold;
  border-top: 1px solid var(--win-darker);
  border-left: 1px solid var(--win-darker);
  border-right: 1px solid var(--win-white);
  border-bottom: 1px solid var(--win-white);
}

/* Stats row */
.viewer-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--win-dark);
  border-top: 2px solid var(--win-dark);
  margin: 0 8px 8px;
}

.stat-box {
  background: var(--win-white);
  padding: 6px 10px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 9px;
  color: var(--win-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-value {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: bold;
  color: var(--win-black);
}

.stat-value.positive { color: #008000; }
.stat-value.negative { color: #cc0000; }

/* ============================
   NOTEPAD
   ============================ */
.notepad-menubar {
  background: var(--win-gray);
  padding: 1px 6px;
  border-bottom: 1px solid var(--win-dark);
  font-size: 11px;
  display: flex;
  gap: 14px;
  margin-bottom: 0;
}

.notepad-menubar span {
  cursor: pointer;
  padding: 1px 4px;
}

.notepad-menubar span:hover {
  background: var(--win-title);
  color: white;
}

.notepad-content {
  background: var(--win-white);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 12px 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.7;
  user-select: text;
}

.notepad-line {
  margin: 0;
  white-space: pre-wrap;
}

.notepad-line.indent {
  padding-left: 24px;
}

.notepad-comment {
  color: #008000;
}

.notepad-keyword {
  color: var(--win-title);
  font-weight: bold;
}

/* ============================
   CLIPPY
   ============================ */
.clippy-container {
  position: fixed;
  bottom: 50px;
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.clippy-enter {
  animation: clippyBounce 0.4s ease-out;
}

.clippy-exit {
  animation: clippyFade 0.3s ease-in forwards;
}

@keyframes clippyBounce {
  0% { transform: translateY(100px); opacity: 0; }
  60% { transform: translateY(-10px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes clippyFade {
  to { transform: translateY(20px); opacity: 0; }
}

.clippy-bubble {
  background: #ffffcc;
  border: 2px solid #000;
  border-radius: 8px;
  padding: 12px 14px;
  max-width: 260px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  margin-bottom: 6px;
  position: relative;
  user-select: text;
}

.clippy-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 30px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #ffffcc;
}

.clippy-bubble::before {
  content: '';
  position: absolute;
  bottom: -11px;
  right: 29px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid #000;
}

.clippy-bubble-text {
  white-space: pre-line;
  margin-bottom: 8px;
}

.clippy-dismiss {
  background: var(--win-btn-face);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  padding: 2px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

.clippy-dismiss:active {
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
}

.clippy-character {
  cursor: pointer;
  transition: transform 0.2s;
}

.clippy-character:hover {
  transform: scale(1.1);
}

/* ============================
   TASKBAR
   ============================ */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--win-gray);
  border-top: 2px solid var(--win-white);
  display: flex;
  align-items: center;
  padding: 2px 4px;
  z-index: 8000;
  gap: 3px;
}

.start-btn {
  background: var(--win-btn-face);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  padding: 2px 8px;
  font-weight: bold;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  height: 28px;
  flex-shrink: 0;
}

.start-btn img {
  width: 18px;
  height: 18px;
}

.start-btn:active {
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
}

.taskbar-divider {
  width: 2px;
  height: 24px;
  border-left: 1px solid var(--win-dark);
  border-right: 1px solid var(--win-white);
  margin: 0 2px;
}

.taskbar-items {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow: hidden;
}

.taskbar-item {
  background: var(--win-btn-face);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  padding: 2px 10px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--win-black);
}

.taskbar-item.active {
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  background: repeating-conic-gradient(var(--win-gray) 0% 25%, var(--win-light) 0% 50%) 0 0 / 2px 2px;
  font-weight: bold;
}

.taskbar-item-icon {
  width: 16px;
  height: 16px;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 2px 8px;
  height: 28px;
}

.tray-icon {
  font-size: 12px;
}

.taskbar-clock {
  font-size: 11px;
  font-family: 'Tahoma', sans-serif;
  min-width: 50px;
  text-align: center;
}

/* ============================
   ANIMATIONS
   ============================ */
@keyframes blink {
  50% { opacity: 0; }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 700px) {
  .desktop-icons {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    gap: 4px;
  }

  .desktop {
    padding: 10px;
    padding-bottom: 50px;
  }

  .hero-title {
    font-size: 32px;
    letter-spacing: 1px;
  }

  .viewer-canvas {
    height: 300px;
  }

  .viewer-mcap-value {
    font-size: 20px;
  }

  .viewer-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .viewer-scale {
    flex-wrap: wrap;
  }

  .taskbar-items {
    display: none;
  }

  .taskbar-divider {
    display: none;
  }

  .stat-value {
    font-size: 11px;
  }
}

@media (max-width: 400px) {
  .hero-title {
    font-size: 26px;
  }

  .viewer-canvas {
    height: 250px;
  }

  .viewer-stats {
    grid-template-columns: 1fr 1fr;
  }
}
