/* ============================================================
   BIT4BIT Colima — css/styles.css
   Combined with transitions, animations and layout rules
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

::selection {
  background: #1b4ad6;
  color: #fff;
}

input,
textarea,
select,
button {
  font-family: inherit;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes floaty {

  0%,
  100% {
    transform: rotateX(54deg) rotateZ(45deg) translateY(0);
  }

  50% {
    transform: rotateX(54deg) rotateZ(45deg) translateY(-12px);
  }
}

@keyframes barGrow {
  from {
    transform: scaleY(.2);
  }

  to {
    transform: scaleY(1);
  }
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Scroll reveal ──────────────────────────────────────── */
[data-reveal] {
  opacity: 1;
  transform: none;
}

body.js [data-reveal]:not([data-shown]) {
  opacity: 0;
  transform: translateY(26px);
}

body.js [data-reveal][data-shown] {
  animation: revealUp .8s cubic-bezier(.2, .7, .2, 1) forwards;
}

body.js [data-reveal][data-done] {
  animation: none;
  opacity: 1;
  transform: none;
}

/* ── Float card ─────────────────────────────────────────── */
.float-card {
  animation: floaty 7s ease-in-out infinite;
}

/* ── Bar chart ──────────────────────────────────────────── */
.bar {
  transform-origin: bottom;
}

.bar-1 {
  animation: barGrow 1s ease-out both .20s;
}

.bar-2 {
  animation: barGrow 1s ease-out both .35s;
}

.bar-3 {
  animation: barGrow 1s ease-out both .50s;
}

.bar-4 {
  animation: barGrow 1s ease-out both .65s;
}

.bar-5 {
  animation: barGrow 1s ease-out both .80s;
}

/* ── Slider track ───────────────────────────────────────── */
.slider-track {
  transition: transform .55s cubic-bezier(.2, .7, .2, 1);
}

.dot-btn {
  transition: width .3s, background .3s;
}

/* ── Nav ────────────────────────────────────────────────── */
.nav-link {
  transition: color .2s;
}

.nav-link:hover {
  color: #0c2340 !important;
}

#nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #e6edf5;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  outline: none;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-cta {
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}

.btn-cta:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 26px rgba(12, 35, 64, .26) !important;
}

.btn-primary {
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}

.btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 16px 36px rgba(27, 74, 214, .40) !important;
}

.btn-secondary {
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), border-color .3s, box-shadow .3s;
}

.btn-secondary:hover {
  transform: translateY(-2px) !important;
  border-color: #1b4ad6 !important;
  box-shadow: 0 12px 28px rgba(16, 30, 54, .10) !important;
}

.btn-submit {
  transition: transform .3s, box-shadow .3s;
}

.btn-submit:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 16px 36px rgba(27, 74, 214, .40) !important;
}

.btn-reset {
  transition: border-color .3s;
}

.btn-reset:hover {
  border-color: #1b4ad6 !important;
}

.btn-repo {
  transition: background .3s, transform .3s;
}

.btn-repo:hover {
  background: rgba(255, 255, 255, .16) !important;
  transform: translateY(-2px) !important;
}

.btn-slide {
  transition: background .3s;
}

.btn-slide:hover {
  background: rgba(255, 255, 255, .18) !important;
}

/* ── Service cards ──────────────────────────────────────── */
.service-card {
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}

.service-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 20px 44px rgba(16, 30, 54, .13) !important;
}

/* ── Project Galleries ──────────────────────────────────── */
.proj-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.gal-thumb {
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #f4f7fb;
  border: 1.5px solid #e6edf5;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gal-thumb:hover {
  transform: translateY(-3px) !important;
  border-color: #1b4ad6;
  box-shadow: 0 10px 24px rgba(27, 74, 214, .15);
}

.ph-img {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f4f7fb;
  padding: 12px;
}

.ph-img span {
  font-size: 11px;
  font-weight: 700;
  color: #7b8aa0;
  text-align: center;
  line-height: 1.3;
}

.ph-img svg {
  opacity: .5;
  color: #7b8aa0;
}

.gal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn-more-photos {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(27, 74, 214, .08);
  border: 1px solid rgba(27, 74, 214, .2);
  color: #1b4ad6;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .3s, transform .3s;
  align-self: flex-start;
  margin-top: 4px;
}

.btn-more-photos:hover {
  background: rgba(27, 74, 214, .14);
  transform: translateY(-1px);
}

/* ── Pricing cards ──────────────────────────────────────── */
.price-card {
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}

.price-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 22px 48px rgba(16, 30, 54, .14) !important;
}

.price-card-featured {
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}

.price-card-featured:hover {
  transform: translateY(-14px) !important;
  box-shadow: 0 30px 60px rgba(12, 35, 64, .40) !important;
}

.price-quote {
  transition: border-color .3s, background .3s;
}

.price-quote:hover {
  border-color: #1b4ad6 !important;
  background: #fff !important;
}

.price-quote-featured {
  transition: transform .3s;
}

