/* ==========================================================================
   GG Desarrollos · Hoja de estilos
   Todo desde :root.
   ========================================================================== */

:root {
  /* Color */
  --bg:           #F4EEFA;   /* lavanda muy claro */
  --bg-2:         #E8DDF4;
  --bg-soft:      #FAF6FE;
  --ink:          #160929;
  --ink-2:        #4A3A6E;
  --ink-3:        #8479A0;

  --purple:       #471D6E;
  --purple-hover: #5B2A8A;
  --purple-soft:  #C9B5E8;
  --purple-glow:  #D8C5F0;

  --white:        #FFFFFF;
  --dark:         #14082A;
  --dark-2:       #28144A;

  /* Plateado para la laptop */
  --silver-1: #E8E6EE;
  --silver-2: #C8C5D2;
  --silver-3: #9A96A8;

  /* Fuentes */
  --display: "Fraunces", "Times New Roman", serif;
  --sans:    "Bricolage Grotesque", -apple-system, system-ui, sans-serif;

  /* Medidas */
  --maxw: 1200px;
  --pad: clamp(1.1rem, 4vw, 2.5rem);
  --r:     22px;
  --r-lg:  34px;
  --r-xl:  44px;
  --pill:  100px;

  /* Sombras */
  --shadow-sm: 0 4px 12px -4px rgba(22,9,41,.12);
  --shadow:    0 24px 50px -24px rgba(22,9,41,.32), 0 6px 14px -8px rgba(22,9,41,.14);
  --shadow-lg: 0 50px 100px -40px rgba(22,9,41,.45), 0 14px 32px -16px rgba(22,9,41,.2);

  --ease: cubic-bezier(.4,0,.2,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
::selection { background: var(--purple); color: var(--white); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

/* ==========================================================================
   Tipografía
   ========================================================================== */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* ==========================================================================
   Botones — el detalle clave del halo exterior (signature Loom/Phantom)
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--sans); font-weight: 600;
  font-size: 1rem;
  padding: .9rem 1.5rem;
  border-radius: var(--pill);
  transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap;
  position: relative;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--purple);
  color: var(--white);
  /* halo lavanda exterior — gap + ring */
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 6px var(--purple-glow),
    0 10px 24px -10px rgba(71,29,110,.45);
}
.btn-primary:hover {
  background: var(--purple-hover);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 7px var(--purple-soft),
    0 16px 32px -12px rgba(71,29,110,.55);
}

.btn-link {
  font-family: var(--sans); font-weight: 600;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .9rem .6rem;
  position: relative;
}
.btn-link::after {
  content: ""; position: absolute; left: .6rem; right: .6rem; bottom: .5rem;
  height: 1.5px; background: var(--ink); transform-origin: left;
  transform: scaleX(0); transition: transform .25s var(--ease);
}
.btn-link:hover::after { transform: scaleX(1); }
.btn-link .arrow { transition: transform .2s var(--ease); }
.btn-link:hover .arrow { transform: translateX(3px); }

.btn-on-dark {
  background: var(--white);
  color: var(--ink);
  box-shadow:
    0 0 0 4px var(--dark),
    0 0 0 6px rgba(255,255,255,.25),
    0 10px 24px -10px rgba(0,0,0,.5);
}
.btn-on-dark:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 4px var(--dark),
    0 0 0 7px rgba(255,255,255,.4),
    0 16px 32px -12px rgba(0,0,0,.6);
}

