/* ===== CUSTOM PROPERTIES ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f1117;
  --bg-card: #12141c;
  --bg-card-hover: #181b25;

  --neon-cyan: #00ffd5;
  --neon-green: #00ff88;
  --neon-glow: rgba(0, 255, 213, 0.15);

  --text-primary: #e0e0e8;
  --text-secondary: #8888a0;
  --text-muted: #555568;

  --border-color: #1e2030;
  --border-glow: rgba(0, 255, 213, 0.3);

  --font-mono: 'Courier New', Consolas, monospace;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --section-padding: clamp(3rem, 8vw, 6rem);
  --content-max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--neon-cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

ul {
  list-style: none;
}

::selection {
  background: rgba(0, 255, 213, 0.25);
  color: #fff;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== NAVIGATION ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 1.5rem;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border-color);
}

.nav-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-logo:hover {
  text-decoration: none;
  color: var(--neon-cyan);
}

.nav-logo img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--neon-cyan);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--neon-cyan);
  border-radius: 1px;
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== HERO ===== */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 1.5rem 3rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 15, 0.93) 0%,
    rgba(10, 10, 15, 0.75) 50%,
    rgba(10, 10, 15, 0.88) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--neon-cyan);
  border: 1px solid var(--border-glow);
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeInUp 0.6s 0.2s forwards;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  opacity: 0;
  animation: fadeInUp 0.6s 0.35s forwards;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--neon-green);
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeInUp 0.6s 0.5s forwards;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s 0.65s forwards;
}

.hero-highlights {
  max-width: 650px;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s 0.8s forwards;
}

.hero-highlights li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.hero-highlights li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 0.6s 0.95s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.6s 1.1s forwards;
}

.hero-gallery {
  position: absolute;
  right: 1.5rem;
  bottom: 5rem;
  display: flex;
  gap: 0.75rem;
  z-index: 1;
  opacity: 0;
  animation: fadeInUp 0.8s 1.3s forwards;
}

.hero-gallery-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: border-color 0.3s, transform 0.3s;
}

.hero-gallery-thumb:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-3px);
}

.scroll-indicator {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  z-index: 1;
  opacity: 0;
  animation: fadeInUp 0.6s 1.5s forwards;
}

.scroll-indicator svg {
  animation: bounce 2s infinite;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  border: 1px solid;
}

.btn-primary {
  color: var(--bg-primary);
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

.btn-primary:hover {
  background: transparent;
  color: var(--neon-cyan);
  text-decoration: none;
  box-shadow: 0 0 15px rgba(0, 255, 213, 0.3);
}

.btn-secondary {
  color: var(--neon-cyan);
  background: transparent;
  border-color: var(--border-glow);
}

.btn-secondary:hover {
  border-color: var(--neon-cyan);
  text-decoration: none;
  box-shadow: 0 0 15px rgba(0, 255, 213, 0.2);
}

/* ===== TAG PILLS ===== */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--neon-cyan);
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid rgba(0, 255, 213, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}

/* ===== SECTIONS ===== */
#projects, #about, #contact {
  padding: var(--section-padding) 1.5rem;
}

.section-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neon-cyan);
  transition: width 0.6s ease;
}

.section-title.is-visible::after {
  width: 60px;
}

/* ===== PROJECTS GRID ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  opacity: 0;
  transform: translateY(20px);
  cursor: pointer;
}

.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s, transform 0.5s, border-color 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(0, 255, 213, 0.08), 0 8px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

.card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.project-card:hover .card-image img {
  transform: scale(1.05);
}

.card-body {
  padding: 1.25rem;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.card-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #fff;
}

.card-subtitle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--neon-green);
  margin-bottom: 0.75rem;
}

.card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.card-links {
  display: flex;
  gap: 0.75rem;
}

.card-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--neon-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
}

.card-link:hover {
  color: #fff;
  text-decoration: none;
}

.card-gallery-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  transition: color 0.2s;
}

.card-gallery-link:hover {
  color: var(--neon-cyan);
}

/* ===== ABOUT ===== */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.about-skills h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--neon-cyan);
  background: rgba(0, 255, 213, 0.06);
  border: 1px solid rgba(0, 255, 213, 0.12);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: background 0.3s, border-color 0.3s;
}

.skill-tag:hover {
  background: rgba(0, 255, 213, 0.12);
  border-color: var(--border-glow);
}

/* ===== CONTACT / FOOTER ===== */
#contact {
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: color 0.3s, border-color 0.3s;
}

.contact-link:hover {
  color: var(--neon-cyan);
  border-color: var(--border-glow);
  text-decoration: none;
}

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

/* ===== PROJECT DETAIL MODAL ===== */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.project-modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: fadeInUp 0.3s ease;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(10, 10, 15, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}

.modal-close:hover {
  color: var(--neon-cyan);
  border-color: var(--border-glow);
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  padding: 1rem 1rem 0;
}

.modal-gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: border-color 0.3s, transform 0.2s;
}

.modal-gallery img:hover {
  border-color: var(--neon-cyan);
  transform: scale(1.02);
}

.modal-body {
  padding: 1.5rem;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.modal-subtitle {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--neon-green);
  margin-bottom: 1rem;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.modal-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.modal-highlights {
  margin-bottom: 1.5rem;
}

.modal-highlights li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.modal-highlights li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

.modal-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--neon-cyan);
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2.5rem;
}

.lightbox-prev {
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-next {
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    display: none;
  }

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

  .nav-links li {
    padding: 0.6rem 0;
  }

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

  .hero-gallery {
    display: none;
  }

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

  .hero-content {
    padding-right: 0;
  }

  .project-modal {
    padding: 1rem;
  }

  .modal-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .hero-highlights {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    text-align: center;
    justify-content: center;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }
}
