/* ============================================================
   MAIN.CSS — Shared styles: variables, reset, nav, footer
   ============================================================ */

/* --- CSS Custom Properties --------------------------------- */
:root {
  --jpm-primary:       #4F46E5;   /* Indigo */
  --jpm-primary-dark:  #3730A3;   /* Deep indigo */
  --jpm-accent:        #06B6D4;   /* Teal/Cyan */
  --jpm-accent-hover:  #0891B2;   /* Darker teal */

  --bg-page:           #F8FAFC;
  --bg-section-alt:    #EEF2FF;   /* Very light indigo tint */
  --bg-card:           #FFFFFF;

  --text-primary:      #0F0F1A;
  --text-secondary:    #1E293B;
  --text-muted:        #64748B;

  --border:            #CBD5E1;
  --border-light:      #E2E8F0;

  --shadow-sm:  0 1px 3px rgba(79,70,229,0.06);
  --shadow-md:  0 4px 12px rgba(79,70,229,0.09);
  --shadow-lg:  0 12px 32px rgba(79,70,229,0.15);

  --success:    #10B981;
  --nav-h:      64px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --transition: 0.22s ease;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  padding-top: var(--nav-h);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* --- Container --------------------------------------------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation -------------------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  box-shadow: 0 1px 8px rgba(79,70,229,0.07);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--jpm-primary), var(--jpm-primary-dark));
  color: white;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

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

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  position: relative;
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 14px; right: 14px;
  height: 2px;
  background: var(--jpm-accent);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--jpm-primary);
  background: rgba(6, 182, 212, 0.07);
}

.nav-link.active::after { transform: scaleX(1); }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--bg-section-alt); }

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--jpm-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger { position: relative; }
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}
.hamburger::before { top: -6px; }
.hamburger::after  { top:  6px; }

/* Open state */
.nav-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle[aria-expanded="true"] .hamburger::after  { transform: rotate(-45deg); top: 0; }

/* --- Mobile Nav -------------------------------------------- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: white;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding: 0;
  }
  .nav-links.open {
    max-height: 300px;
    padding: 8px 0;
  }
  .nav-link {
    width: 100%;
    border-radius: 0;
    padding: 14px 24px;
  }
  .nav-link::after { display: none; }
}

/* --- Footer ------------------------------------------------ */
.footer {
  background: var(--jpm-primary);
  color: rgba(255,255,255,0.7);
  padding: 32px 0;
  margin-top: 80px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 14px;
}

.footer-copy strong {
  color: white;
  font-weight: 600;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
}
.footer-social-link:hover { color: white; }
.footer-social-link svg { flex-shrink: 0; }

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* --- Shared Section Utilities ------------------------------ */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-section-alt); }

.section-header { margin-bottom: 48px; }
.section-header.centered { text-align: center; }

.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--jpm-accent);
  margin-bottom: 10px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-top: 14px;
  max-width: 540px;
  line-height: 1.65;
}

.section-header.centered .section-subtitle { margin-left: auto; margin-right: auto; }

/* --- Shared Button Styles ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 48px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--jpm-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(79,70,229,0.28);
}
.btn-primary:hover {
  background: var(--jpm-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(79,70,229,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--jpm-primary);
  border-color: var(--jpm-primary);
}
.btn-outline:hover {
  background: var(--jpm-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}

.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: white;
  border-color: rgba(255,255,255,0.4);
}
.btn-ghost:hover {
  background: white;
  color: var(--jpm-primary);
  border-color: white;
}

.btn svg { flex-shrink: 0; }

/* --- Tag / Badge ------------------------------------------ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--jpm-accent);
}

/* --- Scroll-Reveal Animation ------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --- Divider ----------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 0;
}

/* --- Page Header Banner (used on About/Skills/Projects/Contact) --- */
.page-header-banner {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 55%, #4F46E5 100%);
  padding: 56px 0 48px;
  color: white;
  position: relative;
  overflow: hidden;
}
.page-header-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.page-header-banner .container { position: relative; z-index: 1; }

.page-header-banner .section-eyebrow { color: rgba(255,255,255,0.6); }

.page-header-banner h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
  color: white;
}

.page-header-banner .page-sub {
  font-size: 17px;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .page-header-banner { padding: 40px 0 32px; }
  .page-header-banner h1 { font-size: 28px; letter-spacing: -0.4px; }
  .page-header-banner .page-sub { font-size: 15px; }
}

/* --- Accessibility ----------------------------------------- */
:focus-visible {
  outline: 2px solid var(--jpm-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (prefers-contrast: high) {
  .nav-link.active::after { height: 3px; }
  .btn { border-width: 2px; }
}
