/* projects.css - Advanced Styling for Projects Page */

/* --- Clean Modern Hero Section --- */
.projects-hero {
    position: relative;
    min-height: 94vh;
    display: flex;
    align-items: flex-end;
    padding: 9rem 5% 5rem;
    overflow-x: hidden;
    overflow-y: visible;
    background: #f8fafc;
}

.projects-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(37, 99, 235, 0.12), transparent 28%),
        radial-gradient(circle at 86% 28%, rgba(16, 185, 129, 0.10), transparent 26%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 46%, #eef4ff 100%);
}

.projects-hero-bg::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 34%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.92));
    z-index: 3;
}

.projects-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 78%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 78%);
    z-index: 2;
}

.projects-hero-sweep {
    position: absolute;
    right: -12%;
    top: 10%;
    width: 58%;
    height: 78%;
    background:
        linear-gradient(120deg, transparent 0 34%, rgba(37, 99, 235, 0.09) 34% 35%, transparent 35% 100%),
        linear-gradient(120deg, transparent 0 48%, rgba(15, 23, 42, 0.08) 48% 49%, transparent 49% 100%);
    transform: skewX(-12deg);
    opacity: 0.75;
    z-index: 2;
    pointer-events: none;
}

@media (max-width: 768px) {
    .projects-hero-sweep {
        display: none;
    }
}

.projects-hero-content {
    position: relative;
    z-index: 10;
    width: min(100%, 1280px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    gap: clamp(3rem, 6vw, 6rem);
    overflow: hidden;
}

@media (min-width: 1025px) {
    .projects-hero-content {
        grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.85fr);
        justify-items: stretch;
    }
}

