/* ═══════════════════════════════════════════════════════════════
   RJR DEV – Portfolio CSS
   Rodrigo Rojas · contacto@rjrdev.com
   ═══════════════════════════════════════════════════════════════ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Palette */
  --bg-deep:       #06060b;
  --bg-surface:    #0d0d14;
  --bg-card:       #12121c;
  --bg-card-hover: #181826;
  --border-subtle: rgba(255,255,255,0.06);
  --text-primary:  #f0f0f5;
  --text-secondary:#8a8a9e;
  --text-muted:    #55556a;
  --accent:        #3b82f6;
  --accent-light:  #60a5fa;
  --accent-glow:   rgba(59,130,246,0.35);
  --gradient-hero: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  --gradient-text: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
  --glass-bg:      rgba(13,13,20,0.72);
  --glass-border:  rgba(255,255,255,0.08);

  /* Easings – https://easings.net */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-back:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring:    cubic-bezier(0.25, 1.05, 0.4, 1);

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

  /* Layout */
  --container-max: 1120px;
  --section-py:    7rem;
  --radius:        16px;
  --radius-sm:     10px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--ff-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

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

.container {
  width: min(var(--container-max), 90%);
  margin-inline: auto;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Grain Overlay ─────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: background 0.5s var(--ease-out-expo),
              padding 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo);
}

.navbar.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.6rem 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

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

.navbar__logo {
  height: 36px;
  transition: transform 0.4s var(--ease-out-back);
}
.navbar__logo:hover { transform: scale(1.08); }

.navbar__links {
  display: flex;
  gap: 2rem;
}

.navbar__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.35s var(--ease-out-expo);
}

.navbar__links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--gradient-hero);
  border-radius: 2px;
  transition: width 0.45s var(--ease-out-expo);
}

.navbar__links a:hover { color: var(--text-primary); }
.navbar__links a:hover::after { width: 100%; }

/* Mobile Hamburger */
.navbar__toggle {
  display: none;
  background: none; border: none;
  cursor: pointer;
  width: 32px; height: 24px;
  position: relative;
  z-index: 1001;
}
.navbar__toggle span {
  display: block;
  position: absolute; left: 0;
  width: 100%; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.4s var(--ease-out-expo);
}
.navbar__toggle span:nth-child(1) { top: 0; }
.navbar__toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.navbar__toggle span:nth-child(3) { bottom: 0; }

.navbar__toggle.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.navbar__toggle.active span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.navbar__toggle.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

@media (max-width: 768px) {
  .navbar__toggle { display: block; }
  .navbar__links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    background: rgba(6,6,11,0.97);
    backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease-out-expo), visibility 0.5s;
  }
  .navbar__links.open {
    opacity: 1;
    visibility: visible;
  }
  .navbar__links a {
    font-size: 1.25rem;
  }
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
  overflow: hidden;
}

/* Animated gradient orbs */
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  animation: orbFloat 12s ease-in-out infinite alternate;
}
.hero__orb--1 {
  width: 600px; height: 600px;
  background: #3b82f6;
  top: -20%; right: -10%;
  animation-delay: 0s;
}
.hero__orb--2 {
  width: 400px; height: 400px;
  background: #8b5cf6;
  bottom: -10%; left: -5%;
  animation-delay: -4s;
}
.hero__orb--3 {
  width: 300px; height: 300px;
  background: #ec4899;
  top: 40%; left: 50%;
  animation-delay: -8s;
}

@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.15); }
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 99px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 1.5rem;
  /* Animation initial state */
  opacity: 0; transform: translateY(24px);
}

.hero__badge .dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #22c55e;
  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(0.8); }
}

.hero__title {
  font-family: var(--ff-heading);
  font-size: clamp(2.5rem, 5.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  /* Animation initial state */
  opacity: 0; transform: translateY(40px);
}

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

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 2.5rem;
  /* Animation initial state */
  opacity: 0; transform: translateY(40px);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  /* Animation initial state */
  opacity: 0; transform: translateY(40px);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  font-family: var(--ff-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.45s var(--ease-out-expo);
}

.btn--primary {
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow);
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--accent-glow);
}
.btn--primary:active {
  transform: translateY(0);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn--outline:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

/* ── Section Title ─────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--ff-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

/* ── Stats Bar ─────────────────────────────────────────────── */
.stats {
  padding: var(--section-py) 0;
  position: relative;
}

.stats::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.stat-item {
  text-align: center;
  padding: 2rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: transform 0.5s var(--ease-out-expo),
              border-color 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo);
}

