/* --- ROOT & GENERAL --- */
/* DEFAULT: DARK MODE */
:root {
  --bg: #10162F;
  --surface: #1E293B;
  --border: #334155;
  --text-dark: #111827;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-muted-light: #6B7280;
  --primary: #FACC15;
  --accent-blue: #6366F1;
  --card-bg: #FFFFFF;
  --card-border: #E5E7EB;
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-subtle: all 0.3s ease;
  --transition-main: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
  min-height: 100vh;
}

/* Light Mode overrides */
body.light-theme {
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --text: #111827;
  --text-muted: #6B7280;
  --text-muted-light: #94A3B8;
  --accent-blue: #4F46E5;
  --primary: #FACC15;
  --card-bg: #FFFFFF;
  --card-border: #E5E7EB;
}

.background-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.1;
  z-index: -1;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 4rem);
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition-main);
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--bg);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.3);
}

.btn-secondary {
  border-color: var(--border);
  background-color: transparent;
  color: var(--text);
}

.btn-secondary:hover {
  background-color: var(--surface);
  border-color: var(--surface);
}

/* --- HEADER (MOBILE FIRST) --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 4%;
  background-color: rgba(16, 22, 47, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

body.light-theme .header {
  background-color: rgba(241, 245, 249, 0.95);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

/* Mobile: Hidden navbar */
.navbar {
  position: fixed;
  top: 60px;
  left: -100%;
  width: 100%;
  background-color: var(--surface);
  padding: 1.5rem 4%;
  flex-direction: column;
  gap: 1rem;
  transition: left 0.4s ease-in-out;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.navbar.active {
  left: 0;
  display: flex;
}

.navbar a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
  padding: 0.75rem;
  border-radius: 8px;
  display: block;
}

