/* ===== CSS Variables (Modern Fluid) ===== */
:root {
    /* Color Palette - Slate & Indigo w/ Gradient Depth */
    --bg-main: #0f172a;
    --bg-deep: #020617;

    /* Gradients for Depth */
    --grad-surface: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.4) 100%);
    --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --grad-glow: radial-gradient(circle at top center, rgba(99, 102, 241, 0.15), transparent 70%);

    --primary: #6366f1;
    --primary-light: #818cf8;
    --accent: #14b8a6;

    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-light: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Soft Geometry */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Effects */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
    --backdrop: blur(12px);
    --transition: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: var(--grad-glow);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1100px;
    /* Slightly wider for fluid feel */
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: var(--backdrop);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    z-index: 1000;
    padding: 12px 32px;
    transition: all 0.4s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.brand-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

/* Tiny dot for active state */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: 0.3s;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center for fluid look */
    text-align: center;
    /* Center text */
    padding-top: 100px;
    position: relative;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    flex-wrap: wrap;
}

.hero-text {
    flex: 1;
    min-width: 400px;
    text-align: left;
}

.hero-image {
    flex: 0 0 350px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--primary);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.4);
    transition: all 0.4s ease;
}

.hero-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 80px rgba(99, 102, 241, 0.6);
}

/* Ambient Background Orb */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    animation: pulse 8s ease-in-out infinite alternate;
}

.hero-title {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    background: linear-gradient(to bottom, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: left;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
    text-align: left;
}

.hero-cta {
    display: flex;
    justify-content: flex-start;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.3s var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-main);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-light);
    color: var(--text-main);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
}

/* ===== What I Build Section ===== */
.what-i-build {
    background-image: var(--grad-glow);
}

.build-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.build-card {
    background: var(--grad-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.4s var(--transition);
    position: relative;
    overflow: hidden;
}

.build-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-hover);
    background: rgba(30, 41, 59, 0.9);
}

.build-card i {
    font-size: 2rem;
    color: var(--primary-light);
    margin-bottom: 16px;
    display: block;
}

.build-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.build-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== Interactive Cards (Shared) ===== */
.card-fluid {
    background: var(--grad-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.4s var(--transition);
    position: relative;
    overflow: hidden;
}

.card-fluid:hover {
    transform: translateY(-8px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-hover);
    background: rgba(30, 41, 59, 0.9);
}

/* ===== Sections ===== */
section {
    padding: var(--space-xl) 0;
}

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

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

/* ===== Experience (Pill layout) ===== */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.timeline-item {
    background: transparent;
    border-left: 2px solid var(--border-light);
    padding-left: 32px;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    border-left-color: var(--primary);
}

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--bg-main);
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

