/* ==========================================================
   css/style.css — Portfolio Sanabre3
   ========================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --primary:        #7C3AED;
  --primary-light:  #9D5CF6;
  --secondary:      #2563EB;
  --accent:         #059669;
  --bg:             #0F0F1A;
  --surface:        #1A1A2E;
  --surface-2:      #16213E;
  --text:           #E2E8F0;
  --text-muted:     #94A3B8;
  --border:         #2D2D4E;
  --gradient:       linear-gradient(135deg, #7C3AED, #2563EB);
}

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

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

/* ==========================================================
   NAVBAR
   ========================================================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

#navbar.scrolled {
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

/* Logo */
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--primary);
}

/* Nav links */
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding-bottom: 4px;
  transition: color 0.2s;
}

/* Animated underline */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-light);
}

.nav-link:hover::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

/* ==========================================================
   HERO / SOBRE
   ========================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124, 58, 237, 0.12) 0%, transparent 70%),
    var(--bg);
}

.hero-content {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Profile photo */
.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
  margin-bottom: 0.5rem;
}

/* Hero heading */
.hero-content h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
}

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

.subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-light);
}

.bio {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 520px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-light);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ==========================================================
   SECTIONS (shared)
   ========================================================== */
.section {
  padding: 5rem 1.5rem;
}

.section-alt {
  background: var(--surface);
}

.section-container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* ==========================================================
   PROJECTS GRID
   ========================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 2.5rem;
}

/* Project Card */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.2);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  flex: 1;
}

/* Tech tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

/* ==========================================================
   CONTACT FORM
   ========================================================== */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contact-form input,
.contact-form textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.contact-form input.error,
.contact-form textarea.error {
  border-color: #EF4444;
}

.field-error {
  color: #EF4444;
  font-size: 0.8rem;
  min-height: 1rem;
}

/* Success message */
.form-success {
  max-width: 600px;
  margin: 1.5rem auto 0;
  background: rgba(5, 150, 105, 0.15);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: #6EE7B7;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.social-links {
  display: flex;
  gap: 1.25rem;
}

.social-link {
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
}

.social-link:hover {
  color: var(--primary-light);
  transform: translateY(-2px);
}

/* ==========================================================
   ANIMATIONS
   ========================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero staggered entry */
.hero-content .fade-in:nth-child(1) { animation: fadeInUp 0.7s ease both 0.1s; }
.hero-content .fade-in:nth-child(2) { animation: fadeInUp 0.7s ease both 0.25s; }
.hero-content .fade-in:nth-child(3) { animation: fadeInUp 0.7s ease both 0.4s; }
.hero-content .fade-in:nth-child(4) { animation: fadeInUp 0.7s ease both 0.55s; }
.hero-content .fade-in:nth-child(5) { animation: fadeInUp 0.7s ease both 0.7s; }

/* Scroll-triggered fade-in (outside hero) */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero children are already animated via @keyframes, keep them visible */
.hero .fade-in {
  opacity: 0; /* will be filled by animation */
}

/* ==========================================================
   RESPONSIVE — Mobile-first breakpoints
   ========================================================== */

/* Tablet & smaller desktop */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {

  /* Hamburger visible */
  .hamburger {
    display: block;
  }

  /* Nav links hidden by default on mobile */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    gap: 0;
    background: rgba(15, 15, 26, 0.97);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    padding: 0.85rem 1.5rem;
  }

  /* Show when nav-open is active */
  .nav-links.nav-open {
    display: flex;
  }

  /* Hero: column layout */
  .hero {
    padding: 5rem 1.25rem 3rem;
  }

  .hero-content {
    text-align: center;
  }

  /* Projects: 1 column */
  .projects-grid {
    grid-template-columns: 1fr;
  }
}