/* ============================================================
   Espar Co. — Data and Business Solutions
   Hoja de estilos compartida (home + portafolio)
   ============================================================ */

:root {
  --navy: #022660;
  --navy-deep: #011845;
  --cyan: #00A7F1;
  --white: #FFFFFF;
  --slate: #2D3748;
  --gray: #718096;
  --line: #E2E8F0;
  --bg-soft: #F7FAFC;
  --pill-bg: #E8F7FE;
  --pill-border: #BEE8FB;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  color: var(--slate);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--navy); }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 48px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.section-heading {
  font-size: 34px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid var(--navy);
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
  padding: 15px 30px;
}
.btn-primary:hover { background: var(--navy-deep); color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  padding: 13px 28px;
}
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-sm { padding: 10px 22px; font-size: 14px; }

/* ---------- Pills / tags ---------- */
.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.pill-tool { background: var(--pill-bg); color: var(--navy); border: 1px solid var(--pill-border); }
.pill-industry { background: var(--navy); color: var(--white); }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: 0 12px 28px rgba(2, 38, 96, .12); transform: translateY(-3px); }

.badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  gap: 24px;
}
.logo-link { display: block; flex-shrink: 0; }
.logo-link img { height: 32px; width: auto; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-link {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--slate);
}
.nav-link:hover { color: var(--navy); }
.nav-link.is-active {
  color: var(--navy);
  border-bottom: 2px solid var(--cyan);
  padding-bottom: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.social-icons { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1.5px solid var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--navy); color: var(--white); }
.icon-btn svg { width: 17px; height: 17px; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--navy);
  border-radius: 6px;
  background: var(--white);
  align-items: center;
  justify-content: center;
  color: var(--navy);
  cursor: pointer;
}

/* ============================================================
   HERO (home)
   ============================================================ */
.hero {
  padding: 96px 0 100px;
  background: linear-gradient(180deg, #FBFDFF 0%, #FFFFFF 60%);
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr 560px;
  gap: 64px;
  align-items: center;
}
.hero h1 {
  font-size: 50px;
  line-height: 1.12;
  font-weight: 800;
  color: var(--navy);
  margin: 18px 0 24px;
  letter-spacing: -.015em;
}
.hero p.lede {
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--gray);
  margin: 0 0 36px;
  max-width: 520px;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.hero-byline {
  display: flex;
  align-items: center;
  gap: 14px;
}
.avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--line);
  flex-shrink: 0;
}
.hero-byline-text { font-size: 13.5px; color: var(--gray); line-height: 1.4; }
.hero-byline-text strong { color: var(--slate); }

.hero-visual { position: relative; width: 100%; height: 460px; }
.hero-visual-main {
  position: absolute;
  top: 34px;
  right: 0;
  width: 480px;
  height: 320px;
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(2, 38, 96, .22);
  z-index: 2;
}
.hero-visual-main img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(2, 38, 96, .38), rgba(0, 167, 241, .08));
}
.hero-visual-detail {
  position: absolute;
  bottom: 6px;
  left: 0;
  width: 212px;
  height: 150px;
  border-radius: 14px;
  overflow: hidden;
  border: 5px solid var(--white);
  box-shadow: 0 16px 32px rgba(2, 38, 96, .20);
  z-index: 3;
}
.hero-visual-detail img { width: 100%; height: 100%; object-fit: cover; }
.hero-stat {
  position: absolute;
  top: 0;
  left: 0;
  width: 230px;
  max-width: 60%;
  padding: 16px 18px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(2, 38, 96, .16);
  border: 1px solid var(--line);
  z-index: 4;
}
.hero-stat-num { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1; }
.hero-stat-label { font-size: 12.5px; color: var(--gray); margin-top: 6px; line-height: 1.4; }

/* ============================================================
   PORTFOLIO PREVIEW (home) + FULL GRID (proyectos)
   ============================================================ */
.section-portfolio { padding: 100px 0; background: var(--bg-soft); }
.section-portfolio .section-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}
.section-portfolio .section-top p {
  font-size: 15px;
  color: var(--gray);
  max-width: 340px;
  margin: 0 0 4px;
  line-height: 1.6;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.project-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.project-card h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.35;
}
.project-card .client {
  font-size: 13px;
  color: var(--cyan);
  margin: 0;
  font-weight: 600;
}
.project-card .desc {
  font-size: 14.5px;
  color: var(--gray);
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}
.project-card .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.project-card .case-link {
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.portfolio-cta { display: flex; justify-content: center; margin-top: 52px; }

/* ============================================================
   SOBRE MÍ (home)
   ============================================================ */
.section-about { padding: 100px 0; background: var(--white); }
.section-about .container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 64px;
  align-items: start;
}
.about-photo-wrap { position: relative; width: 100%; max-width: 340px; height: 400px; }
.about-photo-accent {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: linear-gradient(155deg, var(--navy), var(--cyan));
  z-index: 1;
}
.about-photo {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  z-index: 2;
  overflow: hidden;
}
.about-photo.is-placeholder {
  border: 2px dashed var(--line);
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.about-photo.is-placeholder span {
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  padding: 0 24px;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }

.section-about h2 { margin-bottom: 22px; }
.section-about .about-copy {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--gray);
  margin: 0 0 36px;
  max-width: 520px;
}

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 18px; }
.timeline-dot-col { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--cyan); flex-shrink: 0; }
.timeline-dot.is-last { background: var(--navy); }
.timeline-line { width: 2px; flex-grow: 1; background: var(--line); }
.timeline-content { padding-bottom: 26px; }
.timeline-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.timeline-meta { font-size: 13.5px; color: var(--gray); margin-top: 2px; }

