/* ===== CSS Custom Properties ===== */
:root {
  --bg-deep: #05060f;
  --bg-card: rgba(12, 14, 30, 0.85);
  --bg-card-hover: rgba(18, 21, 42, 0.92);
  --text-primary: #ffffff;
  --text-secondary: #e2e6f0;
  --text-muted: #b8bfcf;
  --accent: #4fd1c5;
  --accent-glow: rgba(79, 209, 197, 0.3);
  --gold: #f0a500;
  --gold-glow: rgba(240, 165, 0, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-visible: rgba(255, 255, 255, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-sans: 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--gold);
}

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

/* ===== Starfield Canvas ===== */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Main Content Wrapper ===== */
.content-wrapper {
  position: relative;
  z-index: 1;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5, 6, 15, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-social a {
  color: var(--text-muted);
  font-size: 1.15rem;
  transition: all var(--transition-fast);
}

.nav-social a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* ===== Sections Common ===== */
.section {
  padding: 6rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-weight: 400;
}

.section-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
  margin-bottom: 2.5rem;
}

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
  text-align: center;
}

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

.hero-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-visible);
  box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(79, 209, 197, 0.08);
  margin: 0 auto 2rem;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.hero-avatar:hover {
  transform: scale(1.04);
  box-shadow: 0 0 60px var(--accent-glow), 0 0 100px rgba(79, 209, 197, 0.15);
}

.hero-name {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-name span {
  background: linear-gradient(135deg, var(--accent), #38b2a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.75;
}

.hero-cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: all var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #05060f;
}

.btn-primary:hover {
  background: #3dbdb2;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: #05060f;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-visible);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ===== About Section ===== */
.about-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 800px;
  line-height: 1.85;
}

.about-text p + p {
  margin-top: 1.25rem;
}

/* ===== Projects Grid (Homepage) ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.75rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-visible);
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px var(--accent-glow);
}

.project-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #0f1025, #1a1c3a);
}

.project-card-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
}

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

.project-card-institution {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.project-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.project-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  background: rgba(79, 209, 197, 0.1);
  color: var(--accent);
  letter-spacing: 0.03em;
}

.tag-gold {
  background: rgba(240, 165, 0, 0.1);
  color: var(--gold);
}

/* ===== Skills Section ===== */
.skills-category {
  margin-bottom: 2.5rem;
}

.skills-category-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-badge {
  font-size: 0.85rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.skill-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79, 209, 197, 0.06);
}

/* ===== Contact Section ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.contact-item .icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(79, 209, 197, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-item a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.contact-item a:hover {
  color: var(--accent);
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(5, 6, 15, 0.6);
  border: 1px solid var(--border-visible);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  min-height: 130px;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 2rem;
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.footer-social a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: all var(--transition-smooth);
}

.footer-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79, 209, 197, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Project Detail Pages ===== */
.project-detail {
  padding-top: 7rem;
  padding-bottom: 4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--accent);
}

.project-header {
  margin-bottom: 3rem;
}

.project-header .institution {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.project-header h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.project-header .date {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.project-meta-item h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.project-meta-item p {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.project-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  margin-top: 2rem;
  color: var(--text-primary);
}

.project-body h2:first-child {
  margin-top: 0;
}

.project-body p {
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.project-body ul {
  list-style: none;
  padding: 0;
}

.project-body ul li {
  color: var(--text-secondary);
  padding: 0.45rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.65;
}

.project-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.project-gallery img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

.project-gallery img:hover {
  transform: scale(1.03);
  border-color: var(--accent);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar {
    padding: 0 1.25rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(5, 6, 15, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-social {
    display: none;
  }

  .hero-name {
    font-size: 2.2rem;
  }

  .hero-title {
    font-size: 1rem;
  }

  .section {
    padding: 4rem 1.25rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

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

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-header h1 {
    font-size: 2rem;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

  .footer-social {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-avatar {
    width: 120px;
    height: 120px;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SVG Icon Helpers ===== */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  stroke-width: 0;
  stroke: currentColor;
  fill: currentColor;
  vertical-align: -0.125em;
}
