/* ==========================================================================
   CSS Variables & Design System
   ========================================================================== */
:root {
  /* Colors */
  --bg-color: #050505;
  --bg-grid: rgba(255, 255, 255, 0.03);
  --text-main: #f5f5f5;
  --text-muted: #888888;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  
  /* Fonts */
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Dynamic Accent Colors handled by body classes */
}

/* Light Mode Overrides */
body.light-mode {
  --bg-color: #f3f4f6;
  --bg-grid: rgba(0, 0, 0, 0.05);
  --text-main: #111827;
  --text-muted: #6b7280;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.1);
}

body.light-mode .bg-text {
  color: #000;
}

body.theme-orange {
  --accent-color: #ff5722;
  --accent-glow: rgba(255, 87, 34, 0.2);
}

body.theme-purple {
  --accent-color: #9d4edd;
  --accent-glow: rgba(157, 78, 221, 0.2);
}

body.theme-cyan {
  --accent-color: #00f5d4;
  --accent-glow: rgba(0, 245, 212, 0.2);
}

body.theme-red {
  --accent-color: #e63946;
  --accent-glow: rgba(230, 57, 70, 0.2);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

.mono-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

/* ==========================================================================
   Background Grid & Layers
   ========================================================================== */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.bg-text-layer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  opacity: 0.02;
  user-select: none;
}

.bg-text {
  font-size: 25vw;
  font-weight: 800;
  white-space: nowrap;
  color: #fff;
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
  position: relative;
}

/* Scroll Status Sidebar */
.scroll-status {
  position: fixed;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%) translateZ(0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 50;
  mix-blend-mode: difference;
}

.scroll-status span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--text-muted);
}

.scroll-bar {
  width: 2px;
  height: 100px;
  background-color: var(--glass-border);
  position: relative;
}

.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: var(--accent-color);
  transition: background-color 0.3s ease;
}

/* ==========================================================================
   Components
   ========================================================================== */
.glassmorphism {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  font-weight: 600;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #000;
  border: 1px solid var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--accent-color);
  box-shadow: 0 0 25px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.btn-outline:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-2px);
}

/* ==========================================================================
   Sections
   ========================================================================== */
section {
  padding: 8rem 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

.section-title .subtitle {
  display: block;
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: normal;
}

/* Hero Section */
.hero-section {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.hero-content {
  flex: 1;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 0.95;
  margin-bottom: 2rem;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.hero-bio {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.hero-card {
  width: 320px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.info-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  color: var(--accent-color);
}

.info-value {
  font-size: 1.2rem;
  font-weight: 500;
}

.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-box {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Stack Section */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}

.stack-heading {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.stack-heading::before {
  content: '';
  display: inline-block;
  width: 15px;
  height: 1px;
  background-color: var(--accent-color);
  margin-right: 10px;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  transition: color 0.3s ease;
}

.stack-list li:hover {
  color: var(--text-main);
}

.stack-list svg {
  width: 18px;
  height: 18px;
  color: var(--accent-color);
}

/* Archive Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.project-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.project-card:hover::before {
  opacity: 1;
}

.project-content, .project-links {
  position: relative;
  z-index: 1;
}

.project-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags span {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent-color);
}

.project-links {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

.icon-link {
  color: var(--text-muted);
  transition: color 0.3s;
}

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

.icon-link svg {
  width: 20px;
  height: 20px;
}

/* Contact Section */
.contact-section {
  text-align: center;
  align-items: center;
  min-height: 70vh;
}

.contact-desc {
  align-items: center;
  max-width: 600px;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.2rem;
}

.contact-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

/* Footer */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
}

/* Theme Switcher */
.theme-switcher {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  border-radius: 50px;
  z-index: 100;
}

.theme-btn {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-btn:hover {
  transform: scale(1.1);
}

.theme-btn.active {
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* Mode Toggle */
.mode-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all 0.3s ease;
}

.mode-toggle:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.1);
}

.mode-toggle .icon-moon {
  display: none;
}

body.light-mode .mode-toggle .icon-sun {
  display: none;
}

body.light-mode .mode-toggle .icon-moon {
  display: block;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 900px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
    padding-top: 6rem;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .hero-bio {
    margin: 0 auto 2.5rem auto;
  }

  .scroll-status {
    display: none; /* Hide on smaller screens */
  }
  
  .bg-text {
    font-size: 35vw;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-actions {
    flex-direction: column;
  }
}
