   * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: "Segoe UI", Arial, sans-serif;
      background: #0f1115;
      color: #f5f7fa;
      padding: 40px 20px;
    }

    .contenedor {
      max-width: 1200px;
      margin: auto;
    }

    .titulo {
      background: url(images/fondo-inicio.jpg)	no-repeat;
      text-align: center;
      margin-bottom: 40px;
    }

    .titulo h1 {
      font-size: 2.3rem;
      margin-bottom: 10px;
    }

    .titulo p {
      color: #aeb6c2;
      max-width: 700px;
      margin: auto;
      line-height: 1.6;
    }

    .galeria {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 28px;
    }

    .proyecto {
      position: relative;
      overflow: hidden;
      border-radius: 18px;
      background: #1a1d24;
      box-shadow: 0 10px 30px rgba(0,0,0,0.25);
      cursor: pointer;
      transition: transform 0.35s ease, box-shadow 0.35s ease;
    }

    .proyecto:hover {
      transform: translateY(-8px);
      box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    }

    .proyecto img {
      width: 100%;
      height: 320px;
      object-fit: cover;
      display: block;
      transition: transform 0.5s ease, filter 0.5s ease;
    }

    .proyecto:hover img {
      transform: scale(1.05);
      filter: brightness(0.5);
    }

    .info {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 24px;
      background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0.35), rgba(0,0,0,0.05));
      opacity: 0;
      transition: opacity 0.35s ease;
    }

    .proyecto:hover .info {
      opacity: 1;
    }

    .categoria {
      display: inline-block;
      width: fit-content;
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.12);
      border: 1px solid rgba(255,255,255,0.18);
      margin-bottom: 12px;
    }

    .info h3 {
      font-size: 1.3rem;
      margin-bottom: 8px;
    }

    .info p {
      color: #d8dee8;
      line-height: 1.5;
    }

    dialog {
      border: none;
      padding: 0;
      background: transparent;
      max-width: 100%;
      max-height: 100%;
    }

    dialog::backdrop {
      background: rgba(0,0,0,0.82);
      backdrop-filter: blur(5px);
    }

    .lightbox {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: min(92vw, 1200px);
      min-height: 82vh;
      padding: 24px 70px;
    }

    .lightbox-imagen {
      max-width: 88vw;
      max-height: 78vh;
        
        
      object-fit: contain;
      border-radius: 18px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.45);
      opacity: 0;
      transform: scale(0.94);
      transition: opacity 0.35s ease, transform 0.35s ease;
    }

    .lightbox-imagen.activa {
      opacity: 1;
      transform: scale(1);
    }

    .lightbox-info {
      position: absolute;
      left: 24px;
      right: 24px;
      bottom: 18px;
      text-align: center;
      color: #d8dde7;
    }

    .lightbox-info h3 {
      margin-bottom: 6px;
      font-size: 1.1rem;
      color: white;
    }

    .lightbox-info p {
      font-size: 0.95rem;
    }

    .control,
    .cerrar {
      position: absolute;
      border: none;
      border-radius: 50%;
      background: rgba(255,255,255,0.12);
      color: white;
      cursor: pointer;
      backdrop-filter: blur(6px);
      transition: background 0.25s ease, transform 0.25s ease;
    }

    .control {
      top: 50%;
      transform: translateY(-50%);
      width: 48px;
      height: 48px;
      font-size: 24px;
    }

    .control:hover,
    .cerrar:hover {
      background: rgba(255,255,255,0.22);
    }

    .anterior {
      left: 10px;
    }

    .siguiente {
      right: 10px;
    }

    .cerrar {
      top: 12px;
      right: 12px;
      width: 46px;
      height: 46px;
      font-size: 24px;
    }

    @media (max-width: 768px) {
      .proyecto img {
        height: 260px;
        filter: brightness(0.55);
      }

      .info {
        opacity: 1;
      }

      .lightbox {
        padding: 20px 50px;
      }

      .lightbox-imagen {
        max-width: 90vw;
        max-height: 68vh;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .proyecto,
      .proyecto img,
      .info,
      .lightbox-imagen,
      .control,
      .cerrar {
        transition: none;
      }

      .proyecto:hover,
      .proyecto:hover img,
      .control:hover,
      .cerrar:hover {
        transform: none;
      }

      .lightbox-imagen,
      .lightbox-imagen.activa {
        opacity: 1;
        transform: none;
      }
    }
