/* 
======================================================
   Technology Stack Section - Premium Light Theme Redesign
   Inspirations: Stripe, Vercel (Light mode), Framer
====================================================== 
*/

/* Base Layout & Light Theme Integration */
.tech-stack-page {
    background-color: #ffffff;
    color: #030303;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

/* Stripe/Vercel Subtle Grid Background (Light mode compatible) */
.tech-stack-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(3, 3, 3, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(3, 3, 3, 0.018) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;
    mask-image: radial-gradient(circle at 50% 30%, black 30%, rgba(0, 0, 0, 0.15) 70%, transparent 98%);
    -webkit-mask-image: radial-gradient(circle at 50% 30%, black 30%, rgba(0, 0, 0, 0.15) 70%, transparent 98%);
    pointer-events: none;
    z-index: 0;
}

/* Noise Overlay Effect (Subtle) */
.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.008;
    pointer-events: none;
    z-index: 1;
}

/* Navbar active adjustments to match golden theme */
.tp-main-menu ul li a:hover,
.tp-main-menu ul li.active a {
    color: #FFB400 !important;
}

/* Background Blobs (Light mode blending) */
.tech-bg-glow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.tech-glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.06;
    mix-blend-mode: multiply;
    pointer-events: none;
}
.tech-glow-blob-1 {
    top: 5%;
    left: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #61DAFB 0%, rgba(255, 255, 255, 0) 70%);
    animation: float-blob-slow 30s infinite alternate ease-in-out;
}
.tech-glow-blob-2 {
    top: 35%;
    right: 5%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #FF2D20 0%, rgba(255, 255, 255, 0) 70%);
    animation: float-blob-slow 35s infinite alternate-reverse ease-in-out;
}
.tech-glow-blob-3 {
    bottom: 10%;
    left: 15%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #FFB400 0%, rgba(255, 255, 255, 0) 70%);
    animation: float-blob-slow 28s infinite alternate ease-in-out;
}

@keyframes float-blob-slow {
    0% { transform: translate(0px, 0px) scale(1); }
    50% { transform: translate(60px, -80px) scale(1.15); }
    100% { transform: translate(-40px, 60px) scale(0.9); }
}

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

.tech-section-heading-wrap {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    opacity: 1;
    transform: translateY(0);
}

.ts-ready .tech-section-heading-wrap {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.ts-ready .tech-section-heading-wrap.in-view {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.tech-section-subtitle {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #FFB400;
    font-weight: 700;
    margin-bottom: 20px;
    display: inline-block;
    background: rgba(255, 180, 0, 0.07);
    border: 1px solid rgba(255, 180, 0, 0.15);
    padding: 6px 16px;
    border-radius: 9999px;
}

.tech-section-title {
    font-size: clamp(40px, 7vw, 76px);
    font-weight: 800;
    letter-spacing: -3px;
    line-height: 1.05;
    margin-bottom: 24px;
    color: #030303;
}

.tech-section-desc {
    font-size: clamp(16px, 2.2vw, 21px);
    color: #475569;
    line-height: 1.6;
    max-width: 760px;
    margin: 0 auto;
    font-weight: 400;
}

/* Technology Showcase Grid */
.tech-grid-section {
    position: relative;
    z-index: 2;
}

.tech-showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Light Card (Rounded 24px, glassmorphic layout) */
.tech-premium-card {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 24px;
    padding: 35px 30px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    will-change: transform;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Default: visible (no-JS fallback) */
    opacity: 1;
    transform: translateY(0);
}

/* JS adds .ts-ready to body — then we enable scroll-triggered reveal */
.ts-ready .tech-premium-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}

.ts-ready .tech-premium-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.ts-ready .tech-premium-card.in-view:nth-child(1) { transition-delay: 0.05s; }
.ts-ready .tech-premium-card.in-view:nth-child(2) { transition-delay: 0.12s; }
.ts-ready .tech-premium-card.in-view:nth-child(3) { transition-delay: 0.19s; }
.ts-ready .tech-premium-card.in-view:nth-child(4) { transition-delay: 0.26s; }
.ts-ready .tech-premium-card.in-view:nth-child(5) { transition-delay: 0.33s; }
.ts-ready .tech-premium-card.in-view:nth-child(6) { transition-delay: 0.40s; }
.ts-ready .tech-premium-card.in-view:nth-child(7) { transition-delay: 0.47s; }
.ts-ready .tech-premium-card.in-view:nth-child(8) { transition-delay: 0.54s; }
.ts-ready .tech-premium-card.in-view:nth-child(9) { transition-delay: 0.61s; }

/* Spotlight CSS Mask Overlay */
.tech-premium-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(350px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(var(--brand-color-rgb), 0.1), transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    pointer-events: none;
}

/* Gradient Border pseudo-element */
.tech-premium-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.01) 40%, rgba(var(--brand-color-rgb), 0.3) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.tech-premium-card:hover::before {
    opacity: 1;
}