.stat-item:hover {
  transform: translateY(-6px);
  border-color: rgba(59,130,246,0.2);
  box-shadow: 0 16px 48px rgba(59,130,246,0.08);
}

.stat-item__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.stat-item__value {
  font-family: var(--ff-heading);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-item__label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Services ──────────────────────────────────────────────── */
.services {
  padding: var(--section-py) 0;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.service-card {
  position: relative;
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: transform 0.55s var(--ease-out-expo),
              border-color 0.55s var(--ease-out-expo),
              box-shadow 0.55s var(--ease-out-expo);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-hero);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out-expo);
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: rgba(59,130,246,0.15);
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  background: var(--bg-card-hover);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card__icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.15);
  transition: transform 0.45s var(--ease-out-back),
              background 0.45s var(--ease-out-expo);
}

.service-card:hover .service-card__icon {
  transform: scale(1.1) rotate(-3deg);
  background: rgba(59,130,246,0.18);
}

.service-card__title {
  font-family: var(--ff-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.service-card__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.service-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.service-card__tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.35s var(--ease-out-expo),
              border-color 0.35s var(--ease-out-expo);
}

.service-card:hover .service-card__tag {
  border-color: rgba(59,130,246,0.2);
  color: var(--text-secondary);
}

/* ── Contact ───────────────────────────────────────────────── */
.contact {
  padding: var(--section-py) 0;
}

.contact__wrapper {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 3rem;
  overflow: hidden;
  position: relative;
}

.contact__wrapper::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 300px; height: 300px;
  background: rgba(59,130,246,0.06);
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.contact__info {
  position: relative;
  z-index: 1;
}

.contact__info h3 {
  font-family: var(--ff-heading);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.contact__info p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact__detail {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.4s var(--ease-out-expo),
              background 0.4s var(--ease-out-expo);
}

.contact__detail:hover {
  border-color: rgba(59,130,246,0.2);
  background: rgba(59,130,246,0.04);
}

.contact__detail-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59,130,246,0.1);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact__detail-text {
  font-size: 0.95rem;
}
.contact__detail-text span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}

/* Form */
.contact__form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group { position: relative; }

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
  color: var(--text-primary);
  font-family: var(--ff-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.4s var(--ease-out-expo),
              box-shadow 0.4s var(--ease-out-expo),
              background 0.4s var(--ease-out-expo);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(59,130,246,0.03);
}

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

.contact__form .btn {
  align-self: flex-start;
  width: 100%;
  justify-content: center;
}

@media (max-width: 768px) {
  .contact__wrapper {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border-subtle);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__logo { height: 28px; opacity: 0.6; transition: opacity 0.4s; }
.footer__logo:hover { opacity: 1; }

.footer__copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__socials {
  display: flex;
  gap: 1rem;
}

.footer__socials a {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all 0.4s var(--ease-out-expo);
}
.footer__socials a:hover {
  color: var(--accent-light);
  border-color: rgba(59,130,246,0.3);
  background: rgba(59,130,246,0.08);
  transform: translateY(-3px);
}

/* ── WhatsApp FAB ──────────────────────────────────────────── */
.whatsapp-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(37,211,102,0.4);
  transition: transform 0.45s var(--ease-out-back),
              box-shadow 0.45s var(--ease-out-expo);
  animation: fabEnter 0.8s var(--ease-out-back) 1.5s both;
}

.whatsapp-fab:hover {
  transform: scale(1.12);
  box-shadow: 0 10px 36px rgba(37,211,102,0.5);
}

.whatsapp-fab svg {
  width: 30px; height: 30px;
  fill: #fff;
}

.whatsapp-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37,211,102,0.4);
  animation: fabPulse 2.5s ease-out infinite;
}

@keyframes fabEnter {
  0% { opacity: 0; transform: scale(0) rotate(-45deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes fabPulse {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ── Scroll Reveal ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.9s var(--ease-out-expo),
              transform 0.9s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for child card animations */
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ── Utility ───────────────────────────────────────────────── */
.gradient-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle) 20%, var(--border-subtle) 80%, transparent);
  margin: 0 auto;
}

@media (max-width: 480px) {
  :root {
    --section-py: 4.5rem;
  }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; justify-content: center; }
}