/* ==========================================================================
   NAVBAR — clásica horizontal limpia, no pildora flotante
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244,238,250,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.scrolled { border-bottom-color: rgba(22,9,41,.08); }
.nav-inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: 1rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark {
  font-family: var(--display); font-weight: 700;
  font-size: 1.25rem; letter-spacing: -0.025em;
  color: var(--ink);
}
.wordmark .dot { color: var(--purple); }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
  font-size: .94rem; font-weight: 500; color: var(--ink-2);
  transition: color .2s var(--ease);
}
.nav-links a:hover { color: var(--purple); }
.nav .btn-primary {
  padding: .65rem 1.25rem; font-size: .9rem;
  box-shadow:
    0 0 0 3px rgba(244,238,250,.85),
    0 0 0 5px var(--purple-glow),
    0 6px 14px -6px rgba(71,29,110,.4);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  padding-block: clamp(3.5rem, 8vw, 6.5rem) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: clamp(2.8rem, 7.5vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: .98;
  max-width: 16ch;
  margin: 0 auto 1.4rem;
  color: var(--ink);
}
.hero-title .word { display: inline-block; opacity: 0; transform: translateY(28px); animation: rise .75s var(--ease) forwards; }
.hero-title .w1 { animation-delay: .1s; }
.hero-title .w2 { animation-delay: .2s; }
.hero-title .w3 { animation-delay: .3s; }
.hero-title .w4 { animation-delay: .4s; }
.hero-title .w5 { animation-delay: .5s; color: var(--purple); }

.hero-sub {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--ink-2);
  max-width: 50ch;
  margin: 0 auto 2rem;
  line-height: 1.55;
  opacity: 0; animation: rise .7s var(--ease) .65s forwards;
}

.hero-cta {
  display: flex; gap: .5rem; justify-content: center; align-items: center;
  flex-wrap: wrap;
  opacity: 0; animation: rise .7s var(--ease) .78s forwards;
}

@keyframes rise { to { opacity: 1; transform: none; } }

/* ============ Cluster de devices ============ */
.hero-scene {
  position: relative;
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  max-width: 1100px;
  padding: 0 var(--pad) clamp(2rem, 6vw, 5rem);
}

