.project {
    background: rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1rem auto 1.25rem;
    max-width: 980px;
    box-shadow: 0 0 12px rgba(0,0,0,0.05);
    transition: transform .2s ease, box-shadow .2s ease;
}
.project:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.10); }

.project h4 {
    margin: 0 0 .35rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.project .sub { margin: 0 0 .35rem; opacity: .9; }
.project .body { margin: 0 0 .75rem; }

.tech-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem 1.1rem;
    align-items: center;
}

.tech-icons i,
.tech-icons img {
    font-size: 2rem;
    width: 32px;
    height: 32px;

    color: #111 !important;
    filter: grayscale(1) contrast(1.05);
    opacity: 0.95;

    transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease;
    transform-origin: center;
    display: inline-block;
    will-change: transform;
    cursor: default;
}

.tech-icons img { object-fit: contain; }

.tech-icons i:hover,
.tech-icons img:hover {
    transform: scale(1.22);
    opacity: 1;
}

.tech-icons i::before {
    margin: 0 2px;
}

.project a.btn-min {
    display: inline-flex; align-items: center; gap: .5rem;
    margin-top: .5rem;
    text-decoration: none; color: #333; font-size: .95rem;
    border: 1px solid rgba(0,0,0,.12); border-radius: 999px;
    padding: .4rem .75rem; background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}
.project a.btn-min:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.10); }

.proj-row {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 1rem;
    align-items: stretch;
}
@media (max-width: 980px) {
    .proj-row { grid-template-columns: 1fr; }
}

.img-frame {
    background: #0d121d0f;
    border: 2px solid rgba(0,0,0);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    min-height: 260px;
}
.proj-gallery {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    width: 100%;
}
.pg-viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0; min-height: 0;
    overflow: hidden;
    border-radius: 10px;
    height: clamp(260px, 40vh, 520px);
    background: #0d121d;
}
.pg-slide {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: translateX(6%);
    transition: opacity .28s ease, transform .28s ease;
    box-shadow: 0 0 10px rgba(63,210,255,.20);
    background: #0d121d;
}
.proj-gallery.pg--cover .pg-slide { object-fit: cover; background: transparent; }
.pg-slide.is-active { opacity: 1; transform: translateX(0); z-index: 1; }

.pg-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    border: 0; width: 36px; height: 36px; line-height: 36px;
    border-radius: 999px; background: rgba(255,255,255,.14);
    color: #fff; font-size: 22px; cursor: pointer; z-index: 2;
    transition: background .2s ease, transform .2s ease;
}
.pg-arrow-dark {
    position: absolute; top: 50%; transform: translateY(-50%);
    border: 0; width: 36px; height: 36px; line-height: 36px;
    border-radius: 999px; background: rgba(0,0,0);
    color: #fff; font-size: 22px; cursor: pointer; z-index: 2;
    transition: background .2s ease, transform .2s ease;
}
.pg-arrow:hover { background: rgba(255,255,255); transform: translateY(-50%) scale(1.05); }
.pg-prev { left: 8px; } .pg-next { right: 8px; }

.pg-dots {
    position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 2;
}
.pg-dot {
    width: 8px; height: 8px; border-radius: 999px; border: 0; cursor: pointer;
    background: rgba(255,255,255,.35);
    box-shadow: 0 0 6px rgba(0,0,0,.35), 0 0 8px rgba(63,210,255,.35);
}
.pg-dot.is-active { background: #FFFFFF; }

.pg-fullscreen {
    position: absolute; top: 8px; right: 48px;
    border: 0; width: 32px; height: 32px;
    border-radius: 8px; background: rgba(255,255,255,.16);
    color: #fff; font-size: 16px; cursor: pointer; z-index: 2;
    transition: background .2s ease;
}
.pg-fullscreen:hover { background: rgba(255,255,255,.24); }

.pg-modal {
    position: fixed; inset: 0; display: none;
}
.pg-modal.is-open { display: block; }
.pg-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.65);
}
.pg-modal__content {
    position: absolute; inset: 5% 4%;
    background: #0b0f16; border: 1px solid gray;
    border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
    display: grid; grid-template-areas: "prev viewport next" "dots dots dots";
    grid-template-columns: 56px 1fr 56px; grid-template-rows: 1fr auto;
    overflow: hidden;
}
.pg-modal__close {
    position: absolute; top: 10px; right: 10px;
    border: 0; width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,.15); color: #fff; cursor: pointer;
}
.pg-modal__viewport {
    grid-area: viewport; position: relative; overflow: hidden;
    border-radius: 10px; background: #0d121d;
}
.pg-modal__slide {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
    opacity: 0; transform: translateX(6%); transition: opacity .28s ease, transform .28s ease;
    background: #0d121d;
}
.pg-modal__slide.is-active { opacity: 1; transform: translateX(0); z-index: 1; }
.pg-modal__arrow {
    border: 0; width: 44px; height: 44px; border-radius: 999px; cursor: pointer;
    align-self: center; color: #fff; background: rgba(255,255,255,.16);
    transition: background .2s ease, transform .2s ease;
}
.pg-modal__prev { grid-area: prev; justify-self: center; }
.pg-modal__next { grid-area: next; justify-self: center; }
.pg-modal__arrow:hover { background: rgba(255,255,255,.24); transform: scale(1.05); }
.pg-modal__dots {
    grid-area: dots; display: flex; justify-content: center; gap: 10px; padding: 12px;
}
.pg-modal__dot {
    width: 9px; height: 9px; border-radius: 999px; border: 0; background: rgba(255,255,255,.35);
    cursor: pointer;
}
.pg-modal__dot.is-active { background: #FFFFFF; }

canvas#backgroundCanvas { z-index: 0; }
.page { position: relative; z-index: 1; }

.pg-modal { position: fixed; inset: 0; display: none; z-index: 9999; }
.pg-modal.is-open { display: block; }

.pg-modal__backdrop { position: absolute; inset: 0; z-index: 0; }
.pg-modal__content  { position: absolute; inset: 5% 4%; z-index: 1; }

body.is-modal-open .pg-arrow,
body.is-modal-open .pg-fullscreen { visibility: hidden; }
body.is-modal-open .page { pointer-events: none; }

/* Responsive adjustments for smaller screens */
@media (max-width: 899.98px) {
    canvas#backgroundCanvas { display: none; }
    .page { margin-left: 0; }
    html, body { overflow: auto; }
}


