/* ==========================================================================
   Adapter: map current HTML classes to base (style.css) design system
   Uses variables from :root (--color-primary, --primary-tint, etc.)
   ========================================================================== */

/* Reserve space for fixed navbar so content is not hidden underneath */
body {
  padding-top: 72px;
}

/* Anchor targets: leave room for fixed nav when smooth-scrolling */
#about,
#skills,
#experience,
#portfolio,
#badges,
#contact {
  scroll-margin-top: 5.5rem;
}

/* ----- Navbar (maps to reference .site-header + .header-main) ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 0.75rem 0;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  background: rgba(18, 18, 18, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.navbar.scrolled {
  background: rgba(12, 12, 12, 0.98);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  min-width: 0;
  gap: 1rem;
  min-height: 48px;
}

/* ----- Logo (maps to reference .logo) ----- */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
  flex-shrink: 0;
}

.nav-logo svg {
  flex-shrink: 0;
  color: inherit;
}

.nav-logo:hover {
  transform: scale(1.04);
  opacity: 0.95;
}

.nav-logo:focus-visible {
  outline-offset: 4px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  text-transform: none;
}

.logo-full {
  font-size: 1.2rem;
  color: var(--text-heading);
}

/* ----- Nav right + menu (maps to reference .nav-list) ----- */
.nav-right {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 1.5rem;
}

.nav-menu {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
  min-height: 36px;
}

.nav-menu li {
  margin: 0;
  padding: 0;
}

/* .nav-link: white by default; green on hover/focus/active (active set on anchor by useSite) */
.navbar .nav-link {
  color: var(--color-white);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25;
  padding: 0.4rem 0;
  position: relative;
  transition: color var(--transition-speed) ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  box-sizing: border-box;
}

.navbar .nav-link svg {
  flex-shrink: 0;
}

.navbar .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-speed) ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible,
.navbar .nav-link.active {
  color: var(--primary);
}

.navbar .nav-link:hover::before,
.navbar .nav-link:focus-visible::before,
.navbar .nav-link.active::before {
  transform: scaleX(1);
  transform-origin: left;
}

.navbar .nav-link::after {
  display: none;
}