/* glow grande, saturado, detrás de todo */
.hero-scene::before {
  content: "";
  position: absolute;
  inset: 8% 5% 12% 5%;
  background:
    radial-gradient(circle at 25% 50%, #FF6B9D 0%, transparent 38%),
    radial-gradient(circle at 75% 60%, #6B3FBF 0%, transparent 42%),
    radial-gradient(circle at 50% 30%, #FFB347 0%, transparent 30%),
    radial-gradient(circle at 90% 30%, #FF8FCB 0%, transparent 28%);
  filter: blur(70px);
  opacity: 0;
  z-index: 0;
  animation: glowIn 1.4s var(--ease) .9s forwards;
}
@keyframes glowIn { to { opacity: .7; } }

.scene-stack {
  position: relative; z-index: 1;
  display: flex; justify-content: center; align-items: flex-end;
}

.laptop {
  width: 100%; max-width: 820px;
  filter: drop-shadow(0 40px 60px rgba(22,9,41,.3));
  opacity: 0; transform: translateY(50px) scale(.96);
  animation: laptopIn 1.1s var(--ease) 1.05s forwards;
}
@keyframes laptopIn { to { opacity: 1; transform: none; } }

.phone {
  position: absolute;
  width: clamp(120px, 14vw, 175px);
  right: clamp(2%, 6vw, 8%);
  bottom: clamp(2rem, 6vw, 5rem);
  z-index: 2;
  filter: drop-shadow(0 30px 50px rgba(22,9,41,.35));
  opacity: 0; transform: translateX(70px) translateY(20px) rotate(10deg);
  animation: phoneIn 1s var(--ease) 1.4s forwards;
}
@keyframes phoneIn { to { opacity: 1; transform: rotate(5deg); } }

/* Notificación flotante */
.notif {
  position: absolute;
  top: clamp(1rem, 6vw, 3rem);
  left: clamp(2%, 6vw, 8%);
  background: var(--white);
  border-radius: 18px;
  padding: .85rem 1.2rem .85rem .85rem;
  display: flex; align-items: center; gap: .8rem;
  box-shadow: 0 24px 50px -16px rgba(22,9,41,.4);
  z-index: 3;
  opacity: 0; transform: translateY(-12px) scale(.85);
  animation: notifIn .6s var(--ease-bounce) 1.85s forwards;
}
.notif-check {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #4DD896, #2FA86B);
  display: grid; place-items: center; flex: none;
}
.notif-check svg { width: 18px; height: 18px; color: var(--white); }
.notif-text strong { display: block; font-weight: 600; font-size: .92rem; color: var(--ink); }
.notif-text span { font-size: .8rem; color: var(--ink-3); }
@keyframes notifIn { to { opacity: 1; transform: none; } }

/* Avatar flotante segundo (Loom-style) */
.avatar-float {
  position: absolute;
  top: clamp(30%, 18vw, 38%);
  right: clamp(6%, 8vw, 10%);
  width: clamp(70px, 8vw, 95px);
  height: clamp(70px, 8vw, 95px);
  border-radius: 50%;
  background: linear-gradient(135deg, #FFB347, #FF6B9D);
  display: grid; place-items: center;
  border: 4px solid var(--white);
  box-shadow: 0 16px 32px -10px rgba(22,9,41,.4);
  z-index: 4;
  opacity: 0; transform: scale(.6);
  animation: notifIn .6s var(--ease-bounce) 2.0s forwards;
}
.avatar-float svg { width: 60%; height: 60%; color: var(--white); }

@media (max-width: 720px) {
  .notif, .phone, .avatar-float { display: none; }
}

/* ==========================================================================
   SERVICIOS
   ========================================================================== */
.services { padding-block: clamp(4rem, 8vw, 7rem) clamp(2rem, 5vw, 4rem); }
.sec-head { text-align: center; max-width: 40ch; margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.sec-head h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.035em; }
.sec-head h2 .accent { color: var(--purple); }
.sec-head p { color: var(--ink-2); margin-top: 1.2rem; font-size: 1.12rem; line-height: 1.55; }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.svc {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 2rem 1.8rem;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  position: relative;
}
.svc:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.svc-ico {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: grid; place-items: center;
  margin-bottom: 1.4rem;
  color: var(--purple);
}
.svc:nth-child(1) .svc-ico { background: linear-gradient(135deg, #FFE5F0, #FFD3E5); color: #C12468; }
.svc:nth-child(2) .svc-ico { background: linear-gradient(135deg, #FFF1D6, #FFE2A8); color: #B8740C; }
.svc:nth-child(3) .svc-ico { background: linear-gradient(135deg, #E8DFFA, #D5C5F2); color: var(--purple); }
.svc-ico svg { width: 26px; height: 26px; }
.svc h3 { font-size: 1.55rem; margin-bottom: .55rem; }
.svc p { color: var(--ink-2); font-size: .98rem; line-height: 1.55; }

/* ==========================================================================
   PROYECTOS — filas alternadas con screenshots reales
   ========================================================================== */
.projects { padding-block: clamp(2rem, 4vw, 3rem) clamp(4rem, 8vw, 6rem); }

.project {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  margin-bottom: clamp(4rem, 8vw, 6.5rem);
}
.project:last-child { margin-bottom: 0; }
.project:nth-child(even) .project-art { order: -1; }

.project-tag {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--purple);
  background: var(--white);
  padding: .45rem .95rem;
  border-radius: var(--pill);
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.project-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.project-name {
  font-size: clamp(2.1rem, 4.8vw, 3.2rem);
  margin-bottom: 1rem;
  letter-spacing: -0.035em;
}
.project-desc {
  color: var(--ink-2);
  font-size: 1.08rem;
  max-width: 46ch;
  margin-bottom: 1.6rem;
  line-height: 1.6;
}
.project-link {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 600; font-size: 1rem;
  color: var(--purple);
}
.project-link::after {
  content: ""; flex: none; width: 18px; height: 1.5px;
  background: currentColor;
  margin-left: .2rem;
  transition: width .25s var(--ease);
}
.project-link:hover::after { width: 28px; }
.project-link .arrow { transition: transform .2s var(--ease); }
.project-link:hover .arrow { transform: translate(3px,-1px); }
.project-link.private { color: var(--ink-3); cursor: default; }
.project-link.private::after { background: var(--ink-3); }

/* Browser mockup — frame que envuelve el screenshot */
.shot-wrap {
  position: relative;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  background: var(--white);
  overflow: hidden;
  transition: transform .35s var(--ease);
}
.project:hover .shot-wrap { transform: translateY(-6px); }

/* Glow detrás de cada screenshot — color distinto por proyecto */
.shot-glow {
  position: absolute;
  inset: -8% -6%;
  filter: blur(60px);
  opacity: .55;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}
.project-art .shot-wrap { position: relative; z-index: 1; }
.p-pink   .shot-glow { background: radial-gradient(circle, #FF8FCB 0%, transparent 65%); }
.p-violet .shot-glow { background: radial-gradient(circle, #8B5CF6 0%, transparent 65%); }
.p-mint   .shot-glow { background: radial-gradient(circle, #5CDFB4 0%, transparent 65%); }

.project-art { position: relative; }

.shot-bar {
  display: flex; align-items: center; gap: .55rem;
  padding: .65rem .85rem;
  background: #F1ECF7;
  border-bottom: 1px solid rgba(22,9,41,.06);
}
.shot-dots { display: flex; gap: .3rem; }
.shot-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.shot-dots i:nth-child(1) { background: #E8A59B; }
.shot-dots i:nth-child(2) { background: #EAD6A0; }
.shot-dots i:nth-child(3) { background: #A9D6AB; }
.shot-url {
  flex: 1;
  font-family: var(--sans);
  font-size: .76rem;
  color: var(--ink-3);
  background: var(--white);
  border-radius: 7px;
  padding: .28rem .75rem;
  text-align: center;
}

.shot-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #E8DDF4, #C9B5E8);
  overflow: hidden;
}
.shot-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  position: relative;
  z-index: 1;
}
.shot-img .ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--purple);
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Sobre mí — banner oscuro con glow dramático
   ========================================================================== */
.about-dark {
  position: relative;
  margin: clamp(3rem, 6vw, 5rem) var(--pad);
  background: var(--dark);
  border-radius: clamp(28px, 4vw, 44px);
  padding: clamp(4rem, 10vw, 7rem) clamp(2rem, 6vw, 5rem);
  text-align: center;
  overflow: hidden;
  color: var(--white);
}
.about-dark::before {
  content: "";
  position: absolute;
  inset: 15% 0% 0% 0%;
  background:
    radial-gradient(ellipse 50% 60% at 20% 60%, #FF3B6B 0%, transparent 50%),
    radial-gradient(ellipse 45% 55% at 75% 55%, #6B3FBF 0%, transparent 55%),
    radial-gradient(ellipse 35% 45% at 50% 80%, #FFB347 0%, transparent 45%),
    radial-gradient(ellipse 30% 40% at 90% 30%, #FF8FCB 0%, transparent 50%);
  filter: blur(60px);
  opacity: .85;
  z-index: 0;
}
.about-dark > * { position: relative; z-index: 1; }
.about-dark h2 {
  color: var(--white);
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: 0 auto 1.6rem;
  max-width: 18ch;
  letter-spacing: -0.04em;
}
.about-dark p {
  color: rgba(255,255,255,.78);
  font-size: 1.15rem;
  max-width: 52ch;
  margin: 0 auto 2.4rem;
  line-height: 1.6;
}

/* ==========================================================================
   CTA final
   ========================================================================== */
.cta { padding-block: clamp(3rem, 6vw, 5rem); }
.cta-card {
  background: var(--white);
  border-radius: clamp(28px, 4vw, 44px);
  padding: clamp(3rem, 7vw, 5rem) clamp(2rem, 5vw, 4rem);
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: "";
  position: absolute;
  inset: 30% 10% -20% 10%;
  background:
    radial-gradient(circle at 30% 50%, #D8C5F0 0%, transparent 55%),
    radial-gradient(circle at 70% 50%, #FFC8DD 0%, transparent 55%);
  filter: blur(60px);
  opacity: .55;
  z-index: 0;
}
.cta-card > * { position: relative; z-index: 1; }
.cta-card h2 {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  margin-bottom: 1.1rem;
  max-width: 18ch;
  margin-inline: auto;
  letter-spacing: -0.04em;
}
.cta-card p {
  font-size: 1.12rem;
  color: var(--ink-2);
  max-width: 44ch;
  margin: 0 auto 2.2rem;
}
.cta-card .btn-primary { font-size: 1.08rem; padding: 1rem 1.8rem; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  padding: 3rem var(--pad) 2.5rem;
  text-align: center;
  color: var(--ink-3);
  font-size: .92rem;
}
.footer .wordmark { display: block; margin-bottom: 1rem; font-size: 1.5rem; }
.footer a { color: var(--purple); font-weight: 600; }
.footer a:hover { text-decoration: underline; }

/* ==========================================================================
   Reveal
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .hero-title .word, .hero-sub, .hero-cta, .laptop, .phone, .notif, .avatar-float, .hero-scene::before {
    opacity: 1 !important; transform: none !important;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .svc-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; gap: 2rem; }
  .project:nth-child(even) .project-art { order: 0; }
  .project-art { order: -1 !important; }
  .about-dark { margin-inline: var(--pad); }
}