/* ═══════════════════════════════════════════════════════════════
   NAVDEEP RANA — PORTFOLIO
   Tajmirul-inspired muted dark theme, loading reveal, grid stack
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0c0c0c;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #ededed;
  --text-secondary: #a3a3a3;
  --text-muted: #666;
  --accent: #ededed;
  --accent-dim: rgba(255, 255, 255, 0.05);
  --font-display: 'Anton', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
}
a { color: inherit; text-decoration: none; }
::selection { background: #fff; color: #000; }

/* ── Loading Screen ───────────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease 0.1s, visibility 0.5s ease 0.1s;
}
.loader-text {
  font-family: var(--font-display);
  font-size: clamp(36px, 8vw, 80px);
  color: var(--text);
  letter-spacing: 8px;
  text-transform: uppercase;
  overflow: visible;
  position: relative;
}

/* Phase 1: Letters appear — slide up, right-to-left stagger */
.loader-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px);
  animation: loaderIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loaderIn {
  to { opacity: 1; transform: translateY(0); }
}


/* ── Trippy Cursor (mix-blend-mode difference) ────────────────── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cursor.hover {
  width: 80px;
  height: 80px;
}
.cursor.click {
  width: 10px;
  height: 10px;
}
/* Trail hidden — single cursor only */
.cursor-trail { display: none; }
@media (max-width: 768px) {
  .cursor { display: none; }
  body { cursor: auto; }
}

/* ── Stars Canvas ─────────────────────────────────────────────── */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ── Navigation ───────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  z-index: 100;
}
.nav-logo {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 2px;
  color: #fff;
  text-transform: lowercase;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.5;
  transition: opacity 0.3s;
}
.nav-links a:hover, .nav-links a.active { opacity: 1; }

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 9996;
  flex-direction: column;
  gap: 5px;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Vertical email (fixed right side, desktop only) */
.side-email {
  position: fixed;
  right: 28px;
  bottom: 0;
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
}
.side-email::after {
  content: '';
  width: 1px;
  height: 80px;
  background: var(--text-muted);
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 140px 48px 80px;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 12vw, 120px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.hero-title-line {
  display: block;
  overflow: hidden;
}
.hero-title-line span {
  display: inline-block;
}
.hero-title .outline {
  -webkit-text-stroke: 1.5px var(--text);
  color: transparent;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 40px;
}
.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 80px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
  transition: all 0.3s;
}
.btn-primary {
  background: #fff;
  color: #000;
}
.btn-primary:hover { background: #ddd; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text); }

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 48px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.scroll-hint-line {
  width: 48px; height: 1px;
  background: var(--text-muted);
  position: relative;
  overflow: hidden;
}
.scroll-hint-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--text);
  animation: scrollLine 2s ease infinite;
}

/* ── Sections ─────────────────────────────────────────────────── */
.section {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 48px;
  max-width: 500px;
}
.section-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* ── About ────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  margin-top: 32px;
}
.about-text p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
  font-size: 14px;
}
.about-text strong { color: var(--text); }
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-label { color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.detail-value { font-weight: 500; }

/* ── Tech Stack Grid (tajmirul-style) ─────────────────────────── */
.stack-section { padding-bottom: 80px; }
.stack-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 32px;
}
.stack-category h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stack-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-secondary);
  transition: all 0.25s;
  letter-spacing: 0.3px;
}
.stack-item:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}
.stack-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dot-color, #666);
  flex-shrink: 0;
}

/* ── Timeline (Experience) ────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; margin-top: 32px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 8px; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 48px; }
.timeline-dot {
  position: absolute;
  left: -28px; top: 8px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-muted);
}
.timeline-item:first-child .timeline-dot {
  background: var(--text);
  border-color: var(--text);
}
.timeline-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.timeline-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.timeline-company {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.timeline-content ul { list-style: none; padding: 0; }
.timeline-content li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.timeline-content li::before {
  content: '';
  position: absolute;
  left: 0; top: 10px;
  width: 6px; height: 1px;
  background: var(--text-muted);
}

/* ── Projects (tajmirul hover-image style) ────────────────────── */
.projects-list { margin-top: 32px; }
.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
  position: relative;
}
.project-row:first-child { border-top: 1px solid var(--border); }
.project-row:hover { padding-left: 16px; }
.project-row:hover .project-title { opacity: 1; }
.project-row:hover .project-arrow { opacity: 1; transform: translateX(4px); }

.project-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  min-width: 40px;
}
.project-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 2px;
  text-transform: uppercase;
  flex: 1;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.project-tags-inline {
  display: flex;
  gap: 8px;
  margin-right: 24px;
}
.project-tags-inline span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
}
.project-arrow {
  font-size: 20px;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.3s;
}

/* Hover image that follows cursor */
.project-hover-img {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  width: 340px;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.project-hover-img.visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Certifications — row style + fixed right preview ─────────── */
.cert-row { cursor: default; }

.cert-preview-fixed {
  position: fixed;
  right: 48px;
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  width: 420px;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.cert-preview-fixed.visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

@media (max-width: 768px) {
  .cert-preview-fixed { display: none; }
}

/* ── Contact ──────────────────────────────────────────────────── */
.contact-section {
  text-align: center;
  padding: 160px 48px;
}
.contact-section .section-title {
  font-size: clamp(36px, 6vw, 64px);
  margin-bottom: 24px;
}
.contact-sub {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 48px;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.3s;
  padding: 10px 0;
}
.contact-link:hover { color: var(--text); }
.contact-link svg { flex-shrink: 0; }

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 32px 48px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* ── Animations ───────────────────────────────────────────────── */
/* Hero name — letters drop from above like falling from loader */
.hero-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(-120px) scale(1.1);
  animation: heroDrop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes heroDrop {
  0% {
    opacity: 0;
    transform: translateY(-120px) scale(1.1) rotate(-5deg);
  }
  50% {
    opacity: 1;
    transform: translateY(8px) scale(1) rotate(1deg);
  }
  70% {
    transform: translateY(-4px) scale(1) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes scrollLine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Scroll reveal — falls back down when scrolled away */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.fallen {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.4s ease, transform 0.8s cubic-bezier(0.55, 0, 1, 0.45);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 16px 24px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 12, 0.9);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 9990;
  }
  .nav { z-index: 9995; }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
  }
  .nav-links a {
    font-size: 20px;
    letter-spacing: 3px;
    color: #fff;
    opacity: 1;
  }
  .nav-links a:hover { color: #fff; }
  .hero { padding: 100px 24px 60px; }
  .hero-stats { gap: 28px; }
  .stat-num { font-size: 28px; }
  .section-inner { padding: 0 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .stack-categories { grid-template-columns: 1fr; gap: 32px; }
  .project-title { font-size: 18px; }
  .project-tags-inline { display: none; }
  .side-email { display: none; }
  .contact-links { flex-direction: column; align-items: center; }
  .certs-grid { grid-template-columns: 1fr; }
}