.tech-premium-card:hover::after {
    background: linear-gradient(135deg, rgba(var(--brand-color-rgb), 0.5) 0%, rgba(0, 0, 0, 0.03) 50%, rgba(var(--brand-color-rgb), 0.6) 100%);
}

@keyframes floatCard {
  0% { transform: translateY(-10px) scale(1.02); }
  50% { transform: translateY(-16px) scale(1.02); }
  100% { transform: translateY(-10px) scale(1.02); }
}

.tech-premium-card:hover {
    /* transform is handled by JS rAF loop — no transform here */
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.13), 
        0 0 40px rgba(var(--brand-color-rgb), 0.30);
    border-color: rgba(var(--brand-color-rgb), 0.3);
}

/* Glow Background */
.tech-card-glow-bg {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--brand-color-rgb), 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    top: -80px;
    right: -80px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -2;
    transition: all 0.6s ease;
}

.tech-premium-card:hover .tech-card-glow-bg {
    transform: scale(1.5);
}

/* Card Content Structure */
.tech-card-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    height: 100%;
}

.tech-logo-wrapper {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    transition: all 0.4s ease;
}

.tech-svg-logo {
    width: 32px;
    height: 32px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.tech-premium-card:hover .tech-logo-wrapper {
    background: rgba(var(--brand-color-rgb), 0.06);
    border-color: rgba(var(--brand-color-rgb), 0.3);
    box-shadow: 0 0 20px rgba(var(--brand-color-rgb), 0.15);
}

.tech-premium-card:hover .tech-svg-logo {
    transform: scale(1.12) translateY(-2px);
    filter: drop-shadow(0 4px 10px rgba(var(--brand-color-rgb), 0.35));
    animation: icon-float 3s infinite ease-in-out alternate;
}

@keyframes icon-float {
    0% { transform: scale(1.12) translateY(-2px); }
    100% { transform: scale(1.12) translateY(-7px); }
}

.tech-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tech-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tech-title {
    font-size: 24px;
    font-weight: 700;
    color: #030303;
    margin-bottom: 0;
    letter-spacing: -0.5px;
}

.tech-tag-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--brand-color);
    background: rgba(var(--brand-color-rgb), 0.07);
    border: 1px solid rgba(var(--brand-color-rgb), 0.15);
    padding: 3px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tech-desc {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 0;
}

/* SECTION 3: Why Choose Our Stack */
.why-stack-section {
    background-color: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.why-stack-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 45px 40px;
    height: 100%;
    transition: box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    will-change: transform;
}

/* Spotlight radial highlight (cursor-following) */
.why-stack-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(320px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 180, 0, 0.09), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
    pointer-events: none;
}

/* Gradient border ::after */
.why-stack-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.01) 40%, rgba(255,180,0,0.25) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.why-stack-card:hover::before {
    opacity: 1;
}

