:root {
  --ink: #0f0f0f;
  --muted: #777;
  --bg: #f5f6f7;
  --glass: rgba(255,255,255,0.75);
}

/* RESET */
* {
  box-sizing: border-box;
}

#modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overscroll-behavior: contain;
}

/* ============================= */
/* MODAL WOW */
/* ============================= */
.modal-wow {
  overflow-y: hidden;
  position: fixed;
  inset: 0;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.modal-wow.active {
  opacity: 1;
  pointer-events: auto;
}

/* FONDO */
.modal-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, #ffffff, #e9ebee),
    linear-gradient(#f5f6f7, #f5f6f7);
  animation: bgMove 20s linear infinite;
}

@keyframes bgMove {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* CONTENEDOR */
.modal-shell {
  position: relative;
  height: 100%;
  padding: clamp(3rem, 6vw, 7rem);
  display: flex;
  flex-direction: column;
}

/* HEADER */
.modal-header {
  max-width: 900px;
}

.modal-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  color: var(--muted);
}

.modal-header h2 {
  font-size: clamp(3rem, 5vw, 4.2rem);
  font-weight: 200;
  margin: 1rem 0 1.5rem;
  color: var(--ink);
}

.modal-close {
  position: absolute;
  top: 22px;
  right: -400px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 100px;
  min-height: 44px;

  padding: 0.8rem 1.2rem;

  border-radius: 999px;

  background: #c62828;
  color: #ffffff !important;

  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;

  box-shadow: 0 10px 22px rgba(198, 40, 40, 0.25);

  border: 1px solid rgba(255,255,255,0.18);

  transition: all 0.25s ease;
}

.modal-close:hover {
  background: blue !important;
  color: var(--bg) !important;
}

/* CUERPO */
.modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 5rem;
  align-items: center;
}

/* TEXTO */
.modal-lead {
  font-size: 1.6rem;
  font-weight: 300;
  margin-bottom: 2rem;
  color: var(--ink);
}

.modal-copy {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #333;
  max-width: 620px;
}

/* BOTON WOW */
.modal-action {
  margin-top: 3rem;
  padding: 1rem 2.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--ink);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.4s ease;
}

.modal-action:hover {
  transform: translateY(-4px);
  background: #000;
}

/* ================================
   CONTENEDOR VISUAL EN MODAL
   ================================ */
#modal-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  overflow: hidden;
}

#modal-visual svg,
#modal-visual img {
  display: block;
}

/* ================================
   SVG SIMPLE (.draw)
   ================================ */
.draw {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
  color: #f2c300;
}