/* ============================================================
   CONTACTO (home)
   ============================================================ */
.section-contact { padding: 100px 0; background: var(--bg-soft); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 64px;
  align-items: start;
}
.contact-intro { padding-top: 8px; }

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 12px 28px rgba(2, 38, 96, .08);
}
.form-note {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--gray);
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 24px;
}
.form-card .field { margin-bottom: 18px; }
.form-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 7px;
}
.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 14.5px;
  color: var(--slate);
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  outline: none;
  border-color: var(--cyan);
}
.form-card textarea { resize: vertical; min-height: 76px; font-family: inherit; }
.form-disclaimer {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
  margin-top: 14px;
  text-align: center;
}

/* ---------- WhatsApp flotante ---------- */
.fab-whatsapp {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(2, 38, 96, .28);
  z-index: 60;
  transition: transform .15s ease;
}
.fab-whatsapp:hover { transform: scale(1.06); }
.fab-whatsapp-icon { width: 28px; height: 28px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--navy); padding: 64px 0 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.footer-brand { font-size: 22px; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.footer-brand span { color: var(--cyan); }
.footer-tagline { font-size: 13.5px; color: rgba(255, 255, 255, .62); line-height: 1.7; max-width: 280px; margin: 0; }
.footer-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.footer-links { display: flex; flex-direction: column; gap: 11px; }
.footer-links a { font-size: 14px; color: rgba(255, 255, 255, .72); }
.footer-links a:hover { color: var(--white); }
.footer-contact-email { font-size: 14px; color: rgba(255, 255, 255, .72); margin: 0 0 18px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}
.footer-social a:hover { background: rgba(255, 255, 255, .12); }
.footer-social svg { width: 15px; height: 15px; }
.footer-bottom { padding-top: 24px; }
.footer-bottom p { font-size: 12.5px; color: rgba(255, 255, 255, .5); margin: 0; }

/* ============================================================
   PÁGINA PORTAFOLIO — encabezado + filtros
   ============================================================ */
.page-header {
  padding: 64px 0 40px;
  background: linear-gradient(180deg, #FBFDFF 0%, #FFFFFF 100%);
}
.page-header h1 {
  font-size: 38px;
  font-weight: 800;
  color: var(--navy);
  margin: 14px 0 14px;
  letter-spacing: -.01em;
}
.page-header p { font-size: 16px; color: var(--gray); margin: 0; max-width: 560px; line-height: 1.6; }

.filters-section { padding: 8px 0 40px; }
.filters-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px;
  background: var(--bg-soft);
  border-radius: 14px;
}
.filter-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 12px;
}
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--navy);
  transition: background .12s ease, color .12s ease;
}
.chip:hover { background: rgba(2, 38, 96, .06); }
.chip.is-active { background: var(--navy); color: var(--white); }
.chip.is-active:hover { background: var(--navy-deep); }

.results-section { padding: 8px 0 100px; }
.results-count { font-size: 13.5px; color: var(--gray); margin: 0 0 28px; }
.no-results { text-align: center; padding: 80px 20px; display: none; }
.no-results.is-visible { display: block; }
.no-results p { font-size: 16px; color: var(--gray); margin: 0; }
.project-card[hidden] { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .hero .container { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { height: 380px; max-width: 480px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-about .container { grid-template-columns: 1fr; }
  .about-photo-wrap { max-width: 280px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .container { padding: 0 24px; }
  .main-nav { display: none; }
  .header-actions .btn-outline.btn-sm { display: none; }
  .nav-toggle { display: flex; }
  .site-header.is-open .main-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 24px;
  }
  .hero { padding: 56px 0 64px; }
  .hero h1 { font-size: 36px; }
  .hero-visual { height: 220px; }
  .hero-visual-detail,
  .hero-stat { display: none; }
  .hero-visual-main { position: static; width: 100%; height: 220px; }
  .project-grid { grid-template-columns: 1fr; }
  .section-portfolio, .section-about { padding: 64px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 30px; }
  .section-contact { padding: 64px 0; }
  .form-card { padding: 24px; }
  .fab-whatsapp { right: 16px; bottom: 16px; width: 52px; height: 52px; }
}
