/* ===== PORTFOLIO SECTION ===== */
.portfolio-section {
    background: linear-gradient(180deg, #0a0a0a 0%, #0b1220 100%);
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
}

.portfolio-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-tag {
    display: inline-block;
    padding: 6px 20px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 50px;
    color: #00D4FF;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.section-title {
    font-size: 38px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.section-title .highlight-text {
    background: linear-gradient(135deg, #00D4FF, #FF6B00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: #888;
    font-size: 16px;
    font-weight: 300;
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== FILTER BUTTONS ===== */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 45px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.02);
    color: #9aa3b2;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn .filter-count {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.06);
    color: #9aa3b2;
}

.filter-btn:hover {
    color: #fff;
    border-color: rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.05);
}

.filter-btn.active {
    color: #00D4FF;
    border-color: #00D4FF;
    background: rgba(0, 212, 255, 0.08);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.12);
}

.filter-btn.active .filter-count {
    background: rgba(0, 212, 255, 0.18);
    color: #00D4FF;
}

/* ===== PROJECT GRID ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

/* ===== PROJECT CARD ===== */
.project-card {
    --accent: #00D4FF;
    --accent2: #FF6B00;
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(255, 255, 255, 0.07);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.45s ease;
    animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.project-card.is-hidden {
    display: none;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* glow that follows the pointer */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 50px -18px var(--accent);
}

.project-card:hover::before {
    opacity: 1;
}

.project-card > * {
    position: relative;
    z-index: 1;
}

/* ===== COVER (window frame) ===== */
.project-cover {
    margin: 14px 14px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0b0f1a;
}

.cover-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cover-bar span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.cover-bar span:nth-child(1) { background: #ff5f57; }
.cover-bar span:nth-child(2) { background: #febc2e; }
.cover-bar span:nth-child(3) { background: #28c840; }

.cover-bar em {
    margin-left: 8px;
    font-style: normal;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: #6b7385;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cover-body {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.cover-body img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .cover-body img {
    transform: scale(1.06);
}

/* generated artwork for projects without a screenshot */
.cover-art {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
        radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--accent2) 55%, transparent), transparent 60%),
        #0b0f1a;
}

.cover-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 78%);
}

.cover-art::after {
    content: '';
    position: absolute;
    width: 62%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    animation: spinSlow 40s linear infinite;
}

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}

.cover-glyph {
    position: relative;
    z-index: 1;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    font-size: 36px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 18px 40px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .cover-glyph {
    transform: scale(1.1) rotate(-6deg);
}

.cover-word {
    position: absolute;
    left: 14px;
    bottom: 10px;
    z-index: 1;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    max-width: 55%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cover-fa {
    position: absolute;
    right: 14px;
    bottom: 8px;
    z-index: 1;
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    direction: rtl;
}

/* ===== CARD BODY ===== */
.project-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 22px 22px;
    flex: 1;
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.project-kind {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
}

.project-kind::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.project-year {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    color: #6b7385;
}

.project-body h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.2px;
}

.project-body p {
    color: #9aa3b2;
    font-size: 14px;
    line-height: 1.65;
    flex: 1;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-stack span {
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #c5ccd9;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
}

.project-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.project-more i {
    color: var(--accent);
    transition: transform 0.35s ease;
}

.project-card:hover .project-more i {
    transform: translateX(6px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 680px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 30px;
    }

    .section-subtitle {
        font-size: 14px;
        padding: 0 15px;
    }

    .filter-btn {
        font-size: 12px;
        padding: 7px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-card,
    .cover-art::after {
        animation: none;
    }
}
