@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

/* --- THEME VARIABLES --- */
:root {
  --bg-color: #111;
  --text-color: #f0f0f0;
  --primary-color: #ffa500;
  --card-bg-color: #1e1e1e;
  --header-bg-color: #000;
  --border-color: #333;
  --hero-bg-color: #1a1a1a;
  --hero-overlay-color: rgba(17, 17, 17, 0.7);
}

body.light-mode {
  --bg-color: #f4f4f4;
  --text-color: #111;
  --primary-color: #d98c00;
  --card-bg-color: #ffffff;
  --header-bg-color: #ffffff;
  --border-color: #ddd;
  --hero-bg-color: #e9e9e9;
  --hero-overlay-color: rgba(233, 233, 233, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  text-align: left;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  background: var(--header-bg-color);
  padding: 20px 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.4s ease;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allow items to wrap on mobile */
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav h1 {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.nav-items {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-items ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-items a {
  color: var(--text-color);
  position: relative;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-items a::after {
  content: '';
  height: 2px;
  width: 0;
  background: var(--primary-color);
  position: absolute;
  left: 0;
  bottom: -4px;
  transition: width 0.3s;
}

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

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

/* --- THEME ICON TOGGLE --- */
.theme-toggle {
  cursor: pointer;
  font-size: 1.5rem;
  position: relative;
  width: 24px;
  height: 24px;
  color: var(--text-color);
}
.theme-icon {
  position: absolute;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#sun-icon {
  opacity: 0;
  transform: scale(0);
}
body.light-mode #sun-icon {
  opacity: 1;
  transform: scale(1);
}
body.light-mode #moon-icon {
  opacity: 0;
  transform: scale(0);
}
/* --- HERO SECTION WITH PARALLAX --- */
#hero {
  padding: 100px 40px 60px;
  text-align: center;
  animation: fadeInUp 1s ease forwards;
  position: relative;
  background-color: var(--hero-bg-color);
  /* background-image: url('your-image.jpg'); */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: background-color 0.4s ease;
}
#hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--hero-overlay-color);
    transition: background 0.4s ease;
}
#hero h2, #hero p {
    position: relative;
    z-index: 2;
}
#hero h2 {
  font-size: 1.5rem;
  max-width: 90vw;
  margin: 0 auto 20px;
  color: var(--primary-color);
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--primary-color);
  width: 0;
  animation: typing 3s steps(68, end) forwards, blink 0.75s step-end infinite;
}
#hero p {
  font-size: 1.2rem;
  color: #ccc;
}
body.light-mode #hero p { color: #333; }

section {
  padding: 60px 40px;
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
section[id] { scroll-margin-top: 100px; }
section.visible {
  opacity: 1;
  transform: translateY(0);
}
#about p, #contact p {
  color: #ccc;
  text-align: left;
}
body.light-mode #about p, body.light-mode #contact p { color: #555; }

#projects .project {
  margin-bottom: 40px;
  padding: 20px;
  background: var(--card-bg-color);
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease;
}
.project h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
}
.project p { color: #ddd; }
body.light-mode .project p { color: #333; }
.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(255, 165, 0, 0.3);
}
.project-link {
  color: var(--primary-color);
  font-weight: bold;
  text-decoration: none;
}
.project-link:hover { text-decoration: underline; }

.social-icons {
  margin-top: 25px;
  display: flex;
  gap: 25px;
  justify-content: center;
}
.social-icons a {
  color: var(--text-color);
  font-size: 1.8rem;
  transition: transform 0.3s ease, color 0.3s ease;
}
.social-icons a:hover {
  color: var(--primary-color);
  transform: translateY(-5px);
}

#stack h2, #projects h2, section h2 {
    margin-bottom: 20px;
}

#stack ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}
#stack li {
  background: var(--card-bg-color);
  color: var(--text-color);
  padding: 10px 20px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  font-weight: 500;
  transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.4s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
#stack li i { font-size: 1.5rem; }
#stack li:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}
#stack li:hover i {
  animation: icon-bounce 0.5s;
}

footer {
  text-align: center;
  padding: 20px;
  background: var(--header-bg-color);
  color: #888;
  font-size: 0.9rem;
  transition: background-color 0.4s ease;
}

@keyframes slideDown {
  from { transform: translateY(-60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink {
  50% { border-color: transparent; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes icon-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* --- MOBILE RESPONSIVE STYLES --- */
@media (max-width: 768px) {
  header { padding: 15px 20px; }
  nav {
    flex-direction: column; 
    gap: 15px;
  }
  .nav-items {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  nav h1 { font-size: 1.5rem; }
  nav ul { gap: 20px; }
  #hero h2 {
    font-size: 1.2rem;
    white-space: normal;
  }
  #hero p { font-size: 1rem; }
  .project h3 { font-size: 1.1rem; }
  p { font-size: 0.95rem; }
  .social-icons a { font-size: 1.5rem; }
  section[id] { scroll-margin-top: 100px; }
}

/* --- DISABLE ANIMATIONS ON MOBILE --- */
@media (max-width: 768px) {
  #hero {
    animation: none !important;
  }

  #hero h2 {
    animation: none !important;
    border-right: none !important;
    white-space: normal !important;
    width: auto !important;
  }

  section {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
