/* =========================================================
   MJSAG Portfolio — style.css
   Theme: Black background, purple gradient, white text, glow
   Fonts: Poppins (headings) + Inter (body)
   ========================================================= */

/* ----------------------- CSS Variables ----------------------- */
:root {
  --bg: #0B0B0F;
  --bg-soft: #121218;
  --bg-card: #16161f;
  --purple-1: #7B2FF7;
  --purple-2: #D946EF;
  --gradient: linear-gradient(135deg, #7B2FF7 0%, #D946EF 100%);
  --white: #ffffff;
  --gray: #a8a8b3;
  --border: rgba(255, 255, 255, 0.08);
  --glow: rgba(123, 47, 247, 0.45);
  --radius: 16px;
  --transition: 0.3s ease;
}

/* ----------------------- Reset ----------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;        /* smooth scrolling */
  scroll-padding-top: 80px;       /* offset for fixed navbar */
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

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

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

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

.section {
  padding: 100px 0;
}

.section-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 56px;
  font-size: 1.05rem;
}

/* ----------------------- Buttons ----------------------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-primary {
  background: var(--gradient);
  color: var(--white);
  box-shadow: 0 0 20px var(--glow);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 35px var(--glow);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--purple-1);
}
.btn-outline:hover {
  background: var(--purple-1);
  transform: translateY(-3px);
  box-shadow: 0 0 25px var(--glow);
}

.btn-small {
  padding: 10px 24px;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--purple-1);
  color: var(--white);
}
.btn-small:hover {
  background: var(--gradient);
  box-shadow: 0 0 20px var(--glow);
}

/* compact CTA in the navbar */
.btn-nav {
  padding: 10px 22px;
  font-size: 0.9rem;
}

/* ============================= PRELOADER / INTRO SPLASH ============================= */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  /* wait for the zoom to finish, THEN fade the background to reveal the landing */
  transition: opacity 0.5s ease 0.7s, visibility 0.5s ease 0.7s;
}
/* On exit: the MJSAG text zooms in toward the viewer first */
.preloader.hidden .preloader-text {
  animation: splashZoom 0.75s cubic-bezier(0.55, 0, 0.45, 1) forwards;
}
/* fade the constellation out during the zoom so only the text is featured */
.preloader.hidden .preloader-stars {
  opacity: 0;
  transition: opacity 0.5s ease;
}
@keyframes splashZoom {
  0%   { transform: scale(1);   opacity: 1; filter: blur(0); }
  60%  { transform: scale(1.6); opacity: 1; }
  100% { transform: scale(2.6); opacity: 0; filter: blur(8px); }
}
.preloader-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.preloader-text {
  position: relative;
  z-index: 1;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 12vw, 8rem);
  letter-spacing: clamp(4px, 2vw, 16px);
  color: var(--white);
  text-shadow: 0 0 40px rgba(123, 47, 247, 0.8), 0 0 80px rgba(217, 70, 239, 0.4);
  animation: splashIn 1.2s ease forwards;
}
@keyframes splashIn {
  0%   { opacity: 0; transform: scale(0.85); letter-spacing: 30px; filter: blur(8px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* Prevent scrolling while the preloader is visible */
body.loading { overflow: hidden; }

/* ============================= NAVBAR ============================= */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}
/* solid background after scrolling (toggled by JS) */
.navbar.scrolled {
  background: rgba(11, 11, 15, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 8px var(--glow));
}
.logo-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  gap: 32px;
}
.nav-link {
  font-weight: 500;
  color: var(--gray);
  position: relative;
  transition: color var(--transition);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  width: 0; height: 2px;
  background: var(--gradient);
  transition: width var(--transition);
}
.nav-link:hover,
.nav-link.active {
  color: var(--white);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  width: 26px;
  height: 3px;
  background: var(--white);
  border-radius: 3px;
  transition: var(--transition);
}
/* active (X) state */
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================= HERO ============================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 100px 24px 60px;
}

