/* ==========================================================================
   PROJECTS PAGE STYLES - premium glassmorphism & responsive animations
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

.projects-page {
    background: var(--bg-primary);
    background-image: var(--bg-image);
    background-attachment: fixed;
    color: var(--text-primary);
    transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
    position: relative;
}

/* Ambient Drifting Glow Spheres */
.projects-page::before,
.projects-page::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
    filter: blur(130px);
    transition: opacity 0.5s ease;
}

.projects-page::before {
    background: radial-gradient(circle, var(--accent-primary) 0%, rgba(0, 242, 254, 0) 70%);
    top: 10%;
    left: -150px;
    animation: ambientDrift1 25s infinite alternate ease-in-out;
}

.projects-page::after {
    background: radial-gradient(circle, var(--accent-secondary) 0%, rgba(255, 0, 127, 0) 70%);
    bottom: 20%;
    right: -150px;
    animation: ambientDrift2 30s infinite alternate ease-in-out;
}

[data-theme="light"] .projects-page::before,
[data-theme="light"] .projects-page::after {
    opacity: 0.05;
    filter: blur(140px);
}

@keyframes ambientDrift1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, 80px) scale(1.15); }
    100% { transform: translate(-30px, 130px) scale(0.95); }
}

@keyframes ambientDrift2 {
    0% { transform: translate(0, 0) scale(0.9); }
    50% { transform: translate(-80px, -100px) scale(1.1); }
    100% { transform: translate(50px, -30px) scale(1); }
}

/* ── Hero Section ─────────────────────────────────────── */
.projects-hero {
    padding: 120px 0 70px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.projects-hero-inner {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 20px;
}

.projects-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
    border-radius: 50px;
    margin-bottom: 25px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.5px;
}

.projects-hero-tag .tag-pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-primary);
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.6; }
}

.projects-hero h1 {
    font-size: clamp(32px, 5.5vw, 56px);
    font-weight: 900;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.projects-hero-desc {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto;
}

/* ── Filter Bar ───────────────────────────────────────── */
.filter-container {
    margin-bottom: 50px;
    position: relative;
    z-index: 10;
    padding: 0 15px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 50px;
    max-width: 780px;
    margin: 0 auto;
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .filter-bar {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 30px rgba(114, 137, 72, 0.08);
}

.filter-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14.5px;
    padding: 10px 22px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Outfit', sans-serif;
    outline: none !important;
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: #ffffff !important;
    box-shadow: 0 6px 15px var(--shadow-color);
}

/* ── Projects Grid ────────────────────────────────────── */
.projects-grid-section {
    padding-bottom: 80px;
    padding-left: 15px;
    padding-right: 15px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
    position: relative;
    z-index: 2;
}

/* Premium Project Card */
.project-card {
    border-radius: 24px;
    overflow: hidden;
    transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), 
                transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), 
                visibility 0.5s;
    opacity: 1;
    transform: scale(1);
    visibility: visible;
    display: flex;
    flex-direction: column;
}

