/* ==========================================================================
   ING. CRISTIAN CASTILLON — TARJETA DE PRESENTACIÓN DIGITAL EJECUTIVA
   Paleta oficial extraída del logotipo:
   - Azul Real Metálico: #1B5494
   - Azul Marino Profundo: #172F5E
   - Azul Noche / Sombra: #0F2147
   - Azul Acero / Luz: #2B6CB0 / #4A90E2
   ========================================================================== */

:root {
  /* Brand Colors from Logo */
  --brand-royal: #1b5494;
  --brand-navy: #172f5e;
  --brand-midnight: #0c1933;
  --brand-deep: #071022;
  --brand-steel: #2b6cb0;
  --brand-sky: #5a9cf8;
  --brand-ice: #e8f1fc;

  /* Theme Variables (Default: Executive Sapphire & Porcelain Card) */
  --bg-primary: #09152b;
  --bg-secondary: #0f2147;
  --grid-line: rgba(90, 156, 248, 0.07);
  --card-shell-bg: rgba(255, 255, 255, 0.96);
  --card-shell-border: rgba(255, 255, 255, 0.65);
  --card-inner-surface: #f4f7fb;
  --card-elevated: #ffffff;
  --text-primary: #0f2147;
  --text-secondary: #43587d;
  --text-muted: #6e82a3;
  --border-subtle: rgba(23, 47, 94, 0.1);
  --border-hover: rgba(27, 84, 148, 0.32);
  --shadow-ambient: 0 30px 70px -15px rgba(4, 10, 24, 0.65),
                    0 0 0 1px rgba(255, 255, 255, 0.14);
  --shadow-card-item: 0 4px 16px -2px rgba(15, 33, 71, 0.06),
                      0 2px 6px -1px rgba(15, 33, 71, 0.04);
  --shadow-card-hover: 0 14px 28px -6px rgba(27, 84, 148, 0.18),
                       0 4px 10px -2px rgba(15, 33, 71, 0.08);

  /* Animation Easings */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  --bg-primary: #050c1a;
  --bg-secondary: #0b1833;
  --grid-line: rgba(90, 156, 248, 0.06);
  --card-shell-bg: rgba(13, 27, 55, 0.88);
  --card-shell-border: rgba(90, 156, 248, 0.22);
  --card-inner-surface: rgba(19, 39, 77, 0.75);
  --card-elevated: rgba(23, 47, 94, 0.65);
  --text-primary: #f0f6ff;
  --text-secondary: #b0c4e4;
  --text-muted: #7b96bf;
  --border-subtle: rgba(90, 156, 248, 0.14);
  --border-hover: rgba(90, 156, 248, 0.45);
  --shadow-ambient: 0 32px 80px -12px rgba(0, 0, 0, 0.85),
                    0 0 40px -10px rgba(27, 84, 148, 0.35);
  --shadow-card-item: 0 4px 20px -2px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 14px 30px -6px rgba(9, 21, 43, 0.6),
                       0 0 15px 0 rgba(43, 108, 176, 0.25);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  padding: 2rem 1rem 3rem;
  transition: background-color 0.5s var(--ease-spring), color 0.4s ease;
}

/* ==========================================================================
   ARCHITECTURAL ENGINEERING BACKGROUND & AMBIENT ORBS
   ========================================================================== */
.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(27, 84, 148, 0.42) 0%, transparent 48%),
    radial-gradient(circle at 85% 80%, rgba(43, 108, 176, 0.35) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #0f2147 0%, #060e1e 100%);
}

.blueprint-grid {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(900px) rotateX(25deg) translateY(-60px);
  animation: gridDrift 28s linear infinite;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 20%, transparent 72%);
}

@keyframes gridDrift {
  0% { transform: perspective(900px) rotateX(25deg) translateY(0); }
  100% { transform: perspective(900px) rotateX(25deg) translateY(44px); }
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #2b6cb0 0%, #1b5494 60%, transparent 100%);
  top: -120px;
  left: calc(50% - 360px);
}

.orb-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #1b5494 0%, #0f2147 70%, transparent 100%);
  bottom: -100px;
  right: calc(50% - 340px);
  animation-delay: -7s;
}

@keyframes orbFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(30px, 24px, 0) scale(1.08); }
}

/* ==========================================================================
   TOP FLOATING CONTROLS BAR
   ========================================================================== */