/* ----- Mobile menu toggle (maps to reference .mobile-menu-button) ----- */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gray);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
  z-index: 1001;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
  background: var(--primary-tint);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-primary);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: currentColor;
  margin: 2px 0;
  transition: var(--transition-speed);
  border-radius: 1px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ----- Mobile overlay + panel (maps to reference .mobile-nav) ----- */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 100%;
  height: 100%;
  background: var(--background-surface);
  box-shadow: -1px 0 0 var(--border-color);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-speed) ease;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
    max(2rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.mobile-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  background: none;
  border: none;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  color: var(--gray);
  transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

.mobile-menu-close:hover,
.mobile-menu-close:focus-visible {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.mobile-menu-close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.mobile-menu-close svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Mobile nav menu + links */
.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.mobile-nav-menu li {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  min-height: 48px;
  box-sizing: border-box;
  text-align: center;
  width: 100%;
  font-size: 1.125rem;
  color: var(--gray);
  text-decoration: none;
  transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

.mobile-nav-link svg {
  flex-shrink: 0;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible,
.mobile-nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.mobile-nav-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.mobile-menu-footer {
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.mobile-social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.mobile-social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  text-decoration: none;
  transition: all var(--transition-speed) ease;
}

.mobile-social-links a svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.mobile-social-links .social-link-github { color: #ffffff; }
.mobile-social-links .social-link-github:hover,
.mobile-social-links .social-link-github:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.mobile-social-links .social-link-linkedin { color: #0A66C2; }
.mobile-social-links .social-link-linkedin:hover,
.mobile-social-links .social-link-linkedin:focus-visible {
  background: rgba(10, 102, 194, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
  color: #0A66C2;
}

/* ----- Responsive: show mobile toggle, hide desktop nav ----- */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
  }

  .nav-menu {
    display: none;
  }

  .nav-right {
    justify-content: flex-end;
  }

  .nav-container {
    padding: 0 1.25rem;
  }
}

/* Medium viewport: tighter nav so all links fit before mobile breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav-menu {
    gap: 1rem;
  }
  .nav-right {
    gap: 1rem;
  }
  .nav-container {
    padding: 0 1.25rem;
  }
  .navbar .nav-link {
    font-size: 0.875rem;
  }
}

/* ----- Body scroll lock when mobile menu open (JS adds .active) ----- */
body.mobile-menu-open {
  overflow: hidden;
}

/* ==========================================================================
   Hero (current HTML uses .hero-bg-effects, .hero-container, .hero-content, etc.)
   ========================================================================== */

/* Reuse base .hero; add layout for .hero-container and content */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 2rem 0;
  background-color: #0e1310;
}

/* LCP background image (priority loaded via Next/Image in Hero.tsx) */
.hero-bg-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-bg-image img {
  object-fit: cover;
}

/* Portrait on its own layer; lazy-loaded in Hero.tsx */
.hero-portrait {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 12%;
}

.hero-portrait img {
  height: 90%;
  max-height: 560px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

@media (max-width: 768px) {
  .hero-portrait {
    display: none;
  }
}

@media (min-width: 1200px) {
  .hero-portrait img {
    height: 95%;
    max-height: 680px;
  }
}

.hero-bg-effects {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(10, 14, 12, 0.88) 0%, rgba(18, 22, 20, 0.72) 35%, rgba(14, 18, 16, 0.82) 70%, rgba(8, 12, 10, 0.9) 100%),
    radial-gradient(ellipse 80% 50% at 50% 20%, var(--primary-tint-strong) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, var(--primary-tint) 0%, transparent 45%),
    radial-gradient(ellipse 100% 80% at 80% 80%, rgba(119, 231, 137, 0.04) 0%, transparent 50%);
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-tint) 0%, rgba(119, 231, 137, 0.03) 100%);
  backdrop-filter: blur(0.5px);
  opacity: 0.35;
}

.shape-1 { width: 200px; height: 200px; top: 10%; left: 10%; }
.shape-2 { width: 150px; height: 150px; top: 60%; right: 15%; }
.shape-3 { width: 100px; height: 100px; top: 30%; left: 60%; }
.shape-4 { width: 250px; height: 250px; bottom: 20%; left: 20%; }
.shape-5 { width: 80px; height: 80px; top: 70%; right: 30%; }

.bg-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(119, 231, 137, 0.08);
  opacity: 0.5;
}

.particle-1 { width: 6px; height: 6px; top: 20%; left: 30%; }
.particle-2 { width: 8px; height: 8px; top: 50%; right: 25%; }
.particle-3 { width: 4px; height: 4px; top: 75%; left: 50%; }
.particle-4 { width: 10px; height: 10px; bottom: 30%; right: 40%; }
.particle-5 { width: 5px; height: 5px; top: 40%; left: 80%; }
.particle-6 { width: 7px; height: 7px; bottom: 50%; left: 15%; }

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  min-height: 85vh;
  position: relative;
  z-index: 2;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  position: relative;
  z-index: 10;
  min-width: 0;
  max-width: 560px;
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-role {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--color-white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-specialty {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-white);
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-description {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.hero-text {
  font-size: 1.1rem;
  color: var(--color-white);
  line-height: 1.75;
  max-width: 520px;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-text strong {
  color: var(--color-white);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.hero-visual {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.hero-graphic,
.hero-profile {
  position: relative;
}

.profile-image {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
}

.employment-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--color-primary);
  color: var(--color-dark);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.hero-social {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0;
}

.hero-social .social-label {
  font-size: 0.9rem;
  color: var(--color-white);
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-social .social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-social .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  text-decoration: none;
  transition: all var(--transition-speed) ease;
}

.hero-social .social-link svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

.hero-social .social-link-github { color: #ffffff; }
.hero-social .social-link-github:hover,
.hero-social .social-link-github:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.hero-social .social-link-linkedin { color: #0A66C2; }
.hero-social .social-link-linkedin:hover,
.hero-social .social-link-linkedin:focus-visible {
  background: rgba(10, 102, 194, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
  color: #0A66C2;
}

.hero-social .social-link-instagram { color: #E4405F; }
.hero-social .social-link-instagram:hover,
.hero-social .social-link-instagram:focus-visible {
  background: rgba(228, 64, 95, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
  color: #E4405F;
}

.hero-social .social-link-email { color: var(--color-gray-medium); }
.hero-social .social-link-email:hover,
.hero-social .social-link-email:focus-visible {
  background: var(--primary-tint);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-primary);
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin-top: 2rem;
}

.scroll-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-white);
  text-decoration: none;
  font-size: 0.85rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: color var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

.scroll-link:hover,
.scroll-link:focus-visible {
  color: var(--color-primary);
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
}

.scroll-indicator span {
  font-size: 0.8rem;
  white-space: nowrap;
}

.scroll-indicator svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  animation: scroll-chevron-bounce 2s ease-in-out infinite;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-tint);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-speed) ease;
}

.highlight-item:hover {
  background: var(--primary-tint-strong);
  color: var(--color-primary);
}

/* Section header (base has .section-title; we use .section-header wrapper) */
.section-header {
  margin-bottom: 3rem;
}

.section-header .section-title {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  body {
    padding-top: calc(72px + env(safe-area-inset-top));
  }

  #about,
  #skills,
  #experience,
  #portfolio,
  #badges,
  #contact {
    scroll-margin-top: calc(5.5rem + env(safe-area-inset-top));
  }

  .navbar .nav-container {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.5rem 0 3rem;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .hero-container {
    justify-content: center;
    min-height: auto;
    padding: 0 max(1.25rem, env(safe-area-inset-left)) 0 max(1.25rem, env(safe-area-inset-right));
    padding-top: 2rem;
  }

  .hero-content {
    gap: 1.5rem;
    max-width: none;
  }

  .hero-name {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }

  .hero-role {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
  }

  .hero-specialty {
    font-size: clamp(0.9rem, 3vw, 1.05rem);
  }

  .hero-text {
    font-size: 1rem;
    line-height: 1.65;
  }

  .hero-actions {
    gap: 0.75rem;
  }

  .hero-actions .cta-button {
    min-height: 44px;
    flex: 1 1 auto;
    min-width: 140px;
  }

  .hero-scroll {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 3rem;
    padding-bottom: 1rem;
  }

  .mobile-menu-content {
    padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
      max(2rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  }

  .mobile-nav-link {
    min-height: 48px;
    padding: 0.875rem 1rem;
  }
}

@media (max-width: 480px) {
  .hero-container {
    padding-top: 1.5rem;
  }

  .hero-scroll {
    margin-top: 3.5rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .hero-name {
    font-size: clamp(1.75rem, 9vw, 2.75rem);
  }
}
