:root {
  --bg: #0e0e11;
  --fg: #f5f5f7;
  --muted: #9a9aa3;
  --accent: #8b8bff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ---------- BODY ---------- */
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  transition: background 0.5s ease, color 0.5s ease;
}

/* ---------- WRAP ---------- */
.wrap {
  max-width: 1000px;
  margin: auto;
  padding: 6rem 1.5rem;
}

@media (max-width: 1024px) {
  .wrap {
    max-width: 900px;
    padding: 6rem 1.5rem;
  }
}

@media (max-width: 600px) {
  .wrap {
    padding: 4rem 1.5rem;
  }
}

/* ---------- HERO ---------- */
.hero {
  text-align: center;
  padding-top: 5rem; /* adjusted top padding for navbar */
}

@media (max-width: 1024px) {
  .hero {
    padding-top: 5rem;
  }
}

@media (max-width: 600px) {
  .hero {
    padding-top: 5.5rem; /* slightly taller for mobile navbar */
  }
}

.hero h1 {
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  letter-spacing: -0.04em;
  margin: 0;
}

.hero p,
.hero-about,
.hero-quote {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
  transition: color 0.5s ease;
}

.hero-about {
  margin-top: 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
}

.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  margin: 0 0 1rem 0;
  border: 3px solid var(--accent);
  transition: border-color 0.5s ease;
}

/* ---------- STATUS & CONTACT ---------- */
.status-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 255, 0, 0.1);
  color: #0f0;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  height: 32px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #0f0;
  border-radius: 50%;
  animation: subtle-blink 1.5s infinite;
}

@keyframes subtle-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-actions {
  display: flex;
  gap: 0.6rem;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  height: 32px;
  transition: all 0.3s ease;
}

.contact-btn:hover {
  background: var(--fg);
  color: var(--bg);
  transform: scale(1.05);
}

/* ---------- WORK ---------- */
.work {
  margin-top: 6rem;
}

.work h2 {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  transition: color 0.5s ease;
  text-align: center;
}

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

.project {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: background 0.5s ease, color 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.project-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.2rem;
  text-decoration: none;
  color: inherit;
}

.project-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.5s ease;
}

.project-link:hover .project-icon {
  transform: scale(1.1);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.project-info h3 {
  margin: 0;
  font-size: 1.2rem;
  transition: color 0.5s ease;
}

.project-info p {
  margin: 0.5rem 0 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  transition: color 0.5s ease;
}

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

.project-tag {
  background: rgba(139, 139, 255, 0.2);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-weight: 500;
}

/* ---------- FILTER ---------- */
.project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.project-filter button {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.project-filter button:hover,
.project-filter button.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1); /* faint line in dark mode */
  padding-top: 1.5rem; /* spacing above the line */
  margin-top: 0;        /* remove extra margin; spacing controlled by CTA bottom */
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.95rem;
  transition: border-color 0.5s ease;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.5s ease;
}

.footer-links a:hover {
  color: var(--fg);
}

.footer-credit {
  color: var(--muted);
}

/* ---------- RESPONSIVE MOBILE ---------- */
@media (max-width: 600px) {
  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-actions {
    width: 100%;
    flex-direction: row;
  }

  .hero {
    text-align: left;
  }

  .hero p,
  .hero-about,
  .hero-quote {
    margin-left: 0;
    margin-right: 0;
  }

  .work h2 {
    text-align: left;
  }

  .project-filter {
    justify-content: flex-start;
  }
}

/* ---------- MOTION ---------- */
.fade {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- MODE TOGGLE ---------- */
.mode-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.05);
  color: var(--fg);
  border: none;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 1000;
  transition: background 0.5s ease, color 0.5s ease, transform 0.3s ease;
}

.mode-toggle:hover {
  background: var(--accent);
  color: var(--bg);
}

.mode-toggle.animate {
  transform: rotate(360deg) scale(1.2);
}

/* ---------- LIGHT MODE ---------- */
body.light-mode {
  --bg: #f5f5f7;
  --fg: #0e0e11;
  --muted: #555;
  --accent: #8b8bff;
}

/* Light mode project background */
body.light-mode .project {
  background: rgba(0,0,0,0.05);
}

/* Light mode status pill */
body.light-mode .status-pill {
  background: rgba(0,255,0,0.15);
  color: #0a0;
}

/* Light mode project filter buttons match project card background */
body.light-mode .project-filter button {
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  color: var(--muted);
}

body.light-mode .project-filter button:hover,
body.light-mode .project-filter button.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ---------- CUSTOM CURSOR ---------- */
.cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 9999;
}

.cursor.hover {
  transform: translate(-50%, -50%) scale(1.5);
  background: rgba(139,139,255,0.2);
}

.cursor.click {
  transform: translate(-50%, -50%) scale(0.8);
}

