/* ============================================
   ABHISHEK IJ - DARK DEMONIC PORTFOLIO
   Premium cinematic dark theme
   ============================================ */

/* CSS Variables */
:root {
  /* Colors - Obsidian & Blood Crimson */
  --bg-obsidian: #0a0a0f;
  --bg-charcoal: #12121a;
  --glass-dark: rgba(18, 18, 26, 0.7);
  --glass-border: rgba(139, 0, 0, 0.2);
  --blood-crimson: #8b0000;
  --crimson-glow: rgba(139, 0, 0, 0.6);
  --crimson-bright: #b22222;
  --ruby-soft: #cd5c5c;
  --text-primary: #e8e6e3;
  --text-secondary: #a0a0a0;
  --text-muted: #6b6b6b;
  
  /* Shadows */
  --shadow-deep: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 30px rgba(139, 0, 0, 0.3);
  --shadow-glow-hover: 0 0 40px rgba(139, 0, 0, 0.5);
  
  /* Spacing & Layout */
  --nav-height: 70px;
  --section-padding: 100px;
  --container-max: 1200px;
  
  /* Transitions */
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-obsidian);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Animation Container - Behind Content */
.bg-animation-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Fog/Smoke Layer */
.fog-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: 
    linear-gradient(135deg, 
      transparent 0%, 
      rgba(139, 0, 0, 0.08) 25%, 
      transparent 50%,
      rgba(139, 0, 0, 0.06) 75%,
      transparent 100%);
  animation: fogDrift 25s linear infinite;
  opacity: 0.8;
}

@keyframes fogDrift {
  0% { transform: translateX(0) translateZ(0); }
  100% { transform: translateX(-50%) translateZ(0); }
}

/* Ember particle container */
.embers-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.ember {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205, 92, 92, 0.8) 0%, rgba(139, 0, 0, 0.4) 40%, transparent 70%);
  will-change: transform;
  box-shadow: 0 0 10px rgba(205, 92, 92, 0.4);
}

/* Sparks layer */
.sparks-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.spark {
  position: absolute;
  background: rgba(255, 255, 200, 0.95);
  clip-path: polygon(
    50% 0%, 61% 35%, 100% 50%, 61% 65%,
    50% 100%, 39% 65%, 0% 50%, 39% 35%
  );
  box-shadow:
    0 0 2px rgba(255, 255, 255, 1),
    0 0 4px rgba(255, 255, 200, 0.9),
    0 0 6px rgba(255, 220, 100, 0.6);
  transform-origin: center;
}

/* Main content - above background */
.main-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

/* ========== NAVIGATION ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--glass-dark);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  transition: var(--transition-smooth);
}

.nav.scrolled {
  box-shadow: var(--shadow-deep);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  text-shadow: 0 0 20px var(--crimson-glow);
  transition: var(--transition-fast);
}

.nav-logo:hover {
  text-shadow: 0 0 30px var(--crimson-glow), 0 0 60px rgba(139, 0, 0, 0.4);
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--crimson-bright);
  background: rgba(139, 0, 0, 0.15);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.2);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ========== SECTIONS ========== */
section {
  padding: var(--section-padding) 24px;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Clear fixed nav on inner pages */
section:first-of-type:not(.hero) {
  padding-top: calc(var(--nav-height) + 60px);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 48px;
  text-align: center;
  text-shadow: 0 0 30px var(--crimson-glow);
  color: var(--text-primary);
}

/* Glass Panels */
.glass-panel {
  background: var(--glass-dark);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-deep);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(139, 0, 0, 0.4);
  box-shadow: var(--shadow-deep), 0 0 30px rgba(139, 0, 0, 0.15);
}