.top-controls {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding: 0 0.25rem;
  animation: fadeSlideDown 0.7s var(--ease-spring) backwards;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 33, 71, 0.72);
  border: 1px solid rgba(90, 156, 248, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #e2eeff;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  animation: pulseDot 2.2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(90, 156, 248, 0.28);
  background: rgba(15, 33, 71, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #e2eeff;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.icon-control-btn:hover {
  background: rgba(27, 84, 148, 0.85);
  border-color: rgba(147, 197, 253, 0.55);
  transform: translateY(-1px);
}

.icon-control-btn:active {
  transform: scale(0.96);
}

.icon-control-btn svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   3D STAGE & DIGITAL PRESENTATION CARD
   ========================================================================== */
.card-stage {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 460px;
  perspective: 1400px;
  animation: cardStageEntrance 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardStageEntrance {
  0% {
    opacity: 0;
    transform: translateY(36px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-flipper {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-flipper.is-flipped {
  transform: rotateY(180deg);
}

.business-card {
  width: 100%;
  background: var(--card-shell-bg);
  border: 1px solid var(--card-shell-border);
  border-radius: 28px;
  box-shadow: var(--shadow-ambient);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(0deg) translateZ(1px);
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    background 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

/* Front card is visible by default; hidden when flipped to QR */
.card-flipper:not(.is-flipped) .business-card:not(.business-card-back) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.card-flipper.is-flipped .business-card:not(.business-card-back) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Back QR card is strictly hidden on load; visible only when flipped */
.business-card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg) translateZ(1px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.card-flipper.is-flipped .business-card-back {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Choreographed Staggered Entrance Animations for Front Card Elements */
@keyframes revealSpringUp {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoPedestalReveal {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.88);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoSheenSweep {
  0% {
    transform: translateX(-140%) skewX(-22deg);
  }
  100% {
    transform: translateX(220%) skewX(-22deg);
  }
}

.logo-pedestal {
  animation: logoPedestalReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
  overflow: hidden;
}

.logo-pedestal::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(27, 84, 148, 0.09),
    rgba(255, 255, 255, 0.75),
    transparent
  );
  transform: translateX(-140%) skewX(-22deg);
  animation: logoSheenSweep 1.35s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
  pointer-events: none;
}

.engineer-badge {
  animation: revealSpringUp 0.7s var(--ease-spring) 0.24s both;
}

.profile-name {
  animation: revealSpringUp 0.7s var(--ease-spring) 0.31s both;
}

.profile-role {
  animation: revealSpringUp 0.7s var(--ease-spring) 0.37s both;
}

.specialty-chips {
  animation: revealSpringUp 0.7s var(--ease-spring) 0.43s both;
}

.reactive-nav-wrap {
  animation: revealSpringUp 0.7s var(--ease-spring) 0.49s both;
}

.contact-stack .contact-card-link:nth-child(1) {
  animation: revealSpringUp 0.75s var(--ease-spring) 0.55s both;
}

.contact-stack .contact-card-link:nth-child(2) {
  animation: revealSpringUp 0.75s var(--ease-spring) 0.63s both;
}

.contact-stack .contact-card-link:nth-child(3) {
  animation: revealSpringUp 0.75s var(--ease-spring) 0.71s both;
}

.utility-grid {
  animation: revealSpringUp 0.75s var(--ease-spring) 0.79s both;
}

@keyframes fadeSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dynamic Specular Glare Overlay */
.card-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: radial-gradient(
    450px circle at var(--mouse-x, 50%) var(--mouse-y, 20%),
    rgba(255, 255, 255, 0.18),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card-stage:hover .card-glare {
  opacity: 1;
}

/* ==========================================================================
   HERO / LOGO SHOWCASE HEADER
   ========================================================================== */
.hero-header {
  position: relative;
  padding: 1.75rem 1.75rem 1.4rem;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(27, 84, 148, 0.08) 0%, transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f6f9fe 100%);
  border-bottom: 1px solid rgba(23, 47, 94, 0.08);
}

/* Top metallic accent bar matching the 3D gradient of the CC logo */
.hero-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #0f2147 0%, #1b5494 35%, #3b82f6 50%, #1b5494 65%, #0f2147 100%);
  background-size: 200% 100%;
  animation: shimmerBar 6s ease infinite;
}

@keyframes shimmerBar {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Subtle engineering geometric rings in header background */
.hero-tech-rings {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px dashed rgba(27, 84, 148, 0.14);
  pointer-events: none;
  animation: slowSpin 40s linear infinite;
}

.hero-tech-rings::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  border: 1px solid rgba(27, 84, 148, 0.07);
}

@keyframes slowSpin {
  from { transform: translateX(-50%) rotate(0deg); }
  to { transform: translateX(-50%) rotate(360deg); }
}

/* Logo Container — Always crisp luminous porcelain showcase so the navy/royal 3D logo shines */
.logo-pedestal {
  position: relative;
  z-index: 2;
  margin: 0 auto 1.15rem;
  width: 100%;
  max-width: 295px;
  padding: 1.05rem 1.35rem 0.9rem;
  border-radius: 22px;
  background: #ffffff;
  box-shadow:
    0 12px 32px -8px rgba(15, 33, 71, 0.12),
    0 2px 6px -1px rgba(15, 33, 71, 0.05),
    inset 0 0 0 1px rgba(27, 84, 148, 0.1);
  transition: transform 0.45s var(--ease-spring), box-shadow 0.45s var(--ease-spring);
}

.logo-pedestal:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow:
    0 18px 38px -8px rgba(27, 84, 148, 0.2),
    0 4px 10px -2px rgba(15, 33, 71, 0.08),
    inset 0 0 0 1px rgba(27, 84, 148, 0.22);
}

.brand-logo-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(15, 33, 71, 0.04));
  transition: transform 0.5s var(--ease-spring);
}

/* Identity Details */
.identity-block {
  position: relative;
  z-index: 2;
}

.engineer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.78rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(27, 84, 148, 0.11) 0%, rgba(15, 33, 71, 0.16) 100%);
  border: 1px solid rgba(27, 84, 148, 0.22);
  color: #1b5494;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.65rem;
}

.engineer-badge svg {
  width: 13px;
  height: 13px;
  color: #1b5494;
}

.profile-name {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f2147;
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.verified-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1b5494;
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.profile-role {
  font-size: 0.91rem;
  font-weight: 500;
  color: #43587d;
  max-width: 340px;
  margin: 0 auto 0.9rem;
  line-height: 1.45;
}

/* Core Specialty Chips */
.specialty-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: #172f5e;
  background: rgba(27, 84, 148, 0.075);
  border: 1px solid rgba(27, 84, 148, 0.15);
  padding: 0.26rem 0.68rem;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.chip:hover {
  background: #1b5494;
  color: #ffffff;
  border-color: #1b5494;
  transform: translateY(-1px);
}

/* ==========================================================================
   REACTIVE SEGMENTED NAVIGATION TABS
   ========================================================================== */
.reactive-nav-wrap {
  padding: 0.9rem 1.35rem 0.35rem;
  background: var(--card-shell-bg);
}

.reactive-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--card-inner-surface);
  padding: 0.3rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.tab-glider {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  left: 0.3rem;
  width: calc((100% - 0.6rem) / 3);
  background: linear-gradient(135deg, #1b5494 0%, #143566 100%);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(23, 47, 94, 0.28);
  transition: transform 0.4s var(--ease-spring);
  z-index: 1;
}

.tab-btn {
  position: relative;
  z-index: 2;
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.56rem 0.4rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  transition: color 0.3s ease;
}

.tab-btn svg {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease-bounce);
}

.tab-btn.is-active {
  color: #ffffff;
}

.tab-btn.is-active svg {
  transform: scale(1.1);
}

/* ==========================================================================
   REACTIVE VIEW PANELS
   ========================================================================== */
.view-container {
  padding: 1rem 1.35rem 1.45rem;
  position: relative;
  min-height: 330px;
}

.view-panel {
  display: none;
  animation: panelFadeIn 0.42s var(--ease-spring) forwards;
}

.view-panel.is-active {
  display: block;
}

@keyframes panelFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   SOCIAL & CONTACT LINKS (MAIN PRESENTATION VIEW)
   ========================================================================== */
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0 0.2rem;
}