/* ---------- HERO QUOTE ---------- */
.hero-quote {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ---------- NAVBAR (NARROW PILL, THEME-AWARE) ---------- */
.navbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 46%;
  max-width: 380px;
  padding: 0.55rem 1rem;
  background: rgba(14, 14, 17, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 1001;
  transition: background 0.5s ease, color 0.5s ease, transform 0.3s ease;
  color: var(--fg);
}

body.light-mode .navbar {
  background: rgba(245, 245, 247, 0.85);
  color: var(--fg);
}

body.dark-mode .navbar {
  background: rgba(14, 14, 17, 0.85);
  color: var(--fg);
}

/* Navbar logo */
.navbar .nav-logo {
  width: 1.8rem; /* same as the emoji font-size */
  height: auto;
  cursor: default;
  transition: transform 0.3s ease, filter 0.5s ease;
}

.navbar .nav-logo:hover {
  transform: scale(1.2);
}

/* Light mode: invert the white SVG to black */
body.light-mode .nav-logo {
  filter: invert(1);
}

/* ---------- HELLO ROTATING ---------- */
.nav-hello {
  display: inline-block;
  margin-left: 0.6rem;
  font-weight: 500;
  font-size: 1rem;
  color: var(--fg);
  white-space: nowrap;
  vertical-align: middle;
  transition: color 0.5s ease, transform 0.3s ease, opacity 0.3s ease;
}

.nav-hello.animate {
  transform: scale(1.2);
}

/* Mode toggle inside navbar */
.navbar .mode-toggle {
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: 1.05rem;
  top: auto;
  right: auto;
  position: relative;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.navbar .mode-toggle:hover {
  background: var(--fg);
  color: var(--bg);
  transform: scale(1.05);
}

/* ---------- TABLET / LAPTOP ---------- */
@media (max-width: 1024px) {
  .navbar {
    width: 55%;
    max-width: 340px;
    padding: 0.5rem 0.9rem;
  }
  .navbar .nav-emoji {
    font-size: 1.6rem;
  }
  .navbar .mode-toggle {
    font-size: 1rem;
    padding: 0.35rem 0.55rem;
  }
  .nav-hello {
    font-size: 0.95rem;
    margin-left: 0.5rem;
  }
}

/* ---------- MOBILE ---------- */
@media (max-width: 600px) {
  .navbar {
    width: calc(100% - 3rem);
    max-width: none;
    padding: 0.55rem 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
  }
  .navbar .nav-emoji {
    font-size: 1.4rem;
  }
  .nav-hello {
    font-size: 0.9rem;
    margin-left: 0.45rem;
  }
  .navbar .mode-toggle {
    font-size: 0.95rem;
    padding: 0.35rem 0.55rem;
  }
}

/* ---------- SKILLS ICONS ---------- */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  justify-content: center; /* center for desktop */
  align-items: center;     /* vertical alignment */
}

.skill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(255, 255, 255, 0.07); /* subtle pill bg */
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--muted);
  min-width: 100px;        /* uniform width for pills */
  justify-content: center;  /* center icon + text */
  white-space: nowrap;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.skill img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Hover effects */
.skill:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}

.skill:hover img {
  transform: scale(1.3);
}

/* ---------- MOBILE ADJUSTMENTS ---------- */
@media (max-width: 600px) {
  .skills {
    justify-content: flex-start; /* align left on mobile */
  }
  .skill {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    min-width: auto;
  }
  .skill img {
    width: 18px;
    height: 18px;
  }
}

/* ================= CALL TO ACTION ================= */
.cta-section {
  margin-top: 6rem;
  margin-bottom: 2rem; /* reduce gap to footer */
  display: flex;
  justify-content: center;
}

.cta-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: row; /* two-column layout */
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 1000px; /* match .wrap container width */
  transition: background 0.5s ease, color 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.cta-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.cta-text {
  flex: 1;
  text-align: left;
}

.cta-text h2 {
  margin: 0;
  font-size: 1.8rem;
  transition: color 0.5s ease;
}

.cta-text p {
  margin: 0.5rem 0 0 0;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  transition: color 0.5s ease;
}

.cta-action {
  flex-shrink: 0;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cta-btn:hover {
  background: var(--fg);
  color: var(--bg);
  transform: scale(1.05);
}

/* Light mode CTA card background (match project cards) */
body.light-mode .cta-card {
  background: rgba(0, 0, 0, 0.05);
  color: var(--fg);
}

/* ---------- RESPONSIVE MOBILE ---------- */
@media (max-width: 768px) {
  .cta-card {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .cta-text {
    text-align: center;
  }

  .cta-action {
    display: flex;
    justify-content: center;
  }
}

/* ---------- FOOTER DIVIDER ---------- */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1); /* faint line in dark mode */
  padding-top: 1.5rem; /* optional, for spacing above the line */
  margin-top: 6rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.95rem;
  transition: border-color 0.5s ease;
}

/* Light mode divider */
body.light-mode footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1); /* subtle in light mode */
}

.footer-rotate {
  display: inline-block;
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 1;
}
