/*
  Portfolio Design System — Sameer Maurya
  Mobile-first · Dark Glassmorphism · Premium
*/

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

/* ===== TOKENS ===== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(99, 102, 241, 0.35);

  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --secondary: #ec4899;
  --secondary-glow: rgba(236, 72, 153, 0.4);
  --accent: #8b5cf6;

  --text-100: #f1f5f9;
  --text-200: #cbd5e1;
  --text-300: #94a3b8;
  --text-400: #64748b;

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  --gradient-brand-hover: linear-gradient(135deg, #4f46e5 0%, #db2777 100%);
  --gradient-text: linear-gradient(to right, #818cf8, #e879f9);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 50px;

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.3s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-200);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-100);
  line-height: 1.25;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin-bottom: 1rem; font-size: 1rem; }
a { text-decoration: none; color: inherit; transition: color var(--transition); }

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  width: 100%;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gradient-brand);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

.section-desc {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 3rem;
  color: var(--text-300);
}

.section-cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }
::selection { background: var(--primary); color: #fff; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.8rem 1.25rem;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  background: rgba(10, 14, 26, 0.96);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.nav-logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.6rem;
}
.nav-links a {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-300);
  padding: 0.35rem 0;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-brand);
  transition: width 0.3s ease;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-100);
}
.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}
.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-100);
  position: relative;
  transition: background 0.3s;
}
.hamburger::before, .hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--text-100);
  transition: transform 0.3s ease, top 0.3s ease;
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle.open .hamburger { background: transparent; }
.nav-toggle.open .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open .hamburger::after { top: 0; transform: rotate(-45deg); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  transition: all 0.3s var(--ease-spring);
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 8px 24px -6px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--gradient-brand-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px -6px var(--secondary-glow);
}
.btn-outline {
  background: transparent;
  color: var(--text-100);
  border: 1.5px solid var(--border-hover);
}
.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.25rem 4rem;
  position: relative;
}
.hero-content {
  max-width: 720px;
  z-index: 2;
  animation: fadeUp 0.8s var(--ease-spring);
}
.profile-pic {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.08);
  box-shadow: 0 0 50px var(--primary-glow);
  object-fit: cover;
  margin-bottom: 1.5rem;
  animation: float 6s ease-in-out infinite;
}
.hero h1 { margin-bottom: 0.4rem; }
.hero-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 1.2rem;
}
.hero-desc {
  color: var(--text-300);
  max-width: 560px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== ABOUT ===== */
.about-content {
  max-width: 900px;
  margin: 2rem auto 0;
}
.about-text {
  text-align: left;
  margin-bottom: 2.5rem;
}
.about-text p {
  color: var(--text-200);
  font-size: 1.02rem;
}
.about-highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: center;
  transition: all 0.3s ease;
}
.highlight-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5);
}
.highlight-card i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: block;
}
.highlight-card h3 { margin-bottom: 0.4rem; }
.highlight-card p { color: var(--text-300); font-size: 0.92rem; margin-bottom: 0; }

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
}
.skill-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 10px 28px -8px rgba(0,0,0,0.4);
}
.skill-card i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.6rem;
  display: block;
  transition: transform 0.3s;
}
.skill-card:hover i { transform: scale(1.15); color: var(--secondary); }
.skill-card h3 { margin-bottom: 0.25rem; font-size: 1rem; }
.skill-card p { color: var(--text-400); font-size: 0.82rem; margin-bottom: 0; }

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.35s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}
.project-icon {
  height: 120px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary);
  transition: all 0.35s ease;
}
.project-card:hover .project-icon {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(236,72,153,0.15));
}
.project-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.project-body h3 { margin-bottom: 0.5rem; font-size: 1.15rem; }
.project-body p { color: var(--text-300); font-size: 0.92rem; flex: 1; }
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}
.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  color: var(--text-300);
  transition: all 0.2s;
}
.project-card:hover .tag {
  background: rgba(99,102,241,0.15);
  color: var(--primary);
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: auto;
  transition: gap 0.3s;
}
.project-link:hover { gap: 0.8rem; }

/* ===== CERTIFICATES ===== */
.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.cert-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -8px rgba(0,0,0,0.4);
}
.cert-card i {
  font-size: 1.6rem;
  color: #fbbf24;
  margin-bottom: 0.5rem;
  display: block;
}
.cert-card h3 { margin-bottom: 0.35rem; }
.cert-card p { color: var(--text-300); font-size: 0.9rem; margin-bottom: 0; }

/* ===== FAQ ===== */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 0.8rem;
  overflow: hidden;
  transition: border-color 0.3s;
}
.faq-item[open] {
  border-color: var(--border-hover);
}
.faq-item summary {
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  transition: background 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--primary);
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 1rem;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item summary:hover {
  background: rgba(255,255,255,0.02);
}
.faq-answer {
  padding: 0 1.5rem 1.1rem;
}
.faq-answer p {
  color: var(--text-300);
  font-size: 0.95rem;
  margin-bottom: 0;
}
.faq-answer a {
  color: var(--primary);
  font-weight: 500;
}
.faq-answer a:hover { text-decoration: underline; }