.draw path,
.draw line,
.draw rect,
.draw circle,
.draw polyline,
.draw polygon,
.draw ellipse {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes simpleDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ================================
   SVG ACUERDO
   ================================ */
.agreement-svg {
  width: 100%;
  max-width: 320px;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.agreement-svg .figure,
.agreement-svg .handshake-core {
  transform-box: fill-box;
  transform-origin: center;
}

/* cabezas */
.agreement-svg .head {
  fill: #f3eee7;
  stroke: #171717;
  stroke-width: 2.2;
}

/* cuerpos */
.agreement-svg .torso {
  stroke: #171717;
  stroke-width: 2.2;
}

.agreement-svg .torso-left {
  fill: #f2c300;
}

.agreement-svg .torso-right {
  fill: #d9dde2;
}

/* brazos y piernas */
.agreement-svg .arm,
.agreement-svg .leg {
  fill: none;
  stroke: #171717;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agreement-svg .arm-left-back,
.agreement-svg .arm-right-back {
  opacity: 0.35;
  stroke-width: 5.5;
}

/* centro del apretón */
.agreement-svg .handshake-shadow {
  fill: rgba(20, 20, 20, 0.06);
}

.agreement-svg .handshake-line {
  fill: none;
  stroke: #171717;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agreement-svg .handshake-line.inner {
  stroke-width: 3;
  opacity: 0.55;
}

/* animación elegante */
.agreement-svg .figure-left {
  animation: leftApproach 2.6s ease-in-out infinite;
}

.agreement-svg .figure-right {
  animation: rightApproach 2.6s ease-in-out infinite;
}

.agreement-svg .arm-left-front {
  transform-origin: 220px 136px;
  animation: leftShakeRefined 2.6s ease-in-out infinite;
}

.agreement-svg .arm-right-front {
  transform-origin: 200px 136px;
  animation: rightShakeRefined 2.6s ease-in-out infinite;
}

.agreement-svg .handshake-core {
  animation: handshakePulse 2.6s ease-in-out infinite;
}

@keyframes leftApproach {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(0); }
  32% { transform: translateX(2px); }
  55% { transform: translateX(2px); }
  72% { transform: translateX(0); }
}

@keyframes rightApproach {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(0); }
  32% { transform: translateX(-2px); }
  55% { transform: translateX(-2px); }
  72% { transform: translateX(0); }
}

@keyframes leftShakeRefined {
  0%, 100% { transform: rotate(0deg); }
  18% { transform: rotate(0deg); }
  34% { transform: rotate(2.2deg); }
  42% { transform: rotate(-1.4deg); }
  50% { transform: rotate(2deg); }
  58% { transform: rotate(-1deg); }
  68% { transform: rotate(0deg); }
}

@keyframes rightShakeRefined {
  0%, 100% { transform: rotate(0deg); }
  18% { transform: rotate(0deg); }
  34% { transform: rotate(-2.2deg); }
  42% { transform: rotate(1.4deg); }
  50% { transform: rotate(-2deg); }
  58% { transform: rotate(1deg); }
  68% { transform: rotate(0deg); }
}

@keyframes handshakePulse {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  34% { transform: translateY(-1px) scale(1.015); opacity: 1; }
  42% { transform: translateY(1px) scale(0.995); opacity: 0.98; }
  50% { transform: translateY(-1px) scale(1.01); opacity: 1; }
  58% { transform: translateY(0.5px) scale(0.998); opacity: 0.98; }
}

/* ================================
   LOGO PNG PREMIUM (.draw2)
   ================================ */
.draw2-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  scale: .7;
  animation: logoWrapTravel 20s ease-in-out infinite;
  will-change: transform, opacity, filter;
}

.draw2 {
  width: 100%;
  display: block;
  opacity: 1;
  filter:
    grayscale(0)
    brightness(1)
    contrast(1);
  animation: logoImageTone 20s ease-in-out infinite;
  will-change: filter;
}

/* shimmer real */
.draw2-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    110deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0) 35%,
    rgba(255,255,255,0.10) 47%,
    rgba(255,255,255,0.42) 50%,
    rgba(255,255,255,0.10) 53%,
    rgba(255,255,255,0) 65%,
    rgba(255,255,255,0) 100%
  );
  mix-blend-mode: screen;
  transform: translateX(-140%);
  animation: logoShimmer 20s ease-in-out infinite;
}

@keyframes logoWrapTravel {
  0% {
    opacity: 0;
    transform: translateX(-38vw) translateY(10px);
    filter: blur(6px);
  }

  8% {
    opacity: 1;
    transform: translateX(-10vw) translateY(4px);
    filter: blur(2px);
  }

  16% {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0);
  }

  46% {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0);
  }

  50% {
    opacity: 0;
    transform: translateX(38vw) translateY(-4px);
    filter: blur(6px);
  }

  52% {
    opacity: 0;
    transform: translateX(38vw) translateY(-4px);
    filter: blur(6px);
  }

  60% {
    opacity: 1;
    transform: translateX(10vw) translateY(4px);
    filter: blur(2px);
  }

  68% {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0);
  }

  96% {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-38vw) translateY(-4px);
    filter: blur(6px);
  }
}