.contact-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-card-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  background: var(--card-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card-item);
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  transition:
    transform 0.35s var(--ease-spring),
    box-shadow 0.35s var(--ease-spring),
    border-color 0.3s ease;
}

.contact-card-link::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.contact-card-link:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-hover);
}

.contact-card-link:active {
  transform: translateY(0) scale(0.99);
}

/* Featured WhatsApp CTA — Harmonized with Royal Blue & Emerald Indicator */
.contact-card-link.whatsapp-featured {
  background: linear-gradient(135deg, #172f5e 0%, #1b5494 60%, #2364ad 100%);
  border-color: rgba(147, 197, 253, 0.35);
  color: #ffffff;
  box-shadow: 0 12px 26px -6px rgba(23, 47, 94, 0.45);
}

.contact-card-link.whatsapp-featured:hover {
  box-shadow: 0 16px 32px -6px rgba(27, 84, 148, 0.65);
  border-color: rgba(255, 255, 255, 0.55);
}

/* Shimmer effect on featured button */
.contact-card-link.whatsapp-featured::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.18),
    transparent
  );
  transform: skewX(-20deg);
  animation: ctaSweep 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ctaSweep {
  0%, 60%, 100% { left: -120%; }
  30% { left: 150%; }
}

.contact-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.social-icon-box {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.35s var(--ease-bounce);
}

