/* ═══════════════════════════════════════════════════
   DESIGN TOKENS — Modern Editorial (Softened)
   ═══════════════════════════════════════════════════ */
:root {
  /* Default Theme: Softer Dark (Deep Slate) */
  --bg:           #0e1116;
  --surface:      #151821;
  --surface2:     #1e222e;
  --border:       rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);

  --accent:       #3b82f6;
  --accent-dim:   rgba(59, 130, 246, 0.12);
  --accent-glow:  rgba(59, 130, 246, 0.25);

  --text:         #f8fafc;
  --text-sub:     #94a3b8;
  --text-muted:   #64748b;

  --ff-display:   'Plus Jakarta Sans', sans-serif;
  --ff-body:      'Inter', sans-serif;
  --ff-mono:      'JetBrains Mono', monospace;

  --radius:       8px;
  --nav-h:        72px;
  --ease:         cubic-bezier(0.25, 1, 0.5, 1);
}

/* Light Theme: Soft Pearl */
[data-theme="light"] {
  --bg:           #fafafa;
  --surface:      #ffffff;
  --surface2:     #f4f4f5;
  --border:       rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.2);

  --accent:       #2563eb;
  --accent-dim:   rgba(37, 99, 235, 0.08);
  --accent-glow:  rgba(37, 99, 235, 0.15);

  --text:         #18181b;
  --text-sub:     #52525b;
  --text-muted:   #71717a;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

a { text-decoration: none; }
strong { color: var(--text); font-weight: 600; }
img { display: block; max-width: 100%; }


/* ═══════════════════════════════════════════════════
   SCROLL REVEAL
   ═══════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 3rem;
  background: rgba(14, 17, 22, 0.85); /* Dark base */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
  z-index: 200;
}

[data-theme="light"] #navbar {
  background: rgba(250, 250, 250, 0.85);
}

.nav-logo {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-right: auto;
}

.nav-logo::after {
  content: '.';
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sub);
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-cta {
  color: var(--text);
  background: var(--surface2);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}

.nav-cta:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-sub);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface2);
}

.sun-icon { display: none; }
.moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }


/* ── Mobile Burger & Sidebar ── */
#menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 210;
}
#menu-btn .line {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
#menu-btn.open .line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-btn.open .line:nth-child(2) { opacity: 0; }
#menu-btn.open .line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

#menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.8); z-index: 205; backdrop-filter: blur(4px); }
#menu-overlay.active { display: block; }

#menu-sidebar {
  position: fixed; top: 0; right: 0; width: 280px; height: 100%;
  background: var(--surface); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.4s var(--ease), background-color 0.3s;
  z-index: 210; display: flex; flex-direction: column;
  justify-content: space-between; padding: 6rem 2rem 3rem;
}
#menu-sidebar.open { transform: translateX(0); }
.sidebar-links { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-links a { font-family: var(--ff-display); font-size: 1.4rem; font-weight: 600; color: var(--text-sub); transition: color 0.2s; }
.sidebar-links a:hover { color: var(--text); }
.sidebar-socials { display: flex; gap: 1.5rem; padding-top: 2rem; border-top: 1px solid var(--border); align-items: center; }
.sidebar-socials a { color: var(--text-muted); transition: color 0.2s; }
.sidebar-socials a svg { width: 22px; height: 22px; }
.sidebar-socials a:hover { color: var(--text); }


/* ═══════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  gap: 5rem;
  padding: calc(var(--nav-h) + 4rem) 5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* Subtle architectural gradient instead of glowing orb */
.hero-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50vh;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.03) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .hero-glow {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%);
}

.hero-content {
  flex: 1;
  position: relative;
  z-index: 1;
  max-width: 600px;
}

/* Clean, minimalist status indicator */
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-bottom: 2rem;
}

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

.hero-name {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 1.2rem;
}

.name-line { display: block; color: var(--text); }
.name-line.accent { color: var(--text-sub); }

.hero-title {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

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

/* Redesigned buttons */
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  background: var(--text);
  color: var(--bg);
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease), background 0.2s, opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-2px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  background: transparent;
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s var(--ease);
}
.btn-ghost:hover { border-color: var(--text-sub); background: var(--surface); }