.why-stack-card:hover::after {
    background: linear-gradient(135deg, rgba(255,180,0,0.45) 0%, rgba(0,0,0,0.02) 50%, rgba(255,180,0,0.55) 100%);
}

/* Hover — transform is owned by JS tilt rAF loop */
.why-stack-card:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 180, 0, 0.28);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.09),
        0 0 35px rgba(255, 180, 0, 0.22);
}

.why-icon-wrap {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
    color: #FFB400;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.why-stack-card:hover .why-icon-wrap {
    background: rgba(255, 180, 0, 0.1);
    border-color: rgba(255, 180, 0, 0.3);
    box-shadow: 0 0 18px rgba(255, 180, 0, 0.2);
    transform: scale(1.08) translateY(-2px);
}

.why-stack-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: #030303;
    margin-bottom: 15px;
    letter-spacing: -0.4px;
    position: relative;
    z-index: 1;
}

.why-stack-card p {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* SECTION 4: CTA */
.tech-premium-cta {
    position: relative;
    background: radial-gradient(circle at 50% 0%, rgba(255, 180, 0, 0.05) 0%, rgba(255, 255, 255, 0) 65%), #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    text-align: center;
    overflow: hidden;
}

.tech-cta-title {
    font-size: clamp(32px, 5.5vw, 56px);
    font-weight: 800;
    letter-spacing: -1.5px;
    color: #030303;
    margin-bottom: 24px;
}

.tech-cta-desc {
    font-size: 18px;
    color: #475569;
    max-width: 600px;
    margin: 0 auto 45px auto;
    line-height: 1.6;
}

.tech-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #FFB400;
    color: #ffffff;
    font-weight: 700;
    padding: 18px 40px;
    border-radius: 9999px;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px -5px rgba(255, 180, 0, 0.4);
}

.tech-cta-btn svg {
    transition: transform 0.3s ease;
}

.tech-cta-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 40px -5px rgba(255, 180, 0, 0.6);
    background: #ffa800;
    color: #ffffff;
}

.tech-cta-btn:hover svg {
    transform: translateX(4px);
}

/* Custom Particle Canvas Background */
#tech-particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

/* Responsive adjustments */
@media (max-width: 1199px) {
    .tech-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .tech-section-title {
        font-size: 40px;
        letter-spacing: -1.5px;
    }
    .tech-showcase-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .tech-premium-card {
        padding: 28px 24px;
    }
    .why-stack-card {
        padding: 35px 30px;
    }

    /* On mobile, simplify transitions for better performance */
    .ts-ready .tech-premium-card {
        transition: opacity 0.5s ease, transform 0.5s ease;
    }
    .ts-ready .tech-premium-card.in-view:nth-child(n) {
        transition-delay: 0.05s !important;
    }
    .ts-ready .tech-premium-card.in-view:nth-child(2) { transition-delay: 0.10s !important; }
    .ts-ready .tech-premium-card.in-view:nth-child(3) { transition-delay: 0.15s !important; }
    .ts-ready .tech-premium-card.in-view:nth-child(4) { transition-delay: 0.20s !important; }
    .ts-ready .tech-premium-card.in-view:nth-child(5) { transition-delay: 0.25s !important; }
    .ts-ready .tech-premium-card.in-view:nth-child(6) { transition-delay: 0.30s !important; }
    .ts-ready .tech-premium-card.in-view:nth-child(7) { transition-delay: 0.35s !important; }
    .ts-ready .tech-premium-card.in-view:nth-child(8) { transition-delay: 0.40s !important; }
    .ts-ready .tech-premium-card.in-view:nth-child(9) { transition-delay: 0.45s !important; }
}

/* Why stack cards — same scroll-reveal approach */
.ts-ready .why-stack-card {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}

.ts-ready .why-stack-card.in-view {
    opacity: 1;
    transform: translateY(0);
}
