/* ================================================================
   CONSTRUCTORA MC — css/styles.css
   Versión estática: compatible con hosting compartido Hostinger
   ================================================================
   Paleta:
     Midnight     #122C4F  → fondo principal
     Pearl        #FBF9E4  → textos y contrastes claros
     Noir         #000000  → profundidad
     Ocean        #5B88B2  → acento, hover, botones
   ================================================================ */


/* ── 1. VARIABLES CSS ─────────────────────────────────────────── */
:root {
  /* Colores de marca */
  --midnight:       #122C4F;
  --midnight-deep:  #0C1E37;
  --midnight-mid:   #1A3A63;
  --pearl:          #FBF9E4;
  --pearl-dim:      #EDE9CC;
  --noir:           #000000;
  --ocean:          #5B88B2;
  --ocean-light:    #7AA3C8;
  --ocean-dark:     #3E6A93;

  /* Superficies y bordes */
  --surface:        rgba(18, 44, 79, 0.55);
  --surface-hover:  rgba(18, 44, 79, 0.80);
  --border:         rgba(91, 136, 178, 0.18);
  --border-hover:   rgba(91, 136, 178, 0.55);

  /* Tipografía */
  --font-display:   'Cormorant Garamond', Georgia, serif;
  --font-body:      'DM Sans', system-ui, sans-serif;

  /* Movimiento */
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io:        cubic-bezier(0.65, 0, 0.35, 1);

  /* Layout */
  --max-w:          500px;
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
}


/* ── 2. RESET Y BASE ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background-color: var(--noir);
  color: var(--pearl);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a   { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
address { font-style: normal; }


/* ── 3. CAPAS DE FONDO ────────────────────────────────────────── */
.bg-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 130% 60% at 50% 0%,   rgba(91, 136, 178, .22) 0%, transparent 55%),
    radial-gradient(ellipse 60%  50% at 15% 40%,  rgba(18,  44,  79, .60) 0%, transparent 60%),
    linear-gradient(180deg, #122C4F 0%, #0C1E37 40%, #07111f 70%, #000000 100%);
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(91, 136, 178, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 136, 178, .06) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}


/* ── 4. CONTENEDOR HUB ────────────────────────────────────────── */
.hub {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;

  /* Animación de entrada al cargar la página */
  animation: hubFadeIn .9s var(--ease-out) both;
}

@keyframes hubFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── 5. ENCABEZADO DE MARCA ───────────────────────────────────── */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  width: 100%;
  animation: fadeSlideUp .8s var(--ease-out) .1s both;
}

/* Logo */
.logo-wrap {
  position: relative;
  width: 110px;
  height: 110px;
}

.logo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  box-shadow:
    0 0 0 8px  rgba(91, 136, 178, .06),
    0 20px 60px rgba(0, 0, 0, .55),
    0 0 40px   rgba(91, 136, 178, .12);
  transition:
    transform .6s var(--ease-out),
    box-shadow .6s var(--ease-out);
}

.logo:hover {
  transform: scale(1.04);
  box-shadow:
    0 0 0 12px rgba(91, 136, 178, .10),
    0 24px 70px rgba(0, 0, 0, .60),
    0 0 60px   rgba(91, 136, 178, .22);
}

/* Halo de luz detrás del logo */
.logo-glow {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 136, 178, .15) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: .6; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.08); }
}

/* Nombre y tagline */
.brand-name {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.1;
  color: var(--pearl);
}

.brand-accent { color: var(--ocean-light); }

.brand-tagline {
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(251, 249, 228, .60);
}

/* Separador decorativo */
.divider-rule {
  display: flex;
  align-items: center;
  gap: .875rem;
  width: 100%;
  margin-top: .25rem;
}

.rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 136, 178, .55), transparent);
}

.rule-diamond {
  font-size: .5rem;
  color: var(--pearl-dim);
  opacity: .75;
}