.hero-socials { display: flex; gap: 1.25rem; }
.hero-socials a { color: var(--text-muted); transition: color 0.2s; }
.hero-socials a svg { width: 22px; height: 22px; }
.hero-socials a:hover { color: var(--text); }

.hero-photo {
  flex-shrink: 0;
  width: 340px;
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* filter: grayscale(90%) contrast(1.1);
  transition: filter 0.5s var(--ease); */

  object-position: 95% 50%;
}

.hero-photo:hover img { filter: grayscale(0%) contrast(1); }


/* ═══════════════════════════════════════════════════
   SHARED SECTION STYLES
   ═══════════════════════════════════════════════════ */
section { padding: 8rem 2.5rem; }
.section-inner { max-width: 900px; margin: 0 auto; }

.section-header { margin-bottom: 4rem; }
.section-header.centered { text-align: center; }

.section-label {
  display: block;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-header h2 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--text);
  letter-spacing: -0.03em;
}


/* ═══════════════════════════════════════════════════
   RESUME — TIMELINE
   ═══════════════════════════════════════════════════ */
.timeline { position: relative; }

/* Thin, elegant line */
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px;
  width: 1px; background: linear-gradient(to bottom, var(--border), transparent);
}

.timeline-item {
  display: grid;
  grid-template-columns: 20px 140px 1fr;
  gap: 0 1.5rem;
  margin-bottom: 3rem;
  align-items: start;
}

.timeline-track { position: relative; padding-top: 8px; }

.tl-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.tl-dot.work { background: var(--text); box-shadow: 0 0 0 4px var(--bg); transition: background-color 0.3s, box-shadow 0.3s; }
.tl-dot.edu { background: var(--text-muted); box-shadow: 0 0 0 4px var(--bg); transition: background-color 0.3s, box-shadow 0.3s; }

.timeline-date {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 4px;
}

/* Borderless cards, relying on surface color for depth */
.timeline-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  transition: background-color 0.3s;
}

.timeline-card.compact { padding: 1.25rem 2rem; }

.card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}

.card-top h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Sharp, solid badges */
.badge {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  background: var(--surface2);
  color: var(--text);
  border-radius: 4px;
  white-space: nowrap;
}

.badge.ongoing {
  background: var(--accent-dim);
  color: var(--accent);
}

.card-bullets {
  list-style: none; margin-top: 1.25rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}

.card-bullets li {
  font-size: 0.9rem;
  color: var(--text-sub);
  position: relative;
  padding-left: 1.25rem;
}

.card-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.card-tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem;
}

.card-tags span {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  color: var(--text-muted);
  background: rgba(100, 116, 139, 0.08); /* Works for light and dark */
  border-radius: 4px;
}

.tl-section-label {
  grid-column: 1 / -1;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 2rem 0 1rem 1.5rem;
}


/* ═══════════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
}

.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background-color 0.3s;
}

.project-card:hover { transform: translateY(-4px); }

.proj-img { position: relative; overflow: hidden; background: #000; }
.project-card:not(.featured) .proj-img { height: 200px; }
.project-card.featured .proj-img { height: 100%; min-height: 320px; }

/* Editorial Grayscale Images */
.proj-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%) opacity(0.8);
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
}

.project-card:hover .proj-img img {
  transform: scale(1.05);
  filter: grayscale(0%) opacity(1);
}

.proj-tag {
  position: absolute; top: 1rem; left: 1rem;
  font-family: var(--ff-mono); font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg);
  color: var(--text);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.proj-body { padding: 2rem; flex: 1; display: flex; flex-direction: column; }

.proj-body h3 {
  font-family: var(--ff-display);
  font-weight: 600; font-size: 1.25rem;
  color: var(--text); margin-bottom: 0.75rem;
}

.panel-text { font-size: 0.9rem; color: var(--text-sub); line-height: 1.6; }

.panel-text.line-clamp-3 {
  display: -webkit-box; 
  -webkit-line-clamp: 3; 
  -webkit-box-orient: vertical; overflow: hidden;
}

.read-more-btn {
  font-family: var(--ff-mono); font-size: 0.75rem;
  color: var(--accent); background: none; border: none; cursor: pointer;
  padding: 0.5rem 0 0; text-align: left; transition: color 0.2s;
}
.read-more-btn:hover { color: var(--text); }