@media (max-width: 1024px) {
    .projects-hero-copy {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .projects-hero-actions {
        justify-content: center;
    }

    .projects-hero-metrics {
        justify-self: center;
    }

    .projects-hero-showcase {
        justify-self: center;
    }
}

.projects-hero-copy {
    max-width: 760px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: fit-content;
    padding: 0.55rem 0.85rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    color: var(--accent-blue-soft);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.hero-badge .material-icons {
    font-size: 1rem;
}

.projects-hero-title {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 0.90;
    color: var(--text-primary);
    margin-bottom: 1.6rem;
    display: flex;
    flex-direction: column;
    font-weight: 800;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.text-gradient {
    color: transparent;
    background: linear-gradient(90deg, #0a2540 0%, #2563eb 48%, #10b981 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.projects-hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 680px;
    font-weight: 400;
}

.projects-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

.projects-hero-actions .btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 52px;
    padding: 0.9rem 1.35rem;
}

.projects-hero-actions .material-icons {
    font-size: 1.05rem;
}

.projects-primary-btn {
    box-shadow: 0 16px 36px rgba(10, 37, 64, 0.16);
}

.projects-secondary-btn {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.projects-secondary-btn:hover {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.22);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.projects-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 620px;
    margin-top: 2.25rem;
}

.hero-metric {
    padding: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.045);
}

.hero-metric strong {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.hero-metric span {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.35;
}

.projects-hero-showcase {
    position: relative;
    align-self: end;
    padding: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    width: 100%;
    max-width: 100%;
}

.showcase-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.25rem 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.showcase-status {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.showcase-main {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 16 / 10;
    background: #0f172a;
}

.showcase-main img,
.showcase-mini-card img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

.showcase-label {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

.showcase-label span {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
}

.showcase-label strong {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1rem;
}

.showcase-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.showcase-mini-card {
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.showcase-mini-card img {
    aspect-ratio: 16 / 10;
}

.showcase-mini-card span {
    display: block;
    padding: 0.55rem 0.65rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Projects Listing Section --- */
.projects-list-section {
    padding: 8rem 5%;
    background: #ffffff;
    position: relative;
    z-index: 20;
}

.projects-container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* Alternating Row Layout */
.project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6rem;
    margin-bottom: 12rem;
    perspective: 1500px;
    width: 100%;
    overflow: hidden;
}

.project-row:last-child {
    margin-bottom: 4rem;
}

.project-row:nth-child(even) {
    flex-direction: row-reverse;
}

/* Thumbnail wrapper with hover scales and 3D tilts */
.project-thumbnail-wrapper {
    flex: 1;
    max-width: 600px;
    width: 100%;
}

.project-card-3d {
    width: 100%;
    transform-style: preserve-3d;
}

.project-card-inner {
    position: relative;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    aspect-ratio: 16 / 10;
    border: 1px solid rgba(15, 23, 42, 0.05);
    cursor: pointer;
    transform-style: preserve-3d;
}

.project-card-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(147, 51, 234, 0.03) 100%);
    z-index: 1;
}

.project-thumbnail-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    z-index: 2;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card-inner:hover .project-thumbnail-img {
    transform: scale(1.04);
}

/* Premium Hover Glass overlay and Play button */
.project-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: opacity 0.4s ease;
}

.project-card-inner:hover .project-hover-overlay {
    opacity: 1;
}

.play-button-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.85) translateZ(40px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-card-inner:hover .play-button-circle {
    transform: translateY(0) scale(1) translateZ(40px);
}

.play-button-circle .material-icons {
    font-size: 2.2rem;
    color: var(--accent-blue);
    margin-left: 4px;
    /* Centering tweak for triangles */
}

.case-study-label {
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transform: translateY(20px) translateZ(20px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    transition-delay: 0.05s;
}

.project-card-inner:hover .case-study-label {
    transform: translateY(0) translateZ(20px);
    opacity: 1;
}

/* Details Column layout */
.project-details-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-info-header {
    margin-bottom: 1.5rem;
}

.project-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: var(--accent-blue-soft);
    background: rgba(37, 99, 235, 0.06);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.project-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.project-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Interactive SVG wrapper inside grid */
.interactive-svg-wrap {
    width: 100%;
    max-width: 440px;
    background: #fafafa;
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 20px;
    margin-bottom: 2.5rem;
    padding: 1rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.01);
    overflow: hidden;
    position: relative;
}

.interactive-svg-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Tech icon styling and metrics */
.project-tech-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    padding-top: 1.5rem;
}

.tech-icons {
    display: flex;
    gap: 0.75rem;
}

.tech-icon-bubble {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.tech-icon-bubble:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.tech-icon-bubble img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.tech-stat-pill {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--accent-blue);
    color: #ffffff;
    padding: 0.6rem 1.4rem;
    border-radius: 100px;
    box-shadow: 0 6px 15px rgba(10, 37, 64, 0.1);
}

.tech-stat-pill strong {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.tech-stat-pill span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
}

/* --- SVG ANIMATIONS KEYFRAMES --- */

/* 1. IntelliSignal Animations */
.radar-wave {
    transform-origin: 200px 90px;
    animation: radarExpand 4s infinite linear;
}

.wave-delay {
    animation-delay: 2s;
}

@keyframes radarExpand {
    0% {
        r: 5px;
        opacity: 1;
        stroke-width: 1.5px;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        r: 90px;
        opacity: 0;
        stroke-width: 0.5px;
    }
}

.pulse-red {
    animation: flashRed 1.5s infinite alternate ease-in-out;
}

.pulse-green {
    animation: flashGreen 1.5s infinite alternate ease-in-out;
}

@keyframes flashRed {
    0% {
        fill: #ef4444;
        filter: drop-shadow(0 0 1px #ef4444);
    }

    100% {
        fill: #f87171;
        filter: drop-shadow(0 0 6px #ef4444);
    }
}

@keyframes flashGreen {
    0% {
        fill: #10b981;
        filter: drop-shadow(0 0 1px #10b981);
    }

    100% {
        fill: #34d399;
        filter: drop-shadow(0 0 6px #10b981);
    }
}

.flow-right {
    animation: carRight 3.5s infinite linear;
}

.flow-left {
    animation: carLeft 4s infinite linear;
}

.flow-down {
    animation: carDown 3s infinite linear;
    animation-delay: 0.8s;
}

@keyframes carRight {
    0% {
        cx: 0px;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        cx: 400px;
        opacity: 0;
    }
}

@keyframes carLeft {
    0% {
        cx: 400px;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        cx: 0px;
        opacity: 0;
    }
}

@keyframes carDown {
    0% {
        cy: 0px;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        cy: 180px;
        opacity: 0;
    }
}

.priority-vehicle-arrow {
    transform-origin: 200px 30px;
    animation: bouncePriority 0.8s infinite alternate ease-in-out;
}

@keyframes bouncePriority {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-5px);
    }
}

/* 2. BrainBazaar Animations */
.spinning-circle-dashed {
    transform-origin: 200px 90px;
    animation: spinDashed 12s infinite linear;
}

@keyframes spinDashed {
    100% {
        transform: rotate(360deg);
    }
}

.floating-bag {
    transform-origin: 200px 90px;
    animation: floatBag 3s infinite alternate ease-in-out;
}

@keyframes floatBag {
    0% {
        transform: translate(182px, 72px) scale(0.9) translateY(0);
    }

    100% {
        transform: translate(182px, 72px) scale(0.9) translateY(-6px);
    }
}

.pulse-glow {
    animation: pulseCircleGlow 2s infinite alternate ease-in-out;
}

@keyframes pulseCircleGlow {
    0% {
        r: 4px;
        opacity: 0.7;
    }

    100% {
        r: 7px;
        opacity: 1;
        filter: drop-shadow(0 0 4px #2563eb);
    }
}

.transaction-item {
    animation: floatTx 4s infinite alternate ease-in-out;
}

.tx-1 {
    animation-delay: 0s;
}

.tx-2 {
    animation-delay: 1.5s;
}

@keyframes floatTx {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-8px);
    }
}

.money-flow-1 {
    stroke-dashoffset: 0;
    animation: flowLines 4s infinite linear;
}

.money-flow-2 {
    stroke-dashoffset: 0;
    animation: flowLines 4s infinite linear;
    animation-direction: reverse;
}

@keyframes flowLines {
    100% {
        stroke-dashoffset: -20;
    }
}

/* 3. Billium Animations */
.printing-receipt {
    animation: receiptPrint 8s infinite ease-in-out;
    transform-origin: 200px 36px;
}

@keyframes receiptPrint {
    0% {
        transform: scaleY(0.1);
        opacity: 0.8;
    }

    30% {
        transform: scaleY(1);
        opacity: 1;
    }

    80% {
        transform: scaleY(1) translateY(0);
        opacity: 1;
    }

    100% {
        transform: scaleY(1) translateY(40px);
        opacity: 0;
    }
}

.draw-check {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: checkSync 3s infinite ease-in-out;
}

@keyframes checkSync {

    0%,
    30% {
        stroke-dashoffset: 20;
    }

    50%,
    80% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: -20;
    }
}

/* 4. Ujjwalit Learn Animations */
.terminal-cursor {
    animation: cursorBlink 1s infinite steps(2, start);
}

@keyframes cursorBlink {
    to {
        visibility: hidden;
    }
}

.typing-text-console text {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: typeCodes 6s infinite alternate steps(60);
}

@keyframes typeCodes {

    0%,
    10% {
        stroke-dashoffset: 400;
        fill: transparent;
    }

    60%,
    100% {
        stroke-dashoffset: 0;
        fill: currentColor;
    }
}

.node-dot {
    animation: pulseNodeDot 2s infinite alternate ease-in-out;
}

.node-dot:nth-child(odd) {
    animation-delay: 1s;
}

@keyframes pulseNodeDot {
    0% {
        transform: scale(0.9);
        filter: brightness(0.9);
    }

    100% {
        transform: scale(1.15);
        filter: brightness(1.2) drop-shadow(0 0 5px currentColor);
    }
}

/* 5. Smart Attendance Animations */
.scan-laser-line {
    animation: scanMove 4s infinite ease-in-out;
}

@keyframes scanMove {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.8;
    }

    50% {
        transform: translateY(140px);
        opacity: 1;
        filter: drop-shadow(0 0 4px #10b981);
    }
}

.mesh-point {
    transform-origin: center;
    transform-box: fill-box;
    animation: pulseMeshPoint 1.5s infinite alternate ease-in-out;
}

.mesh-point:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes pulseMeshPoint {
    0% {
        transform: scale(0.8);
        fill: #10b981;
        filter: drop-shadow(0 0 1px #10b981);
    }

    100% {
        transform: scale(1.3);
        fill: #34d399;
        filter: drop-shadow(0 0 5px #10b981);
    }
}

.mesh-mouth {
    animation: pulseMouth 3s infinite alternate ease-in-out;
}

@keyframes pulseMouth {
    0% {
        stroke: #10b981;
    }

    100% {
        stroke: #34d399;
        filter: drop-shadow(0 0 2px #10b981);
    }
}

.voice-bar {
    transform-origin: bottom;
    transform-box: fill-box;
    animation: voiceJump 1.2s infinite ease-in-out alternate;
}

.v-bar-1 {
    animation-delay: 0.1s;
}

.v-bar-2 {
    animation-delay: 0.4s;
}

.v-bar-3 {
    animation-delay: 0.2s;
}

.v-bar-4 {
    animation-delay: 0.6s;
}

.v-bar-5 {
    animation-delay: 0.3s;
}

.v-bar-6 {
    animation-delay: 0.5s;
}

@keyframes voiceJump {
    0% {
        transform: scaleY(0.3);
    }

    100% {
        transform: scaleY(1.1);
        fill: #7c3aed;
    }
}

.ai-classification-box {
    animation: floatClassification 4s infinite alternate ease-in-out;
}

@keyframes floatClassification {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-4px);
    }
}


/* --- CASE STUDY POPUP MODAL --- */

/* Lock body scroll when modal is open */
html.modal-open,
body.modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

body.modal-open {
    position: fixed;
    width: 100%;
}

.project-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

.project-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.project-modal-container {
    position: relative;
    width: min(92%, 1150px);
    max-height: 90vh;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 32px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10010;
}

.project-modal-overlay.active .project-modal-container {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10020;
    transition: background 0.3s, transform 0.3s;
}

.modal-close-btn:hover {
    background: rgba(15, 23, 42, 0.15);
    transform: rotate(90deg);
}

.modal-close-btn .material-icons {
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Modal Two Columns Card Layout */
.project-modal-card {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 580px;
    max-height: 85vh;
}

/* Left: Custom Video Player */
.modal-video-side {
    flex: 1.2;
    background: #000000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Play button centered on overlay */
.video-overlay-play-btn {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 5;
    transition: transform 0.3s, opacity 0.3s;
}

.video-overlay-play-btn:hover {
    transform: scale(1.1);
}

.video-overlay-play-btn.playing {
    opacity: 0;
    pointer-events: none;
}

.video-overlay-play-btn .material-icons {
    font-size: 2.8rem;
    color: var(--accent-blue);
    margin-left: 6px;
}

/* Control bar at the bottom */
.video-controls-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 6;
}

.video-player-wrapper:hover .video-controls-wrap {
    opacity: 1;
    transform: translateY(0);
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn .material-icons {
    color: #ffffff;
    font-size: 1.6rem;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
}

.control-btn:hover .material-icons {
    opacity: 1;
    transform: scale(1.1);
}

/* Timeline scrubber bar */
.video-timeline-bg {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s;
}

.video-timeline-bg:hover {
    height: 6px;
}

.video-timeline-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-blue-soft);
    border-radius: 10px;
    position: relative;
}

/* Right: Case Study Info */
.modal-info-side {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
}

.modal-info-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding-bottom: 1.5rem;
}

.modal-project-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--accent-blue-soft);
    font-weight: 600;
    text-transform: uppercase;
}