/* glowing purple background blobs */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  z-index: 0;
}
.glow-1 {
  width: 480px; height: 480px;
  background: var(--purple-1);
  top: -80px; left: -120px;
  animation: float 8s ease-in-out infinite;
}
.glow-2 {
  width: 420px; height: 420px;
  background: var(--purple-2);
  bottom: -100px; right: -100px;
  animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-40px); }
}

/* subtle grid overlay behind the hero */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
}

/* Rotating wireframe shape on the right */
.hero-shape {
  position: absolute;
  top: 50%;
  right: 4%;
  transform: translateY(-50%);
  width: 480px;
  height: 480px;
  max-width: 45vw;
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}
.hero-greeting {
  color: var(--purple-2);
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  margin-bottom: 12px;
  text-shadow: 0 0 30px rgba(123, 47, 247, 0.3);
}
.hero-subtitle {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  margin-bottom: 20px;
}
.highlight {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-text {
  color: var(--gray);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 36px;
}
.hero-buttons {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Hero social proof */
.hero-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.proof-rating { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stars { color: #FACC15; letter-spacing: 2px; font-size: 1rem; }
.proof-label { color: var(--gray); font-size: 0.85rem; }
.proof-divider { width: 1px; height: 36px; background: var(--border); }
.proof-stat { color: var(--gray); font-size: 0.9rem; }
.proof-stat strong {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: bob 2s ease-in-out infinite;
}
.mouse {
  width: 24px; height: 38px;
  border: 2px solid var(--gray);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.wheel {
  width: 4px; height: 8px;
  background: var(--purple-2);
  border-radius: 4px;
  animation: wheel 1.5s ease-in-out infinite;
}
@keyframes wheel {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-8px); }
}

/* ============================= ABOUT ============================= */
.about-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: center;
}
.about-image {
  position: relative;
  display: flex;
  justify-content: center;
}
.about-image img {
  width: 280px;
  border-radius: var(--radius);
  position: relative;
  z-index: 1;
}
.about-image-glow {
  position: absolute;
  inset: 20px;
  background: var(--gradient);
  filter: blur(60px);
  opacity: 0.4;
  z-index: 0;
}
.about-content h3 {
  font-size: 1.6rem;
  margin-bottom: 18px;
}
.about-content p {
  color: var(--gray);
  margin-bottom: 16px;
  text-align: justify;
}
.about-content strong { color: var(--white); }

.about-stats {
  display: flex;
  gap: 36px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.stat {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
}
.stat-number,
.stat-plus {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  grid-column: 1 / -1;
  color: var(--gray);
  font-size: 0.9rem;
}

/* ============================= TECH STACK (infinite carousel) ============================= */
.marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 10px 0;
  /* fade the edges so pills appear/disappear smoothly */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 18px;
  animation: scroll-x 30s linear infinite;
}
/* pause the carousel on hover */
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes scroll-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* -50% because the track is duplicated */
}
/* each logo + label, like Devoura's "Tools We Use" */
.tech-item {
  flex-shrink: 0;
  width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px;
  transition: transform var(--transition);
}
.tech-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  /* dim slightly until hovered, with a soft purple glow */
  filter: grayscale(15%) drop-shadow(0 0 10px rgba(123, 47, 247, 0.25));
  transition: filter var(--transition), transform var(--transition);
}
.tech-item span {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--gray);
  white-space: nowrap;
  transition: color var(--transition);
}
.tech-item:hover img {
  filter: grayscale(0) drop-shadow(0 0 16px rgba(123, 47, 247, 0.6));
  transform: translateY(-6px) scale(1.08);
}
.tech-item:hover span { color: var(--white); }

