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

:root {
  --bg:       #0c0c0e;
  --bg-alt:   #111115;
  --bg-card:  #16161a;
  --bg-card2: #1c1c22;
  --border:   rgba(255,255,255,0.08);
  --accent:   #5b8dee;
  --accent2:  #4a78d8;
  --text:     #dde1eb;
  --text-muted: #8892a4;
  --text-dim:   #4a5568;
  --font:     'Inter', system-ui, sans-serif;
  --mono:     'JetBrains Mono', monospace;
  --radius:   12px;
  --radius-sm:8px;
  --shadow:   0 4px 24px rgba(0,0,0,0.5);
  --transition: 0.3s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

img { max-width: 100%; display: block; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-card2); border-radius: 3px; }

/* ── Utilities ───────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
}
.btn-primary:hover {
  background: #4a78d8;
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(91,141,238,0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover {
  background: rgba(100,255,218,0.08);
  opacity: 1;
  transform: translateY(-2px);
}

.full-width { width: 100%; justify-content: center; }

/* ── Reveal animation ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Section base ────────────────────────────────────────── */
.section {
  padding: 7rem 0;
}
.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.4rem;
  border-radius: 2px;
}
.section-sub {
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tags.tight { margin-top: 0.75rem; }
.tag {
  font-size: 0.75rem;
  font-family: var(--mono);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  background: var(--bg-card2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.accent-tag {
  background: rgba(91,141,238,0.08);
  color: var(--accent);
  border-color: rgba(91,141,238,0.2);
}

/* ── NAV ─────────────────────────────────────────────────── */
.nav-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background var(--transition), backdrop-filter var(--transition);
}
.nav-header.scrolled {
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.nav-logo .dot { color: var(--accent); }
.nav-logo:hover { opacity: 0.9; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--accent); opacity: 1; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
}
.nav-mobile.open { display: flex; }
.mobile-link {
  color: var(--text-muted);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}
.mobile-link:last-child { border-bottom: none; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(91,141,238,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(74,120,216,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.hero-greeting {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 400;
  min-height: 2rem;
}

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 560px;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-socials {
  display: flex;
  gap: 1rem;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}
.social-link svg { width: 18px; height: 18px; }
.social-link:hover {
  border-color: rgba(91,141,238,0.5);
  color: var(--accent);
  opacity: 1;
  transform: translateY(-3px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeIn 2s ease 1.5s both;
}
.scroll-arrow {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  animation: scrollPulse 2s ease infinite;
}
@keyframes scrollPulse {
  0%,100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── ABOUT ───────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 3rem;
}

.photo-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3/4;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.photo-frame:hover img { transform: scale(1.04); }
.photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  pointer-events: none;
}

.about-text p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  line-height: 1.9;
}
.about-text strong { color: var(--text); }

.about-edu { margin-top: 2rem; }
.about-edu h3 {
  font-size: 0.85rem;
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.edu-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.edu-badge {
  background: rgba(91,141,238,0.1);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 2px;
}
.edu-item strong { color: var(--text); font-size: 0.95rem; }
.edu-item span { color: var(--text-muted); font-size: 0.88rem; display: block; margin-top: 0.15rem; }
.edu-note { color: var(--text-dim) !important; font-family: var(--mono); font-size: 0.78rem !important; }

/* ── SKILLS ──────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all var(--transition);
}
.skill-card:hover {
  border-color: rgba(91,141,238,0.2);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.skill-card-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 1rem;
}
.skill-card-icon svg { width: 100%; height: 100%; }

.skill-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

/* ── EXPERIENCE ──────────────────────────────────────────── */
.timeline {
  position: relative;
  margin-top: 3rem;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-dot {
  position: absolute;
  left: -2.37rem;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(91,141,238,0.15);
}

.timeline-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
  letter-spacing: 0.05em;
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  transition: all var(--transition);
}
.timeline-card:hover {
  border-color: rgba(100,255,218,0.2);
  box-shadow: var(--shadow);
}

.timeline-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.timeline-company {
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 500;
}
.timeline-card ul {
  list-style: none;
  padding: 0;
  margin-bottom: 0.5rem;
}
.timeline-card ul li {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.7;
}
.timeline-card ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.42rem;
}

/* ── PROJECTS ────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.project-card-featured {
  border-color: rgba(91,141,238,0.2);
}

.badge-fyp {
  display: inline-block;
  font-size: 0.65rem;
  font-family: var(--mono);
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(91,141,238,0.15);
  color: var(--accent);
  border: 1px solid rgba(91,141,238,0.3);
  vertical-align: middle;
  letter-spacing: 0.05em;
  margin-left: 0.4rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: rgba(91,141,238,0.2);
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.project-preview {
  height: 200px;
  position: relative;
  overflow: hidden;
  background: var(--bg-card2);
}
.project-preview.project-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s ease;
  display: block;
}
.project-card:hover .project-preview.project-screenshot img {
  transform: scale(1.04);
}
.project-preview.project-placeholder {
  background: linear-gradient(135deg, #0f1f3d 0%, #162a50 50%, #1a1f3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-preview.project-placeholder .placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.6;
}
.project-preview.project-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--accent);
  opacity: 0.9;
}
.project-preview.project-placeholder span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
  letter-spacing: 0.03em;
}
.project-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(20,20,22,0.7));
  pointer-events: none;
}

.project-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.project-header h3 { font-size: 1.1rem; font-weight: 600; }

.project-links { display: flex; gap: 0.5rem; }
.icon-link {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.icon-link svg { width: 14px; height: 14px; }
.icon-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.project-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.75;
  flex: 1;
}

/* ── PHOTOS ──────────────────────────────────────────────── */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 0.75rem;
  margin-top: 3rem;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.photo-item.wide { grid-column: span 2; }

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.photo-item:hover img { transform: scale(1.06); }

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 0.9rem 1rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.photo-item:hover .photo-overlay { opacity: 1; }
.photo-overlay span {
  font-size: 0.8rem;
  font-family: var(--mono);
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.05em;
}

.photo-cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* ── CONTACT ─────────────────────────────────────────────── */
.contact-container { max-width: 900px; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  margin-top: 3rem;
  align-items: start;
}

.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.contact-icon svg { width: 18px; height: 18px; }
.contact-label {
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}
.contact-item a, .contact-item span {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.contact-item a:hover { color: var(--accent); opacity: 1; }

.resume-btn {
  margin-top: 0.5rem;
  width: 100%;
  justify-content: center;
}

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.form-group input,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(91,141,238,0.4);
  box-shadow: 0 0 0 3px rgba(91,141,238,0.08);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }

/* ── FOOTER ──────────────────────────────────────────────── */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer strong { color: var(--text-muted); }
.footer-sub { margin-top: 0.3rem; font-size: 0.78rem; font-family: var(--mono); }

/* ── LIGHTBOX ────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }
.lightbox-caption {
  font-size: 0.85rem;
  font-family: var(--mono);
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .photo-frame {
    max-width: 280px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .section { padding: 5rem 0; }

  .hero { padding: 5rem 1.5rem 3rem; }

  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .timeline { padding-left: 1.5rem; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  .photo-gallery {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 150px;
  }
  .photo-item.wide { grid-column: span 2; }
}
