/* ===== VARIABLES ===== */
:root {
  /* Base properties */
  --font-family: "Fira Code", monospace;
  --animation-duration: 0.8s;
  --text-color: #ffffff;

  /* Default theme (Cyberpunk) */
  --primary-color: #00fffc;
  --primary-color-rgb: 0, 255, 252;
  --secondary-color: #fc00ff;
  --accent-color: #fffc00;
  --bg-gradient: linear-gradient(45deg, rgba(0, 0, 50, 0.8), rgba(0, 0, 0, 0.8));
  --glow-color: rgba(0, 255, 252, 0.7);
}

/* Theme variations */
:root.theme-matrix {
  --primary-color: #00ff41;
  --primary-color-rgb: 0, 255, 65;
  --secondary-color: #003b00;
  --accent-color: #39ff14;
  --bg-gradient: linear-gradient(45deg, rgba(0, 20, 0, 0.8), rgba(0, 0, 0, 0.9));
  --glow-color: rgba(0, 255, 65, 0.7);
}

:root.theme-synthwave {
  --primary-color: #ff00ff;
  --primary-color-rgb: 255, 0, 255;
  --secondary-color: #00ffff;
  --accent-color: #ff3377;
  --bg-gradient: linear-gradient(45deg, rgba(50, 0, 60, 0.8), rgba(0, 0, 20, 0.9));
  --glow-color: rgba(255, 0, 255, 0.7);
}

:root.theme-hacker {
  --primary-color: #0f0;
  --primary-color-rgb: 0, 255, 0;
  --secondary-color: #080;
  --accent-color: #8f8;
  --bg-gradient: linear-gradient(45deg, rgba(0, 10, 0, 0.9), rgba(0, 0, 0, 1));
  --glow-color: rgba(0, 255, 0, 0.7);
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: #000;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  cursor: none;
}

/* ===== LOADER ===== */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.loader-content {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-text {
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--primary-color);
}

.dot {
  display: inline-block;
  opacity: 0;
  animation: dotPulse 1.5s infinite;
}

.dot:nth-of-type(1) {
  animation-delay: 0s;
}

.dot:nth-of-type(2) {
  animation-delay: 0.5s;
}

.dot:nth-of-type(3) {
  animation-delay: 1s;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

/* Hide content until loaded */
#content.hidden {
  opacity: 0;
  pointer-events: none;
}

#content {
  transition: opacity 1s ease-in;
  opacity: 1;
}

/* ===== BACKGROUNDS ===== */
/* Particles */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Video background */
#video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  background-color: #0a0a15; /* Lighter dark blue background */
  background-image: linear-gradient(135deg, #0a0a25 0%, #0d0f28 50%, #0a0a20 100%);
}

#player {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.6;
}

/* Dark overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(10, 10, 40, 0.6) 0%, rgba(10, 15, 30, 0.7) 100%);
  z-index: -1;
  box-shadow: inset 0 0 150px rgba(0, 255, 252, 0.08);
}

/* Matrix rain effect */
.matrix-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: none;
}

/* ===== MAIN CONTENT ===== */
#center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 1200px;
  z-index: 10;
  text-align: center;
  animation: fadeIn 1s ease-in-out 0.5s both;
}

/* ===== ANALOG CLOCK ===== */
.clock-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem auto 2rem;
  width: 100%;
}

.analog-clock {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(10, 10, 20, 0.7);
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 10px var(--glow-color), inset 0 0 10px var(--glow-color);
  display: flex;
  justify-content: center;
  align-items: center;
}

.clock-face {
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotate(180deg); /* Start at 12 o'clock */
}

/* Clock tick marks */
.tick {
  position: absolute;
  width: 2px;
  height: 8px;
  background: var(--primary-color);
  left: 50%;
  top: 5px; /* Position at top of clock face */
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  box-shadow: 0 0 3px var(--glow-color);
  z-index: 2;
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom;
  border-radius: 2px;
  background: var(--primary-color);
  box-shadow: 0 0 5px var(--glow-color);
  transform: translateX(-50%);
}

