/* ===========================
   CSS VARIABLES & RESET
=========================== */
:root {
  --bg:        #050810;
  --bg2:       #080d1a;
  --bg3:       #0d1428;
  --card:      #0f1830;
  --card-hover:#141e38;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(100,160,255,0.15);
  --accent:    #4a8fff;
  --accent2:   #6cb2ff;
  --gold:      #c9a84c;
  --text:      #e8eaf2;
  --text-muted:#7a8aaa;
  --text-dim:  #3d4d6a;
  --white:     #ffffff;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow:    0 4px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 60px rgba(74,143,255,0.08);
  --max-w:     1160px;
  --pad:       clamp(16px, 5vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; transition: color .2s; }
img { display: block; max-width: 100%; }

/* ===========================
   SCROLL REVEAL
=========================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===========================
   UTILITIES
=========================== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); }
.section    { padding: clamp(64px, 10vw, 120px) 0; }

.section-label {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 500;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 16px;
}
.section-title em { font-style: italic; color: var(--accent2); }
.section-sub {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 500px;
  margin-bottom: 48px;
}

/* ===========================
   BUTTONS
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .25s;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 0 30px rgba(74,143,255,0.3);
}
.btn-primary:hover { background: var(--accent2); box-shadow: 0 0 40px rgba(74,143,255,0.5); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: var(--border); color: var(--white); transform: translateY(-2px); }

/* ===========================
   LOGO
=========================== */
.logo {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 24px;
  color: var(--white);
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--white);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
  margin-right: 4px;
  box-shadow: 0 0 16px rgba(74,143,255,0.4);
}

/* ===========================
   HEADER
=========================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(5,8,16,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 2px;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width .25s;
}
.nav a:hover { color: var(--white); }
.nav a:hover::after { width: 100%; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================
   HERO
=========================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px var(--pad) 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .18;
}
.orb1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #1a4fff 0%, transparent 70%);
  top: -100px; right: -100px;
  animation: drift1 12s ease-in-out infinite alternate;
}
.orb2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #003399 0%, transparent 70%);
  bottom: -80px; left: -80px;
  animation: drift2 10s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate(0,0); } to { transform: translate(-40px, 30px); } }
@keyframes drift2 { from { transform: translate(0,0); } to { transform: translate(30px, -20px); } }

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74,143,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,143,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  animation: fadeUp .8s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.hero-tag {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 500;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(40px, 8vw, 88px);
  font-weight: 900;
  line-height: 1.0;
  color: var(--white);
  margin-bottom: 24px;
  letter-spacing: -.02em;
}
.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, #99cfff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-scroll {
  position: absolute;
  bottom: 32px; left: var(--pad);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  z-index: 1;
}
.hero-scroll span {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.mobile-break { display: none; }

/* ===========================
   ABOUT
=========================== */
.about { background: var(--bg2); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
.about-left { display: flex; flex-direction: column; gap: 28px; }
.avatar-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden; /* 🔥 important */
  border: 2px solid var(--border2);
  box-shadow: 0 0 32px rgba(74,143,255,0.15);
}

.avatar-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 🔥 para hindi ma-stretch */
}

.avatar-placeholder img {
  transition: transform 0.3s ease;
}

.avatar-placeholder:hover img {
  transform: scale(1.1);
}
.about-right { display: flex; flex-direction: column; gap: 20px; }

.info-block label {
  display: block;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}
.info-fill {
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.8;
  min-height: 48px;
  font-style: italic;
}
.info-fill.tall { min-height: 72px; }

.stats-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px 28px;
  flex: 1;
  min-width: 80px;
}
.stat-num {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
}
.stat-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===========================
   PROJECTS
