/* ==========================================================================
   Portofoliu 3D — rând de carduri înclinate, cu drag, inerție și val la viteză
   ========================================================================== */

#portofoliu {
    --miw-card-w: clamp(230px, min(36vw, 47vh), 580px);
    --miw-card-h: calc(var(--miw-card-w) * 0.6155);
    --miw-skew: 29.5deg;
    --miw-radius: 18px;

    position: relative;
    height: 100svh;
    min-height: 620px;
    max-height: 980px;
    overflow: hidden;
    background-color: #08090c;
    background-image: linear-gradient(180deg, #08090c 0%, #0a0910 13%, #0c0a15 35%, #0b0914 70%, #09090f 88%, #08090c 100%);
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* 04.10.2026 — in the site's violet (it was deep green): a quiet light behind the projects, kept low so the section
   stays dark. Our green is left only for the „Live” sign of the live viewer (portfolio-live.css). */
#portofoliu::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(65% 48% at 50% 65%, rgba(130, 84, 255, .085), transparent 72%),
        radial-gradient(42% 60% at 12% 50%, rgba(112, 69, 255, .03), transparent 75%);
    pointer-events: none;
}

/* Decorative PCB layer: quiet detail, behind the cards and all interaction. */
#portofoliu::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("assets/portfolio-circuits-violet.svg") center / cover no-repeat;
    opacity: .07;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%, #000 79%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 16%, #000 79%, transparent);
}

@media (max-width: 767px) {
    #portofoliu::after { background-size: auto 100%; background-position: 12% center; opacity: .06; }
}

/* ---------- titlu ---------- */

.miw-head {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    text-align: center;
    padding: clamp(5.5rem, 11vh, 8rem) 1.25rem 0;
    pointer-events: none;
}

.miw-eyebrow {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #b6a0ff;
    margin: 0 0 .75rem;
}

.miw-title {
    font-size: clamp(2rem, 5.5vw, 4.5rem);
    line-height: .95;
    font-weight: 800;
    letter-spacing: -.035em;
    color: #f5f5f7;
    margin: 0;
}

.miw-sub {
    margin: .9rem 0 0;
    font-size: clamp(.875rem, 1.5vw, 1.0625rem);
    color: #9195a1;
    font-weight: 500;
}

/* ---------- scena ---------- */

.miw-stage {
    position: relative;
    z-index: 10;
    flex: 1 1 auto;
    perspective: 2200px;
    perspective-origin: 50% 50%;
    cursor: grab;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.miw-stage.is-dragging {
    cursor: grabbing;
}

.miw-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--miw-card-w);
    margin-left: calc(var(--miw-card-w) / -2);
    margin-top: calc(var(--miw-card-h) / -2);
    display: block;
    text-decoration: none;
    will-change: transform, opacity;
    transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* fereastră de browser */
.miw-win {
    width: 100%;
    height: var(--miw-card-h);
    border-radius: var(--miw-radius);
    overflow: hidden;
    background: #121117;
    border: 1px solid rgba(205, 191, 255, .14);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, .2),
        0 22px 48px -18px rgba(0, 0, 0, .7);
    display: flex;
    flex-direction: column;
}

.miw-bar {
    flex: 0 0 auto;
    height: clamp(18px, calc(var(--miw-card-h) * 0.115), 34px);
    display: flex;
    align-items: center;
    gap: .45em;
    padding: 0 .8em;
    background: #18161f;
    border-bottom: 1px solid rgba(205, 191, 255, .08);
    font-size: clamp(6px, calc(var(--miw-card-w) * 0.018), 11px);
}

.miw-dot {
    width: 1em;
    height: 1em;
    border-radius: 50%;
    background: #4a4658;
    flex: 0 0 auto;
}