.project-card.fade-out {
    opacity: 0;
    transform: scale(0.92) translateY(15px);
    visibility: hidden;
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.project-card.fade-in {
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
}

.project-card-inner {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

[data-theme="light"] .project-card-inner {
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

.project-card:hover .project-card-inner {
    border-color: var(--card-border);
    box-shadow: 0 25px 50px var(--shadow-color);
    transform: translateY(-8px);
}

/* Card Glow Blob */
.card-glow-blob {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.4s ease;
}

.blob-accent {
    background: radial-gradient(circle, rgba(255, 0, 127, 0.08) 0%, transparent 70%);
}

.blob-tertiary {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
}

[data-theme="light"] .card-glow-blob {
    background: radial-gradient(circle, rgba(114, 137, 72, 0.07) 0%, transparent 70%);
}

.project-card:hover .card-glow-blob {
    opacity: 1.5;
}

/* Project Card Image */
.project-image-wrap {
    height: 220px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-img {
    transform: scale(1.08) rotate(1deg);
}

/* Card Overlays & Badges */
.project-category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    background: rgba(7, 5, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    z-index: 2;
}

.project-metric-pill {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: var(--gradient-primary);
    padding: 5px 14px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Project Info Body */
.project-info {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.project-info h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 10px;
    font-family: 'Outfit', sans-serif;
    transition: color 0.3s;
}

.project-card:hover .project-info h3 {
    color: var(--accent-primary);
}

.project-desc {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 20px;
}

/* Tech Badges */
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tech-pill {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.project-card:hover .tech-pill {
    border-color: var(--badge-border);
    color: var(--text-primary);
}

/* Card Actions */
.project-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.proj-btn-primary {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--gradient-primary);
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.proj-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.proj-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary) !important;
    text-decoration: none;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.proj-btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary) !important;
    transform: translateY(-2px);
}

/* ── Stats counter ────────────────────────────────────── */
.stats-section {
    padding: 90px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.stat-counter-card {
    text-align: center;
    padding: 20px;
}

.stat-number-wrap {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Delivery process timeline ─────────────────────────── */
.timeline-section {
    padding: 80px 15px;
}

.timeline-timeline {
    position: relative;
    max-width: 1000px;
    margin: 50px auto 0;
}

.timeline-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 40px;
    box-sizing: border-box;
    margin-bottom: 50px;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-badge {
    position: absolute;
    top: 15px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.4s;
}

.timeline-item:nth-child(odd) .timeline-badge {
    right: -23px;
}

.timeline-item:nth-child(even) .timeline-badge {
    left: -23px;
}

.timeline-item:hover .timeline-badge {
    background: var(--gradient-primary);
    color: #ffffff;
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.timeline-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 20px;
    position: relative;
    transition: all 0.4s;
}

[data-theme="light"] .timeline-card {
    background: #ffffff;
}

.timeline-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 15px 30px var(--shadow-color);
    transform: translateY(-3px);
}

.timeline-card h4 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.timeline-card p {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Interactive Shimmer Sweep ────────────────────────── */
.project-card-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    pointer-events: none;
    z-index: 2;
    transition: none;
}

.project-card:hover .project-card-inner::after {
    left: 150%;
    transition: left 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .project-card-inner::after {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(114, 137, 72, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

/* ── Custom reveal overrides ──────────────────────────── */
.timeline-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.timeline-item.visible-reveal {
    opacity: 1;
    transform: translateY(0);
}

.timeline-timeline .timeline-item:nth-child(1) { transition-delay: 0s; }
.timeline-timeline .timeline-item:nth-child(2) { transition-delay: 0.12s; }
.timeline-timeline .timeline-item:nth-child(3) { transition-delay: 0.24s; }
.timeline-timeline .timeline-item:nth-child(4) { transition-delay: 0.36s; }
.timeline-timeline .timeline-item:nth-child(5) { transition-delay: 0.48s; }

.timeline-item:not(.visible-reveal) {
    transition-delay: 0s !important;
}

.redesign-section {
    padding: 80px 0;
}

/* ── Responsive Media Queries ────────────────────────── */

/* Tablet: linearise timeline to left-aligned single column */
@media (max-width: 991px) {
    .timeline-timeline::before {
        left: 22px;
        transform: none;
    }
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding-left: 68px;
        padding-right: 15px;
        margin-bottom: 36px;
    }
    .timeline-item .timeline-badge,
    .timeline-item:nth-child(odd) .timeline-badge,
    .timeline-item:nth-child(even) .timeline-badge {
        left: 0 !important;
        right: auto !important;
    }
    .timeline-section {
        padding: 60px 15px;
    }
}

/* Mobile ≤ 767px */
@media (max-width: 767px) {
    /* Hero */
    .projects-hero {
        padding: 75px 0 35px;
    }
    .projects-hero h1 {
        font-size: clamp(26px, 7vw, 36px);
        letter-spacing: -0.3px;
    }
    .projects-hero-desc {
        font-size: 15px;
        line-height: 1.65;
    }
    .projects-hero-tag {
        font-size: 12px;
        padding: 7px 14px;
    }

    /* Filter bar: horizontal scroll on small screens */
    .filter-container {
        padding: 0 12px;
        margin-bottom: 35px;
        overflow: hidden;
    }
    .filter-bar {
        border-radius: 16px;
        padding: 8px;
        gap: 7px;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;          /* Firefox */
    }
    .filter-bar::-webkit-scrollbar {
        display: none;                  /* Chrome / Safari */
    }
    .filter-btn {
        font-size: 13px;
        padding: 9px 16px;
        flex-shrink: 0;                 /* prevent squishing */
        white-space: nowrap;
    }

    /* Projects grid: single column */
    .projects-grid-section {
        padding-bottom: 35px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .project-image-wrap {
        height: 190px;
    }
    .project-info {
        padding: 18px;
    }
    .project-info h3 {
        font-size: 17px;
    }
    .project-desc {
        font-size: 13.5px;
    }
    .project-tech {
        gap: 6px;
        margin-bottom: 18px;
    }
    .project-actions {
        gap: 10px;
    }
    .proj-btn-primary {
        padding: 10px 14px;
        font-size: 13px;
    }
    .proj-btn-secondary {
        width: 40px;
        height: 40px;
    }

    /* Stats section: 2-column grid */
    .stats-section {
        padding: 45px 15px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .stat-number-wrap {
        font-size: 2.2rem;
    }
    .stat-label {
        font-size: 11.5px;
        letter-spacing: 0.5px;
    }

    /* Timeline */
    .timeline-section {
        padding: 45px 12px;
    }
    .timeline-timeline {
        margin-top: 30px;
    }
    .timeline-card {
        padding: 20px;
    }
    .timeline-card h4 {
        font-size: 16px;
    }
    .timeline-card p {
        font-size: 13.5px;
    }

    /* CTA */
    .redesign-section {
        padding: 40px 0 50px;
    }
    .redesign-cta-banner {
        padding: 40px 20px;
    }
    .redesign-cta-banner h2 {
        font-size: 1.6rem;
    }
    .redesign-cta-banner p {
        font-size: 15px;
    }
}

/* Very small phones ≤ 480px */
@media (max-width: 480px) {
    .projects-hero {
        padding: 65px 0 28px;
    }
    .projects-hero h1 {
        font-size: clamp(22px, 7vw, 30px);
    }
    .projects-hero-tag {
        font-size: 11.5px;
        padding: 6px 12px;
    }
    .projects-hero-desc {
        font-size: 14px;
    }
    .filter-btn {
        font-size: 12.5px;
        padding: 8px 14px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .stat-number-wrap {
        font-size: 1.9rem;
    }
    .project-image-wrap {
        height: 170px;
    }
    .timeline-badge {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    .timeline-timeline::before {
        left: 18px;
    }
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-left: 56px;
        padding-right: 10px;
    }
}