/* ============================= PROCESS ============================= */
.process-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  counter-reset: step;
}
.process-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 22px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.process-card:hover {
  transform: translateY(-8px);
  border-color: var(--purple-1);
  box-shadow: 0 12px 35px rgba(123, 47, 247, 0.25);
}
/* connecting line between steps (desktop) */
.process-card:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 46px; right: -12px;
  width: 24px; height: 2px;
  background: var(--gradient);
  opacity: 0.5;
}
.process-num {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 14px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.process-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.process-card p { color: var(--gray); font-size: 0.9rem; }

/* ============================= PROJECTS ============================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--purple-1);
  box-shadow: 0 12px 35px rgba(123, 47, 247, 0.25);
}
.project-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
/* white rounded tile so logos read clearly on the dark card */
.project-logo {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(123, 47, 247, 0.25);
}
.project-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* transparent variant — for logos that already sit on no/transparent background */
.project-logo--bare {
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.project-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(123, 47, 247, 0.15);
  color: var(--purple-2);
  border: 1px solid rgba(123, 47, 247, 0.35);
}
/* highlighted badge for the current capstone */
.badge-live {
  background: var(--gradient);
  color: var(--white);
  border: none;
  box-shadow: 0 0 16px var(--glow);
}
.project-card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.project-card p {
  color: var(--gray);
  margin-bottom: 20px;
  flex-grow: 1;
}
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tech-stack span {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--gray);
}
.project-card .btn-small { align-self: flex-start; }

/* ============================= SERVICES ============================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.service-card:hover {
  transform: translateY(-8px);
  border-color: var(--purple-1);
  box-shadow: 0 12px 35px rgba(123, 47, 247, 0.25);
}
.service-icon {
  font-size: 2.4rem;
  margin-bottom: 18px;
  display: inline-block;
  filter: drop-shadow(0 0 12px var(--glow));
}
.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}
.service-card p { color: var(--gray); }

/* ============================= CONTACT ============================= */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
}
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.95rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--purple-1);
  box-shadow: 0 0 0 3px rgba(123, 47, 247, 0.2);
}
.form-group textarea { resize: vertical; }
.form-status {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--purple-2);
}

.contact-info h3 {
  font-size: 1.4rem;
  margin-bottom: 14px;
}
.contact-info p {
  color: var(--gray);
  margin-bottom: 28px;
}
.social-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 500;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.social-link:hover {
  transform: translateX(6px);
  border-color: var(--purple-1);
  box-shadow: 0 6px 20px rgba(123, 47, 247, 0.2);
}
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--gradient);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.social-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ============================= FOOTER ============================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  background: var(--bg-soft);
}
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-content p {
  color: var(--gray);
  font-size: 0.9rem;
}
.footer .logo-icon { width: 34px; height: 34px; }
.footer .logo-text { font-size: 1.2rem; }

/* ============================= SCROLL ANIMATION ============================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal: cards inside a grid animate one after another */
.projects-grid .reveal,
.process-grid .reveal,
.services-grid .reveal {
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* ============================= RESPONSIVE ============================= */

/* Tablet */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-wrapper { grid-template-columns: 1fr; gap: 40px; }
  .about-image img { width: 220px; }
  .contact-wrapper { grid-template-columns: 1fr; }

  /* process becomes a flexible wrap, drop the connector line */
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .process-card:not(:last-child)::after { display: none; }

  /* shrink the wireframe shape and let it sit behind the text */
  .hero-shape { max-width: 70vw; opacity: 0.35; }
}

/* Mobile */
@media (max-width: 700px) {
  .section { padding: 70px 0; }

  /* mobile menu */
  .nav-menu {
    position: fixed;
    top: 0; right: -100%;
    height: 100vh;
    width: 70%;
    max-width: 300px;
    background: var(--bg-soft);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    transition: right var(--transition);
  }
  .nav-menu.active { right: 0; }
  .nav-link { font-size: 1.2rem; }

  .hamburger { display: flex; z-index: 1100; }

  /* keep the CTA compact beside the hamburger */
  .btn-nav { padding: 8px 16px; font-size: 0.8rem; }

  .projects-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }

  /* hide the wireframe shape on phones to keep the hero clean */
  .hero-shape { display: none; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; max-width: 280px; text-align: center; }
}

/* Small mobile */
@media (max-width: 420px) {
  .about-stats { gap: 24px; }
}