.hour-hand {
  width: 4px;
  height: 30px;
  background: var(--primary-color);
  z-index: 3;
}

.minute-hand {
  width: 3px;
  height: 45px;
  background: var(--primary-color);
  z-index: 2;
}

.second-hand {
  width: 2px;
  height: 50px;
  background: #87cefa; /* Light blue */
  z-index: 1;
}

/* Arrow for second hand */
.second-hand::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 8px solid #87cefa; /* Light blue */
  filter: drop-shadow(0 0 3px rgba(135, 206, 250, 0.7));
}

/* Hour numbers */
.hour-number {
  position: absolute;
  font-size: 12px;
  font-weight: bold;
  color: var(--primary-color);
  text-shadow: 0 0 3px var(--glow-color);
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
  transform: translate(-50%, -50%) rotate(180deg); /* Counter-rotate to make numbers upright */
}

.center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--primary-color);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 5px var(--glow-color);
  z-index: 4;
}

/* Site Title */
.site-title {
  font-size: 4rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-transform: lowercase;
  letter-spacing: 2px;
  color: var(--primary-color);
  text-shadow: 0 0 20px var(--glow-color);
  position: relative;
  animation: fadeInDown 1s ease-in-out;
  width: 100%;
  display: block;
  text-align: center;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
}

/* Title glitch effect */
.site-title::before,
.site-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  clip: rect(0, 900px, 0, 0);
}

.site-title::before {
  left: 2px;
  text-shadow: -2px 0 var(--secondary-color);
  animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.site-title::after {
  left: -2px;
  text-shadow: 2px 0 var(--accent-color);
  animation: glitch-anim-2 7s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% {
    clip: rect(20px, 9999px, 21px, 0);
  }
  5% {
    clip: rect(37px, 9999px, 4px, 0);
  }
  10% {
    clip: rect(87px, 9999px, 59px, 0);
  }
  15% {
    clip: rect(10px, 9999px, 13px, 0);
  }
  20% {
    clip: rect(28px, 9999px, 63px, 0);
  }
  25% {
    clip: rect(20px, 9999px, 44px, 0);
  }
  30% {
    clip: rect(54px, 9999px, 82px, 0);
  }
  35% {
    clip: rect(42px, 9999px, 67px, 0);
  }
  40% {
    clip: rect(57px, 9999px, 9px, 0);
  }
  45% {
    clip: rect(34px, 9999px, 38px, 0);
  }
  50% {
    clip: rect(80px, 9999px, 72px, 0);
  }
  55% {
    clip: rect(60px, 9999px, 78px, 0);
  }
  60% {
    clip: rect(44px, 9999px, 23px, 0);
  }
  65% {
    clip: rect(90px, 9999px, 55px, 0);
  }
  70% {
    clip: rect(37px, 9999px, 14px, 0);
  }
  75% {
    clip: rect(75px, 9999px, 5px, 0);
  }
  80% {
    clip: rect(15px, 9999px, 68px, 0);
  }
  85% {
    clip: rect(83px, 9999px, 43px, 0);
  }
  90% {
    clip: rect(30px, 9999px, 56px, 0);
  }
  95% {
    clip: rect(69px, 9999px, 72px, 0);
  }
  100% {
    clip: rect(18px, 9999px, 50px, 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip: rect(14px, 9999px, 27px, 0);
  }
  5% {
    clip: rect(62px, 9999px, 33px, 0);
  }
  10% {
    clip: rect(12px, 9999px, 7px, 0);
  }
  15% {
    clip: rect(31px, 9999px, 71px, 0);
  }
  20% {
    clip: rect(45px, 9999px, 26px, 0);
  }
  25% {
    clip: rect(73px, 9999px, 2px, 0);
  }
  30% {
    clip: rect(9px, 9999px, 72px, 0);
  }
  35% {
    clip: rect(40px, 9999px, 15px, 0);
  }
  40% {
    clip: rect(22px, 9999px, 60px, 0);
  }
  45% {
    clip: rect(28px, 9999px, 49px, 0);
  }
  50% {
    clip: rect(53px, 9999px, 37px, 0);
  }
  55% {
    clip: rect(67px, 9999px, 48px, 0);
  }
  60% {
    clip: rect(11px, 9999px, 10px, 0);
  }
  65% {
    clip: rect(84px, 9999px, 28px, 0);
  }
  70% {
    clip: rect(35px, 9999px, 15px, 0);
  }
  75% {
    clip: rect(38px, 9999px, 82px, 0);
  }
  80% {
    clip: rect(42px, 9999px, 6px, 0);
  }
  85% {
    clip: rect(70px, 9999px, 55px, 0);
  }
  90% {
    clip: rect(9px, 9999px, 77px, 0);
  }
  95% {
    clip: rect(61px, 9999px, 18px, 0);
  }
  100% {
    clip: rect(52px, 9999px, 39px, 0);
  }
}

/* Quote styles */
.quote-container {
  position: relative;
  width: 80%;
  max-width: 800px;
  margin: 2rem auto 3rem;
  padding: 0;
  text-align: center;
}

.quote-text {
  display: inline-block;
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--text-color);
  position: relative;
  white-space: normal;
  margin: 0 auto;
  max-width: 90%;
  width: auto;
  border-right: 3px solid var(--primary-color);
  animation: blink-caret 0.75s step-end 2s infinite;
  text-shadow: 0 0 10px var(--glow-color);
  letter-spacing: 1px;
  opacity: 0;
  animation: fade-in 0.5s ease-in 0.5s forwards;
}

.quote-text.typing-done {
  width: auto;
  border-right: none;
  animation: none;
  opacity: 1;
}

.quote-text::before,
.quote-text::after {
  content: "\201C"; /* Opening quotation mark */
  font-family: Georgia, serif;
  font-size: 1.8rem;
  color: var(--primary-color);
  position: relative;
  top: 5px;
  margin: 0 0.2rem;
}

.quote-text::after {
  content: "\201D"; /* Closing quotation mark */
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

/* Info boxes */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 90%;
  max-width: 1000px;
  margin: 2rem auto 0;
}

.info-box {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  color: var(--text-color);
  transition: all 0.3s ease;
  border-left: 3px solid var(--primary-color);
  animation: fadeInUp 0.6s both;
  animation-delay: calc(var(--animation-order) * 0.1s);
  transform-origin: center;
}

.info-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.3);
  background-color: rgba(10, 10, 20, 0.8);
}