.contact-card-link:hover .social-icon-box {
  transform: scale(1.08) rotate(-3deg);
}

.social-icon-box svg {
  width: 24px;
  height: 24px;
}

/* Brand-Harmonized Icon Containers */
.icon-whatsapp {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #4ade80;
  box-shadow: inset 0 0 12px rgba(74, 222, 128, 0.15);
}

.icon-instagram {
  background: linear-gradient(135deg, rgba(27, 84, 148, 0.12) 0%, rgba(193, 53, 132, 0.12) 100%);
  border: 1px solid rgba(27, 84, 148, 0.2);
  color: var(--brand-royal);
}

[data-theme="dark"] .icon-instagram {
  color: #7dd3fc;
  background: rgba(27, 84, 148, 0.28);
}

.contact-card-link.instagram-card:hover .icon-instagram {
  background: linear-gradient(135deg, #1b5494 0%, #833ab4 55%, #e1306c 100%);
  color: #ffffff;
  border-color: transparent;
}

.icon-facebook {
  background: rgba(27, 84, 148, 0.1);
  border: 1px solid rgba(27, 84, 148, 0.2);
  color: var(--brand-royal);
}

[data-theme="dark"] .icon-facebook {
  color: #60a5fa;
  background: rgba(27, 84, 148, 0.28);
}

.contact-card-link.facebook-card:hover .icon-facebook {
  background: linear-gradient(135deg, #172f5e 0%, #1877f2 100%);
  color: #ffffff;
  border-color: transparent;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
}

.contact-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.contact-platform {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.whatsapp-online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.75);
  animation: pulseGreenDot 2.2s infinite;
  flex-shrink: 0;
}

@keyframes pulseGreenDot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.75); }
  70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.contact-handle {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whatsapp-featured .contact-handle {
  color: #dbeafe;
  font-family: 'Space Grotesk', monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.contact-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.action-arrow {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 84, 148, 0.08);
  color: var(--brand-royal);
  transition: all 0.3s var(--ease-spring);
}

[data-theme="dark"] .action-arrow {
  background: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
}

.whatsapp-featured .action-arrow {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.contact-card-link:hover .action-arrow {
  transform: translateX(3px);
  background: var(--brand-royal);
  color: #ffffff;
}

.whatsapp-featured:hover .action-arrow {
  background: #ffffff;
  color: var(--brand-navy);
}

/* Quick Utility Grid (Save vCard, Copy Phone, Flip QR) */
.utility-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}

.utility-btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--card-inner-surface);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 0.68rem 0.5rem;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.25s var(--ease-spring);
}

.utility-btn svg {
  width: 18px;
  height: 18px;
  color: var(--brand-royal);
  transition: transform 0.25s var(--ease-bounce);
}

[data-theme="dark"] .utility-btn svg {
  color: #60a5fa;
}

.utility-btn:hover {
  background: var(--card-elevated);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-item);
}

.utility-btn:hover svg {
  transform: scale(1.12);
}

.utility-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   SERVICES PANEL (SOLUCIONES DE INGENIERÍA)
   ========================================================================== */
.services-grid {
  display: flex;
  flex-direction: column;
  gap: 0.68rem;
}

.service-item {
  border-radius: 16px;
  background: var(--card-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.9rem 1rem;
  transition: all 0.3s var(--ease-spring);
  cursor: pointer;
}

.service-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-item);
  transform: translateY(-2px);
}

.service-item.is-expanded {
  border-color: var(--brand-royal);
  background: linear-gradient(180deg, var(--card-elevated) 0%, var(--card-inner-surface) 100%);
}

