/* =========================================
   1. VARIABLES & THEME
   ========================================= */
:root {
  /* Palette: "Neo-Pop Studio" */
  --bg: #f4f1ea;       /* Warm Cream Paper */
  --ink: #101010;      /* Sharp Black */
  --blue: #3E46B8;     /* Electric Indigo */
  --pop: #FF4400;      /* Safety Orange */
  --acid: #CCFF00;     /* Acid Green */
  --pink: #FF99CC;     /* Bubblegum */
  
  /* Dimensions */
  --sidebar-w: 240px;
  
  /* Typography */
  --font-head: 'DM Serif Display', serif;
  --font-body: 'Space Mono', monospace;
}

/* =========================================
   2. GLOBAL RESET & BASE
   ========================================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  /* Dot Grid Background */
  background-image: radial-gradient(#d0d0d0 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  /* Hide default cursor to use custom blob */
  cursor: none; 
  overflow-x: hidden;
  /* Prevent selecting UI elements by mistake */
  user-select: none; 
  -webkit-user-select: none;
}

/* Allow text selection only inside the actual content areas */
.markdown-section, .guestbook-section, .track-list {
  user-select: text;
  -webkit-user-select: text;
}

/* =========================================
   3. SIDEBAR (NAVIGATION)
   ========================================= */
.sidebar {
  background: transparent !important;
  border-right: 3px solid var(--ink);
  width: var(--sidebar-w) !important;
  padding-top: 60px;
  position: fixed; 
  top: 0; bottom: 0; left: 0;
  z-index: 200;
  overflow-y: auto;
}

/* Remove default Docsify list styling */
.sidebar ul { margin: 0 !important; padding: 0 !important; }
.sidebar ul li { list-style: none !important; margin: 15px 0 !important; }
.sidebar ul li::before, .sidebar ul li::after { content: none !important; display: none; }

/* Link Styling */
.sidebar ul li a {
  display: block; 
  font-family: var(--font-head); 
  font-size: 1.8rem;
  color: var(--ink) !important; 
  text-decoration: none !important;
  padding: 5px 20px; 
  text-align: right;
  border-right: 5px solid transparent;
  transition: 0.2s; 
  cursor: none; /* Custom cursor */
}

/* Hover / Active State */
.sidebar ul li a:hover, .sidebar ul li.active > a {
  color: var(--blue) !important; 
  border-right: 15px solid var(--pop);
  background: rgba(255,255,255,0.5);
}

/* Hide the default hamburger toggle */
.sidebar-toggle { display: none !important; }

/* =========================================
   4. MAIN CONTENT AREA
   ========================================= */
.content {
  margin-left: var(--sidebar-w) !important;
  padding: 40px 60px !important;
  max-width: 900px;
  position: relative; 
  z-index: 150;
  top: 0;
}

/* The White Card */
.markdown-section {
  background: #fff;
  border: 3px solid var(--ink);
  padding: 60px !important;
  box-shadow: 12px 12px 0px var(--ink);
  margin-top: 20px;
}

/* Remove top margin from first element for clean alignment */
.markdown-section > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* =========================================
   5. TYPOGRAPHY
   ========================================= */
h1 {
  font-family: var(--font-head);
  font-size: 4rem !important;
  line-height: 0.95;
  color: var(--ink);
  margin-bottom: 30px;
}

h2 {
  font-family: var(--font-head);
  font-size: 2rem;
  border-bottom: 4px solid var(--ink);
  display: inline-block;
  margin-top: 40px;
  color: var(--pop);
  margin-bottom: 20px;
  padding-bottom: 5px;
}

h3 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--blue);
  margin-top: 30px;
}

p, li {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #333;
}

/* Inline Links */
a {
  color: var(--pop);
  font-weight: bold;
  text-decoration: none;
  border-bottom: 2px solid var(--pop);
  cursor: none;
  transition: 0.1s;
}
a:hover {
  background: var(--pop);
  color: #fff;
}

/* --- Special List Styling (Interests / Reading List) --- */
/* Turns bullet points into tech cards */
.markdown-section ul {
  list-style: none;
  padding: 0;
}

.markdown-section ul li {
  background: #fff;
  border: 2px solid var(--ink);
  margin-bottom: 15px;
  padding: 15px 20px;
  box-shadow: 4px 4px 0px var(--acid);
  transition: transform 0.2s;
  position: relative;
}

.markdown-section ul li:hover {
  transform: translateX(5px);
  box-shadow: 6px 6px 0px var(--blue);
}

.markdown-section ul li strong {
  display: block;
  color: var(--blue);
  font-family: var(--font-head);
  font-size: 1.4rem;
  margin-bottom: 5px;
  text-transform: uppercase;
}

