/* ===================================
   OPEN SOURCE PAGE STYLES
   Beautiful dedicated page for open source projects
   =================================== */

:root {
    --ebony: #1E2330;
    --canopy-green: #D2E823;
    --pastel-green: #42E661;
    --gradient-green: linear-gradient(135deg, #D2E823 0%, #42E661 100%);
}

body {
    background: #1E2330 !important;
    color: #fff !important;
}

/* ===================================
   HERO SECTION
   =================================== */

.opensource-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(210, 232, 35, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(66, 230, 97, 0.1), transparent),
        radial-gradient(ellipse 50% 30% at 20% 80%, rgba(139, 92, 246, 0.08), transparent);
}

.hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(210, 232, 35, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(210, 232, 35, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
}

.opensource-hero .container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.opensource-hero .hero-content {
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(210, 232, 35, 0.1);
    border: 1px solid rgba(210, 232, 35, 0.3);
    border-radius: 100px;
    margin-bottom: 32px;
    animation: fadeInDown 0.8s ease;
}

.hero-badge svg {
    stroke: var(--canopy-green);
}

.hero-badge span {
    font-size: 14px;
    font-weight: 700;
    color: var(--canopy-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    color: #fff;
    animation: fadeInUp 0.8s ease 0.2s both;
}

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

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

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 700px;
    margin: 0 auto 48px;
    line-height: 1.7;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 48px;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(210, 232, 35, 0.1);
    border-color: rgba(210, 232, 35, 0.3);
    transform: translateY(-4px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(210, 232, 35, 0.15);
    border-radius: 12px;
}

.stat-icon svg {
    fill: var(--canopy-green);
    stroke: var(--canopy-green);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.hero-github-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease 0.8s both;
}

.hero-github-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

.hero-github-btn svg {
    fill: #fff;
}

/* ===================================
   PROJECTS SECTION - Card Grid + Mobile Carousel
   =================================== */

.projects-section {
    padding: 80px 24px 100px;
    background: var(--ebony);
}

.projects-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

.projects-section .section-header {
    text-align: center;
    margin-bottom: 48px;
}

.projects-section .section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.projects-section .section-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 500px;
    margin: 0 auto;
}

.projects-carousel-wrapper {
    position: relative;
}

.projects-carousel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.project-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 28px 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    min-height: 360px;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-green);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-card:hover {
    background: rgba(210, 232, 35, 0.06);
    border-color: rgba(210, 232, 35, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(210, 232, 35, 0.15);
}

/* Card Icon */
.card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-green);
    border-radius: 14px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.card-icon svg {
    stroke: var(--ebony);
    width: 26px;
    height: 26px;
}

.card-icon.icon-muted {
    background: rgba(255, 255, 255, 0.08);
}

.card-icon.icon-muted svg {
    stroke: rgba(255, 255, 255, 0.35);
}

/* Card Badges */
.card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-live {
    background: rgba(66, 230, 97, 0.15);
    color: #42E661;
    border: 1px solid rgba(66, 230, 97, 0.3);
}

.badge-license {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-soon {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Card Title */
.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.project-card:hover .card-title {
    color: var(--canopy-green);
}

/* Card Description */
.card-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* Card Tags */
.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.project-card:hover .tag {
    border-color: rgba(210, 232, 35, 0.25);
    background: rgba(210, 232, 35, 0.08);
}

.tag-muted {
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Card Footer */
.card-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--canopy-green);
    transition: all 0.3s ease;
}

.card-link svg:first-child {
    fill: var(--canopy-green);
}

.card-link svg:last-child {
    stroke: var(--canopy-green);
    transition: transform 0.3s ease;
}

.project-card:hover .card-link svg:last-child {
    transform: translate(3px, -3px);
}

.card-link.link-muted {
    color: rgba(255, 255, 255, 0.3);
}

.card-link.link-muted svg {
    fill: rgba(255, 255, 255, 0.2);
}

/* Placeholder cards */
.card-placeholder {
    cursor: default;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.06);
}

.card-placeholder:hover {
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-placeholder::before {
    display: none;
}

.card-placeholder .card-title {
    color: rgba(255, 255, 255, 0.5);
}

.card-placeholder:hover .card-title {
    color: rgba(255, 255, 255, 0.5);
}

.card-placeholder:hover .tag {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.06);
}

/* Carousel Dots - hidden on desktop */
.carousel-dots {
    display: none;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.carousel-dots .dot.active {
    background: var(--canopy-green);
    width: 24px;
}

/* ===================================
   WHY OPEN SOURCE SECTION
   =================================== */

.why-opensource {
    padding: 100px 24px;
    background: linear-gradient(180deg, var(--ebony) 0%, #151922 100%);
}

.why-opensource .container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 600px;
    margin: 0 auto;
}

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.reason-card {
    padding: 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: all 0.4s ease;
}

.reason-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(210, 232, 35, 0.3);
    transform: translateY(-8px);
}

.reason-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(210, 232, 35, 0.15);
    border-radius: 16px;
    margin-bottom: 24px;
}

.reason-icon svg {
    stroke: var(--canopy-green);
}

.reason-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.reason-card p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin: 0;
}

/* ===================================
   CTA SECTION
   =================================== */

.opensource-cta {
    padding: 80px 24px;
    background: linear-gradient(180deg, #151922 0%, var(--ebony) 100%);
    border-top: 1px solid rgba(210, 232, 35, 0.15);
}

.opensource-cta .container {
    max-width: 800px;
    margin: 0 auto;
}

.cta-content {
    text-align: center;
}

.cta-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.cta-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--gradient-green);
    color: var(--ebony);
    text-decoration: none;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(210, 232, 35, 0.3);
}

.cta-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(210, 232, 35, 0.4);
}

.cta-buttons .btn-primary svg {
    fill: var(--ebony);
}

.cta-buttons .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: transparent;
    color: #fff;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cta-buttons .btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* ===================================
   RESPONSIVE
   =================================== */

/* Tablet: 2 columns */
@media (max-width: 1024px) {
    .projects-carousel {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .project-card {
        min-height: 340px;
    }
}

/* Mobile: horizontal scroll carousel */
@media (max-width: 768px) {
    .opensource-hero {
        min-height: auto;
        padding: 100px 20px 60px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
    }

    .stat-item {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .projects-section {
        padding: 60px 0 80px;
    }

    .projects-section .container {
        padding: 0 20px;
    }

    .projects-carousel-wrapper {
        margin: 0 -20px;
        padding: 0 20px;
    }

    .projects-carousel {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
        padding: 4px 0 20px;
        scrollbar-width: none;
    }

    .projects-carousel::-webkit-scrollbar {
        display: none;
    }

    .project-card {
        flex: 0 0 calc(100vw - 56px);
        scroll-snap-align: center;
        min-height: 340px;
        border-radius: 20px;
        padding: 24px 20px;
    }

    .carousel-dots {
        display: flex;
    }

    .why-opensource {
        padding: 60px 20px;
    }

    .reasons-grid {
        grid-template-columns: 1fr;
    }

    .reason-card {
        padding: 24px;
        text-align: center;
    }

    .reason-icon {
        margin: 0 auto 16px;
    }

    .opensource-cta {
        padding: 60px 20px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn-primary,
    .cta-buttons .btn-outline {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}