.service-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.service-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.service-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(27, 84, 148, 0.12) 0%, rgba(23, 47, 94, 0.18) 100%);
  color: var(--brand-royal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .service-icon {
  color: #60a5fa;
  background: rgba(27, 84, 148, 0.3);
}

.service-icon svg {
  width: 19px;
  height: 19px;
}

.service-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.service-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.service-chevron {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.3s var(--ease-spring), background 0.25s ease;
}

.service-item.is-expanded .service-chevron {
  transform: rotate(180deg);
  background: rgba(27, 84, 148, 0.12);
  color: var(--brand-royal);
}

.service-details {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.81rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.service-item.is-expanded .service-details {
  display: block;
  animation: panelFadeIn 0.3s var(--ease-spring);
}

.service-cta-btn {
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  background: var(--brand-royal);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.service-cta-btn:hover {
  background: var(--brand-navy);
  transform: translateX(2px);
}

/* ==========================================================================
   QUICK WHATSAPP COMPOSER PANEL (MENSAJE DIRECTO)
   ========================================================================== */
.composer-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.topic-pill {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--card-inner-surface);
  color: var(--text-secondary);
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}

.topic-pill:hover {
  border-color: var(--brand-royal);
  color: var(--text-primary);
}

.topic-pill.is-selected {
  background: var(--brand-royal);
  border-color: var(--brand-royal);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(27, 84, 148, 0.28);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.styled-input,
.styled-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--card-elevated);
  color: var(--text-primary);
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.styled-textarea {
  resize: none;
  min-height: 76px;
}

.styled-input:focus,
.styled-textarea:focus {
  border-color: var(--brand-royal);
  box-shadow: 0 0 0 3px rgba(27, 84, 148, 0.16);
}

.send-whatsapp-btn {
  appearance: none;
  border: none;
  width: 100%;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #172f5e 0%, #1b5494 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 10px 24px -6px rgba(23, 47, 94, 0.5);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
}

.send-whatsapp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -6px rgba(27, 84, 148, 0.65);
}

.send-whatsapp-btn svg {
  width: 19px;
  height: 19px;
}

/* ==========================================================================
   CARD BACK (3D FLIP — QR CODE & EXECUTIVE CREDENTIAL)
   ========================================================================== */
.qr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.qr-brand-mini {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.qr-brand-mini img {
  height: 32px;
  width: auto;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(15, 33, 71, 0.12);
}

.qr-brand-mini span {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.qr-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 0.5rem;
  margin: auto 0;
}

.qr-frame {
  padding: 1.15rem;
  border-radius: 24px;
  background: #ffffff;
  border: 2px solid rgba(27, 84, 148, 0.2);
  box-shadow: 0 16px 36px -8px rgba(15, 33, 71, 0.18);
  margin-bottom: 1.1rem;
  position: relative;
}

.qr-canvas-wrap {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-caption {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.qr-subcaption {
  font-size: 0.78rem;
  color: var(--text-secondary);
  max-width: 280px;
}

.back-return-btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--card-inner-surface);
  color: var(--text-primary);
  width: 100%;
  padding: 0.8rem;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.back-return-btn:hover {
  background: var(--brand-royal);
  color: #ffffff;
  border-color: var(--brand-royal);
}

/* ==========================================================================
   CARD FOOTER
   ========================================================================== */
.card-footer {
  padding: 0.85rem 1.35rem 1.15rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-phone-link {
  color: var(--brand-royal);
  font-weight: 700;
  text-decoration: none;
}

[data-theme="dark"] .footer-phone-link {
  color: #60a5fa;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px) scale(0.92);
  background: #0f2147;
  color: #ffffff;
  border: 1px solid rgba(90, 156, 248, 0.4);
  padding: 0.72rem 1.25rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s var(--ease-spring);
}

.toast-notification.is-visible {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}

.toast-notification svg {
  width: 17px;
  height: 17px;
  color: #4ade80;
  flex-shrink: 0;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem 2rem;
  }
  .hero-header {
    padding: 1.4rem 1.2rem 1.15rem;
  }
  .logo-pedestal {
    max-width: 255px;
    padding: 0.9rem 1.1rem 0.75rem;
  }
  .profile-name {
    font-size: 1.38rem;
  }
  .view-container {
    padding: 0.9rem 1.05rem 1.25rem;
  }
  .reactive-nav-wrap {
    padding: 0.75rem 1.05rem 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