/* =========================================
   6. UI ELEMENTS
   ========================================= */

/* --- Professional Link (Top Right) --- */
.pro-link {
  position: fixed;
  top: 30px; right: 40px;
  font-family: var(--font-body);
  font-weight: bold;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  padding: 10px 20px;
  background: #fff;
  z-index: 99999;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
  cursor: none;
  transition: 0.2s;
}
.pro-link:hover {
  background: var(--ink);
  color: #fff;
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* --- Scribble Tools (Bottom Left) --- */
.tools-wrapper {
  position: fixed;
  bottom: 30px; left: 30px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
}

#toggle-draw {
  appearance: none; -webkit-appearance: none;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-weight: bold;
  font-size: 1rem;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 4px 4px 0px var(--pop);
  transform: rotate(-2deg);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
}

#toggle-draw:hover { transform: scale(1.05) rotate(0deg); }
#toggle-draw:active { transform: scale(0.95); }

/* Active Draw State */
body.draw-mode #toggle-draw {
  background: var(--pop);
  box-shadow: 4px 4px 0px var(--ink);
}

#color-picker { display: flex; gap: 5px; background: #fff; padding: 5px; border: 2px solid var(--ink); }
#color-picker.hidden { display: none; }
.swatch { width: 30px; height: 30px; border: 2px solid #fff; cursor: pointer; box-shadow: 2px 2px 0px rgba(0,0,0,0.2); }
#clear-canvas { background: transparent; border: 1px solid red; color: red; cursor: pointer; font-weight: bold; padding: 0 10px; }

/* =========================================
   7. FEATURE: MUSIC (LAST.FM)
   ========================================= */
#music-mount { margin-top: 20px; width: 100%; }

/* Now Playing Card */
.now-playing-card {
  border: 2px solid var(--pop);
  background: #fff;
  padding: 15px;
  margin-bottom: 30px;
  box-shadow: 6px 6px 0px var(--pop);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.5s ease-out;
}

.np-label {
  font-size: 0.8rem; font-weight: bold; color: var(--pop);
  margin-bottom: 10px; letter-spacing: 1px; animation: pulse 2s infinite;
}

.np-content { display: flex; align-items: center; gap: 15px; }
.np-art { width: 50px; height: 50px; border: 1px solid var(--ink); }
.np-info { display: flex; flex-direction: column; }
.np-track { font-weight: bold; color: var(--ink); font-size: 1.1rem; }
.np-artist { font-size: 0.9rem; color: #666; }

/* Equalizer Animation */
.equalizer {
  display: flex; gap: 2px; height: 20px;
  margin-left: auto; align-self: flex-end;
}
.bar { width: 6px; background: var(--pop); animation: eq 0.5s infinite ease-in-out alternate; }
.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }

/* Track List */
.track-list-header {
  font-family: var(--font-head); font-size: 1.5rem; color: var(--blue);
  border-bottom: 2px solid var(--ink); margin-bottom: 15px; padding-bottom: 5px;
}
.track-list {
  background: #fff; border: 2px solid var(--ink); padding: 10px;
  box-shadow: 4px 4px 0px var(--ink);
}
.track-row {
  display: flex; align-items: center; padding: 10px;
  border-bottom: 1px dashed #ccc; transition: 0.2s;
}
.track-row:last-child { border-bottom: none; }
.track-row:hover { background: rgba(62, 70, 184, 0.05); transform: translateX(5px); }
.track-num { font-weight: bold; color: var(--pop); font-size: 1.2rem; margin-right: 15px; width: 20px; }
.track-art { width: 40px; height: 40px; border: 1px solid var(--ink); margin-right: 15px; background: #eee; }
.track-info { display: flex; flex-direction: column; }
.track-name { font-weight: bold; font-size: 1rem; color: var(--ink) !important; text-decoration: none !important; border: none !important; }
.track-name:hover { color: var(--blue) !important; background: none !important; }
.track-artist { font-size: 0.85rem; color: #666; text-transform: uppercase; }

@keyframes eq { 0% { height: 5px; } 100% { height: 20px; } }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* =========================================
   8. FEATURE: GUESTBOOK (PIXEL ART)
   ========================================= */
#pixel-editor {
  display: flex; gap: 30px; align-items: flex-start; margin-top: 20px; flex-wrap: wrap;
}

.grid-container {
  display: grid; grid-template-columns: repeat(10, 1fr);
  width: 250px; height: 250px;
  border: 3px solid var(--ink); background: #fff;
  box-shadow: 8px 8px 0px var(--acid);
}

.pixel { border: 1px solid #eee; background: #fff; cursor: pointer; }
.pixel:hover { border-color: #aaa; }

.editor-controls { flex: 1; display: flex; flex-direction: column; gap: 15px; }
.color-palette { display: flex; gap: 10px; }
.p-swatch { width: 30px; height: 30px; border: 2px solid var(--ink); cursor: pointer; }
.p-swatch.active { transform: scale(1.2); box-shadow: 2px 2px 0px var(--ink); }

#submit-art {
  font-family: var(--font-body); font-weight: bold; font-size: 1.2rem;
  padding: 15px; background: var(--blue); color: #fff;
  border: 3px solid var(--ink); cursor: pointer;
  box-shadow: 5px 5px 0px var(--ink);
}
#submit-art:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0px var(--ink); }

#gallery {
  margin-top: 50px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 20px;
}
.gallery-item {
  width: 100px; height: 100px;
  display: grid; grid-template-columns: repeat(10, 1fr);
  border: 2px solid var(--ink); background: #fff;
}
.g-pixel { width: 100%; height: 100%; }

/* =========================================
   9. INTERACTIVE & CHAOS (BACKGROUND)
   ========================================= */

/* --- Stickers (Draggable) --- */
#chaos-layer {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 100; pointer-events: none;
}
.sticker {
  position: absolute;
  transition: transform 0.1s linear;
  pointer-events: auto; /* Allow clicking */
  cursor: grab;
}
.sticker:active { cursor: grabbing; z-index: 1000; }

/* Shapes */
.star-1 { top: 10%; right: 10%; width: 0; height: 0; border-left: 40px solid transparent; border-right: 40px solid transparent; border-bottom: 80px solid var(--pop); transform: rotate(15deg); }
.star-1::after { content: ""; position: absolute; top: 25px; left: -40px; width: 0; height: 0; border-left: 40px solid transparent; border-right: 40px solid transparent; border-top: 80px solid var(--pop); }
.circle-1 { bottom: 10%; left: 5%; width: 120px; height: 120px; background: var(--blue); border-radius: 50%; mix-blend-mode: multiply; opacity: 0.8; }
.square-1 { top: 40%; left: 20%; width: 50px; height: 50px; border: 4px solid var(--ink); background: var(--acid); transform: rotate(-10deg); }
.donut-1 { top: 15%; left: 35%; width: 60px; height: 60px; border: 15px solid var(--pink); border-radius: 50%; }
.bolt-1 { top: 60%; right: 20%; width: 40px; height: 120px; background: var(--ink); transform: skewX(-20deg) rotate(10deg); }

/* --- Sparkles (Cursor Trail) --- */
#sparkles-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 999999;
}
.sparkle {
  position: absolute; width: 6px; height: 6px; background: var(--pop);
  border-radius: 50%; pointer-events: none; animation: fallFade 0.8s forwards;
}
@keyframes fallFade {
  0% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.2) translateY(20px); }
}

