﻿:root {
    --bg: #0b0b12; /* کمی روشن‌تر از قبل */
    --bg-panel: #141422; /* پنل‌ها روشن‌تر */
    --bg-panel-2: #19192a; /* گالری پایین روشن‌تر */
    --purple: #9366ff;
    --purple-deep: #7c3aed;
    --purple-dim: rgba(147,102,255,0.16);
    --purple-line: rgba(147,102,255,0.32);
    --text: #f5f4fa;
    --text-dim: #a3a1b0;
    --text-faint: #6a6876;
    --line: rgba(255,255,255,0.10);
    --mono: 'JetBrains Mono', monospace;
    --display: 'Bebas Neue', sans-serif;
    --body: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---------- ambient glow ---------- */
.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(600px 400px at 15% -5%, rgba(147,102,255,0.22), transparent 60%), radial-gradient(500px 350px at 85% 10%, rgba(124,58,237,0.18), transparent 60%);
    animation: ambientDrift 22s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
    0% {
        background-position: 0% 0%, 0% 0%;
    }

    100% {
        background-position: 4% 3%, -3% -4%;
    }
}

.wrap {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ---------- header ---------- */
header.page-head {
    padding: 100px 0 70px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--purple);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

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

h1.page-title {
    font-family: var(--display);
    font-size: clamp(52px, 9vw, 104px);
    letter-spacing: 0.01em;
    line-height: 0.95;
    text-transform: uppercase;
}

    h1.page-title span {
        color: var(--purple);
    }

.page-sub {
    max-width: 560px;
    margin-top: 22px;
    color: var(--text-dim);
    font-size: 16px;
    font-weight: 300;
}

/* ---------- project section ---------- */
.project {
    padding: 90px 0;
    border-bottom: 1px dashed var(--line);
    /* هیچ تاریک‌کننده‌ای */
    filter: none !important;
}

    .project:last-of-type {
        border-bottom: none;
    }

    .project.is-active {
        filter: none !important;
    }

/* repo header bar */
.repo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 20px;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 34px;
}

.repo-name {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

    .repo-name .owner {
        color: var(--text-faint);
    }

.repo-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-faint);
}

    .repo-meta .lang {
        display: flex;
        align-items: center;
        gap: 6px;
    }

.lang-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

/* ---------- titles ---------- */
h2.project-title {
    font-family: var(--display);
    font-size: clamp(36px, 5.5vw, 56px);
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin-bottom: 8px;
}

.project-tagline {
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 300;
    max-width: 620px;
    margin-bottom: 36px;
}

/* ---------- hero screenshot ---------- */
.hero-shot {
    position: relative;
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    overflow: hidden;
    margin-bottom: 44px;
    background: linear-gradient(135deg, #1b1728, #12121c 60%);
}

.hero-shot-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

    .hero-shot-inner img {
        display: block;
        width: 100%;
        height: auto;
        min-height: 108%;
        object-fit: cover;
        will-change: transform;
        transition: transform 0.45s ease;
    }

/* بزرگ شدن نرم روی Hover */
.hero-shot:hover .hero-shot-inner img {
    transform: scale(1.06);
}

/* حذف تیرگی جدی روی عکس‌ها */
.hero-shot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(5,5,8,0.04), transparent 40%) !important;
    pointer-events: none;
    z-index: 1;
}

.hero-shot:empty {
    display: none;
}

.shot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-faint);
    font-family: var(--mono);
    font-size: 13px;
    text-align: center;
    padding: 60px 20px;
}

/* ---------- two column layout ---------- */
.project-body {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 56px;
}

@media (max-width: 860px) {
    .project-body {
        grid-template-columns: 1fr;
    }
}

/* ---------- readme ---------- */
.readme h3 {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--purple);
    margin: 28px 0 12px;
}

    .readme h3:first-child {
        margin-top: 0;
    }

.readme p {
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 300;
    margin-bottom: 6px;
}