.modal-project-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.5rem;
    letter-spacing: -0.02em;
}

.modal-info-scroll-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 1rem;
    margin-bottom: 2rem;
    overscroll-behavior: contain;
}

/* Scrollbar styling for modal body */
.modal-info-scroll-body::-webkit-scrollbar {
    width: 6px;
}

.modal-info-scroll-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-info-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 10px;
}

.modal-info-scroll-body::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.2);
}

.case-study-section {
    margin-bottom: 2.5rem;
}

.case-study-section h4 {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.case-study-section p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Modal Metrics stats */
.modal-stats-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: #fafafa;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.m-stat-item {
    display: flex;
    flex-direction: column;
}

.m-stat-val {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.m-stat-lbl {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Modal Tech Stack Pills */
.modal-tech-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-tech-pill {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 100px;
}

.modal-info-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 1.5rem;
}

.modal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    width: 100%;
}




.project-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.view-case-study-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.1rem;
    border-radius: 100px;
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.view-case-study-btn .material-icons {
    font-size: 1rem;
    color: var(--accent-blue-soft);
    transition: transform 0.3s ease;
}

.view-case-study-btn:hover {
    background: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.view-case-study-btn:hover .material-icons {
    color: #ffffff;
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .project-title-wrapper {
        gap: 0.75rem;
    }
}

/* --- SCROLL PROGRESS BAR --- */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #10b981);
    z-index: 9999;
    transition: width 0.1s linear;
    will-change: width;
}