/* --- Cursor Blob --- */
#blob {
  position: fixed; width: 20px; height: 20px;
  background: var(--pop); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
}
body.hovering #blob { width: 60px; height: 60px; opacity: 0.5; background: var(--blue); }

/* --- Graffiti Canvas --- */
#graffiti-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9000; pointer-events: none;
}
body.draw-mode #graffiti-canvas { pointer-events: all; background: rgba(255, 255, 255, 0.4); }

/* =========================================
   10. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
  /* Stack Layout */
  .sidebar {
    position: relative; width: 100% !important; height: auto;
    padding-top: 20px; border-right: none;
    border-bottom: 3px solid var(--ink);
    overflow-y: visible;
  }
  
  .sidebar ul li a { text-align: center; border: none; }
  
  .content {
    margin-left: 0 !important;
    padding: 20px 20px !important;
  }
  
  .markdown-section { padding: 30px !important; }
  
  /* Disable heavy interactive elements on mobile */
  .sticker, #blob, #graffiti-canvas, .tools-wrapper { display: none; }
  
  /* Move Pro Link inline or adjust position */
  .pro-link {
    position: relative; top: auto; right: auto;
    margin: 20px auto; display: inline-block;
    z-index: 1000;
  }
  
  /* Restore default cursor */
  body { cursor: auto; }
}

/* --- CONTENT AREA (Wider) --- */
.content {
  margin-left: var(--sidebar-w) !important;
  /* Reduced side padding, increased max-width */
  padding: 40px 40px !important; 
  max-width: 1200px; 
  position: relative; 
  z-index: 150;
}

.markdown-section {
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 12px 12px 0px var(--ink);
  margin-top: 20px;
}

/* Mobile Tweak */
@media (max-width: 768px) {
  .content { padding: 20px !important; }
  .markdown-section { padding: 30px 20px !important; }
}