.proj-stack {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 1.5rem;
}

.proj-stack span {
  font-family: var(--ff-mono); font-size: 0.75rem; color: var(--text-muted);
}

.proj-links {
  display: flex; gap: 1.5rem; margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border); transition: border-color 0.3s;
}

.proj-links a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--ff-mono); font-size: 0.8rem;
  color: var(--text); transition: color 0.2s;
}
.proj-links a svg { width: 16px; height: 16px; }
.proj-links a:hover { color: var(--accent); }

.link-dead {
  font-family: var(--ff-mono); font-size: 0.8rem;
  color: var(--text-muted); text-decoration: line-through;
}


/* ═══════════════════════════════════════════════════
   TECH STACK
   ═══════════════════════════════════════════════════ */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 3rem;
}

.tech-group h4 {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  transition: border-color 0.3s;
}

.tech-chips { display: flex; flex-direction: column; gap: 0.75rem; }

.tech-chips span {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-size: 0.95rem; color: var(--text-sub);
  transition: color 0.2s, transform 0.2s;
}

.tech-chips span svg {
  width: 16px; height: 16px; color: var(--text-muted); transition: color 0.2s;
}

.tech-chips span:hover { color: var(--text); transform: translateX(4px); }
.tech-chips span:hover svg { color: var(--accent); }


/* ═══════════════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════════════ */
.contact-wrap { max-width: 600px; }

.contact-sub {
  font-size: 1rem; color: var(--text-sub);
  text-align: center; margin-bottom: 3rem;
}

.contact-links {
  display: flex; flex-direction: column; gap: 1rem; align-items: center;
}

.contact-link {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 2rem; background: var(--surface);
  border-radius: var(--radius); color: var(--text);
  font-size: 0.95rem; font-weight: 500; width: 100%; max-width: 400px;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background-color 0.3s;
}

.contact-link svg { width: 18px; height: 18px; color: var(--text-muted); transition: color 0.2s; }
.contact-link:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--text-sub); }
.contact-link:hover svg { color: var(--text); }


/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
footer { border-top: 1px solid var(--border); padding: 4rem 2.5rem; background: var(--bg); transition: background-color 0.3s, border-color 0.3s; }

.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}

.footer-logo { font-family: var(--ff-display); font-weight: 800; font-size: 1.25rem; color: var(--text); }
.footer-logo::after { content: '.'; color: var(--accent); }

.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; }
.footer-nav a { font-family: var(--ff-body); font-size: 0.85rem; color: var(--text-muted); transition: color 0.2s; }
.footer-nav a:hover { color: var(--text); }

.footer-copy { font-family: var(--ff-mono); font-size: 0.75rem; color: var(--text-muted); opacity: 0.5; margin-top: 1rem; }


/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: auto; grid-template-columns: 1fr; }
  .project-card.featured .proj-img { height: 240px; }
}

@media (max-width: 768px) {
  #hero {
    flex-direction: column-reverse;
    padding: calc(var(--nav-h) + 2rem) 1.5rem 4rem;
    min-height: auto; gap: 3rem; text-align: center;
  }
  .hero-label, .hero-actions, .hero-socials { justify-content: center; }
  .hero-bio { margin-left: auto; margin-right: auto; }
  
  .hero-photo { width: 100%; max-width: 340px; height: 340px; }
  .hero-name { font-size: 3.5rem; }

  .nav-links { display: none; }
  #menu-btn { display: flex; }

  .timeline-item { grid-template-columns: 20px 1fr; grid-template-rows: auto auto; }
  .timeline-date { grid-column: 2; grid-row: 1; padding-top: 8px; margin-bottom: 0.5rem; }
  .timeline-card { grid-column: 2; grid-row: 2; padding: 1.5rem; }

  section { padding: 5rem 1.5rem; }
  #navbar { padding: 0 1.5rem; }
}

@media (max-width: 520px) {
  .hero-actions { flex-direction: column; width: 100%; }
  .btn-primary, .btn-ghost { width: 100%; justify-content: center; }
  .card-top { flex-direction: column; gap: 0.75rem; }
  .timeline-item { grid-template-columns: 12px 1fr; gap: 0 1rem; }
  .timeline::before { left: 5px; }
}