/* --- SECTION HEADER --- */
.projects-section-header {
    padding: 2rem 5% 0;
    background: #ffffff;
    position: relative;
    z-index: 20;
}

.section-header-content {
    max-width: 1300px;
    margin: 0 auto;
    text-align: center;
    padding-bottom: 3rem;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--accent-blue-soft);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 1.25rem;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.section-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.7;
}

/* --- BACK TO TOP BUTTON --- */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--text-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.4s ease;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.3);
}

.back-to-top-btn .material-icons {
    color: #ffffff;
    font-size: 1.5rem;
}

/* --- TABLET BREAKPOINT (768px) --- */
@media (max-width: 768px) {
    .projects-hero {
        padding: 6.5rem 5% 3rem;
    }

    .projects-hero-title {
        font-size: 2.4rem;
    }

    .projects-hero-content {
        gap: 2rem;
    }

    .projects-hero-subtitle {
        font-size: 1rem;
    }

    .projects-hero-metrics {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }

    .hero-metric {
        padding: 0.6rem;
    }

    .hero-metric strong {
        font-size: 1rem;
    }

    .hero-metric span {
        font-size: 0.75rem;
    }

    .projects-hero-showcase {
        max-width: 100%;
    }

    .showcase-main {
        aspect-ratio: 16 / 9;
    }

    .project-row {
        flex-direction: column !important;
        gap: 2rem;
        margin-bottom: 5rem;
    }

    .project-thumbnail-wrapper,
    .project-details-column {
        max-width: 100%;
        width: 100%;
    }

    .project-title {
        font-size: 1.7rem;
    }

    .project-desc {
        font-size: 0.95rem;
    }

    .interactive-svg-wrap {
        max-width: 100%;
        margin-bottom: 1.5rem;
    }

    .project-tech-stats {
        gap: 1rem;
    }

    .tech-stat-pill {
        padding: 0.45rem 0.9rem;
    }

    .tech-stat-pill strong {
        font-size: 1rem;
    }

    .tech-stat-pill span {
        font-size: 0.7rem;
    }

    .tech-icon-bubble {
        width: 34px;
        height: 34px;
    }

    .tech-icon-bubble img {
        width: 16px;
        height: 16px;
    }

    .project-modal-card {
        flex-direction: column;
        max-height: 80vh;
    }

    .modal-video-side {
        flex: none;
        height: 200px;
    }

    .modal-info-side {
        padding: 1.5rem;
    }

    .modal-project-title {
        font-size: 1.4rem;
    }

    .modal-stats-list {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 0.85rem;
    }

    .m-stat-val {
        font-size: 1.3rem;
    }

    .projects-list-section {
        padding: 4rem 5%;
    }

    .projects-section-header {
        padding: 1.25rem 5% 0;
    }

    .section-header-content {
        padding-bottom: 1.5rem;
    }

    .section-desc {
        font-size: 0.95rem;
    }

    .section-heading {
        font-size: 2.2rem;
    }

    .back-to-top-btn {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 42px;
        height: 42px;
    }
}

