/* CSS Variables */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --accent: #bada55;
  --accent-dim: rgba(186, 218, 85, 0.3);
  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --spacing-unit: 1rem;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grid Pattern Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(186, 218, 85, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(186, 218, 85, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* Subtle Background Animation */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 0%, rgba(186, 218, 85, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: pulse-bg 8s ease-in-out infinite;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Main Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero {
  margin-bottom: calc(var(--spacing-unit) * 4);
  animation: fade-in-up 0.8s ease-out forwards;
  opacity: 0;
}

.hero__title {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.hero__title .accent {
  color: var(--accent);
}

.hero__tagline {
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Blinking Cursor */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.2em;
  background-color: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Projects Section */
.projects {
  flex: 1;
  animation: fade-in-up 0.8s ease-out 0.2s forwards;
  opacity: 0;
}

.projects__heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.projects__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 0.5);
}

/* Project Link */
.project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.25);
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.project-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(186, 218, 85, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.project-link:hover {
  border-color: var(--accent-dim);
  transform: translateX(4px);
  box-shadow: 0 0 20px rgba(186, 218, 85, 0.1);
}

.project-link:hover::before {
  left: 100%;
}

.project-link__name {
  font-weight: 500;
  transition: color 0.3s ease;
}

.project-link:hover .project-link__name {
  color: var(--accent);
}

.project-link__arrow {
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
  color: var(--accent);
}

.project-link:hover .project-link__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: calc(var(--spacing-unit) * 4);
  animation: fade-in-up 0.8s ease-out 0.4s forwards;
  opacity: 0;
}

.footer__text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== */
/* 404 Page Styles      */
/* ==================== */

.canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#star-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  text-align: center;
  padding: var(--spacing-unit);
}

.error-overlay__code {
  font-size: clamp(6rem, 25vw, 12rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  text-shadow:
    0 0 40px rgba(186, 218, 85, 0.5),
    0 0 80px rgba(186, 218, 85, 0.3);
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% {
    text-shadow:
      0 0 40px rgba(186, 218, 85, 0.5),
      0 0 80px rgba(186, 218, 85, 0.3);
  }
  50% {
    text-shadow:
      0 0 60px rgba(186, 218, 85, 0.7),
      0 0 120px rgba(186, 218, 85, 0.4);
  }
}

.error-overlay__message {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: calc(var(--spacing-unit) * 1.5) 0;
  max-width: 400px;
}

.error-overlay__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.error-overlay__link:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 30px rgba(186, 218, 85, 0.4);
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1.5);
  }

  .project-link {
    padding: calc(var(--spacing-unit) * 0.875) calc(var(--spacing-unit) * 1);
  }
}