@keyframes logoImageTone {
  0%,
  24% {
    filter:
      grayscale(0)
      brightness(1.02)
      contrast(1.02)
      drop-shadow(0 12px 26px rgba(0,0,0,0.05));
  }

  34%,
  46% {
    filter:
      grayscale(1)
      brightness(0.82)
      contrast(1.04)
      drop-shadow(0 8px 18px rgba(0,0,0,0.04));
  }

  52%,
  76% {
    filter:
      grayscale(0)
      brightness(1.02)
      contrast(1.02)
      drop-shadow(0 12px 26px rgba(0,0,0,0.05));
  }

  86%,
  100% {
    filter:
      grayscale(1)
      brightness(0.82)
      contrast(1.04)
      drop-shadow(0 8px 18px rgba(0,0,0,0.04));
  }
}

@keyframes logoShimmer {
  0%,
  10% {
    opacity: 0;
    transform: translateX(-140%);
  }

  14% {
    opacity: 0.95;
    transform: translateX(-20%);
  }

  18% {
    opacity: 0.95;
    transform: translateX(35%);
  }

  22% {
    opacity: 0;
    transform: translateX(140%);
  }

  23%,
  62% {
    opacity: 0;
    transform: translateX(140%);
  }

  66% {
    opacity: 0.95;
    transform: translateX(20%);
  }

  70% {
    opacity: 0.95;
    transform: translateX(-35%);
  }

  74% {
    opacity: 0;
    transform: translateX(-140%);
  }

  75%,
  100% {
    opacity: 0;
    transform: translateX(-140%);
  }
}

/* RESPONSIVE */
@media (max-width: 767px) {
  .modal-shell {
    padding: 18px 14px 20px;
  }

  .about-portfolio {
    padding: 0 !important;
    grid-template-columns: 1fr;
  }

  .modal-body {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    align-items: start;
    text-align: left;
  }

  /* ocultar visuales en celular */
  #modal-visual {
    display: none !important;
    min-height: 0 !important;
  }

  .draw,
  .draw2-wrap,
  .agreement-svg {
    display: none !important;
  }

  /* texto adaptado */
  .modal-header {
    max-width: 100%;
    padding-right: 96px; /* deja espacio para botón volver */
  }

  .modal-eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    line-height: 1.5;
  }

  .modal-header h2 {
    font-size: clamp(1.55rem, 6vw, 2rem);
    line-height: 1.12;
    margin: 0.7rem 0 1rem;
  }

  .modal-text {
    padding-top: 10px;
  }

  .modal-lead {
    font-size: 1.08rem;
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  .modal-copy {
    max-width: 100%;
    font-size: 0.95rem;
    line-height: 1.75;
  }

  .modal-copy br + br {
    display: block;
    content: "";
    margin-top: 0.2rem;
  }

  /* botón volver estilo real en móvil */
  .modal-close {
    position: absolute;
    top: 30px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    min-height: 40px;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    background: #c62828;
    color: #fff !important;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(198, 40, 40, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  .modal-close:hover,
  .modal-close:active,
  .modal-close:focus {
    color: #fff !important;
    background: #b71c1c;
    transform: none;
  }

  .modal-action {
    width: 100%;
    margin-top: 2rem;
    padding: 0.95rem 1.2rem;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
  }

  .modal-header h2 {
    margin-top: 60px;
  }
}

.modal-header {
  position: relative;
}

@media (min-width: 768px) {
  #modal-visual {
    min-height: 380px;
  }

  .draw {
    max-width: 240px;
  }

  .draw2-wrap {
    max-width: 620px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .modal-shell {
    padding: 28px 22px 24px;
  }

  .modal-body {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    align-items: start;
  }

  .modal-text {
    order: 1;
    padding-top: 10px;
  }

  #modal-visual {
    order: 2;
    display: flex !important;
    min-height: auto;
    margin-top: 0.5rem;
    overflow: visible;
  }

  .modal-header {
    max-width: 100%;
  }



  .modal-header h2 {
  font-size: clamp(2.6rem, 5vw, 3.2rem);
  line-height: 1.08;
  margin: 1rem 0 1.4rem;
}

.modal-eyebrow{
  font-size: 0.8rem;
  letter-spacing: 0.28em;
}

.modal-lead {
  font-size: 1.45rem;
  line-height: 1.45;
  margin-bottom: 1.4rem;
}

.modal-copy {
  font-size: 1.12rem;
  line-height: 1.85;
  max-width: 680px;
  margin: 0 auto;
}

  /* botón volver estilo botón también en tablet vertical */
  .modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    min-width: 92px;
    min-height: 42px;
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    background: #c62828;
    color: #fff !important;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* tamaños visuales para tablet vertical */
  .draw {
    max-width: 210px;
  }

  .agreement-svg {
    max-width: 280px;
  }

  .draw2 {
    max-width: 420px;
  }
}