/* --- ENHANCED 480px BREAKPOINT --- */
@media (max-width: 480px) {
    .projects-hero {
        padding: 5.5rem 4% 2.5rem;
    }

    .projects-hero-title {
        font-size: 1.7rem;
        line-height: 1.05;
    }

    .projects-hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .projects-hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .projects-hero-actions .btn-hero {
        width: 100%;
        min-height: 44px;
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }

    .projects-hero-metrics {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .hero-metric {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.6rem 0.8rem;
    }

    .hero-metric strong {
        font-size: 0.95rem;
        margin-bottom: 0;
    }

    .hero-metric span {
        font-size: 0.75rem;
    }

    .projects-hero-showcase {
        padding: 0.5rem;
        max-width: 100%;
    }

    .showcase-strip {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .showcase-mini-card {
        display: grid;
        grid-template-columns: 70px 1fr;
        align-items: center;
    }

    .showcase-mini-card img {
        aspect-ratio: 1.35 / 1;
    }

    .showcase-mini-card span {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }

    .showcase-label {
        left: 0.5rem;
        bottom: 0.5rem;
        padding: 0.4rem 0.55rem;
    }

    .showcase-label strong {
        font-size: 0.8rem;
    }

    .showcase-label span {
        font-size: 0.6rem;
    }

    .projects-list-section {
        padding: 2.5rem 4%;
    }

    .project-row {
        gap: 1.5rem;
        margin-bottom: 3.5rem;
    }

    .project-tag {
        font-size: 0.65rem;
        padding: 0.25rem 0.7rem;
    }

    .project-title {
        font-size: 1.3rem;
    }

    .project-desc {
        font-size: 0.85rem;
        line-height: 1.55;
        margin-bottom: 1rem;
    }

    .project-info-header {
        margin-bottom: 0.75rem;
    }

    .interactive-svg-wrap {
        padding: 0.5rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .project-tech-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding-top: 0.75rem;
    }

    .tech-icons {
        gap: 0.4rem;
    }

    .tech-icon-bubble {
        width: 28px;
        height: 28px;
    }

    .tech-icon-bubble img {
        width: 14px;
        height: 14px;
    }

    .tech-stat-pill {
        padding: 0.4rem 0.8rem;
        gap: 0.6rem;
    }

    .tech-stat-pill strong {
        font-size: 0.9rem;
    }

    .tech-stat-pill span {
        font-size: 0.6rem;
    }

    .project-title-wrapper {
        gap: 0.5rem;
    }

    .view-case-study-btn {
        padding: 0.25rem 0.7rem;
        font-size: 0.68rem;
    }

    .view-case-study-btn .material-icons {
        font-size: 0.8rem;
    }

    .project-thumbnail-wrapper {
        max-width: 100%;
    }

    .project-card-inner {
        border-radius: 14px;
    }

    .play-button-circle {
        width: 48px;
        height: 48px;
    }

    .play-button-circle .material-icons {
        font-size: 1.5rem;
    }

    .case-study-label {
        font-size: 0.68rem;
    }

    .modal-close-btn {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
    }

    .modal-close-btn .material-icons {
        font-size: 1.1rem;
    }

    .modal-video-side {
        height: 160px;
    }

    .modal-info-side {
        padding: 1rem;
    }

    .modal-project-title {
        font-size: 1.2rem;
    }

    .modal-project-tag {
        font-size: 0.65rem;
    }

    .modal-info-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .case-study-section {
        margin-bottom: 1.25rem;
    }

    .case-study-section p {
        font-size: 0.85rem;
    }

    .modal-stats-list {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 0.7rem;
    }

    .m-stat-val {
        font-size: 1.1rem;
    }

    .m-stat-lbl {
        font-size: 0.68rem;
    }

    .modal-action-btn {
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
    }

    .projects-section-header {
        padding: 0.75rem 4% 0;
    }

    .section-header-content {
        padding-bottom: 1.25rem;
    }

    .section-badge {
        font-size: 0.6rem;
        padding: 0.3rem 0.7rem;
    }

    .section-heading {
        font-size: 1.5rem;
    }

    .section-desc {
        font-size: 0.85rem;
    }

    .back-to-top-btn {
        bottom: 0.75rem;
        right: 0.75rem;
        width: 36px;
        height: 36px;
    }

    .back-to-top-btn .material-icons {
        font-size: 1.15rem;
    }

    .scroll-progress-bar {
        height: 2px;
    }
}

/* --- ENHANCED 1024px BREAKPOINT --- */
@media (max-width: 1024px) and (min-width: 769px) {
    .projects-hero {
        padding: 8rem 5% 4rem;
        height: auto;
        min-height: auto;
        align-items: center;
    }

    .projects-hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .projects-hero-title {
        font-size: 3.2rem;
    }

    .projects-hero-showcase {
        max-width: 720px;
        width: 100%;
        align-self: auto;
    }

    .project-row {
        flex-direction: column !important;
        gap: 3rem;
        margin-bottom: 7rem;
    }

    .project-thumbnail-wrapper,
    .project-details-column {
        max-width: 100%;
        width: 100%;
    }

    .project-title {
        font-size: 2.2rem;
    }

    .project-desc {
        font-size: 1.05rem;
    }

    .modal-video-side {
        flex: none;
        height: 240px;
    }

    .modal-info-side {
        padding: 2rem;
    }

    .modal-project-title {
        font-size: 1.8rem;
    }

    .section-heading {
        font-size: 2.8rem;
    }
}