/* ── 6. TARJETAS DE ENLACE ────────────────────────────────────── */
.links-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  animation: fadeSlideUp .8s var(--ease-out) .25s both;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: .95rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  /* glassmorphism sutil */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition:
    background    .32s var(--ease-io),
    border-color  .32s var(--ease-io),
    transform     .18s var(--ease-out),
    box-shadow    .32s var(--ease-io);
}

/* Efecto shimmer en hover */
.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 25%,
    rgba(251, 249, 228, .06) 50%,
    transparent 75%
  );
  transform: translateX(-100%);
  transition: transform .6s var(--ease-out);
}

.link-card:hover::before  { transform: translateX(100%); }
.link-card:hover {
  background:   var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .45), 0 0 24px rgba(91, 136, 178, .18);
}
.link-card:active { transform: translateY(0) scale(.99); }

/* Ícono */
.link-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(18, 44, 79, .70);
  border: 1px solid rgba(91, 136, 178, .35);
  color: var(--ocean-light);
  font-size: 1.2rem;
  transition: background .32s, color .32s, border-color .32s;
}

.link-card:hover .link-icon-wrap {
  background: rgba(91, 136, 178, .28);
  border-color: rgba(91, 136, 178, .45);
  color: var(--pearl);
}

/* Texto */
.link-text {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--pearl);
}

/* Flecha derecha */
.link-arrow {
  font-size: 1rem;
  color: rgba(251, 249, 228, .25);
  transition: color .32s, transform .32s var(--ease-out);
}
.link-card:hover .link-arrow {
  color: var(--ocean-light);
  transform: translate(3px, -3px);
}

/* Dirección física */
.address-text {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .73rem;
  color: rgba(251, 249, 228, .38);
  letter-spacing: .06em;
  padding-left: 1.3rem;
  margin-top: -.15rem;
}
.address-text i { color: var(--ocean); font-size: .85rem; }


/* ── 7. SECCIÓN DE PROYECTOS ──────────────────────────────────── */
.projects-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: fadeSlideUp .8s var(--ease-out) .4s both;
}

/* Etiqueta de sección */
.section-label-text {
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ocean-light);
  padding: .25rem .9rem;
  border: 1px solid rgba(91, 136, 178, .45);
  border-radius: 999px;
  background: rgba(18, 44, 79, .70);
}

/* Título de sección */
.projects-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 600;
  color: var(--pearl);
  letter-spacing: .02em;
}

/* Grid de tarjetas de proyecto */
.projects-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
}

/* ── Tarjeta de proyecto ── */
.project-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
  background: rgba(18, 44, 79, 0.60);
  border: 1px solid rgba(91, 136, 178, 0.28);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  transition:
    transform   .32s var(--ease-out),
    border-color .32s,
    box-shadow   .32s;
}

/* Línea de acento superior */
.project-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ocean), transparent);
  z-index: 2;
}

.project-card--active::after {
  background: linear-gradient(90deg, transparent, var(--ocean-light), var(--ocean), transparent);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(91, 136, 178, .55);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .50), 0 0 32px rgba(91, 136, 178, .20);
}

/* ── Imagen del proyecto ── */
/*
  CONTENEDOR DE IMAGEN
  Aspect-ratio fijo para que todas las imágenes tengan
  la misma proporción sin importar sus dimensiones reales.
*/
.project-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;   /* proporción de render arquitectónico */
  overflow: hidden;
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .7s var(--ease-out);
  /*
    loading="lazy" se define en el HTML.
    El zoom al hover se aplica en el selector :hover más abajo.
  */
}

/* Zoom sutil en la imagen al pasar el cursor */
.project-card:hover .project-card__image {
  transform: scale(1.06);
}

/* Overlay degradado sobre la imagen para legibilidad del badge */
.project-card__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12, 30, 55, .10) 0%,
    rgba(12, 30, 55, .50) 100%
  );
  pointer-events: none;
}

