*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:       #0f0f0e;
  --ink-mid:   #3a3935;
  --ink-soft:  #7a7870;
  --paper:     #f8f6f1;
  --cream:     #ede9e0;
  --gold:      #b89a5a;
  --gold-light:#d4b87a;
  --white:     #ffffff;
  --line:      rgba(15,15,14,0.10);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* NAVEGACIÓN */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(248,246,241,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 5vw;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}
.nav-logo span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

/* HAMBURGER */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* MOBILE MENU */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: rgba(248,246,241,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  z-index: 99;
  padding: 2rem 5vw;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
.mobile-menu.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: 1.2rem; }
.mobile-menu ul a {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  display: block;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}
.mobile-social {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.5rem;
}
.mobile-social a {
  font-size: 1.1rem;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.mobile-social a:hover { color: var(--gold); }

/* HERO SECTION */
#inicio {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 64px;
}

.hero-left {
  padding: 8vw 5vw 8vw 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--gold);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  color: var(--ink);
}
.hero-title strong { font-weight: 600; display: block; }

.hero-sub {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 38ch;
  margin-bottom: 3rem;
  font-weight: 300;
  line-height: 1.75;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.9rem 2rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s, transform 0.2s;
}
.btn-primary:hover { background: var(--gold); transform: translateY(-1px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--ink-mid);
  color: var(--ink-mid);
  padding: 0.9rem 2rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-right {
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-monogram {
  font-family: var(--font-display);
  font-size: clamp(6rem, 14vw, 14rem);
  font-weight: 300;
  color: rgba(15,15,14,0.06);
  line-height: 1;
  user-select: none;
  position: absolute;
}

.hero-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 2rem 2.5rem;
  z-index: 1;
  max-width: 320px;
  width: 100%;
}

.hero-card-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.metric-row { display: flex; flex-direction: column; gap: 1.2rem; }

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.metric-item:last-child { border-bottom: none; padding-bottom: 0; }

.metric-label { font-size: 0.8rem; color: var(--ink-soft); }
.metric-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--ink);
}
.metric-unit { font-size: 0.75rem; color: var(--ink-soft); margin-left: 0.2rem; }

/* SECCIONES COMUNES */
section { padding: 6rem 8vw; }
.section-header { margin-bottom: 4rem; }

.section-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--ink);
}
.section-title strong { font-weight: 600; }

/* NOSOTROS */
#nosotros { background: var(--white); }
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 5rem; align-items: start; }
.about-text p { color: var(--ink-soft); margin-bottom: 1.5rem; font-weight: 300; font-size: 0.95rem; }

.about-pillars { display: flex; flex-direction: column; gap: 0; }
.pillar {
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.pillar:first-child { padding-top: 0; }
.pillar:last-child { border-bottom: none; }

.pillar-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
}

.pillar-body h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.4rem; }
.pillar-body p { font-size: 0.85rem; color: var(--ink-soft); font-weight: 300; line-height: 1.65; }

/* SERVICIOS */
#servicios { background: var(--paper); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.service-card { background: var(--paper); padding: 2.5rem 2rem; transition: background 0.25s; position: relative; }
.service-card:hover { background: var(--white); }
.service-icon { width: 36px; height: 36px; margin-bottom: 1.5rem; color: var(--gold); }
.service-card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin-bottom: 0.8rem; }
.service-card p { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 1.5rem; font-weight: 300; line-height: 1.7; }
.services-tags { display: flex; flex-direction: column; gap: 0.4rem; }
.service-tag { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink-mid); display: flex; align-items: center; gap: 0.5rem; }
.service-tag::before { content: ''; display: inline-block; width: 14px; height: 1px; background: var(--gold); flex-shrink: 0; }

/* ==========================================================================
   PORTAFOLIO (REVISADO Y CORREGIDO COMPLETO)
   ========================================================================== */
#portafolio { background: var(--cream); }

.portfolio-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.pf-btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}
.pf-btn:hover { border-color: var(--gold); color: var(--gold); }
.pf-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(15,15,14,0.1);
  border: 1px solid rgba(15,15,14,0.1);
}

/* Tarjeta individual */
.portfolio-card {
  background: var(--cream);
  display: flex;
  flex-direction: column;
  transition: background 0.25s;
  overflow: hidden;
}
.portfolio-card:hover { background: var(--white); }
.portfolio-card.hidden { display: none; }

