/* ============================================
   PORTAFOLIO — SALVADOR AYALA
   Design System: Dark Emerald + Glassmorphism
   ============================================ */

/* ---- Google Fonts ---- */
@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');

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors */
  --bg-primary: #050a08;
  --bg-secondary: #0a1410;
  --bg-card: rgba(16, 32, 24, 0.55);
  --bg-card-hover: rgba(16, 42, 28, 0.7);

  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-glow: rgba(16, 185, 129, 0.3);

  --text-primary: #f0fdf4;
  --text-secondary: #a7c4b8;
  --text-muted: #6b8f7e;

  --border-glass: rgba(52, 211, 153, 0.15);
  --border-glass-hover: rgba(52, 211, 153, 0.3);

  /* Spacing */
  --section-padding: 100px 0;
  --container-max: 1100px;
  --container-padding: 0 24px;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Borders */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ---- Container ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--container-padding);
}

/* ---- Background Ambient Effects ---- */
.bg-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  animation: float-glow 12s ease-in-out infinite;
}

.bg-glow::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.06) 0%, transparent 70%);
  animation: float-glow 15s ease-in-out infinite reverse;
}

@keyframes float-glow {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(40px, -30px); }
  66% { transform: translate(-20px, 20px); }
}

/* ---- Navigation ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition-smooth);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(5, 10, 8, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 10px 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--emerald-400);
  letter-spacing: -0.5px;
}

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

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--emerald-500);
  transition: var(--transition-fast);
}

.nav-links a:hover {
  color: var(--emerald-400);
}

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

.nav-cta {
  background: var(--emerald-600);
  color: var(--text-primary) !important;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600 !important;
  transition: var(--transition-fast) !important;
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  background: var(--emerald-500) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--emerald-glow);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

/* ---- HERO Section ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 120px 0 80px;
}

.hero-content {
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--emerald-400);
  margin-bottom: 24px;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  background: var(--emerald-500);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--emerald-400), var(--emerald-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-700));
  color: white;
  box-shadow: 0 4px 24px var(--emerald-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
}

.btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2px;
  flex-shrink: 0;
}

.btn-icon {
  font-size: 1.2rem;
}

/* WhatsApp button */
.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  box-shadow: 0 4px 24px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.4);
}

/* ---- Section Titles ---- */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--emerald-500);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ---- PROJECTS Section ---- */
.projects {
  padding: var(--section-padding);
  position: relative;
  z-index: 1;
}

.projects-grid {
  display: grid;
  gap: 32px;
}

/* Project Card */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition-smooth);
}

.project-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.project-card-featured {
  display: grid;
  grid-template-columns: 1fr;
}

.project-images {
  position: relative;
  overflow: hidden;
}

/* Image carousel for project cards */
.project-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-secondary);
}

.project-carousel img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.project-carousel img.active {
  opacity: 1;
  z-index: 2;
}



/* Carousel dots */
.carousel-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: linear-gradient(transparent, rgba(5, 10, 8, 0.7));
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0;
}

.carousel-dot.active {
  background: var(--emerald-400);
  width: 24px;
  border-radius: 4px;
}

.project-info {
  padding: 28px;
}

.project-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.tag-dynamic {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
}

.tag-static {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.project-info h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-info p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tech span {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Small project cards grid */
.projects-small-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.project-card-small .project-carousel {
  aspect-ratio: 16 / 10;
}

.project-card-small .project-info {
  padding: 20px;
}

.project-card-small .project-info h3 {
  font-size: 1.15rem;
}

/* ---- SERVICES Section ---- */
.services {
  padding: var(--section-padding);
  position: relative;
  z-index: 1;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--emerald-500), var(--emerald-700));
  opacity: 0;
  transition: var(--transition-smooth);
}

.service-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
  margin-bottom: 20px;
}

.service-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2px;
}

.service-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.service-card .plan-type {
  font-size: 0.82rem;
  color: var(--emerald-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.service-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.service-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.service-features li .check {
  color: var(--emerald-500);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.service-note {
  padding: 16px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 32px;
  grid-column: 1 / -1;
}

.service-note strong {
  color: var(--emerald-400);
}

/* Maintenance card — full width */
.service-card-maintenance {
  grid-column: 1 / -1;
}

/* ---- CONTACT Section ---- */
.contact {
  padding: var(--section-padding);
  position: relative;
  z-index: 1;
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.contact-photo {
  position: relative;
}

.contact-photo img {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-glass);
}

.contact-photo .photo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, var(--emerald-glow) 0%, transparent 70%);
  filter: blur(40px);
  z-index: -1;
}

.contact-details h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.contact-details .role {
  color: var(--emerald-400);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 24px;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.contact-info-item .icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
  flex-shrink: 0;
}

.contact-info-item .icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--border-glass);
  position: relative;
  z-index: 1;
}

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

.footer a {
  color: var(--emerald-400);
  transition: var(--transition-fast);
}

.footer a:hover {
  color: var(--emerald-500);
}

/* ---- Scroll Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.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; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  :root {
    --section-padding: 70px 0;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(5, 10, 8, 0.96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transition: var(--transition-smooth);
    border-left: 1px solid var(--border-glass);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

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

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

  .contact-wrapper {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact-photo {
    display: flex;
    justify-content: center;
  }

  .contact-photo img {
    max-width: 280px;
  }

  .contact-info-list {
    align-items: center;
  }

  .contact-details .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.9rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .service-card {
    padding: 24px;
  }

  .project-info {
    padding: 20px;
  }
}