/* Badge de estado — posicionado sobre la imagen */
.project-card__badge {
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 3;
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .22rem .6rem;
  border-radius: 999px;
  background: rgba(12, 30, 55, .75);
  color: rgba(251, 249, 228, .65);
  border: 1px solid rgba(251, 249, 228, .15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.project-card__badge--active {
  background: rgba(18, 44, 79, .90);
  color: var(--ocean-light);
  border-color: var(--ocean);
}

/* ── Cuerpo de la tarjeta ── */
.project-card__body {
  padding: 1rem 1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex: 1;
}

.project-card__icon {
  font-size: 1.4rem;
  color: var(--ocean);
}
.project-card--active .project-card__icon { color: var(--ocean-light); }

.project-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--pearl);
  line-height: 1.2;
}

.project-card__desc {
  font-size: .70rem;
  color: rgba(251, 249, 228, .42);
  line-height: 1.55;
  flex: 1;
}

.project-card__footer {
  margin-top: .5rem;
  padding-top: .55rem;
  border-top: 1px solid rgba(251, 249, 228, .07);
}

/* Estado del proyecto */
.project-status {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .63rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: rgba(251, 249, 228, .38);
}

.project-status--active { color: rgba(122, 163, 200, .8); }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(251, 249, 228, .25);
  flex-shrink: 0;
}

/* Punto animado para proyecto activo */
.status-dot--active {
  background: var(--ocean-light);
  box-shadow: 0 0 8px rgba(91, 136, 178, .75);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

/* Nota de privacidad */
.projects-note {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  font-size: .67rem;
  color: rgba(251, 249, 228, .28);
  line-height: 1.55;
  text-align: center;
  padding: 0 .75rem;
}
.projects-note i { color: var(--ocean); font-size: .8rem; margin-top: .1rem; flex-shrink: 0; }


/* ── 8. CTA DE CONTACTO ───────────────────────────────────────── */
.cta-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  animation: fadeSlideUp .8s var(--ease-out) .55s both;
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--ocean-dark), var(--ocean));
  border: 1px solid rgba(91, 136, 178, .4);
  border-radius: var(--radius-md);
  color: var(--pearl);
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .05em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform   .18s var(--ease-out),
    box-shadow  .32s var(--ease-io),
    filter      .32s;
}

/* Brillo interior del botón */
.cta-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), transparent);
  pointer-events: none;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 50px rgba(91, 136, 178, .42), 0 0 30px rgba(91, 136, 178, .22);
  filter: brightness(1.08);
}

.cta-button:active { transform: translateY(0) scale(.99); }

.cta-arrow {
  margin-left: auto;
  font-size: 1.1rem;
  transition: transform .32s var(--ease-out);
}
.cta-button:hover .cta-arrow { transform: translateX(4px); }

.cta-subtext {
  font-size: .72rem;
  color: rgba(251, 249, 228, .35);
  letter-spacing: .06em;
}
.cta-subtext strong { color: rgba(251, 249, 228, .60); font-weight: 500; }


/* ── 9. PIE DE PÁGINA ─────────────────────────────────────────── */
.hub-footer {
  width: 100%;
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(251, 249, 228, .07);
  display: flex;
  flex-direction: column;
  gap: .3rem;
  animation: fadeSlideUp .8s var(--ease-out) .65s both;
}

.hub-footer p { font-size: .64rem; color: rgba(251, 249, 228, .35); letter-spacing: .08em; }
.footer-craft span { color: var(--ocean-light); margin: 0 .3rem; }


/* ── 10. ANIMACIONES GLOBALES ─────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── 11. ACCESIBILIDAD ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ocean-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Respeta la preferencia del sistema de reducir animaciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:   0.01ms !important;
    transition-duration:  0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ── 12. RESPONSIVE ───────────────────────────────────────────── */

/* Pantallas muy pequeñas (≤ 380px) */
@media (max-width: 380px) {
  .hub { padding: 2rem .9rem 1.75rem; }

.brand-name { font-size: 1.7rem; }
}

/* Tablets y escritorio (≥ 520px) */
@media (min-width: 520px) {
  .hub { padding: 4rem 1.5rem 3rem; }

  .project-card__name { font-size: 1.05rem; }
  .project-card__desc { font-size: .73rem; }
}
