/* =========================================
   FRAMING & CONSTRUCTION — DIGITAL CARD
   ========================================= */

:root {
  color-scheme: dark;

  --navy: #062e64;
  --blue: #07539c;
  --bright-blue: #54adff;
  --ink: #080d15;
  --white: #ffffff;
  --muted: #b1bece;
  --line: rgba(255, 255, 255, 0.15);

  --card-gap: 12px;
  --card-padding: 20px;

  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(
      ellipse at 50% 15%,
      #173a63 0%,
      #0a1729 38%,
      #05090f 80%
    );

  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:focus-visible {
  outline: 3px solid #92ccff;
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pantalla fija; respeta las zonas seguras de iPhone. */

.stage {
  width: 100%;
  height: 100vh;
  height: 100dvh;

  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
}

.business-card {
  position: relative;
  isolation: isolate;

  width: min(100%, 450px);
  height: 100%;
  max-height: 880px;
  min-height: 0;

  padding: var(--card-padding);
  display: grid;

  grid-template-rows:
    minmax(90px, 1fr)
    auto
    auto
    minmax(150px, 1.2fr)
    auto;

  gap: var(--card-gap);

  background:
    radial-gradient(
      ellipse at 110% 42%,
      rgba(10, 77, 143, 0.3),
      transparent 52%
    ),
    linear-gradient(145deg, #121c2a, #080d15 65%);

  border: 1px solid rgba(141, 186, 232, 0.24);
  border-radius: 24px;

  box-shadow:
    0 35px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  animation: card-entry 0.75s 1.15s both;
}

/* Panel blanco para conservar legibles las letras negras del logo. */

.brand-panel {
  position: relative;
  min-height: 0;
  overflow: hidden;

  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;

  padding: 10px 14px;

  color: var(--navy);
  background:
    linear-gradient(
      125deg,
      transparent 68%,
      rgba(6, 46, 100, 0.05) 68%,
      rgba(6, 46, 100, 0.05) 82%,
      transparent 82%
    ),
    #ffffff;

  border-radius: 12px 12px 3px 3px;
  border-bottom: 4px solid var(--blue);
}

.brand-topline {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;

  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.25px;
}

.business-logo {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 340px;

  object-fit: contain;
  padding: 4px 0;
}

.brand-values {
  display: flex;
  align-items: center;
  gap: 12px;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.brand-values i {
  width: 3px;
  height: 3px;
  background: var(--blue);
  transform: rotate(45deg);
}

/* Mensaje principal */

.headline {
  padding: 1px 2px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.3;
}

h1 {
  font-size: clamp(28px, 7.5vw, 36px);
  font-weight: 900;
  letter-spacing: -1.2px;
  line-height: 0.99;
}

h1 br {
  display: none;
}

h1 span {
  color: var(--bright-blue);
}

/* Botones */

.contact-actions {
  display: grid;
  gap: 9px;
}

.call-button {
  position: relative;
  min-height: 62px;
  padding: 10px 17px;

  display: flex;
  align-items: center;
  gap: 13px;

  border: 1px solid rgba(137, 199, 255, 0.5);
  border-radius: 11px;

  background: linear-gradient(110deg, #064487, #0870c3);
  box-shadow: 0 8px 24px rgba(0, 65, 141, 0.25);

  animation: call-glow 4s 2.2s infinite;
  transition: filter 0.2s, transform 0.2s;
}

.call-icon {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.call-icon .icon {
  width: 21px;
  height: 21px;

  animation: phone-ring 4s 2.2s infinite;
}

.call-copy {
  display: grid;
  gap: 3px;
}

.call-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.9px;
}

.call-copy strong {
  font-size: clamp(21px, 5.7vw, 26px);
  line-height: 1;
  letter-spacing: 0.2px;
}

.button-arrow {
  margin-left: auto;
  width: 21px;
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.secondary-button {
  min-height: 47px;
  padding: 8px 10px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  border: 1px solid var(--line);
  border-radius: 9px;

  font-size: 14px;
  font-weight: 700;

  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

.whatsapp-button {
  color: #ffffff;
  border-color: #277750;
  background: linear-gradient(120deg, #103c2c, #145737);

  animation: whatsapp-glow 4s 3.4s infinite;
}

.whatsapp-button .icon {
  width: 25px;
  height: 25px;
}

.email-button {
  background: rgba(255, 255, 255, 0.04);
}

.email-button .icon {
  width: 21px;
  height: 21px;
}

.call-button:active,
.secondary-button:active,
.service-card:active {
  transform: scale(0.98);
}

/* Servicios: fotografías pequeñas, como la referencia. */

.services {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h2 {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.3px;
}

.section-heading h2 span {
  color: var(--bright-blue);
}

.heading-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, #2379c2, transparent);
}

.section-number {
  color: #acbbcd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.service-grid {
  min-height: 0;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));

  gap: 9px;
}

.service-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;

  background: #143452;
  border: 1px solid rgba(151, 189, 226, 0.28);
  border-radius: 8px;

  transition: border-color 0.2s, transform 0.2s;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;

  background: linear-gradient(
    180deg,
    rgba(3, 10, 19, 0.08) 10%,
    rgba(3, 10, 19, 0.08) 30%,
    rgba(3, 10, 19, 0.75) 75%,
    rgba(3, 10, 19, 0.97)
  );

  pointer-events: none;
}

.service-card > img {
  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;
  transition: transform 0.55s, opacity 0.3s;
}

.service-number {
  position: absolute;
  top: 7px;
  left: 8px;
  z-index: 2;

  padding: 3px 5px;
  color: white;
  background: rgba(5, 24, 43, 0.65);

  border-left: 2px solid #70bdff;
  border-radius: 2px;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.service-caption {
  position: absolute;
  right: 9px;
  bottom: 10px;
  left: 9px;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.service-caption strong {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.service-caption .icon {
  width: 15px;
  height: 15px;
  color: #83c5ff;
}

.service-card.image-unavailable {
  background: linear-gradient(135deg, #205888, #091a2c);
}

.service-card.image-unavailable > img {
  visibility: hidden;
}

/* Pie */

.card-footer {
  min-width: 0;
  padding-top: 9px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  border-top: 1px solid var(--line);
}

.location {
  display: flex;
  align-items: center;
  gap: 5px;

  color: #e1e8ef;
  font-size: 12px;
  white-space: nowrap;
}

.location .icon {
  width: 16px;
  height: 16px;
  color: var(--bright-blue);
}

.footer-signature {
  color: #a9b8cb;
  font-size: 11px;
  font-style: italic;
  text-align: right;
}

/* Entrada con el logo */

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;

  display: grid;
  place-items: center;

  background:
    radial-gradient(
      ellipse at center,
      #ffffff,
      #ecf2f8
    );

  pointer-events: none;

  animation: intro-out 0.6s 1.1s forwards;
}

.intro-brand {
  width: min(78vw, 340px);
  color: var(--navy);
  text-align: center;
}

.intro-brand img {
  width: 100%;
  height: auto;
  animation: logo-entry 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.intro-rule {
  width: 70%;
  height: 3px;
  margin: 20px auto 15px;

  background: linear-gradient(90deg, var(--navy), #1685d6);
  transform-origin: left;
  animation: line-entry 0.8s 0.15s both;
}

.intro-brand p {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  animation: logo-entry 0.7s 0.2s both;
}

/* Dispositivos con mouse */

@media (hover: hover) {
  .call-button:hover {
    filter: brightness(1.13);
  }

  .secondary-button:hover {
    border-color: #74b9f7;
    background-color: rgba(74, 140, 202, 0.16);
  }

  .service-card:hover {
    border-color: #79c0ff;
  }

  .service-card:hover > img {
    transform: scale(1.07);
  }
}

/* Celulares: aprovecha toda la pantalla. */

@media (max-width: 520px) {
  .stage {
    padding:
      env(safe-area-inset-top)
      env(safe-area-inset-right)
      env(safe-area-inset-bottom)
      env(safe-area-inset-left);
  }

  .business-card {
    width: 100%;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;

    --card-padding: 16px;
  }
}

/* Pantallas de poca altura: comprime espacios, no recorta la tarjeta. */

@media (max-height: 700px) {
  .business-card {
    --card-gap: 9px;
    --card-padding: 13px;
  }

  .brand-panel {
    padding: 7px 12px;
  }

  .brand-topline {
    font-size: 8px;
  }

  .brand-values {
    font-size: 9px;
    gap: 10px;
    letter-spacing: 1.5px;
  }

  h1 {
    font-size: 29px;
  }

  .eyebrow {
    font-size: 9px;
    margin-bottom: 4px;
  }

  .call-button {
    min-height: 56px;
    padding: 8px 13px;
  }

  .secondary-button {
    min-height: 44px;
  }

  .contact-actions,
  .secondary-actions,
  .service-grid,
  .services {
    gap: 7px;
  }

  .card-footer {
    padding-top: 7px;
  }
}

@media (max-width: 360px) {
  .business-card {
    --card-padding: 11px;
  }

  h1 {
    font-size: 27px;
  }

  .eyebrow {
    letter-spacing: 1.4px;
  }

  .service-caption strong {
    font-size: 11px;
  }

  .footer-signature {
    font-size: 10px;
  }
}

/* Teléfono horizontal: dos columnas, sin desplazamiento. */

@media (orientation: landscape) and (max-height: 540px) {
  .stage {
    padding:
      max(8px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .business-card {
    width: min(100%, 940px);
    max-width: 940px;
    max-height: none;

    grid-template-columns:
      minmax(0, 0.95fr)
      minmax(0, 1.05fr);

    grid-template-rows:
      minmax(65px, 1fr)
      auto
      auto
      auto;

    grid-template-areas:
      "brand services"
      "headline services"
      "contact services"
      "footer footer";

    column-gap: 18px;
    row-gap: 7px;

    padding: 10px 14px;
    border-radius: 15px;
  }

  .brand-panel {
    grid-area: brand;
    padding: 4px 10px;
  }

  .brand-topline,
  .brand-values {
    display: none;
  }

  .brand-panel {
    grid-template-rows: minmax(0, 1fr);
  }

  .business-logo {
    max-width: 230px;
    padding: 0;
  }

  .headline {
    grid-area: headline;
  }

  .headline .eyebrow {
    display: none;
  }

  h1 {
    font-size: 25px;
  }

  .contact-actions {
    grid-area: contact;
    gap: 6px;
  }

  .call-button {
    min-height: 48px;
    padding: 6px 10px;
  }

  .call-copy strong {
    font-size: 22px;
  }

  .call-icon {
    width: 32px;
    height: 32px;
  }

  .secondary-button {
    min-height: 40px;
    padding: 6px;
  }

  .services {
    grid-area: services;
  }

  .card-footer {
    grid-area: footer;
    padding-top: 5px;
  }
}

/* Animaciones */

@keyframes logo-entry {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.94);
    filter: blur(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes line-entry {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes intro-out {
  to {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.035);
  }
}

@keyframes card-entry {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes call-glow {
  0%, 48%, 100% {
    box-shadow:
      0 8px 24px rgba(0, 65, 141, 0.25),
      0 0 0 0 rgba(65, 161, 255, 0);
  }

  15% {
    box-shadow:
      0 8px 28px rgba(0, 105, 218, 0.4),
      0 0 0 5px rgba(65, 161, 255, 0.13);
  }

  30% {
    box-shadow:
      0 8px 24px rgba(0, 65, 141, 0.25),
      0 0 0 9px rgba(65, 161, 255, 0);
  }
}

@keyframes phone-ring {
  0%, 24%, 100% {
    transform: rotate(0);
  }

  5%, 15% {
    transform: rotate(-13deg);
  }

  10%, 20% {
    transform: rotate(13deg);
  }
}

@keyframes whatsapp-glow {
  0%, 45%, 100% {
    box-shadow: 0 0 0 0 rgba(67, 205, 131, 0);
  }

  15% {
    box-shadow: 0 0 0 4px rgba(67, 205, 131, 0.14);
  }

  30% {
    box-shadow: 0 0 0 8px rgba(67, 205, 131, 0);
  }
}

/* Respeta la preferencia de reducir movimiento. */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .intro-screen {
    display: none;
  }
}

/* Redes sociales al pie de la tarjeta */

.card-footer.social-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding-top: 10px;
  padding-bottom: 2px;
}

.social-logo {
  --social-glow: 90, 170, 255;

  display: grid;
  place-items: center;
  flex: 0 0 auto;

  width: 40px;
  height: 40px;

  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

  animation: social-heartbeat 3.6s ease-in-out infinite;
}

.social-logo svg {
  display: block;
  width: 22px;
  height: 22px;
}

.social-facebook {
  --social-glow: 24, 119, 242;
  background: linear-gradient(145deg, #2588ff, #0756bc);
  animation-delay: 0s;
}

.social-tiktok {
  --social-glow: 37, 244, 238;
  background: #080b10;
  animation-delay: 0.65s;
}

.social-tiktok svg {
  filter:
    drop-shadow(-1px -0.5px 0 #25f4ee)
    drop-shadow(1px 0.5px 0 #fe2c55);
}

.social-instagram {
  --social-glow: 225, 48, 108;

  background: radial-gradient(
    circle at 25% 110%,
    #ffdc80 0%,
    #fcaf45 20%,
    #f77737 34%,
    #e1306c 58%,
    #833ab4 82%,
    #405de6 100%
  );

  animation-delay: 1.3s;
}

@keyframes social-heartbeat {
  0%, 38%, 100% {
    transform: scale(1);
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.25),
      0 0 0 0 rgba(var(--social-glow), 0);
  }

  10%, 24% {
    transform: scale(1.08);
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.25),
      0 0 0 5px rgba(var(--social-glow), 0.13);
  }

  17% {
    transform: scale(1);
  }
}

@media (max-height: 700px) {
  .card-footer.social-footer {
    gap: 20px;
    padding-top: 7px;
    padding-bottom: 1px;
  }

  .social-logo {
    width: 34px;
    height: 34px;
  }

  .social-logo svg {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-logo {
    animation: none;
  }
}