:root {
    --bg-dark: #09090b;
    --card-bg: rgba(24, 24, 27, 0.4);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #8b5cf6;
    --secondary: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --aws-orange: #ff9900;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

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

/* Background Effects */
.bg-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1), transparent 30%);
    z-index: -2;
    pointer-events: none;
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

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

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: radial-gradient(var(--card-border) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    opacity: 0.2;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-btn:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px var(--primary);
}

/* Sections */
.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero */
.hero {
    text-align: center;
    padding: 8rem 2rem 4rem;
}

.hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero .highlight {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Data Flow Diagram */
.flow-container {
    position: relative;
    width: 100%;
    height: 700px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.flow-node {
    position: absolute;
    width: 120px;
    height: 120px;
    background: rgba(30, 30, 36, 0.8);
    border: 2px solid var(--card-border);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.flow-node:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.flow-node i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--aws-orange);
}

.flow-node span {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

/* Node Positions */
.node-client {
    top: 250px;
    left: 20px;
}

.node-api {
    top: 50px;
    left: 200px;
}

.node-lambda-pre {
    top: 50px;
    left: 380px;
}

.node-s3-raw {
    top: 250px;
    left: 380px;
}

.node-sns {
    top: 250px;
    left: 560px;
}

.node-sqs-resize {
    top: 100px;
    left: 740px;
}

.node-lambda-resize {
    top: 100px;
    left: 920px;
}

.node-sqs-mod {
    top: 400px;
    left: 740px;
}

.node-lambda-mod {
    top: 400px;
    left: 920px;
}

.node-rekognition {
    top: 550px;
    left: 920px;
}

.node-s3-final {
    top: 250px;
    left: 920px;
}

/* Lines */
.flow-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
    height: 2px;
    transform-origin: left center;
}

.packet {
    position: absolute;
    width: 10px;
    height: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #00ffcc;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ffcc, 0 0 20px #00ffcc;
}

/* Path 1: Client -> API */
.line-1 {
    top: 310px;
    left: 80px;
    width: 269px;
    transform: translateY(-50%) rotate(-48deg);
}

.packet-1 {
    animation: moveRight 3s linear infinite;
}

/* Path 2: API -> Lambda-pre */
.line-2 {
    top: 110px;
    left: 260px;
    width: 180px;
    transform: translateY(-50%) rotate(0deg);
}

.packet-2 {
    animation: moveRight 3s linear infinite 0.5s;
}

/* Path 3: Lambda-pre -> S3 Raw */
.line-3 {
    top: 110px;
    left: 440px;
    width: 200px;
    transform: translateY(-50%) rotate(90deg);
}

.packet-3 {
    animation: moveRight 3s linear infinite 1s;
}

/* Path 4: S3 Raw -> SNS */
.line-4 {
    top: 310px;
    left: 440px;
    width: 180px;
    transform: translateY(-50%) rotate(0deg);
}

.packet-4 {
    animation: moveRight 3s linear infinite 1.5s;
}

/* Path 5a: SNS -> SQS Resize */
.line-5a {
    top: 310px;
    left: 620px;
    width: 234px;
    transform: translateY(-50%) rotate(-39.8deg);
}

.packet-5a {
    animation: moveRight 3s linear infinite 2s;
    background: #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
}

/* Path 5b: SNS -> SQS Mod */
.line-5b {
    top: 310px;
    left: 620px;
    width: 234px;
    transform: translateY(-50%) rotate(39.8deg);
}

.packet-5b {
    animation: moveRight 3s linear infinite 2s;
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

/* Path 6a: SQS Resize -> Lambda Resize */
.line-6a {
    top: 160px;
    left: 800px;
    width: 180px;
    transform: translateY(-50%) rotate(0deg);
}

.packet-6a {
    animation: moveRight 3s linear infinite 2.5s;
    background: #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
}

/* Path 6b: SQS Mod -> Lambda Mod */
.line-6b {
    top: 460px;
    left: 800px;
    width: 180px;
    transform: translateY(-50%) rotate(0deg);
}

.packet-6b {
    animation: moveRight 3s linear infinite 2.5s;
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

/* Path 7b: Lambda Mod -> Rekognition */
.line-7b {
    top: 460px;
    left: 980px;
    width: 150px;
    transform: translateY(-50%) rotate(90deg);
}

.packet-7b {
    animation: moveRight 3s linear infinite 3s;
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

/* Path 8a: Lambda Resize -> S3 Final */
.line-8a {
    top: 160px;
    left: 980px;
    width: 150px;
    transform: translateY(-50%) rotate(90deg);
}

.packet-8a {
    animation: moveRight 3s linear infinite 3s;
    background: #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
}

/* Path 8b: Lambda Mod -> S3 Final */
.line-8b {
    top: 460px;
    left: 980px;
    width: 150px;
    transform: translateY(-50%) rotate(-90deg);
}

.packet-8b {
    animation: moveRight 3s linear infinite 3.5s;
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

@keyframes moveRight {
    0% {
        left: 0;
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Tech Stack Cards */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tech-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}

.tech-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(139, 92, 246, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

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

.tech-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--aws-orange);
    margin-bottom: 1.5rem;
}

.tech-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.tech-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Features List */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: 0.3s;
}

.feature-item:hover {
    border-color: var(--secondary);
    transform: translateX(10px);
}

.feature-icon {
    font-size: 2rem;
    color: var(--secondary);
    margin-right: 2rem;
    width: 50px;
    text-align: center;
}

.feature-text h4 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    font-family: 'Outfit', sans-serif;
}

.feature-text p {
    color: var(--text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    margin-top: 5rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .flow-container {
        display: none;
        /* Flow chart is complex, hide on small screens or make it vertical */
    }

    .flow-section::after {
        content: "Data flow animation is optimized for Desktop view.";
        display: block;
        text-align: center;
        color: var(--text-muted);
        padding: 2rem;
        background: var(--card-bg);
        border-radius: 10px;
    }
}

/* CI/CD Node Positions */
.node-dev { top: 250px; left: 20px; }
.node-github { top: 250px; left: 200px; }
.node-jenkins { top: 250px; left: 380px; }
.node-s3-fe { top: 100px; left: 560px; }
.node-terraform { top: 400px; left: 560px; }
.node-s3-state { top: 250px; left: 740px; }
.node-dynamodb { top: 550px; left: 740px; }
.node-aws { top: 400px; left: 920px; }

/* CI/CD Lines */
.cicd-line-1 { top: 310px; left: 80px; width: 180px; transform: translateY(-50%) rotate(0deg); }
.cicd-line-2 { top: 310px; left: 260px; width: 180px; transform: translateY(-50%) rotate(0deg); }
.cicd-line-3a { top: 310px; left: 440px; width: 234px; transform: translateY(-50%) rotate(-39.8deg); }
.cicd-line-3b { top: 310px; left: 440px; width: 234px; transform: translateY(-50%) rotate(39.8deg); }
.cicd-line-4a { top: 460px; left: 620px; width: 234px; transform: translateY(-50%) rotate(-39.8deg); }
.cicd-line-4b { top: 460px; left: 620px; width: 234px; transform: translateY(-50%) rotate(39.8deg); }
.cicd-line-5 { top: 460px; left: 620px; width: 360px; transform: translateY(-50%) rotate(0deg); }

/* CI/CD Animations */
.cicd-packet-1 { animation: moveRight 3s linear infinite; background: #00ffcc; box-shadow: 0 0 10px #00ffcc; }
.cicd-packet-2 { animation: moveRight 3s linear infinite 1s; background: #00ffcc; box-shadow: 0 0 10px #00ffcc; }
.cicd-packet-3a { animation: moveRight 3s linear infinite 2s; background: #E34F26; box-shadow: 0 0 10px #E34F26; }
.cicd-packet-3b { animation: moveRight 3s linear infinite 2s; background: #844FBA; box-shadow: 0 0 10px #844FBA; }
.cicd-packet-4a { animation: moveRight 2s linear infinite 3s; background: #4CAF50; box-shadow: 0 0 10px #4CAF50; }
.cicd-packet-4b { animation: moveRight 2s linear infinite 3s; background: #4CAF50; box-shadow: 0 0 10px #4CAF50; }
.cicd-packet-5 { animation: moveRight 3s linear infinite 4s; background: #FF9900; box-shadow: 0 0 10px #FF9900; }