/* Portada independiente: las apps y fotografía conservan sus materiales y sus
   ajustes medidos. Aquí el texto tiene color propio, sin depender de la aurora. */
.portada {
  --bg: light-dark(#edf1f8, #090e1b);
  --fg: light-dark(#162139, #f2f5fd);
  --muted: light-dark(#43516a, #bcc8dd);
  --accent: light-dark(#3046a0, #a9dfff);
  --accent-hover: light-dark(#182d84, #d1efff);
  --line: light-dark(#c5cddd, #303c51);
  --cristal: light-dark(rgb(255 255 255 / 62%), rgb(23 34 55 / 62%));
  --canto: light-dark(rgb(255 255 255 / 90%), rgb(210 234 255 / 28%));
  background: var(--bg);
  isolation: isolate;
}
/* Dos superficies estáticas: el compositor mueve la luz, sin recalcular ruido ni filtros. */
.aurora-portada { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora-portada::before, .aurora-portada::after {
  background: radial-gradient(ellipse 44% 18% at 67% 52%, light-dark(#b398d43d, #ad65d525), transparent 80%);
  animation-duration: 13s; animation-direction: alternate-reverse;
}
/* Cada cinta tiene su propio recorrido. Al cruzarse se suman las transparencias,
   sin blend modes, filtros animados ni un lienzo que repintar en cada cuadro. */
.aurora-rayo {
  --tinta: light-dark(#58bca641, #48e7be32);
  position: absolute; left: 62%; top: -38vmax; width: 13vmax; height: 125vmax;
  background: radial-gradient(ellipse 48% 47% at 50% 50%, var(--tinta), transparent 88%);
  transform-origin: 50% 65%; transform: rotate(45deg);
  animation: trenza-aurora 9s ease-in-out -3s infinite alternate;
}
.aurora-rayo:nth-child(2) { left: 76%; width: 8vmax; animation-duration: 11s; animation-delay: -7s; animation-direction: alternate-reverse; --tinta: light-dark(#78c5c540,#7eeedb30); }
.aurora-rayo:nth-child(3) { left: 52%; top: -20vmax; width: 18vmax; animation-duration: 14s; animation-delay: -10s; --tinta: light-dark(#bb93ce35,#b577da29); }
.aurora-rayo:nth-child(4) { left: 87%; top: -46vmax; width: 10vmax; animation-duration: 8s; animation-delay: -5s; animation-direction: alternate-reverse; }
.aurora-rayo:nth-child(5) { left: 34%; top: -10vmax; width: 11vmax; animation-duration: 12s; animation-delay: -9s; --tinta: light-dark(#6cb9c433,#52bcd329); }
.aurora-rayo:nth-child(6) { left: 68%; top: -30vmax; width: 7vmax; animation-duration: 10s; animation-delay: -2s; animation-direction: alternate-reverse; --tinta: light-dark(#8cc6a435,#a4eac829); }
@keyframes luz-ambiente {
  from { transform: translate(4%, -3%) rotate(-3deg) scale(1.02); }
  to { transform: translate(-9%, 7%) rotate(4deg) scale(1.09); }
}
@keyframes trenza-aurora {
  0% { transform: translate(-6vw, 4vh) rotate(33deg) scaleX(.8); }
  50% { transform: translate(2vw, -3vh) rotate(47deg) scaleX(1.15); }
  100% { transform: translate(8vw, 1vh) rotate(57deg) scaleX(.9); }
}
.portada .envoltorio { width: min(1120px, calc(100% - 64px)); }
.portada h1, .portada h2, .portada h3 {
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: var(--fg); background: none; -webkit-text-fill-color: currentColor;
  mix-blend-mode: normal; letter-spacing: -.045em;
}
.portada h2 { font-size: clamp(2rem, 3.4vw, 2.8rem); max-width: 23ch; }
.portada h3 { font-size: 1.35rem; letter-spacing: -.025em; line-height: 1.25; }
.portada section { padding: 88px 0; border: 0; scroll-margin-top: 96px; }
.portada .seccion-bajada { margin-top: 20px; max-width: 64ch; }
.portada .antetitulo { display: block; font-size: .69rem; font-weight: 600; letter-spacing: .17em; color: var(--accent); }
.portada .hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 72px; padding: 92px 0 100px; }
.portada .hero h1 { font-size: clamp(3.5rem, 6.2vw, 5.35rem); line-height: 1.02; margin: 24px 0 26px; }
.portada .hero h1 span { color: light-dark(#4156a2, #b9d6f9); }
.portada .hero-texto p { font-size: 1.03rem; line-height: 1.7; max-width: 53ch; }
.portada .hero-texto > p + p { font-size: .98rem; }
.portada .hero-acciones { gap: 18px; margin-top: 30px; align-items: center; }
.portada .boton {
  border-radius: 100px; min-height: 52px; padding: 0 25px;
  background: linear-gradient(115deg, #c2c9ff, #9ce5e8); color: #101b35;
  border: 1px solid rgb(255 255 255 / 65%); font-size: .91rem;
  box-shadow: 0 6px 30px -12px #76b9eb80; backdrop-filter: none;
  -webkit-backdrop-filter: none; transition: box-shadow .2s, background .2s;
}
.portada .boton:hover { box-shadow: 0 6px 28px -6px #76b9eb90; }
.portada .boton-suave { color: var(--fg); background: transparent; border-color: var(--line); box-shadow: none; }
.portada .boton-suave:hover { background: var(--cristal); }
.portada .boton::after { display: none; }
.portada .hero-texto .hero-prueba { font-size: .74rem; gap: 8px; max-width: 44ch; margin-top: 26px; }
.portada .hero-prueba .estrellas { display: block; width: 100%; color: light-dark(#89600f, #e5c48b); font-size: .8rem; }
/* El contenedor compartido tiene line-height: 0 para la foto; la firma necesita texto normal. */
.portada .marco-caja { line-height: 1.5; display: block; position: relative; padding: 0 8px 38px 0; }
.portada .marco-retrato {
  display: block; padding: 5px; border: 1px solid var(--canto);
  border-radius: 130px 130px 24px 24px; background: rgb(255 255 255 / 6%);
  box-shadow: 0 30px 70px -40px #0008; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.portada .hero-retrato { display: block; width: 100%; height: 440px; border-radius: 125px 125px 20px 20px; object-position: center; box-shadow: none; }
.portada .retrato-firma {
  position: absolute; left: -26px; right: 36px; bottom: 0; padding: 20px 26px;
  border-radius: 4px 24px 24px 24px; background: var(--cristal); border: 1px solid var(--canto);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); font-weight: 600; font-size: 1rem;
  box-shadow: 0 14px 35px -25px #0008;
}
.portada .retrato-firma small { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; margin-top: 4px; }
.portada .retrato-oficio {
  position: absolute; right: -24px; top: 22px; display: flex; gap: 10px; align-items: center;
  background: var(--cristal); border: 1px solid var(--canto); padding: 14px 18px;
  border-radius: 24px 24px 4px 24px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.portada .retrato-oficio strong { font-size: 2.5rem; font-weight: 500; line-height: 1; letter-spacing: -.06em; }
.portada .retrato-oficio span { font-size: .67rem; line-height: 1.3; color: var(--muted); }
/* Mayor especificidad que la navegación compartida, que se inserta al final. */
:is(.portada, .foto-editorial) .nav-sitio {
  width: min(1160px, calc(100% - 40px)); margin: 20px auto 0; top: 12px;
  border: 1px solid var(--canto); border-radius: 100px; background: var(--cristal);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
:is(.portada, .foto-editorial) .nav-sitio .nav-caja { max-width: none; padding: 10px 22px; }
:is(.portada, .foto-editorial) .nav-sitio a, :is(.portada, .foto-editorial) .nav-sitio .nav-luna, :is(.portada, .foto-editorial) .nav-sitio .nav-abrir { color: var(--fg); }
:is(.portada, .foto-editorial) .nav-sitio .nav-marca { font: 600 .88rem "Instrument Sans", sans-serif; }
:is(.portada, .foto-editorial) .nav-sitio .nav-contacto, :is(.portada, .foto-editorial) .nav-sitio .nav-idioma, :is(.portada, .foto-editorial) .nav-sitio .nav-luna { border-color: var(--line); border-radius: 100px; }
:is(.portada, .foto-editorial) .nav-sitio .nav-x { background: light-dark(#554bb1, #ffed8a); }
:is(.portada, .foto-editorial) .nav-sitio .nav-enlaces a { font-size: .81rem; }
:is(.portada, .foto-editorial) .nav-sitio a:focus-visible, :is(.portada, .foto-editorial) .nav-sitio .nav-luna:focus-visible { outline-color: var(--accent); }
.portada .tarjeta {
  background: var(--cristal); border: 1px solid var(--canto); border-radius: 24px;
  box-shadow: 0 18px 40px -32px #0008; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 32px;
}
.portada .tarjeta:hover, .portada .tarjeta:focus-within { box-shadow: 0 18px 40px -32px #0008; border-color: var(--accent); }
.portada .tarjeta::after { display: none; }
.portada .historia-servicio { color: var(--muted); max-width: 64ch; margin: 22px 0 38px; }
.portada .historia-servicio summary { cursor: pointer; color: var(--fg); text-underline-offset: 4px; }
.portada .historia-servicio summary:hover { text-decoration: underline; }
.portada .historia-servicio p { margin-top: 18px; }
.portada .servicios-portada .grilla-3 { grid-template-columns: 1.05fr 1fr; gap: 0 56px; }
.portada .servicio { padding: 30px 0; }
.portada .servicio:first-child {
  grid-row: span 2; border-radius: 40px 8px 40px 8px; padding: 36px;
  background: linear-gradient(155deg, light-dark(#fff9,#7292c51f), transparent), var(--cristal);
}
.portada .servicio:not(:first-child) { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.portada .servicio-marca { width: auto; height: auto; background: none; font-size: .65rem; letter-spacing: .13em; color: var(--accent); margin-bottom: 20px; }
.portada .servicio p { font-size: .94rem; margin-top: 14px; }
.portada .dispositivos { width: 100%; max-height: 160px; margin: 12px 0 28px; stroke: var(--accent); stroke-width: 1.3; }
.portada .dispositivos rect { fill: light-dark(#c8d9f145, #8abbe112); }
.portada .respaldo-portada { padding: 30px 0 60px; }
.portada .respaldo-portada .envoltorio { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; border-top: 1px solid var(--line); padding-top: 44px; }
.portada .respaldo-portada h2 { font-size: 1.8rem; }
.portada .respaldo-portada .seccion-bajada { margin: 0; font-size: .95rem; }
.portada .trabajos-portada .grilla-2 { grid-template-columns: 1.12fr 1fr; gap: 24px; margin-top: 40px; align-items: start; }
.portada .entrega { position: relative; padding: 34px; }
.portada .entrega:nth-child(2) { margin-top: 58px; border-radius: 8px 32px 32px 32px; }
.portada .entrega:nth-child(3) { border-radius: 32px 32px 32px 8px; }
.portada .entrega:nth-child(4) { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.portada .proyecto-icono { display: block; width: 60px; height: 60px; border-radius: 13px; margin-bottom: 30px; }
.portada .entrega-cuando { position: absolute; right: 30px; top: 40px; font: 500 .68rem "Instrument Sans", sans-serif; color: var(--muted); border: 1px solid var(--line); border-radius: 100px; padding: 7px 12px; }
.portada .entrega h3 { font-size: 1.75rem; max-width: 21ch; }
.portada .entrega p { font-size: .94rem; margin: 18px 0 0; color: var(--muted); }
.portada .pasos { gap: 32px; }
.portada .pasos li { background: none; padding: 24px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.portada .pasos li::before { background: none; color: var(--accent); justify-content: start; font: 400 2.4rem "Instrument Sans",sans-serif; width: auto; height: auto; margin-bottom: 24px; content: "0" counter(paso); }
.portada .pasos li::after { display: none; }
.portada .pasos strong { font-size: 1.12rem; letter-spacing: -.025em; }
.portada .clientes { gap: 18px 28px; margin-top: 36px; }
.portada .opinion { background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.portada .opinion:hover { border-color: var(--line); box-shadow: none; }
.portada .opinion blockquote { font: 400 1.35rem/1.45 "Crimson Pro", Georgia, serif; }
.portada .contacto { background: light-dark(#dce5f2, #101b2ce6); color: var(--fg); border-top: 1px solid var(--line); }
.portada .contacto h2, .portada .contacto h3 { color: var(--fg); }
.portada .contacto-ayuda, .portada .contacto .seccion-bajada { color: var(--muted); }
.portada .campo > span { color: var(--muted); }
.portada .campo input, .portada .campo textarea { background: var(--cristal); border-color: var(--line); color: var(--fg); border-radius: 12px; }
.portada .campo input:focus, .portada .campo textarea:focus { outline-color: var(--accent); }
.portada .campo input::placeholder, .portada .campo textarea::placeholder { color: var(--muted); }
.portada .contacto .boton { background: linear-gradient(115deg, #c2c9ff, #9ce5e8); color: #101b35; }
.portada .pie { background: var(--bg); border-top: 1px solid var(--line); color: var(--muted); }
@media (max-width: 900px) {
  .portada .hero { gap: 40px; }
  .portada .hero-retrato { height: 360px; }
  .portada .hero h1 { font-size: 3.7rem; }
  .portada .servicios-portada .grilla-3 { gap: 0 30px; }
}
@media (max-width: 760px) {
  :is(.portada, .foto-editorial) .nav-sitio { width: calc(100% - 24px); margin-top: 12px; top: 8px; }
  :is(.portada, .foto-editorial) .nav-sitio .nav-caja { padding: 10px 16px; }
  :is(.portada, .foto-editorial) .nav-sitio .nav-enlaces { background: light-dark(#f1f5fc,#111c30); border: 1px solid var(--canto); border-radius: 20px; top: calc(100% + 8px); }
  :is(.portada, .foto-editorial) .nav-sitio .nav-enlaces a { font-size: 1rem; }
  :is(.portada, .foto-editorial) .nav-sitio .nav-abrir { min-width: 44px; min-height: 36px; }
  .portada .envoltorio { width: calc(100% - 40px); }
  .portada section { padding: 58px 0; }
  .portada .hero { grid-template-columns: 1fr; padding: 52px 0 64px; gap: 46px; }
  .portada .hero h1 { font-size: clamp(3.3rem, 10.5vw, 4.6rem); }
  .portada .hero-texto p { font-size: 1rem; }
  .portada .hero-acciones { gap: 10px; }
  .portada .hero-acciones .boton { flex: 1 1 auto; padding: 0 17px; font-size: .84rem; }
  .portada .marco-caja { width: min(320px, calc(100% - 24px)); justify-self: center; }
  .portada .hero-retrato { height: 370px; }
  .portada .retrato-oficio { right: -12px; }
  .portada .retrato-firma { left: -12px; right: 20px; }
  .portada .servicios-portada .grilla-3, .portada .trabajos-portada .grilla-2, .portada .respaldo-portada .envoltorio { grid-template-columns: 1fr; gap: 24px; }
  .portada .servicio:first-child { padding: 28px; }
  .portada .servicio:not(:first-child) { padding: 26px 8px 8px; }
  .portada .entrega { padding: 28px; }
  .portada .entrega:nth-child(2) { margin-top: 0; }
  .portada .entrega-cuando { top: 35px; right: 24px; }
  .portada .respaldo-portada { padding-top: 18px; }
  .portada .pasos { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .aurora-portada::before, .aurora-portada::after, .aurora-rayo { animation: none; } }

/* Reflejo fino sobre el material: no cambia el área clicable ni tapa el texto. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :is(.portada, .foto-editorial) .profundidad-portada { perspective: 1000px; }
  :is(.portada, .foto-editorial) .tiene-reflejo {
    position: relative;
    transition: transform 240ms ease-out, border-color 240ms, box-shadow 300ms;
  }
  :is(.portada, .foto-editorial) .tiene-reflejo::after {
    content: ""; display: block; position: absolute; inset: 0; z-index: 1;
    border-radius: inherit; pointer-events: none;
    background: radial-gradient(240px circle at var(--luz-x,50%) var(--luz-y,50%), light-dark(#ffffff75, #b9e9ff1f), transparent 75%);
    opacity: 0; transition: opacity 320ms;
  }
  :is(.portada, .foto-editorial) .tiene-reflejo.reflejo-activo::after { opacity: 1; }
  .portada .marco-retrato.reflejo-activo, .portada .tarjeta.reflejo-activo {
    border-color: light-dark(#ffffff, #a9dfff70);
    box-shadow: 0 20px 40px -30px #0008, 0 0 26px -12px light-dark(#5b75c55c, #8bcfff38);
  }
  .portada .marco-retrato::after {
    background: radial-gradient(300px circle at var(--luz-x,50%) var(--luz-y,50%), #d3f3ff22, transparent 75%);
  }
}

/* Un enlace nativo extiende su área al artículo, sin scripts de navegación. */
.portada .enlace-proyecto { color: inherit; text-decoration: none; }
.portada .enlace-proyecto::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.portada .enlace-proyecto::after { content: " ↗"; color: var(--accent); font-size: .8em; white-space: nowrap; }
.portada .enlace-proyecto:focus-visible { outline: none; }
.portada .entrega:has(.enlace-proyecto:focus-visible) { outline: 2px solid var(--accent); outline-offset: 5px; }

.portada .historia-avance { display: block; margin-top: 8px; color: var(--muted); font-size: .93rem; }
.portada .historia-servicio[open] .historia-avance { display: none; }
/* Un único reflejo recortado al canto. Reutiliza la posición del mouse existente,
   sin animación adicional ni una superficie de desenfoque. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  @supports (mask-composite: exclude) {
    .portada .tarjeta.tiene-reflejo::before, .portada .marco-retrato.tiene-reflejo::before {
      content: ""; position: absolute; inset: -1px; padding: 1.5px;
      border-radius: inherit; pointer-events: none; z-index: 2;
      background: radial-gradient(170px circle at var(--luz-x,50%) var(--luz-y,50%), #fff 0%, #b8eaffbb 35%, transparent 80%);
      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      mask-composite: exclude;
      opacity: 0; transition: opacity 300ms;
    }
    .portada .tarjeta.reflejo-activo::before, .portada .marco-retrato.reflejo-activo::before { opacity: 1; }
  }
}