/* ========== HOME / HERO ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: var(--nav-height) 24px 80px;
}

.hero-content {
  max-width: 800px;
}

.hero-greeting {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--crimson-bright);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-name {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  text-shadow: 0 0 40px var(--crimson-glow), 0 0 80px rgba(139, 0, 0, 0.3);
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
}

.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--text-secondary);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-quote {
  font-size: 1rem;
  font-style: italic;
  color: var(--ruby-soft);
  max-width: 500px;
  margin: 0 auto 48px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
}

.hero-cta {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 1s;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-smooth);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blood-crimson), var(--crimson-bright));
  color: white;
  box-shadow: 0 4px 20px rgba(139, 0, 0, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(139, 0, 0, 0.5), var(--shadow-glow-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--crimson-bright);
  border: 2px solid var(--blood-crimson);
}

.btn-secondary:hover {
  background: rgba(139, 0, 0, 0.2);
  box-shadow: 0 0 25px rgba(139, 0, 0, 0.3);
}

/* ========== ABOUT ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

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

.bio-panel {
  padding: 40px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.skill-tag {
  padding: 12px 16px;
  background: rgba(139, 0, 0, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  text-align: center;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.skill-tag:hover {
  background: rgba(139, 0, 0, 0.2);
  border-color: var(--blood-crimson);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.3);
  transform: translateY(-2px);
}

/* ========== EXPERIENCE TIMELINE ========== */
.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--blood-crimson), transparent);
  opacity: 0.5;
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  padding-bottom: 48px;
  opacity: 0;
  transform: translateY(30px);
}

.timeline-item.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blood-crimson);
  box-shadow: 0 0 20px var(--crimson-glow);
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--crimson-bright);
  margin-bottom: 8px;
}

.timeline-role {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-company {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.timeline-desc ul {
  list-style: none;
  padding-left: 0;
}

.timeline-desc li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.timeline-desc li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--crimson-bright);
}

/* ========== EDUCATION CARDS ========== */
.education-grid {
  display: grid;
  gap: 32px;
  max-width: 700px;
  margin: 0 auto;
}

.edu-card {
  opacity: 0;
  transform: translateY(30px);
}

.edu-card.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.edu-card .glass-panel {
  padding: 40px;
}

.edu-school {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--crimson-bright);
}

.edu-degree {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.edu-period {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.edu-gpa {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--ruby-soft);
}

.edu-coursework {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== PROJECTS ========== */
.projects-list {
  max-width: 800px;
  margin: 0 auto;
}

.project-item {
  margin-bottom: 24px;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.project-item.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.project-header {
  padding: 24px 32px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass-dark);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: var(--transition-smooth);
}

.project-header:hover {
  border-color: rgba(139, 0, 0, 0.4);
  box-shadow: 0 0 25px rgba(139, 0, 0, 0.2);
}

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.project-year {
  font-size: 0.9rem;
  color: var(--crimson-bright);
}

.project-expand {
  font-size: 1.5rem;
  color: var(--crimson-bright);
  transition: transform var(--transition-fast);
}

.project-item.expanded .project-expand {
  transform: rotate(180deg);
}

.project-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.project-item.expanded .project-content {
  max-height: 800px;
}

.project-body {
  padding: 24px 32px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  margin-top: -1px;
}

.project-body p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

/* ========== RESEARCH ========== */
.research-list {
  max-width: 800px;
  margin: 0 auto;
}

.research-item {
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(30px);
}

.research-item.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.research-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--crimson-bright);
}

.research-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.research-desc {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== ACHIEVEMENTS ========== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.achievement-card {
  opacity: 0;
  transform: translateY(30px);
}

.achievement-card.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.achievement-card .glass-panel {
  padding: 28px;
  height: 100%;
}

.achievement-card .glass-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-deep), 0 0 35px rgba(139, 0, 0, 0.2);
}

.achievement-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--crimson-bright);
}

.achievement-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== CONTACT ========== */
.contact-section {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px 20px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blood-crimson);
  box-shadow: 0 0 25px rgba(139, 0, 0, 0.3);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-info {
  margin-top: 48px;
  padding: 32px;
  background: var(--glass-dark);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.contact-info h3 {
  margin-bottom: 20px;
  color: var(--crimson-bright);
}

.contact-info a {
  color: var(--ruby-soft);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.contact-info a:hover {
  color: var(--crimson-bright);
  text-shadow: 0 0 10px var(--crimson-glow);
}

/* ========== FOOTER ========== */
.footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll reveal base */
.reveal {
  opacity: 0;
  transform: translateY(40px);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--glass-dark);
    backdrop-filter: blur(20px);
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
  }
  
  .nav-links.open {
    display: flex;
  }
  
  .nav-toggle {
    display: block;
  }
  
  :root {
    --section-padding: 60px;
  }
  
  .project-header {
    flex-wrap: wrap;
    gap: 12px;
  }
}
