/* Full-card preview, with content-driven height when details expand. */
.project-infrastructure {
  margin: 18px 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.project-infrastructure h4 {
  font-size: 12px;
  letter-spacing: 0;
  margin: 0 0 10px;
  color: #dce8f5;
}
.project-infrastructure ul {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.project-infrastructure li { display: grid; gap: 2px; }
.project-infrastructure strong { color: #76b9ff; font-size: 11px; font-weight: 600; }
.project-infrastructure span { color: var(--muted); font-size: 11px; }
.project-access {
  margin: 16px 0 8px;
  border: 1px solid #294259;
  border-radius: 8px;
  background: #0b1926;
  padding: 12px;
}
.project-access summary {
  font-size: 12px;
  font-weight: 600;
  color: #c9e2ff;
  cursor: pointer;
}
.project-access-fields { display: grid; gap: 8px; margin-top: 14px; }
.project-access-fields label { color: #b7c9db; font-size: 11px; }
.project-access-fields input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #334a61;
  border-radius: 5px;
  background: #050e18;
  color: #e7f1ff;
  font: 12px/1.5 ui-monospace, Consolas, monospace;
  user-select: all;
}
.project-access-fields input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.project-access-fields small { font-size: 10px; }
@media (hover: hover) and (pointer: fine) {
  #proyectos .project {
    position: relative;
    isolation: isolate;
    --reveal-ease: cubic-bezier(.22, 1, .36, 1);
    transition: border-color 450ms ease, box-shadow 450ms ease;
  }

  #proyectos .project::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background-image: var(--project-preview);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    transition: opacity 500ms ease, transform 800ms var(--reveal-ease), filter 500ms ease;
  }

  #proyectos .featured {
    --project-preview: url('../assets/images/contigo.webp');
    aspect-ratio: auto;
    height: auto;
    grid-template-rows: auto;
  }

  #proyectos .featured::after {
    background-size: contain;
    background-position: center;
    background-color: #f4f7fb;
  }

  #proyectos .project-grid .project:first-child {
    --project-preview: url('../assets/images/chanum.webp');
  }

  #proyectos .project-grid .project:last-child {
    --project-preview: url('../assets/images/senaa.webp');
  }

  #proyectos .project:hover::after,
  #proyectos .project:focus-within::after {
    opacity: 0;
    transform: scale(1.065);
    filter: blur(5px);
  }

  #proyectos .project:is(:hover, :focus-within) {
    border-color: #35628a;
    box-shadow: 0 14px 40px #0003, 0 0 0 1px #168dff0d;
  }

  #proyectos .project .project-info {
    opacity: 0;
    transition: opacity 250ms ease;
  }

  #proyectos .project .project-info > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 250ms ease, transform 350ms var(--reveal-ease);
  }

  #proyectos .project:is(:hover, :focus-within) .project-info > * {
    opacity: 1;
    transform: translateY(0);
    transition-duration: 450ms, 650ms;
    transition-delay: 100ms;
  }

  #proyectos .project:is(:hover, :focus-within) .project-info > h3 {
    transition-delay: 140ms;
  }

  #proyectos .project:is(:hover, :focus-within) .project-info > p:not(.eyebrow) {
    transition-delay: 180ms;
  }

  #proyectos .project:is(:hover, :focus-within) .project-info > .tags {
    transition-delay: 220ms;
  }

  #proyectos .project:is(:hover, :focus-within) .project-info > .text-link {
    transition-delay: 260ms;
  }

  #proyectos .project .project-image {
    opacity: .35;
    translate: 18px 0;
    transition: opacity 500ms ease, translate 750ms var(--reveal-ease);
  }

  #proyectos .project:is(:hover, :focus-within) .project-image {
    opacity: 1;
    translate: 0 0;
  }

  /* Keyboard interaction is immediate, even during an interrupted animation. */
  #proyectos .project:focus-within .project-info > * {
    transition-delay: 0ms;
  }

  #proyectos .project:hover .project-info,
  #proyectos .project:focus-within .project-info {
    opacity: 1;
  }
}

/* Preserve the full screenshot in the revealed layout and on touch screens. */
#proyectos .featured .project-info {
  min-width: 0;
  min-height: min-content;
}

/* Keep access details available when the pointer leaves the card. */
#proyectos .featured:has(.project-access[open])::after {
  opacity: 0;
}

#proyectos .featured:has(.project-access[open]) .project-info,
#proyectos .featured:has(.project-access[open]) .project-info > *,
#proyectos .featured:has(.project-access[open]) .project-image {
  opacity: 1;
  transform: none;
  translate: none;
}

#proyectos .featured .project-image img {
  aspect-ratio: 1920 / 917;
  object-fit: contain;
  height: auto;
}

#proyectos .featured .project-image:hover img {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  #proyectos .project,
  #proyectos .project::after,
  #proyectos .project .project-image,
  #proyectos .project .project-info,
  #proyectos .project .project-info > * {
    transition: none !important;
    transform: none !important;
    translate: none !important;
    filter: none !important;
  }
}
