/* ===========================
   GROISE — Infinite Scroll ASCII
   =========================== */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --text: #e0e0e0;
  --accent: #00ff00;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  line-height: 1.2;
  overflow-x: hidden;
  cursor: none;
}

.site-footer {
  display: none;
}

/* ===========================
   Custom Cursor
   =========================== */

#custom-cursor {
  position: fixed;
  width: 120px;
  height: 120px;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

#custom-cursor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #FF0000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.cursor-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #FF0000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

/* ===========================
   ASCII Background
   =========================== */

#ascii-background {
  position: fixed;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: auto;
  max-height: none;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(14px, 2vw, 28px);
  line-height: 1.6;
  color: #000000;
  opacity: 1;
  white-space: pre-wrap;
  text-align: center;
  display: block;
  padding: 20px 0;
}

/* ===========================
   Project Grid - Centered Background
   =========================== */

.project-grid {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 1fr;
  gap: 20px;
  padding: 40px;
  pointer-events: none;
}

.project-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  background: rgba(255, 0, 0, 0.05);
  border: 2px solid #FF0000;
  color: #FF0000;
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  pointer-events: auto;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5), 0 0 30px rgba(255, 0, 0, 0.3);
}

.project-box:hover {
  background: rgba(255, 0, 0, 0.15);
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.8), 0 0 60px rgba(255, 0, 0, 0.6), 0 0 80px rgba(255, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
  }
  
  .project-box {
    width: 80px;
    height: 80px;
    font-size: 14px;
  }
  
  /* Adjust audio bar for mobile */
  #audio-bar {
    bottom: 20px;
    left: 20px;
    width: calc(100% - 40px);
  }
  
  /* Smaller playhead and time */
  #audio-playhead {
    font-size: 16px;
    top: -18px;
  }
  
  #time-display {
    font-size: 10px;
  }
  
  /* Move volume toggle to better position */
  #volume-toggle {
    bottom: 30px;
    right: 20px;
    font-size: 12px;
    padding: 4px 8px;
  }
  
  /* Adjust ASCII background */
  #ascii-background {
    font-size: clamp(12px, 2vw, 24px);
    line-height: 1.5;
  }
  
  /* Reduce scroll container top padding */
  #scroll-container {
    padding-top: 30px;
  }
}

/* ===========================
   Infinite Scroll Container
   =========================== */

#scroll-container {
  position: relative;
  z-index: 10;
  padding-top: 60px;
}

.scroll-section {
  position: relative;
  overflow: visible;
}

.ascii-element {
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-10px) rotate(calc(var(--r, 0deg) + 2deg)); }
}

.chaos-overlay {
  animation: pulse-chaos 2s ease-in-out infinite;
}

@keyframes pulse-chaos {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .ascii-element,
  .chaos-overlay {
    animation: none !important;
  }
}

/* ===========================
   Audio Progress Bar
   =========================== */

#audio-bar {
  position: fixed;
  bottom: 90px;
  left: 50px;
  width: calc(100% - 100px);
  height: 4px;
  background: rgba(255, 0, 0, 0.3);
  z-index: 10001;
  cursor: pointer;
  transition: height 0.2s ease;
}

#audio-bar:hover {
  height: 6px;
}

#audio-progress {
  height: 100%;
  width: 0%;
  background: #FF0000;
  transition: width 0.1s linear;
  pointer-events: none;
}

#audio-playhead {
  position: absolute;
  top: -20px;
  left: 0%;
  color: #FF0000;
  font-size: 20px;
  font-weight: bold;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  transition: left 0.1s linear;
  white-space: nowrap;
}

#audio-playhead.dragging {
  cursor: grabbing;
  transition: none;
}

#time-display {
  margin-left: 5px;
  font-size: 12px;
  font-weight: normal;
}

#prompt-button {
  position: fixed;
  bottom: 50px;
  right: 170px;
  color: #FF0000;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  padding: 5px 10px;
  border: 2px solid #FF0000;
  background: transparent;
  user-select: none;
  transition: all 0.2s ease;
}

#prompt-button:hover {
  background: rgba(255, 0, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-left: 1px solid #FF0000;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #FF0000;
  border-radius: 0;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #ff4444;
}

/* Firefox scrollbar */
.modal-body {
  scrollbar-width: thin;
  scrollbar-color: #FF0000 #1a1a1a;
}

#volume-toggle {
  position: fixed;
  bottom: 50px;
  right: 50px;
  color: #FF0000;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  padding: 5px 10px;
  border: 2px solid #FF0000;
  background: transparent;
  user-select: none;
  transition: all 0.2s ease;
}

#volume-toggle:hover {
  background: rgba(255, 0, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #0a0a0a;
  border: 3px solid #FF0000;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.7);
  max-width: 800px;
  max-height: 80vh;
  width: 100%;
  position: relative;
  font-family: "Courier New", Courier, monospace;
  color: #e0e0e0;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #FF0000;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  z-index: 1;
}

.modal-close:hover {
  color: #ff4444;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.modal-body {
  padding: 40px 30px 30px;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

.modal-body h2 {
  color: #FF0000;
  font-size: 18px;
  margin: 0 0 20px 0;
  text-align: center;
  border-bottom: 2px solid #FF0000;
  padding-bottom: 10px;
}

.modal-body h3 {
  color: #FF0000;
  font-size: 16px;
  margin: 25px 0 10px 0;
  font-weight: bold;
}

.modal-body h4 {
  color: #ff6666;
  font-size: 14px;
  margin: 20px 0 10px 0;
  font-weight: bold;
}

.modal-body p {
  margin: 10px 0;
  line-height: 1.6;
  font-size: 13px;
}

.modal-body ul {
  margin: 10px 0;
  padding-left: 20px;
}

.modal-body li {
  margin: 5px 0;
  line-height: 1.6;
  font-size: 13px;
}

.modal-body strong {
  color: #ff8888;
}

@media (max-width: 768px) {
  #prompt-button {
    bottom: 30px;
    right: 90px;
    font-size: 12px;
    padding: 4px 8px;
  }
  
  .modal {
    padding: 10px;
  }
  
  .modal-content {
    max-height: 90vh;
    border-width: 2px;
  }
  
  .modal-body {
    padding: 35px 20px 20px;
    max-height: calc(90vh - 55px);
    font-size: 12px;
  }
  
  .modal-body h2 {
    font-size: 16px;
  }
  
  .modal-body h3 {
    font-size: 14px;
  }
  
  .modal-body h4 {
    font-size: 13px;
  }
  
  .modal-body p,
  .modal-body li {
    font-size: 12px;
  }
}

#audio-selector {
  position: fixed;
  bottom: 50px;
  left: 50px;
  display: flex;
  gap: 10px;
  z-index: 10001;
}

.audio-mode {
  color: #FF0000;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 5px 10px;
  border: 2px solid #FF0000;
  background: transparent;
  user-select: none;
  transition: all 0.2s ease;
}

.audio-mode:hover {
  background: rgba(255, 0, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.audio-mode.active {
  background: rgba(255, 0, 0, 0.3);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.7);
}

@media (max-width: 768px) {
  #audio-selector {
    bottom: 30px;
    left: 20px;
    gap: 8px;
  }
  
  .audio-mode {
    font-size: 14px;
    padding: 4px 8px;
  }
}