@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
  .modal-shell {
    padding: clamp(2rem, 3vw, 3.2rem);
  }

  .modal-body {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 2.4rem;
    align-items: center;
  }

  .modal-header {
    max-width: 760px;
  }

  .modal-header h2 {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    line-height: 1.05;
    margin: 0.8rem 0 1.2rem;
  }

  .modal-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.28em;
  }

  .modal-lead {
    font-size: 1.3rem;
    line-height: 1.45;
    margin-bottom: 1.3rem;
  }

  .modal-copy {
    font-size: 1rem;
    line-height: 1.75;
    max-width: 560px;
  }

  #modal-visual {
    min-height: 280px;
  }

  .draw2 {
    max-width: 620px;
  }

  .draw {
    max-width: 200px;
  }

  .agreement-svg {
    max-width: 260px;
  }

  .modal-action,
  .modal-close {
    font-size: 0.78rem;
    padding: 0.9rem 1.8rem;
    letter-spacing: 0.14em;
  }
}

/* accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .draw,
  .draw path,
  .draw line,
  .draw rect,
  .draw circle,
  .draw polyline,
  .draw polygon,
  .draw ellipse,
  .agreement-svg *,
  .draw2-wrap,
  .draw2,
  .draw2-shimmer {
    animation: none !important;
    transition: none !important;
  }

  .draw2-wrap {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .draw2 {
    filter: none !important;
  }

  .draw2-shimmer {
    display: none !important;
  }
}


/* =========================================
   CELULAR HORIZONTAL
   ========================================= */
/* =========================================
   CELULAR HORIZONTAL
   como tablet horizontal, pero compacto
   ========================================= */
@media screen and (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .modal-wow {
    overflow-y: auto;
  }

  .modal-shell {
    height: auto;
    min-height: 100dvh;
    padding: 14px 14px 16px;
    padding-left: 60px;
  }

  .modal-header {
    max-width: 100%;
    padding-right: 96px;
  }

  .modal-eyebrow {
    font-size: 0.56rem;
    letter-spacing: 0.16em;
    line-height: 1.25;
  }

  .modal-header h2 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    line-height: 1.02;
    margin: 0.35rem 0 0.75rem;
    margin-top: 0;
  }

  .modal-close {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 78px;
    min-height: 34px;
    padding: 0.55rem 0.8rem;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    box-shadow: 0 6px 14px rgba(198, 40, 40, 0.18);
  }

  .modal-body {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 1rem;
    align-items: center;
    text-align: left;
  }

  .modal-text {
    padding-top: 0;
    min-width: 0;
  }

  .modal-lead {
    font-size: 0.92rem;
    line-height: 1.3;
    margin-bottom: 0.65rem;
  }

  .modal-copy {
    max-width: 100%;
    font-size: 0.78rem;
    line-height: 1.42;
  }

  .modal-action {
    width: 100%;
    margin-top: 0.9rem;
    padding: 0.78rem 0.95rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  /* visual visible y contenido */
  #modal-visual {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    overflow: hidden;
  }

  /* tamaños compactos para que no se salga */
  .draw {
    max-width: 130px;
  }

  .agreement-svg {
    max-width: 180px;
  }

  .draw2-wrap {
    max-width: 240px;
    scale: 0.6;
  }

  .draw2 {
    max-width: 100%;
    height: auto;
  }
}