/* ============================================
   GLOBAL STYLES — Shree Nath Mahato Portfolio
   Font: Plus Jakarta Sans (clean, normal, professional)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0d1421;
  --bg-card: #111827;
  --bg-card-hover: #161f30;

  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(6,182,212,0.15) 100%);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --border: rgba(255,255,255,0.07);
  --border-accent: rgba(139,92,246,0.3);

  --nav-height: 70px;
  --radius: 12px;
  --radius-lg: 20px;

  --font-body: 'Plus Jakarta Sans', sans-serif;

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-accent: 0 0 40px rgba(139,92,246,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity 0.5s ease;
}
body.loaded { opacity: 1; }

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

h1,h2,h3,h4,h5 { font-family: var(--font-body); line-height: 1.2; color: var(--text-primary); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-purple); border-radius: 3px; }

/* ============================================ NAVBAR */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; height: var(--nav-height);
  display: flex; align-items: center;
  transition: background var(--transition), border-bottom var(--transition);
}
.navbar.scrolled {
  background: rgba(8,12,20,0.93);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: 1200px; width: 100%; margin: 0 auto;
  padding: 0 2rem; display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-weight: 800; font-size: 1.1rem; letter-spacing: 0.08em;
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-menu { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  font-weight: 500; font-size: 0.9rem; color: var(--text-secondary);
  padding: 0.5rem 1rem; border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.nav-link.active { color: var(--accent-cyan); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================ BUTTONS */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.8rem; background: var(--accent-gradient);
  color: white; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em;
  border-radius: 8px; border: none; cursor: pointer; text-transform: uppercase;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(139,92,246,0.4); opacity: 0.92; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.6rem; background: transparent; color: var(--text-primary);
  font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em;
  border-radius: 8px; border: 1px solid var(--border-accent); cursor: pointer; text-transform: uppercase;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.btn-outline:hover { background: rgba(139,92,246,0.1); border-color: var(--accent-purple); transform: translateY(-2px); }

/* ============================================ BADGES */
.badge, .skill-tag {
  display: inline-block; padding: 0.3rem 0.75rem;
  background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.25);
  color: var(--accent-purple); font-size: 0.78rem; font-weight: 600;
  border-radius: 100px; transition: background var(--transition), color var(--transition);
}
.badge:hover, .skill-tag:hover { background: rgba(139,92,246,0.2); color: #c4b5fd; }

/* ============================================ CARDS */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-accent); box-shadow: var(--shadow-accent); }

/* ============================================ PAGE HEADER */
.page-header {
  padding: calc(var(--nav-height) + 5rem) 2rem 4rem;
  text-align: center; position: relative; overflow: hidden;
}
.page-header::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(139,92,246,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.page-header h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 1rem;
  animation: fadeUp 0.7s ease 0.1s both;
}
.page-header p {
  font-size: 1.1rem; color: var(--text-secondary); max-width: 500px; margin: 0 auto;
  animation: fadeUp 0.7s ease 0.25s both;
}

/* ============================================ PAGE CONTENT */
.page-content { max-width: 1200px; margin: 0 auto; padding: 2rem 2rem 6rem; }
.content-section { margin-bottom: 4rem; }
.content-section h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: 1rem; }
.content-section p { color: var(--text-secondary); font-size: 1.05rem; max-width: 700px; line-height: 1.8; }

/* ============================================ GRIDS */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.5rem; margin-top: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1.5rem; margin-top: 2rem; }

/* ============================================ CTA BANNER */
.cta-banner {
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1040 50%, #0f172a 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg); padding: 4rem 2rem;
  margin-top: 4rem; position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(139,92,246,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.cta-banner h2 {
  font-size: clamp(1.5rem,3vw,2.2rem); font-weight: 800; margin-bottom: 0.75rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cta-banner p { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 2rem; }

/* ============================================ FOOTER */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 4rem 2rem 2rem; }
.footer-content {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem;
  padding-bottom: 3rem; border-bottom: 1px solid var(--border);
}
.footer-section h3 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.25rem; }
.footer-section p, .footer-section a { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.9; transition: color var(--transition); }
.footer-section a:hover { color: var(--accent-cyan); }
.footer-section ul li { margin-bottom: 0.5rem; }
.footer-brand-name { font-weight: 800; font-size: 1rem; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 0.75rem; }
.social-links { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); transition: all var(--transition); }
.social-links a:hover { background: var(--accent-gradient); border-color: transparent; color: white; transform: translateY(-2px); }
.footer-bottom { max-width: 1200px; margin: 2rem auto 0; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* ============================================ NOTIFICATIONS */
.notification { position: fixed; top: 90px; right: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); z-index: 9999; max-width: 380px; animation: notifIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.notification.success { border-left: 3px solid #10b981; }
.notification.error { border-left: 3px solid #ef4444; }
.notification-content { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notification-content span { font-size: 0.92rem; color: var(--text-primary); }
.notification-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.3rem; line-height: 1; padding: 0; transition: color var(--transition); }
.notification-close:hover { color: var(--text-primary); }

/* ============================================ ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(139,92,246,0.3); }
  50%       { box-shadow: 0 0 50px rgba(139,92,246,0.6), 0 0 80px rgba(6,182,212,0.2); }
}
@keyframes notifIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes notifOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left  { opacity: 0; transform: translateX(-30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-right { opacity: 0; transform: translateX(30px);  transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale { opacity: 0; transform: scale(0.9); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ============================================ RESPONSIVE */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-menu { position: fixed; top: var(--nav-height); left: 0; right: 0; bottom: 0; background: rgba(8,12,20,0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); flex-direction: column; justify-content: center; align-items: center; gap: 0.5rem; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
  .nav-menu.active { opacity: 1; pointer-events: all; }
  .nav-link { font-size: 1.2rem; padding: 0.75rem 2rem; }
  .footer-content { grid-template-columns: 1fr; gap: 2rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  /* Root cause fix: backdrop-filter on .navbar.scrolled turns the navbar into
     a new containing block for position:fixed children. This makes .nav-menu's
     top/bottom/left/right resolve relative to the 70px navbar instead of the
     viewport, collapsing the overlay to zero height so only the nav links
     overflow-render without any background. Removing backdrop-filter when the
     menu is open restores the viewport as the containing block. */
  .navbar.scrolled.menu-open {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
@media (max-width: 480px) {
  .page-content { padding: 1.5rem 1.25rem 4rem; }
  /* Fix: notification max-width of 380px exceeds viewport on phones ≤480px,
     pushing it off the left edge. Pin both sides instead. */
  .notification { left: 1rem; right: 1rem; max-width: none; }
}