/* Contenedor de Imagen: Altura de 280px para ver mejor las interfaces */
.pc-visual {
  width: 100%;
  height: 280px; 
  position: relative;
  overflow: hidden;
  background-color: #161615; /* Fondo oscuro elegante */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Comportamiento Inteligente de Imágenes (Evita cortes raros) */
.pc-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Enmarca los mockups de apps/chats enteros sin cortar texto */
  padding: 1.2rem; /* Separación estética de los bordes oscuros */
  object-position: center center;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Forzar que las capturas de escritorio de StoreOS y JAC usen cover si prefieres que llenen todo */
/* .portfolio-card:nth-child(1) .pc-img, .portfolio-card:nth-child(2) .pc-img { object-fit: cover; padding: 0; object-position: top center; } */

.portfolio-card:hover .pc-img {
  transform: scale(1.03);
}

/* Bloque Split (Caso Especial Sun Tech App + Web lado a lado) */
.pc-visual--split {
  display: flex;
  flex-direction: row;
}
.pc-visual--split .pc-img--left,
.pc-visual--split .pc-img--right {
  width: 50%;
  height: 100%;
  object-fit: contain;
  padding: 0.6rem;
}
.pc-visual--split .pc-img--left {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Etiquetas de estado */
.pc-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  z-index: 2;
}
.pc-status--done { background: rgba(184,154,90,0.92); color: var(--paper); border: 1px solid var(--gold); backdrop-filter: blur(4px); }
.pc-status--dev  { background: rgba(15,15,14,0.8); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(4px); }

/* Cuerpo de la Tarjeta */
.pc-body {
  padding: 1.8rem 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.pc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pc-cat {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.pc-year {
  font-size: 0.68rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.pc-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.pc-desc {
  font-size: 0.83rem;
  color: var(--ink-soft);
  font-weight: 300;
  line-height: 1.7;
  flex: 1;
}

.pc-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.pc-stack span {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--ink-mid);
  background: var(--cream);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
}
.portfolio-card:hover .pc-stack span { background: var(--paper); }

/* CLIENTES */
#clientes { background: var(--ink); color: var(--paper); }
#clientes .section-title { color: var(--paper); }
#clientes .section-label { color: var(--gold-light); }
#clientes .section-label::before { background: var(--gold-light); }
.clients-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); margin-bottom: 5rem; }
.client-cell { background: var(--ink); padding: 3rem 2rem; transition: background 0.25s; }
.client-cell:hover { background: #1a1a18; }
.client-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--paper); }
.client-sector { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 1rem; }
.client-desc { font-size: 0.83rem; color: rgba(248,246,241,0.55); font-weight: 300; line-height: 1.7; }

/* TESTIMONIOS */
#testimonios { background: var(--cream); }
.testimonios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.testimonio { background: var(--white); padding: 2rem; border-left: 2px solid var(--gold); }
.testimonio blockquote { font-family: var(--font-display); font-size: 1.1rem; font-weight: 400; font-style: italic; line-height: 1.6; color: var(--ink); margin-bottom: 1.5rem; }
.testimonio cite { font-style: normal; }
.cite-name { font-size: 0.8rem; font-weight: 500; color: var(--ink); display: block; }
.cite-role { font-size: 0.75rem; color: var(--ink-soft); display: block; }

/* CONTACTO */
#contacto { background: var(--white); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
.contact-info-list { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.contact-item:last-child { border-bottom: none; }
.contact-item-icon { width: 36px; height: 36px; background: var(--cream); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-item-label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 0.2rem; }
.contact-item-value { font-size: 0.9rem; color: var(--ink-mid); }

/* SOCIAL EN CONTACTO */
.contact-social {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.contact-social-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.contact-social-label::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--gold);
}
.contact-social-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink-mid);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.social-link:last-child { border-bottom: none; }
.social-link i { font-size: 1rem; color: var(--gold); width: 18px; text-align: center; }
.social-link:hover { color: var(--gold); }

.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.form-group input, .form-group textarea { border: 1px solid var(--line); background: var(--paper); padding: 0.85rem 1rem; font-family: var(--font-body); font-size: 0.9rem; color: var(--ink); outline: none; transition: border-color 0.2s; resize: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--gold); }

/* FOOTER */
footer {
  background: var(--ink);
  color: rgba(248,246,241,0.5);
  padding: 3rem 8vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-logo { font-family: var(--font-display); font-size: 1.2rem; color: var(--paper); font-weight: 500; }
.footer-logo span { color: var(--gold); }
footer p { font-size: 0.78rem; }

.footer-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 2rem; list-style: none; }
.footer-links a { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(248,246,241,0.4); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--gold); }

.footer-social {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}
.footer-social a {
  font-size: 0.95rem;
  color: rgba(248,246,241,0.35);
  text-decoration: none;
  transition: color 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
}
.footer-social a:hover { color: var(--gold); border-color: var(--gold); }

/* TECH STRIP */
.tech-strip { background: var(--cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.5rem 8vw; display: flex; gap: 3rem; align-items: center; overflow: hidden; }
.tech-strip-label { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; flex-shrink: 0; }
.tech-list { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.tech-item { font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; color: var(--ink-mid); letter-spacing: 0.05em; }
.divider { width: 1px; height: 1rem; background: var(--line); }

/* RESPONSIVE */
@media (max-width: 900px) {
  #inicio { grid-template-columns: 1fr; }
  .hero-right { min-height: 40vw; }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .services-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .clients-grid { grid-template-columns: 1fr; }
  .testimonios-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  section { padding: 4rem 6vw; }
  footer { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .footer-right { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
}

@media (max-width: 600px) {
  .portfolio-filters { gap: 0.4rem; }
  .pf-btn { font-size: 0.65rem; padding: 0.4rem 0.9rem; }
  .pc-visual { height: 200px; } 
}

/* ANIMACIONES */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero-left > * { opacity: 0; animation: fadeUp 0.7s ease forwards; }
.hero-left > *:nth-child(1) { animation-delay: 0.1s; }
.hero-left > *:nth-child(2) { animation-delay: 0.25s; }
.hero-left > *:nth-child(3) { animation-delay: 0.4s; }
.hero-left > *:nth-child(4) { animation-delay: 0.55s; }
.hero-card { opacity: 0; animation: fadeUp 0.8s ease 0.6s forwards; }

@keyframes cardReveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.portfolio-card {
  opacity: 0;
  animation: cardReveal 0.5s ease forwards;
}
.portfolio-card:nth-child(1) { animation-delay: 0.05s; }
.portfolio-card:nth-child(2) { animation-delay: 0.12s; }
.portfolio-card:nth-child(3) { animation-delay: 0.19s; }
.portfolio-card:nth-child(4) { animation-delay: 0.26s; }
.portfolio-card:nth-child(5) { animation-delay: 0.33s; }
.portfolio-card:nth-child(6) { animation-delay: 0.40s; }