.readme ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .readme ul li {
        color: var(--text-dim);
        font-size: 15px;
        font-weight: 300;
        padding-left: 20px;
        position: relative;
    }

        .readme ul li::before {
            content: '▸';
            position: absolute;
            left: 0;
            top: 0;
            color: var(--purple);
            font-size: 13px;
        }

/* ---------- sidebar ---------- */
.sidebar {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 26px;
    align-self: start;
    position: sticky;
    top: 24px;
}

    .sidebar h4 {
        font-family: var(--mono);
        font-size: 12px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-faint);
        margin-bottom: 14px;
    }

        .sidebar h4:not(:first-child) {
            margin-top: 26px;
        }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text);
    background: var(--purple-dim);
    border: 1px solid var(--purple-line);
    padding: 6px 11px;
    border-radius: 6px;
}

/* ---------- GitHub button ---------- */
.gh-btn {
    margin-top: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 18px;
    background: var(--purple);
    color: #0a0710;
    font-family: var(--body);
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

    .gh-btn:hover {
        background: #a97fff;
        transform: translateY(-2px);
    }

/* ---------- gallery ---------- */
.gallery-label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 48px 0 16px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.gallery-item {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: #202034; /* پایین روشن‌تر و خواناتر */
    cursor: zoom-in;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

    .gallery-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 0 18px rgba(147,102,255,0.35);
    }

    .gallery-item img {
        width: 100%;
        height: auto;
        display: block;
        transition: transform 0.5s ease;
    }

    .gallery-item:hover img {
        transform: scale(1.05);
    }

/* ---------- lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(5,5,8,0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

    .lightbox.active {
        display: flex;
    }

    .lightbox img {
        max-width: 100%;
        max-height: 100%;
        border-radius: 8px;
    }

.lightbox-close {
    position: absolute;
    top: 28px;
    right: 36px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    cursor: pointer;
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: 6px;
}

/* ---------- footer ---------- */
.end-note {
    padding: 70px 0 100px;
    text-align: center;
    color: var(--text-faint);
    font-family: var(--mono);
    font-size: 12.5px;
}

/* ============================================================
   CINEMATIC LAYER — grain, progress rail, reel, slate, spotlight
   ============================================================ */

/* Grain عملاً خاموش، بدون نویز */
.grain {
    position: fixed;
    inset: -10%;
    z-index: 40;
    pointer-events: none;
    opacity: 0 !important;
    mix-blend-mode: normal !important;
    animation: none !important;
}

@keyframes grainShift {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-1%, 1%);
    }

    50% {
        transform: translate(1%, -1%);
    }

    75% {
        transform: translate(-1%, -1%);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* top scroll-progress line */
.progress-rail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.06);
    z-index: 60;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--purple-deep), var(--purple));
    box-shadow: 0 0 12px rgba(147,102,255,0.6);
    transition: width 0.1s linear;
}

/* vertical film-reel rail */
.reel-rail {
    position: fixed;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.reel-tick {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-faint);
    transition: background 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

    .reel-tick.is-active {
        background: var(--purple);
        transform: scale(1.9);
        box-shadow: 0 0 10px rgba(147,102,255,0.75);
    }

@media (max-width: 900px) {
    .reel-rail {
        display: none;
    }
}

/* slate counter */
.slate {
    position: fixed;
    left: 32px;
    bottom: 28px;
    z-index: 45;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.slate-current {
    color: var(--purple);
    font-weight: 600;
}

@media (max-width: 700px) {
    .slate {
        display: none;
    }
}

/* cursor */
.type-cursor {
    display: inline-block;
    color: var(--purple);
    margin-left: 2px;
    opacity: 1;
}

    .type-cursor.blink {
        animation: caretBlink 0.9s step-end infinite;
    }

@keyframes caretBlink {
    50% {
        opacity: 0;
    }
}

/* word-mask */
.page-title .word-mask {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}

.page-title .word {
    display: inline-block;
    will-change: transform;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    .project {
        filter: none;
    }

    .ambient, .grain {
        animation: none;
    }

    * {
        scroll-behavior: auto !important;
    }
}