/* ===== CONTACT FORM ===== */
.contact-form {
  max-width: 620px;
  margin: 0 auto;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-300);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-100);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background: rgba(15, 23, 42, 0.85);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-submit { text-align: center; margin-top: 0.5rem; }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border-glass);
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}
.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand h3 { margin-bottom: 0.5rem; }
.footer-brand p { color: var(--text-400); font-size: 0.9rem; margin-bottom: 0; }

.footer-links h4,
.footer-social h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-100);
}
.footer-links ul {
  list-style: none;
}
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a {
  color: var(--text-400);
  font-size: 0.9rem;
}
.footer-links a:hover { color: var(--primary); }

.social-links {
  display: flex;
  gap: 1.25rem;
}
.social-links a {
  font-size: 1.3rem;
  color: var(--text-400);
  transition: all 0.3s;
}
.social-links a:hover {
  color: var(--primary);
  transform: translateY(-2px);
}
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-glass);
}
.footer-bottom p {
  color: var(--text-400);
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-spring);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ===== BACKGROUND (universe from background.js) ===== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at center, #0b0b15 0%, #000000 100%);
}

.universe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at center, #0b0b15 0%, #000 100%);
  perspective: 1000px;
}

.blackhole-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 15vw; height: 15vw;
  min-width: 200px; min-height: 200px;
  background: #000;
  border-radius: 50%;
  z-index: 20;
  box-shadow: 0 0 60px 20px rgba(99,102,241,0.4);
}

.photon-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotateX(75deg);
  width: 17vw; height: 17vw;
  min-width: 230px; min-height: 230px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 30px rgba(99,102,241,0.9), inset 0 0 20px rgba(236,72,153,0.5);
  z-index: 25;
  opacity: 0.9;
  filter: blur(1px);
}

.accretion-disk {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  transform-style: preserve-3d;
}
.accretion-disk.part-1 {
  width: 45vw; height: 45vw;
  min-width: 600px; min-height: 600px;
  background: conic-gradient(from 0deg, transparent 0%, var(--primary) 15%, transparent 30%, var(--secondary) 45%, transparent 60%, var(--primary) 75%, transparent 90%);
  animation: spin 12s linear infinite;
  transform: translate(-50%, -50%) rotateX(75deg);
  opacity: 0.6;
  filter: blur(10px);
  z-index: 10;
}
.accretion-disk.part-2 {
  width: 35vw; height: 35vw;
  min-width: 450px; min-height: 450px;
  background: conic-gradient(from 180deg, transparent 0%, #d8b4fe 20%, transparent 40%, #818cf8 60%, transparent 80%, #f472b6 100%);
  animation: spin-reverse 18s linear infinite;
  transform: translate(-50%, -50%) rotateX(75deg) rotate(45deg);
  opacity: 0.8;
  filter: blur(5px);
  z-index: 15;
  box-shadow: 0 0 50px rgba(236,72,153,0.2);
}

@keyframes spin {
  0%   { transform: translate(-50%, -50%) rotateX(75deg) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotateX(75deg) rotate(360deg); }
}
@keyframes spin-reverse {
  0%   { transform: translate(-50%, -50%) rotateX(75deg) rotate(360deg); }
  100% { transform: translate(-50%, -50%) rotateX(75deg) rotate(0deg); }
}

.nebula-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  background: #000;
  overflow: hidden;
}
.nebula-cloud {
  position: absolute;
  width: 100%; height: 100%;
  filter: blur(100px);
  opacity: 0.5;
  animation: nebula-drift 30s ease-in-out infinite alternate;
}
@keyframes nebula-drift {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.2) translate(-5%, -5%); }
}
.matrix-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  background: #000;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  z-index: 0;
  opacity: 0;
  animation: twinkle var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
  box-shadow: 0 0 4px rgba(255,255,255,0.8);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.5); }
  50%      { opacity: 1; transform: scale(1.2); }
}

/* ===== RESPONSIVE — TABLET (768px+) ===== */
@media (min-width: 768px) {
  .nav-links { gap: 2rem; }

  .form-row { grid-template-columns: 1fr 1fr; }

  .about-highlights { grid-template-columns: repeat(3, 1fr); }

  .skills-grid { grid-template-columns: repeat(4, 1fr); }

  .projects-grid { grid-template-columns: repeat(2, 1fr); }

  .cert-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-content { grid-template-columns: 2fr 1fr 1fr; }
}

/* ===== RESPONSIVE — MOBILE (< 768px) ===== */
@media (max-width: 767px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70vw;
    max-width: 300px;
    height: 100vh;
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 0.5rem;
    transition: right 0.35s ease;
    border-left: 1px solid var(--border-glass);
  }
  .nav-links.open { right: 0; }

  .nav-links a {
    font-size: 1.1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-glass);
    display: block;
  }

  .hero {
    padding: 5rem 1rem 3rem;
    min-height: 90vh;
  }
  .profile-pic { width: 120px; height: 120px; }
  .hero-desc { font-size: 0.95rem; }

  .section { padding: 3.5rem 0; }

  .project-icon { height: 100px; font-size: 2.5rem; }
}

/* ===== LARGE SCREENS (1024px+) ===== */
@media (min-width: 1024px) {
  .container { max-width: 1100px; }
  .hero-content { max-width: 760px; }
  .profile-pic { width: 180px; height: 180px; }
}