/* Animation for info boxes */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Media query for smaller screens */
@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== CONTROLS ===== */
.controls {
  position: fixed;
  z-index: 100;
  pointer-events: auto;
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  border: none;
  color: var(--primary-color);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 5px var(--primary-color);
  margin: 10px;
}

.control-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6), 0 0 10px var(--primary-color);
}

/* Theme switcher */
#theme-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
}

/* Audio controls */
.audio-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
}

.volume-slider-container {
  width: 0;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 25px;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-right: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 5px var(--primary-color);
  transition: width 0.3s ease, padding 0.3s ease;
}

.audio-controls:hover .volume-slider-container {
  width: 130px;
  padding: 0 15px;
}

#volume-slider {
  width: 100%;
  margin: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 0 5px var(--primary-color);
}

#volume-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 5px var(--primary-color);
}

/* ===== CUSTOM CURSOR ===== */
.cursor {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: width 0.3s, height 0.3s, border-color 0.3s;
  mix-blend-mode: difference;
}

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: background-color 0.3s;
}

.interactive:hover ~ .cursor {
  width: 60px;
  height: 60px;
  border-color: var(--accent-color);
}

.interactive:hover ~ .cursor-dot {
  background-color: var(--accent-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1200px) {
  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .site-title {
    font-size: 3.5rem;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .site-title {
    font-size: 2.5rem;
  }

  .quote-container {
    width: 95%;
    padding: 1.5rem;
  }

  .quote-text {
    font-size: 1rem;
  }

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

  .control-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}
