:root {
  --bg-dark: #1f2933;
  --bg-light: #f5f7fa;
  --accent: #2563eb;

  --text-primary: #111827;
  --text-inverse: #ffffff;

  --nav-bg: #1f2933;
  --main-bg: #f5f7fa;
  --card-bg: #ffffff;
}

/* DARK MODE */
[data-theme="dark"] {
  --nav-bg: #0f172a;
  --main-bg: #020617;
  --card-bg: #020617;

  --text-primary: #e5e7eb;
  --text-inverse: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  height: 100vh;
  background: var(--main-bg);
  color: var(--text-primary);
  overflow: hidden;
}

/* NAV */

nav {
  width: 280px;
  background: var(--nav-bg);
  color: var(--text-inverse);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

nav img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
}

nav h1 {
  margin: 12px 0 24px;
  font-size: 1.4rem;
}

nav ul {
  list-style: none;
  padding: 0;
  width: 100%;
}

nav ul li a {
  display: block;
  padding: 8px 12px;
  margin-bottom: 8px;
  color: var(--text-inverse);
  text-decoration: none;
  border-radius: 6px;
}

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* NAV STYLES */
.nav-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  position: relative;
}

.nav-menu li a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: transparent;
  border-radius: 0 4px 4px 0;
  transition: background 0.2s ease;
}

.nav-menu li a:hover::before {
  background: var(--accent);
}

[data-theme="dark"] .nav-menu li a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-menu li a:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
}

.nav-menu li a:focus-visible::before {
  background: var(--accent);
}

.nav-menu i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1000;
}

.nav-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* .nav-menu li a:hover i {
  opacity: 1;
  transform: translateX(2px);
  color: var(--accent);
} */

/* .nav-menu li a:hover span {
  color: var(--accent);
} */
.nav-menu li a span,
.nav-menu li a i {
  color: var(--text-inverse);
}

.nav-menu li a i {
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

/* ACTIVE NAV ITEM */
.nav-menu li a.active {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .nav-menu li a.active {
  background: rgba(255, 255, 255, 0.06);
}

.nav-menu li a.active::before {
  background: var(--accent);
}

/* NAV ICON VISIBILITY FIX */
.nav-menu li a i {
  color: var(--text-inverse);

  opacity: 0.8;
  transform: scale(1);
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.nav-menu li a:hover i,
.nav-menu li a.active i {
  opacity: 1;
  transform: scale(1.08);
}

.linkedin {
  margin-top: auto;
  text-align: center;
}

.linkedin a {
  display: inline-block;
}

.linkedin img {
  width: 120px;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.linkedin img:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.qr-label {
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-inverse);
  opacity: 0.85;
}

.qr-label i {
  margin-right: 6px;
}

.qr-subtext {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

/* MAIN */
main {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

section {
  margin-bottom: 60px;
}

section h2 {
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  padding-bottom: 4px;
}

/* PORTFOLIO */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--card-bg);
  color: var(--text-primary);
  padding: 32px;
  border-radius: 12px;
  max-width: 640px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
}

.modal-section {
  margin-top: 24px;
}

.modal-section h4 {
  margin-bottom: 8px;
}

.close {
  float: right;
  font-size: 1.4rem;
  cursor: pointer;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
}

.theme-toggle {
  margin: 20px 0;
  padding: 8px 12px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-inverse);
  cursor: pointer;
  font-size: 0.9rem;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 16px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--text-inverse);
  margin: 5px 0;
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.mobile-header {
  display: none;
}

/* Role Switcher Style */
.role-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0 24px;
}

.role-label {
  font-size: 0.85rem;
  opacity: 0.7;
}

.role-buttons {
  display: flex;
  gap: 8px;
}

.role-btn {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-btn:hover {
  background: rgba(37, 99, 235, 0.1);
}

.role-btn.active {
  background: var(--accent);
  color: #fff;
}

/***********************/
/* Mobile Layout Rules */
/***********************/
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    background: var(--nav-bg);
    color: var(--text-inverse);
    position: sticky;
    top: 0;
    z-index: 1200;
  }

  .mobile-title {
    font-size: 1rem;
    font-weight: 600;
  }

  /* Hamburger visible here */
  .hamburger {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
  }

  .hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-inverse);
    margin: 5px 0;
    border-radius: 2px;
  }
  /* Kill desktop flex layout entirely */
  body {
    display: block !important;
    height: auto !important;
    min-height: 100vh;
    overflow: auto !important;
  }

  /* Nav becomes a true off-canvas drawer */
  nav {
    display: block; /* BREAK OUT of flexbox context */
    position: fixed;
    top: 56px;
    left: 0;
    width: 280px;
    height: calc(100vh - 56px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1100;
  }

  nav.open {
    transform: translateX(0);
  }
  .nav-content {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 24px;
  }

  /* Main content must not reserve sidebar space */
  main {
    overflow-y: visible;
    scroll-behavior: auto;
    margin-left: 0 !important;
    width: 100%;
    height: auto;
    overflow: visible;
  }
  .modal-content {
    max-height: 85vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

/* Cards and Roles Styles */
.card.deemphasized {
  opacity: 0.4;
  filter: grayscale(60%);
}

.role-highlights {
  margin-top: 10px;
  padding-left: 18px;
  font-size: 0.85rem;
}

.role-highlights li {
  margin-bottom: 6px;
}

.role-reset {
  margin-left: auto;
  font-size: 0.75rem;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
}

/* Skills section */
.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
}

.skills-list li {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.skills-list li.primary {
  border-left: 4px solid var(--accent);
  font-weight: 600;
}

.skills-list li.secondary {
  opacity: 0.55;
}

.skills-list li.active {
  border-left: 4px solid var(--accent);
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

/* Visual testimonial cards */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.testimonial-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 24px;
  position: relative;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.testimonial-quote {
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 16px;
}

.testimonial-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-person img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.testimonial-title {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Contact email address copy link */
.contact-email {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  border-radius: 4px;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.copy-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  transform: scale(1.05);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.copy-btn.copied {
  color: green;
}

/* vCard details */
.contact-actions {
  margin-top: 12px;
}

.vcard-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

/* CONTACT */
.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
}

.contact-item i {
  color: var(--accent);
  font-size: 1rem;
}

.contact-text {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons */
.vcard-btn,
.linkedin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

/* LinkedIn accent (subtle, not loud) */
.linkedin-btn {
  background: #0a66c2;
}

.linkedin-btn:hover {
  background: #084d94;
}

/* Role selector */
.role-selector {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 40px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.role-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.role-subtitle {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 16px;
}

.role-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.role-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}

.role-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
