/* ==== Reset & Base ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  background-color: #ffffff;
  color: #222;
  transition: background-color 0.3s, color 0.3s;
  padding-top: 80px;
}

/* Dark Mode */
body.dark {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark a {
  color: #80d8ff;
  font-weight: 600;
}

body.dark a:hover,
body.dark a:focus {
  color: #4fc3f7;
  background-color: rgba(128, 216, 255, 0.15);
  outline: 3px solid #4fc3f7;
  outline-offset: 3px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: #f5f5f5;
  color: #000;
  padding: 1rem 2rem;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.dark .header {
  background: #1e1e1e;
  color: #fff;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 1rem; /* space between theme toggle and burger */
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-list a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-list a:hover,
.nav-list a:focus {
  color: #007acc;
  outline: none;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: inherit;
  text-decoration: none;
}

/* Mobile Menu (Burger) */
#menu-toggle {
  display: none; /* Hidden on desktop */
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

#menu-toggle, #theme-toggle {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

#menu-toggle:focus, #theme-toggle:focus {
  outline: 3px solid #007acc;
  outline-offset: 3px;
}

/* Theme toggle */
#theme-toggle {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  padding: 0.25rem 0.5rem;
  transition: color 0.3s;
}

#theme-toggle:focus {
  outline: 3px solid #007acc;
  outline-offset: 3px;
}

/* Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  z-index: 1100;
  background: linear-gradient(90deg, #007acc, #00bcd4, #4cafef);
  transition: width 0.2s ease-out;
}

/* Intro */
.intro {
  max-width: 700px;
  margin: 2rem auto 4rem auto;
  text-align: center;
  position: relative;
  padding: 4rem 2rem;
  z-index: 1;
}

.intro h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 10;
}

.intro .tagline {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  font-weight: 500;
  color: #007acc;
}

body.dark .intro .tagline {
  color: #90caf9;
}

#download-cv {
  background-color: #007acc;
  border: none;
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  z-index: 10;
  transition: background 0.3s;
}

#download-cv:hover,
#download-cv:focus {
  background: #005f99;
  outline: 3px solid #007acc;
  outline-offset: 3px;
}

/* Sections */
section {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  color: #007acc;
  border-bottom: 2px solid #007acc;
  padding-bottom: 0.25rem;
}

body.dark h2 {
  color: #90caf9;
  border-color: #90caf9;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: #444;
}

body.dark h3 {
  color: #ddd;
}

#typewriter-name,
#typewriter-tagline {
  border-right: .1em solid #007acc;
  white-space: nowrap;
  overflow: hidden;
  animation: blink-cursor 0.7s steps(1) infinite;
  font-weight: 600;
}

#typewriter-name {
  font-size: 2.75rem; /* same size as original h1 */
}

#typewriter-tagline {
  font-size: 1.25rem;
  font-weight: 500;
  color: #007acc;
}

body.dark #typewriter-tagline {
  color: #90caf9;
}

@keyframes blink-cursor {
  0%, 100% { border-color: #007acc; }
  50% { border-color: transparent; }
}

/* Skills */
.skill-category {
  margin-bottom: 2rem;
}

.skill-category h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #007acc;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.dark .skill-category h3 {
  color: #90caf9;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.skill-tag {
  background: linear-gradient(135deg, #0077b6, #004c75);
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 180px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background 0.3s, box-shadow 0.3s;
  position: relative;
  box-shadow: 0 3px 6px rgba(0, 119, 182, 0.5);
}

.skill-tag:focus,
.skill-tag:hover {
  background: linear-gradient(135deg, #004c75, #0077b6);
  box-shadow: 0 6px 12px rgba(0, 150, 199, 0.7);
  outline: 3px solid #007acc;
}

.skill-tag .tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #007accdd;
  color: white;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s;
}

.skill-tag:hover .tooltip,
.skill-tag:focus .tooltip {
  opacity: 1;
}

.skill-logo {
  font-size: 1.4rem;
  margin-right: 8px;
  vertical-align: middle;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.skill-tag:hover .skill-logo,
.skill-tag:focus .skill-logo {
  opacity: 1;
}

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project {
  background: #f0f8ff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

body.dark .project {
  background: #222;
}

.project:hover,
.project:focus {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 122, 204, 0.3);
  outline: 3px solid #007acc;
}

.project h3 {
  margin-bottom: 0.75rem;
  color: #007acc;
}

body.dark .project h3 {
  color: #90caf9;
}

.project p {
  margin-bottom: 1rem;
  color: #444;
}

body.dark .project p {
  color: #ccc;
}

.project a {
  color: #007acc;
  font-weight: 600;
  text-decoration: none;
}

.project a:hover,
.project a:focus {
  text-decoration: underline;
}

/* Achievements */
#achievements ul {
  list-style: none;
  padding: 0;
}

#achievements li {
  background: #f0f8ff;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 500;
}

#achievements li::before {
  content: "🏆";
  margin-right: 0.5rem;
}

body.dark #achievements li {
  background: #1e1e1e;
  color: #e0e0e0;
}

/* Testimonials */
#testimonials blockquote {
  border-left: 4px solid #007acc;
  padding-left: 1rem;
  font-style: italic;
  background: #f9f9f9;
  border-radius: 6px;
  padding: 1rem 1.5rem;
}

#testimonials cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

body.dark #testimonials blockquote {
  background: #1e1e1e;
  color: #ccc;
}

body.dark #testimonials cite {
  color: #aaa;
}

/* Contact */
#contact p a {
  color: #007acc;
  text-decoration: none;
}

#contact p a:hover,
#contact p a:focus {
  text-decoration: underline;
}

body.dark #contact p a {
  color: #80d8ff;
}

#contact-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#contact-form input,
#contact-form textarea {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

body.dark #contact-form input,
body.dark #contact-form textarea {
  background: #1e1e1e;
  border: 1px solid #444;
  color: #fff;
}

#contact-form button {
  align-self: flex-start;
  background: #007acc;
  color: white;
  font-weight: 600;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

#contact-form button:hover {
  background: #005f99;
}

/* Scroll Animations - default hidden state */
.skill-tag,
.project,
#achievements li,
#testimonials blockquote {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Visible state */
.skill-tag.visible,
.project.visible,
#achievements li.visible,
#testimonials blockquote.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .skill-tag,
  .project {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive Tweaks */

/* Mobile Breakpoint */
@media (max-width: 768px) {

  #menu-toggle {
    display: block; /* show burger menu on mobile */
  }

  .nav-list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 20px;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
  }

  body.dark .nav-list {
    background: #1e1e1e;
  }

  .nav-list.show {
    display: flex;
  }
}

/* Hide burger menu on desktop */
@media (min-width: 769px) {
  #menu-toggle {
    display: none;
  }
}

/* Smaller mobile devices tweaks */
@media (max-width: 480px) {
  .nav-list {
    gap: 1rem;
  }

  .intro h1 {
    font-size: 2rem;
  }

  .intro p {
    font-size: 1rem;
  }

  #contact-form button {
    width: 100%;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: #777;
}