=========================== */
.projects { background: var(--bg); }
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  transition: background .25s, border-color .25s, transform .25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(74,143,255,0.05), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.project-card:hover { background: var(--card-hover); border-color: var(--border2); transform: translateY(-4px); }
.project-card:hover::before { opacity: 1; }
.project-card.featured { border-color: var(--border2); box-shadow: var(--shadow-glow); }
.project-num {
  font-family: var(--font-head);
  font-size: 48px;
  font-weight: 900;
  color: var(--text-dim);
  line-height: 1;
  flex-shrink: 0;
  min-width: 52px;
}
.project-body { flex: 1; }
.project-tag {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}
.project-body h3 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.project-body p { font-size: 14px; color: var(--text-muted); }
.project-arrow {
  font-size: 24px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color .25s, transform .25s;
}
.project-card:hover .project-arrow { color: var(--accent); transform: translate(4px,-4px); }

/* ===========================
   GALLERY
=========================== */
.gallery { background: var(--bg2); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(1fr);
  grid-template-rows: 220px;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--pad);
}
.gallery-item:nth-child(n){
  grid-column: auto;
  grid-row: auto;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s;
}
.gallery-item:hover { transform: scale(1.02); }

.gallery-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color .25s;
}

.gallery-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .4s ease;
}

.gallery-item:hover .gallery-placeholder img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.55);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity .3s ease;
}

.gallery-overlay span {
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

/* Responsive */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
}
/* Optional: make 1st and last item span full width */
  .gallery-item:nth-child(1) { grid-column: 1 / -1; }
  .gallery-item:nth-child(6) { grid-column: 1 / -1; }

  /* Tall variant still works */
  .g-tall { grid-row: span 2; }


/* ===========================
   FOOTER
=========================== */
.footer {
  background: var(--bg3);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand p { color: var(--text-muted); font-size: 14px; margin-top: 12px; max-width: 260px; }
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 10px; }
.footer-links h4, .footer-contact h4 {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
}
.footer-links a, .footer-contact a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color .2s;
}
.footer-links a:hover, .footer-contact a:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}

/* ===========================
   TABLET  ≥ 640px
=========================== */
@media (min-width: 640px) {
  .about-grid {
    grid-template-columns: 240px 1fr;
    gap: 48px;
    align-items: start;
  }
  .avatar-placeholder { width: 200px; height: 200px; font-size: 36px; }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
  }
  .g-tall { grid-row: span 2; }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-top {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 32px;
  }
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ===========================
   DESKTOP  ≥ 1024px
=========================== */
@media (min-width: 1024px) {
  .nav-toggle { display: none !important; }
  .nav { display: flex !important; }

  .hero { padding-top: 140px; }
  .hero-content { max-width: 720px; }

  .about-grid {
    grid-template-columns: 300px 1fr;
    gap: 64px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card.featured {
    grid-column: span 2;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 240px;
  }
  .g-tall { grid-row: span 2; }
  .g-wide { grid-column: span 2; }
}
.gallery-item:nth-child(1) { grid-column: auto; }
  .gallery-item:nth-child(6) { grid-column: auto; }

  /* Featured/wide items */
  .g-wide { grid-column: span 2; }
  .g-tall { grid-row: span 2; }


/* ===========================
   MOBILE  < 640px
=========================== */
@media (max-width: 639px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: rgba(5,8,16,0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 32px var(--pad);
    gap: 28px;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 18px; }

  .hero-title { font-size: clamp(36px, 11vw, 52px); }
  .mobile-break { display: block; }
  .hero-btns { flex-direction: column; }
  .btn { justify-content: center; width: 100%; max-width: 280px; }
  .hero-scroll { display: none; }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 140px;
  }
  .g-tall { grid-row: span 1; }
  .g-wide { grid-column: span 2; }

  .stats-row { gap: 12px; }
  .stat { padding: 16px 12px; }

  .section-title { font-size: clamp(28px, 8vw, 40px); }
}

.stacks-card {
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--card);
  margin-top: 8px;
}
.stacks-title {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 14px;
}
.stacks-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.stack-tag {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .03em;
  transition: all .2s;
  cursor: default;
}
.stack-tag:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  box-shadow: 0 0 16px rgba(74,143,255,0.35);
  transform: translateY(-2px);
}