.price-quote-featured:hover {
  transform: translateY(-2px) !important;
}

/* ── Contact links ──────────────────────────────────────── */
.contact-link {
  transition: border-color .3s, transform .3s;
}

.contact-link:hover {
  transform: translateX(3px) !important;
}

.contact-link-email:hover {
  border-color: #1b4ad6 !important;
}

.contact-link-wa:hover {
  border-color: #0f9d6e !important;
}

.contact-link-gh:hover {
  border-color: #0c2340 !important;
}

/* ── GitHub text link ───────────────────────────────────── */
.github-link {
  transition: border-color .3s;
}

.github-link:hover {
  border-color: #1b4ad6 !important;
}

/* ── Footer links ───────────────────────────────────────── */
.footer-link {
  transition: color .2s;
}

.footer-link:hover {
  color: #fff !important;
}

/* ── Form inputs ────────────────────────────────────────── */
.input-field {
  transition: border-color .25s, background .25s;
}

.input-field:focus {
  border-color: #1b4ad6 !important;
  background: #fff !important;
  outline: none;
}

/* ── Lightbox ───────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 26, .93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

#lb-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .25s, transform .25s;
}

#lb-close:hover {
  background: rgba(255, 255, 255, .18);
  transform: scale(1.05);
}

#lb-prev,
#lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .25s, transform .25s;
}

#lb-prev {
  left: 20px;
}

#lb-next {
  right: 20px;
}

#lb-prev:hover,
#lb-next:hover {
  background: rgba(255, 255, 255, .18);
  transform: translateY(-50%) scale(1.05);
}

#lb-main {
  position: relative;
  z-index: 5;
  width: min(900px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#lb-img-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #061121;
  border: 1px solid rgba(255, 255, 255, .1);
  min-height: 240px;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
}

#lb-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease;
}

#lb-img.lb-hidden {
  opacity: 0;
}

#lb-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px;
  background: #061121;
}

#lb-placeholder.is-visible {
  display: flex;
}

#lb-ph-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, .65);
  text-align: center;
  max-width: 520px;
  line-height: 1.5;
}

#lb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#lb-counter {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .08);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  white-space: nowrap;
}

#lb-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  max-width: 80%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

#lb-strip::-webkit-scrollbar {
  height: 4px;
}

#lb-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .2);
  border-radius: 2px;
}

/* Dots inside lightbox strip */
.lb-dot {
  flex: 0 0 auto;
  width: 56px;
  height: 40px;
  padding: 0;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, .06);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  opacity: .5;
  transition: opacity .25s, border-color .25s, transform .25s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-dot:hover,
.lb-dot.is-active {
  opacity: 1;
  border-color: #1b4ad6;
  transform: translateY(-2px);
}

.lb-dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-dot-ph {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, .7);
}

/* ── Media Queries (Responsive) ─────────────────────────── */

/* ---------- RESPONSIVE 980px ---------- */
@media (max-width: 980px) {
  #hero-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  #founder-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  #contact-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  #founder-photo {
    margin: 0 auto;
  }

  #services-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #service-wide {
    grid-column: span 2 !important;
  }

  #pricing-grid {
    grid-template-columns: 1fr !important;
    max-width: 460px;
    margin: 0 auto;
  }

  .slide-inner {
    grid-template-columns: 1fr !important;
    padding: 30px !important;
    gap: 30px !important;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- RESPONSIVE 720px ---------- */
@media (max-width: 720px) {

  /* Nav móvil */
  #nav-toggle {
    display: flex !important;
  }

  #nav-links {
    position: absolute;
    top: 64px;
    right: 22px;
    left: 22px;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 20px 44px rgba(16, 30, 54, .13);
    display: none !important;
  }

  #nav-links.is-open {
    display: flex !important;
  }

  .nav-link {
    padding: 10px 8px !important;
    display: block;
  }

  .btn-cta {
    justify-content: center;
    text-align: center;
  }

  /* Hero */
  #hero-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    padding: 40px 20px 60px !important;
  }

  #hero-illustration {
    display: none !important;
  }

  #hero-stats {
    gap: 16px !important;
  }

  /* Servicios */
  #services-grid {
    grid-template-columns: 1fr !important;
  }

  #service-wide {
    grid-column: auto !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Proyectos */
  #projects-header {
    align-items: flex-start !important;
  }

  .slide-inner {
    padding: 24px !important;
  }

  /* Gallery en mobile: 2 columnas */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  #footer-top {
    flex-direction: column !important;
  }

  #footer-bottom {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center;
  }

  /* Contacto form row → 1 col */
  #form-row {
    grid-template-columns: 1fr !important;
  }

  /* Padding general */
  #servicios,
  #precios {
    padding: 60px 20px !important;
  }
}

/* ---------- RESPONSIVE 480px ---------- */
@media (max-width: 480px) {
  #hero-stats {
    flex-wrap: wrap;
  }

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

  #lb-main {
    width: 95vw;
  }

  #lb-prev {
    left: 8px;
  }

  #lb-next {
    right: 8px;
  }
}