.timeline-item:hover .timeline-dot {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.role-title {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.company-name {
    font-size: 1.1rem;
    color: var(--primary-light);
    margin-bottom: 12px;
    display: block;
}

.role-date {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ===== Projects (Large Fluid Cards) ===== */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Full width cards stack */
    gap: 48px;
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 40px;
    height: auto;
    align-items: center;
}

/* Alternate layout */
.project-card:nth-child(even) {
    direction: rtl;
}

.project-card:nth-child(even) .project-content {
    direction: ltr;
}

.project-icon-large {
    font-size: 5rem;
    color: var(--primary);
    opacity: 0.8;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background-color: rgba(0, 0, 0, 0.2);
}

.project-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-title {
    font-size: 2rem;
    margin-bottom: 16px;
}

.project-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tech-badge {
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
}

.project-link-btn {
    align-self: flex-start;
    padding: 10px 24px;
    background: var(--text-main);
    color: var(--bg-main);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
}

.project-link-btn:hover {
    background: var(--text-secondary);
    transform: translateY(-2px);
}

/* ===== Skills (Floating Pills) ===== */
.skills-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.skill-pill {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.skill-pill:hover {
    border-color: var(--primary);
    color: var(--text-main);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15);
}

/* ===== Contact ===== */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-email {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 32px 0;
    display: block;
    transition: color 0.3s;
}

.contact-email:hover {
    color: var(--primary-light);
}

/* ===== Footer ===== */
.footer {
    padding: 64px 0 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-socials a {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.footer-socials a:hover {
    color: var(--text-main);
    transform: translateY(-3px);
}

/* ===== Flagship Project Card ===== */
.project-card.flagship {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--primary);
    padding: 48px;
    background: var(--grad-surface);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.project-card.flagship:nth-child(even) {
    direction: ltr;
}

.flagship-badge {
    display: inline-block;
    background: var(--grad-primary);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 24px;
    align-self: flex-start;
}

/* ===== Architecture Diagram ===== */
.architecture-diagram {
    padding: 24px;
    background: rgba(2, 6, 23, 0.4);
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.arch-flow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.arch-node {
    padding: 12px 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.arch-node.client {
    border-color: var(--text-muted);
}

.arch-node.api {
    border-color: var(--primary);
}

.arch-node.redis {
    border-color: #ef4444;
}

.arch-node.worker {
    border-color: var(--accent);
}

.arch-node.handler {
    border-color: var(--primary-light);
}

.arch-node.success {
    border-color: #22c55e;
}

.arch-node.retry {
    border-color: #f59e0b;
}

.arch-node.dlq {
    border-color: #ef4444;
}

.arch-node span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.arch-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
}

.arch-outcomes {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 16px;
}

.arch-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== Engineering Points ===== */
.engineering-points {
    margin: 16px 0;
    padding: 8px 0;
}

.engineering-points h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--primary-light);
}

.engineering-points ul {
    list-style: disc;
    padding-left: 20px;
    color: var(--text-secondary);
}

.engineering-points li {
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== Project Metrics ===== */
.project-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.metric-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* ===== Project Indicators ===== */
.project-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.indicator.testing i {
    color: var(--accent);
}

.indicator.reliability i {
    color: #f59e0b;
}

/* ===== Proof of Work (Hero) ===== */
.proof-of-work {
    list-style: none;
    padding: 0;
    margin-bottom: 32px;
}

.proof-of-work li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.proof-of-work li i {
    color: var(--accent);
    font-size: 0.9rem;
}

/* ===== System Thinking Section ===== */
.system-thinking {
    padding: var(--space-xl) 0;
}

.thinking-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.thinking-card {
    background: var(--grad-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.4s var(--transition);
    position: relative;
    overflow: hidden;
}

.thinking-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-hover);
    background: rgba(30, 41, 59, 0.9);
}

.thinking-card i {
    font-size: 2rem;
    color: var(--primary-light);
    margin-bottom: 16px;
    display: block;
}

.thinking-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.thinking-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Animations ===== */
@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.8;
    }
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        grid-template-columns: 1fr;
        padding: 24px;
        text-align: center;
    }

    .project-card.flagship {
        padding: 24px;
    }

    .project-card:nth-child(even) {
        direction: ltr;
    }

    .project-icon-large {
        margin-bottom: 24px;
        height: 200px;
    }

    .tech-stack {
        justify-content: center;
    }

    .project-link-btn {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .build-grid {
        grid-template-columns: 1fr;
    }

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

    .arch-flow {
        flex-direction: column;
    }

    .arch-outcomes {
        flex-direction: column;
        gap: 16px;
    }

    .proof-of-work li {
        font-size: 0.9rem;
    }

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

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 40px;
    }

    .hero-text {
        min-width: auto;
        text-align: center;
    }

    .hero-title {
        text-align: center;
    }

    .hero-subtitle {
        text-align: center;
    }

    .hero-cta {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-image {
        flex: 0 0 250px;
    }

    .hero-image img {
        width: 250px;
        height: 250px;
    }

    .navbar {
        width: 100%;
        border-radius: 0;
        top: 0;
        max-width: 100%;
        background: rgba(15, 23, 42, 0.95);
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-main);
        padding: 32px;
        flex-direction: column;
        align-items: center;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-menu.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }
}

@media (max-width: 320px) {
    .architecture-diagram {
        overflow-x: auto;
    }
}