.miw-dot:nth-child(1) { background: #ff605c; }
.miw-dot:nth-child(2) { background: #ffbd44; }
.miw-dot:nth-child(3) { background: #00ca4e; }

.miw-url {
    margin-left: .4em;
    flex: 1 1 auto;
    height: 1.9em;
    border-radius: 999px;
    background: #0e0d13;
    border: 1px solid rgba(205, 191, 255, .09);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a7a5b5;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
}

/* 04.10.2026 — our green, the one green thing in the portfolio: a small „live” light in each card's address bar,
   because these are real sites, live. A click opens the site in a new tab (the in-page viewer was removed). */
.miw-url::before {
    content: "";
    flex: none;
    width: .6em;
    height: .6em;
    margin-right: .55em;
    border-radius: 50%;
    background: #7fdaaa;
    box-shadow: 0 0 .7em #7fdaaa99;
}
/* Press and hold on a phone previews the card (portfolio3d.js), so no link callout or text selection on the cards. */
.miw-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* Kept from the removed viewer's stylesheet: it smooths the carousel's per-frame card opacity. */
#portofoliu .miw-card { transition: opacity .55s ease; }


.miw-shot {
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
    background: #121117;
}

.miw-shot img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* eticheta rămâne în pagină pentru SEO și pentru varianta fără JS,
   dar în mod normal textul apare sub rând, la hover */
.miw-meta {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- eticheta de sub rând ---------- */

/* înălțimea etichetei e FIXĂ și conținutul stă scos din flux — altfel
   apariția numelui de proiect ar mări blocul, ar micșora scena și tot
   rândul de carduri ar sări în sus într-un singur cadru */
.miw-caption {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    height: clamp(5rem, 10vh, 6.5rem);
    pointer-events: none;
}

.miw-cap-in {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(1.25rem, 4vh, 2.5rem);
    padding: 0 1.25rem;
    text-align: center;
}

.miw-caption strong {
    display: block;
    min-height: 1.2em;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 700;
    color: #f5f5f7;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .3s ease, transform .3s ease;
}

.miw-caption.is-on strong {
    opacity: 1;
    transform: none;
}

.miw-caption span {
    display: block;
    margin-top: .4rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #8d909c;
    transition: color .3s ease;
}

.miw-caption.is-on span {
    color: #b6a0ff;
}

/* ---------- fallback fără JS ---------- */

#portofoliu.no-js {
    height: auto;
    max-height: none;
    display: block;
}

#portofoliu.no-js .miw-stage {
    position: relative;
    inset: auto;
    perspective: none;
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 3rem 1.5rem;
}

#portofoliu.no-js .miw-card {
    position: relative;
    left: auto;
    top: auto;
    margin: 0;
    flex: 0 0 auto;
    transform: none !important;
    opacity: 1 !important;
}

#portofoliu.no-js .miw-meta {
    position: static;
    width: auto;
    height: auto;
    margin: .85rem 0 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    color: #f5f5f7;
}

#portofoliu.no-js .miw-meta span {
    display: block;
    margin-top: .15rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #b6a0ff;
}

#portofoliu.no-js .miw-caption {
    display: none;
}



/* ---------- hover: fereastra „derulează" încet conținutul ---------- */

.miw-shot img {
    transform: translateY(0);
    transition: transform 1.2s ease-out;
}

.miw-card.is-hover .miw-shot img {
    transform: translateY(var(--miw-scroll-y, 0));
    transition: transform var(--miw-scroll-t, 5s) ease-in-out;
}

.miw-win {
    transition: box-shadow .35s ease, border-color .35s ease;
}

.miw-card.is-hover .miw-win {
    border-color: rgba(182, 160, 255, .5);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, .2),
        0 30px 60px -20px rgba(0, 0, 0, .8),
        0 0 40px -15px rgba(130, 84, 255, .25);
}

.miw-card.is-hover .miw-url {
    color: #d9d0ff;
    border-color: rgba(182, 160, 255, .3);
}

.miw-card:focus-visible .miw-win {
    outline: 2px solid #b6a0ff;
    outline-offset: 4px;
}



/* ---------- mobil ---------- */

@media (max-width: 767px) {
    #portofoliu {
        --miw-card-w: min(82vw, 46vh);
        min-height: 560px;
    }

    .miw-head {
        padding-top: clamp(5.5rem, 9vh, 7rem);
    }
}