.navbar a:hover {
  color: var(--text);
  background-color: rgba(99, 102, 241, 0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Mobile: Hide Download CV button */
.header-right .btn-primary {
  display: none;
}

#theme-toggle {
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  width: 40px;
  height: 40px;
}

#menu-icon {
  display: block;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

/* --- HOME SECTION (MOBILE FIRST) --- */
.home {
  padding: 3rem 4%;
  min-height: auto;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.hero-text h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-text p {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 100%;
}

.hero-image-container {
  display: none;
}

.hero-image {
  width: 100%;
  max-width: 250px;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- SKILLS SECTION (MOBILE FIRST) --- */
.skills {
  padding: 3rem 4%;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.skill-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: transparent;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-main);
}

.skill-card:hover {
  background-color: var(--surface);
  transform: translateY(-3px);
}

.skill-card i {
  color: var(--accent-blue);
  flex-shrink: 0;
}

.skill-card span {
  word-break: break-word;
}

/* --- PROJECTS SECTION (MOBILE FIRST) --- */
.projects {
  padding: 3rem 0;
  overflow: hidden;
}

.projects-header {
  padding: 0 4%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.projects-header .section-title {
  text-align: center;
  margin-bottom: 0;
  width: 100%;
}

.projects-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.project-nav-btn {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.project-nav-btn:hover {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.projects-scroller {
  overflow-x: auto;
  padding: 0.5rem 4% 1.5rem 4%;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.projects-scroller::-webkit-scrollbar {
  display: none;
}

.project-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  width: max-content;
}

.project-card {
  width: 280px;
  flex-shrink: 0;
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  transition: var(--transition-subtle);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-blue);
}

.project-card .card-tag {
  align-self: flex-start;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--accent-blue);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  white-space: nowrap;
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.3;
}

.project-card p.card-summary {
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1rem;
  line-height: 1.5;
  font-size: 0.9rem;
}

.project-card .card-footer {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.project-card .card-footer i {
  width: 14px;
  flex-shrink: 0;
}

.btn-view-project {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 100%;
  padding: 0.65rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-subtle);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.btn-view-project:hover {
  background-color: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

/* --- EXPERIENCE/JOURNEY SECTION (MOBILE FIRST) --- */
.experience {
  padding: 3rem 4%;
}

.journey-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 100%;
  margin: 0 auto;
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.journey-nav {
  list-style: none;
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.journey-nav::-webkit-scrollbar {
  display: none;
}

.journey-nav-item {
  font-family: var(--font-heading);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-main);
  border: 1px solid transparent;
  flex-shrink: 0;
  white-space: nowrap;
}

.journey-nav-item.active {
  color: var(--text);
  background-color: rgba(79, 70, 229, 0.1);
  border-color: var(--accent-blue);
}

.journey-content {
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.journey-panel {
  flex-grow: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  position: absolute;
  inset: 0;
}

.journey-panel.active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

.journey-panel h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.journey-panel .meta {
  display: block;
  color: var(--accent-blue);
  font-weight: 600;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.journey-panel p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.btn-view-more {
  align-self: flex-start;
}

/* --- CERTIFICATIONS SECTION (MOBILE FIRST) --- */
.certifications {
  padding: 3rem 4%;
}

.credential-category {
  margin-bottom: 3rem;
}

.credential-category:last-child {
  margin-bottom: 0;
}

.credential-category h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.cert-card-new {
  background-color: var(--surface);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.cert-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cert-header i {
  color: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.cert-header h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  line-height: 1.3;
  word-break: break-word;
}

.cert-issuer {
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
  font-size: 0.9rem;
}

.cert-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.cert-verify {
  margin-top: auto;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  font-size: 0.9rem;
}

.cert-verify:hover {
  text-decoration: underline;
}

.cert-card-new.is-hidden {
  display: none;
}

.btn-view-all {
  display: block;
  margin: 1.5rem auto 0;
  width: fit-content;
}

/* --- CONTACT SECTION (MOBILE FIRST) --- */
.contact {
  padding: 3rem 4%;
  text-align: center;
}

.contact h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  color: var(--text);
  margin-bottom: 1rem;
}

.contact p {
  color: var(--text-muted);
  max-width: 100%;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  padding: 0 1rem;
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 0 1rem;
}

.contact-buttons .btn {
  width: 100%;
  max-width: 300px;
  text-align: center;
  justify-content: center;
}

/* --- FOOTER (MOBILE FIRST) --- */
.footer {
  padding: 2rem 4%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  gap: 1rem;
  text-align: center;
}

.footer-contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-contact-links a {
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
  font-weight: 500;
  font-size: 0.9rem;
  word-break: break-all;
}

.footer-contact-links a:hover {
  color: var(--text);
}

/* --- MODAL (MOBILE FIRST) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 22, 47, 0.9);
  backdrop-filter: blur(8px);
  z-index: 1001;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
  padding: 1rem;
  overflow-y: auto;
}

body.light-theme .modal-overlay {
  background: rgba(241, 245, 249, 0.9);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--surface);
  width: 100%;
  max-width: 600px;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  transform: scale(0.95);
  transition: transform 0.4s ease;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  gap: 1rem;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.modal-header .close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-project-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.modal-body h1 {
  color: var(--text);
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  line-height: 1.3;
}

.modal-body h4 {
  color: var(--text);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.modal-body p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.modal-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.modal-body .btn-external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1.25rem;
  background-color: var(--accent-blue);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  width: 100%;
  justify-content: center;
  max-width: 250px;
}

.modal-body .btn-external-link:hover {
  background-color: var(--primary);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ================================================ */
/* TABLET RESPONSIVE (min-width: 768px) */
/* ================================================ */
@media (min-width: 768px) {
  .section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 3rem;
  }

  /* Header */
  .header {
    padding: 1.25rem 5%;
  }

  .logo {
    font-size: 1.75rem;
  }

  .navbar {
    position: static;
    display: flex;
    flex-direction: row;
    width: auto;
    background-color: transparent;
    padding: 0;
    gap: 1.5rem;
    border-bottom: none;
    box-shadow: none;
  }

  .navbar a {
    padding: 0;
  }

  #menu-icon {
    display: none;
  }

  .header-right .btn-primary {
    display: inline-block;
  }

  /* Home */
  .home {
    padding: 4rem 5%;
  }

  .hero-content {
    flex-direction: row;
    text-align: left;
    gap: 3rem;
  }

  .hero-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero-image {
    max-width: 280px;
  }

  /* Skills */
  .skills {
    padding: 4rem 5%;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .skill-card {
    padding: 1.25rem;
  }

  /* Projects */
  .projects {
    padding: 4rem 0;
  }

  .projects-header {
    padding: 0 5%;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 2rem;
  }

  .projects-scroller {
    padding: 0.5rem 5% 1.5rem 5%;
  }

  .project-grid {
    gap: 1.25rem;
  }

  .project-card {
    width: 320px;
    padding: 1.5rem;
  }

  .project-card h3 {
    font-size: 1.4rem;
  }

  .project-card p.card-summary {
    font-size: 0.95rem;
  }

  /* Experience */
  .experience {
    padding: 4rem 5%;
  }

  .journey-container {
    padding: 2rem;
    gap: 3rem;
  }

  .journey-nav {
    border-bottom: none;
    flex-direction: column;
    overflow-x: visible;
  }

  .journey-nav-item {
    font-size: 1.25rem;
    padding: 1rem;
    border-left: 3px solid transparent;
  }

  .journey-nav-item.active {
    border-left-color: var(--accent-blue);
    border-bottom: none;
  }

  .journey-content {
    min-height: 250px;
  }

  .journey-panel h3 {
    font-size: 1.75rem;
  }

  /* Certifications */
  .certifications {
    padding: 4rem 5%;
  }

  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .cert-card-new {
    padding: 1.5rem;
  }

  .cert-header h4 {
    font-size: 1.2rem;
  }

  /* Contact */
  .contact {
    padding: 4rem 5%;
  }

  .contact-buttons {
    flex-direction: row;
    justify-content: center;
  }

  .contact-buttons .btn {
    width: auto;
  }

  /* Footer */
  .footer {
    padding: 2.5rem 5%;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-contact-links {
    flex-direction: row;
    gap: 1.5rem;
  }

  /* Modal */
  .modal-content {
    max-width: 700px;
    padding: 2rem;
  }

  .modal-header h2 {
    font-size: 1.75rem;
  }

  .modal-body h1 {
    font-size: 1.75rem;
  }

  .modal-body h4 {
    font-size: 1.25rem;
  }

  .modal-body .btn-external-link {
    width: auto;
  }
}

/* ================================================ */
/* DESKTOP RESPONSIVE (min-width: 992px) */
/* ================================================ */
@media (min-width: 992px) {
  /* Home */
  .home {
    padding: 6rem 5%;
  }

  .hero-content {
    gap: 4rem;
  }

  .hero-image {
    max-width: 300px;
  }

  .hero-image-container:hover .hero-image {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  }

  body.light-theme .hero-image-container:hover .hero-image {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Projects */
  .projects {
    padding: 6rem 0;
  }

  .projects-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .projects-header .section-title {
    grid-column: 2 / 3;
  }

  .projects-header .projects-nav {
    grid-column: 3 / 4;
    justify-self: end;
  }

  .project-card {
    width: 350px;
  }

  /* Experience */
  .experience {
    padding: 6rem 5%;
  }

  .journey-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    max-width: 1100px;
    padding: 3rem;
  }

  .journey-nav-item {
    font-size: 1.5rem;
  }

  .journey-panel h3 {
    font-size: 2rem;
  }

  /* Certifications */
  .certifications {
    padding: 6rem 5%;
  }

  .cert-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .credential-category h3 {
    font-size: 1.8rem;
  }

  /* Contact */
  .contact {
    padding: 6rem 5%;
  }

  /* Footer */
  .footer {
    padding: 3rem 5%;
  }
}

/* ================================================ */
/* LARGE DESKTOP (min-width: 1200px) */
/* ================================================ */
@media (min-width: 1200px) {
  .hero-image {
    max-width: 350px;
  }

  .journey-nav-item {
    font-size: 1.8rem;
  }
}

/* ================================================ */
/* FIX OVERFLOW ISSUES */
/* ================================================ */
img {
  max-width: 100%;
  height: auto;
}

/* Prevent text overflow */
h1, h2, h3, h4, h5, h6, p, span, a {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Smooth scrolling for modal */
.modal-content {
  -webkit-overflow-scrolling: touch;
}