/**
 * Arthur Rangel Portfolio - Modern & Bold Design
 * CSS with CSS Variables, Modern Layout, Premium Animations
 */

/* ========================================
   CSS RESET & ROOT VARIABLES
======================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors - Cyber Industrial (Light Mode) */
    /* Light Mode needs CONTRAST. Acid Lime on White is invisible. */
    /* Solution: Primary becomes Deep Carbon (Black), Lime is accent. */

    --color-primary: #111111;
    /* Industrial Black for Headers/Buttons */
    --color-primary-dark: #000000;

    --color-accent: #CCFF00;
    /* Acid Lime as highlight/accent */
    --color-accent-dark: #AACC00;

    --color-bg: #EAEAEA;
    /* Raw Concrete */
    --color-bg-secondary: #FFFFFF;
    --color-bg-tertiary: #F5F5F7;

    --color-text: #050505;
    --color-text-secondary: #444444;
    --color-text-muted: #666666;

    --color-border: rgba(0, 0, 0, 0.1);
    --color-shadow: rgba(0, 0, 0, 0.05);

    /* Gradient - Subtle Grey/Lime in Light Mode */
    --gradient-primary: linear-gradient(135deg, #111111, #333333);
    --gradient-glow: linear-gradient(135deg, rgba(17, 17, 17, 0.2), rgba(204, 255, 0, 0.1));

    /* Typography */
    --font-heading: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Z-Index */
    --z-cursor: 9999;
    --z-modal: 1000;
    --z-nav: 100;
    --z-float: 10;
}

/* Dark Theme */
/* Dark Theme (Default) */
/* Dark Theme (Default) */
[data-theme="dark"] {
    /* Revert to Acid Lime Primary for Dark Mode */
    --color-primary: #CCFF00;
    --color-primary-dark: #AACC00;

    --color-accent: #FFFFFF;

    --color-bg: #050505;
    /* Deep Carbon */
    --color-bg-secondary: #0A0A0A;
    /* Card Surface */
    --color-bg-tertiary: #141414;
    /* Hover Surface */

    --color-text: #EEEEEE;
    --color-text-secondary: #A0A0A0;
    /* Concrete Grey */
    --color-text-muted: #505050;

    --color-border: rgba(255, 255, 255, 0.05);
    /* Sharper, fainter borders */
    --color-shadow: rgba(0, 0, 0, 0.6);

    /* Gradient Override */
    --gradient-primary: linear-gradient(135deg, #CCFF00, #9EFF00);
    --gradient-glow: linear-gradient(135deg, rgba(204, 255, 0, 0.4), rgba(255, 255, 255, 0.1));
}



/* ========================================
   TEXTURE / NOISE (Phase 2)
======================================== */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.035;
    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");
    mix-blend-mode: overlay;
}

/* ========================================
   BASE STYLES
======================================== */

html {
    scroll-behavior: smooth;
    font-size: 16px;
    width: 100%;
    overflow-x: hidden;
    /* Critical Fix */
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    /* Double safety */
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-normal);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul,
ol {
    list-style: none;
}

.container {
    width: 100%;
    /* Fix centering calculations */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-4xl) 0;
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   CURSOR CUSTOMIZADO
======================================== */

.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    opacity: 0;
    transition: opacity 0.3s, transform 0.15s;
}

.cursor-outline {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    opacity: 0;
    transition: opacity 0.3s, transform 0.15s, width 0.2s, height 0.2s, border-color 0.2s;
}

.cursor-outline.hovering {
    width: 60px;
    height: 60px;
    border-color: var(--color-accent);
    background: rgba(0, 212, 240, 0.1);
}

body.cursor-active .cursor-dot,
body.cursor-active .cursor-outline {
    opacity: 1;
}

/* Hide default cursor when custom active */
body.cursor-active,
body.cursor-active * {
    cursor: none !important;
}

/* ========================================
   PARTICLES BACKGROUND
======================================== */

#particles-bg {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

/* ========================================
   SCROLL PROGRESS
======================================== */

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: calc(var(--z-nav) + 1);
    width: 0%;
    transition: width 0.1s linear;
}

/* ========================================
   NAVIGATION
======================================== */

#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav);
    padding: var(--space-md) 0;
    transition: var(--transition-normal);
}

#nav.scrolled {
    background: rgba(var(--color-bg), 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) 0;
}

[data-theme="dark"] #nav.scrolled {
    background: rgba(10, 10, 15, 0.9);
}

[data-theme="light"] #nav.scrolled {
    background: rgba(250, 251, 252, 0.9);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.nav-menu {
    display: flex;
    gap: var(--space-xl);
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    position: relative;
    padding: var(--space-sm) 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.theme-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    font-size: 1.2rem;
    transition: var(--transition-normal);
}

.theme-btn:hover {
    background: var(--gradient-primary);
    color: white;
    transform: rotate(15deg);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    padding: var(--space-sm);
}

.nav-toggle span {
    width: 100%;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition-normal);
}

/* Mobile Menu */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--space-xl);
        transition: var(--transition-smooth);
        box-shadow: -10px 0 30px var(--color-shadow);
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* ========================================
   BUTTONS
======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(129, 112, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(129, 112, 237, 0.4);
}

.btn-outline {
    border: 2px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(129, 112, 237, 0.05);
}

.btn-block {
    width: 100%;
}

.btn i {
    transition: var(--transition-normal);
}

.btn:hover i {
    transform: translateX(4px);
}

/* ========================================
   HERO SECTION
======================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Fix centering */
    position: relative;
    padding-top: 80px;
}

.hero-container {
    width: 100%;
    /* Ensure it takes full width */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--color-border);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #22C55E;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-title {
    margin-bottom: var(--space-lg);
}

.title-line {
    display: block;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.title-name {
    display: block;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.typed-text {
    color: var(--color-accent);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 480px;
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-wrapper {
    position: relative;
    width: 380px;
    height: 380px;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
    position: relative;
    z-index: 2;
}

.image-glow {
    position: absolute;
    inset: -20px;
    background: var(--gradient-glow);
    border-radius: var(--radius-xl);
    filter: blur(40px);
    opacity: 0.6;
    z-index: 1;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* Floating Cards */
.floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px var(--color-shadow);
    border: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 3;
    animation: float 6s ease-in-out infinite;
}

.floating-card i {
    font-size: 1.3rem;
    color: var(--color-primary);
}

.card-1 {
    top: 10%;
    left: -20%;
    animation-delay: 0s;
}

.card-2 {
    bottom: 20%;
    right: -15%;
    animation-delay: 2s;
}

.card-3 {
    bottom: 5%;
    left: 0;
    animation-delay: 4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--color-primary), transparent);
    animation: scrollLine 2s infinite;
}

@keyframes scrollLine {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    50.1% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* Hero Responsive */
@media (max-width: 968px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-description {
        margin: 0 auto var(--space-xl);
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .hero-image-wrapper {
        width: 100%;
        max-width: 280px;
        /* Responsive cap */
        height: auto;
        aspect-ratio: 1/1;
    }

    .floating-card {
        display: none;
    }
}

/* ========================================
   SECTION HEADERS
======================================== */

.section-header {
    margin-bottom: var(--space-3xl);
}

.section-header.center {
    text-align: center;
}

.section-tag {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: rgba(129, 112, 237, 0.1);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--space-md);
}

.section-desc {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 600px;
}

.section-header.center .section-desc {
    margin: 0 auto;
}

/* ========================================
   ABOUT SECTION
======================================== */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-3xl);
    align-items: center;
}

.about-image {
    position: relative;
}

.image-frame {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.image-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
}

.image-frame img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
}

.experience-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: 0 10px 40px rgba(129, 112, 237, 0.3);
}

.exp-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.exp-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

.about-intro {
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.about-text {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.8;
}

.skills-grid {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.skill-category h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.skill-category h4 i {
    color: var(--color-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.skill-tag {
    padding: var(--space-xs) var(--space-md);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    transition: var(--transition-normal);
}

.skill-tag:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* ========================================
   SERVICES SECTION
======================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.service-card {
    position: relative;
    padding: var(--space-xl);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: var(--transition-smooth);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px var(--color-shadow);
    border-color: var(--color-primary);
}

.service-card.featured {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.service-card.featured .service-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.service-card.featured h3,
.service-card.featured p,
.service-card.featured li {
    color: white;
}

.service-card.featured li i {
    color: rgba(255, 255, 255, 0.9);
}

.service-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(129, 112, 237, 0.1);
    color: var(--color-primary);
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
}

.service-card p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.service-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.service-features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.service-features li i {
    color: var(--color-accent);
}

/* ========================================
   PROJECTS SECTION
======================================== */

.projects-filter {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.filter-btn {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    transition: var(--transition-normal);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.projects-grid {
    display: grid;
    /* FIX: Ultrasafe min-width for narrow phones */
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.project-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px var(--color-shadow);
}

.project-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: var(--space-lg);
    opacity: 0;
    transition: var(--transition-normal);
}

.project-card {
    will-change: transform;
    /* Performance optimization */
    transform: translateZ(0);
    /* Hardware acceleration */
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.view-project {
    padding: var(--space-sm) var(--space-lg);
    background: white;
    color: var(--color-text);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.project-info {
    padding: var(--space-lg);
}

.project-category {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(129, 112, 237, 0.1);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.project-info h3 {
    font-size: 1.15rem;
    margin-bottom: var(--space-sm);
}

.project-info p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.project-metrics {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.project-metrics span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 500;
}

/* Project Tech Tags */
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.project-tech span {
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: var(--transition-normal);
}

.project-card:hover .project-tech span {
    background: rgba(129, 112, 237, 0.1);
    color: var(--color-primary);
}

/* Project Badge */
.project-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0, 0, 0, 0.85);
    /* Darker solid bg instead of blur */
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

/* Featured Project */
.project-card.featured {
    border: 2px solid var(--color-primary);
}

.project-card.featured::after {
    content: '⭐ Destaque';
    position: absolute;
    top: -12px;
    right: var(--space-lg);
    padding: var(--space-xs) var(--space-sm);
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 3;
    pointer-events: none;
    /* Prevent interference */
    box-shadow: 0 4px 10px rgba(129, 112, 237, 0.4);
}

/* Project overlay link */
.project-overlay a.view-project {
    text-decoration: none;
    color: var(--color-text);
}

/* ========================================
   TESTIMONIALS SECTION
======================================== */

.testimonials-grid {
    display: grid;
    /* FIX: Ultrasafe min-width */
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.testimonial-card {
    padding: var(--space-xl);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: var(--transition-smooth);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px var(--color-shadow);
}

.testimonial-content {
    margin-bottom: var(--space-lg);
}

.quote-icon {
    font-size: 2rem;
    color: var(--color-primary);
    opacity: 0.3;
    margin-bottom: var(--space-md);
}

.testimonial-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.author-avatar {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    border-radius: var(--radius-full);
}

.author-info strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

.author-info span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.testimonial-rating {
    display: flex;
    gap: 2px;
}

.testimonial-rating i {
    color: #FFC107;
    font-size: 0.9rem;
}

/* ========================================
   EDUCATION SECTION
======================================== */

.education-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.education-card {
    padding: var(--space-xl);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
    transition: var(--transition-smooth);
}

.education-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px var(--color-shadow);
    border-color: var(--color-primary);
}

.education-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 1.8rem;
}

.education-content h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.education-content .institution {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.education-content .period {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-right: var(--space-sm);
}

.status-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.certifications-list {
    padding: var(--space-xl);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.certifications-list h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

.certifications-list h4 i {
    color: var(--color-primary);
}

.cert-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.cert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.cert-item:hover {
    background: rgba(129, 112, 237, 0.1);
    transform: translateX(5px);
}

.cert-name {
    font-weight: 500;
    color: var(--color-text);
}

.cert-year {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .education-grid {
        grid-template-columns: 1fr;
    }

    .education-card {
        flex-direction: column;
        text-align: center;
    }

    .education-icon {
        margin: 0 auto;
    }
}

/* ========================================
   CONTACT SECTION
======================================== */

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-3xl);
    align-items: start;
}

.contact-info {
    position: sticky;
    top: 100px;
}

.contact-info p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.contact-method {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    transition: var(--transition-normal);
}

.contact-method:hover {
    background: var(--gradient-primary);
    transform: translateX(8px);
}

.contact-method:hover .method-icon,
.contact-method:hover .method-info {
    color: white;
}

.method-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    color: var(--color-primary);
    transition: var(--transition-normal);
}

.contact-method:hover .method-icon {
    background: rgba(255, 255, 255, 0.2);
}

.method-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.method-value {
    font-weight: 600;
    color: var(--color-text);
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-links a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    transition: var(--transition-normal);
}

.social-links a:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-3px);
}

/* Contact Form */
.contact-form {
    padding: var(--space-xl);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    transition: var(--transition-normal);
}

/* Select com seta customizada */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888A0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--color-text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(129, 112, 237, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
}

/* Textarea fica com border-radius menor para manter proporção visual */
.form-group textarea {
    border-radius: var(--radius-lg);
    resize: vertical;
    min-height: 120px;
}

/* ========================================
   CUSTOM SELECT DROPDOWN
======================================== */

.custom-select {
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition-normal);
}

.custom-select-trigger:hover {
    border-color: var(--color-text-muted);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(129, 112, 237, 0.15);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-trigger i {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    transition: var(--transition-normal);
}

.custom-select.open .custom-select-trigger i {
    transform: rotate(180deg);
}

.selected-text {
    color: var(--color-text);
}

.custom-select-trigger:has(.selected-text:empty) .selected-text,
.selected-text[data-placeholder="true"] {
    color: var(--color-text-muted);
}

/* Dropdown Options */
.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-primary);
    border-top: none;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 50;
    box-shadow: 0 10px 40px var(--color-shadow);
}

.custom-select.open .custom-select-options {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
}

.custom-select-options li {
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--color-text);
}

.custom-select-options li:hover {
    background: rgba(129, 112, 237, 0.1);
    color: var(--color-primary);
}

.custom-select-options li.selected {
    background: var(--gradient-primary);
    color: white;
}

.custom-select-options li:last-child {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .contact-info {
        position: static;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   FOOTER
======================================== */

.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-3xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.footer-brand p {
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: var(--space-lg);
}

.footer-links a {
    display: block;
    color: var(--color-text-secondary);
    padding: var(--space-xs) 0;
    transition: var(--transition-normal);
}

.footer-links a:hover {
    color: var(--color-primary);
    transform: translateX(5px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
}

.footer-bottom p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    gap: var(--space-md);
}

.footer-social a {
    color: var(--color-text-secondary);
    font-size: 1.2rem;
    transition: var(--transition-normal);
}

.footer-social a:hover {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        max-width: none;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
    }
}

/* ========================================
   MODAL
======================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    position: relative;
    transform: scale(0.9);
    transition: var(--transition-smooth);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
}

.modal-close:hover {
    background: var(--color-primary);
    color: white;
}

.modal-image {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

/* ========================================
   POPUP
======================================== */

.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.popup-box {
    background: var(--color-bg-secondary);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    text-align: center;
    max-width: 400px;
}

.popup-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.popup-icon.success {
    color: #22C55E;
}

.popup-box h3 {
    margin-bottom: var(--space-md);
}

.popup-box p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

/* ========================================
   ANIMATIONS (Reduced Motion Support)
======================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   GLOBAL MOBILE FIXES (Small Phones)
======================================== */
@media (max-width: 480px) {
    :root {
        /* Shrink Spacing for Mobile */
        --space-lg: 20px;
        --space-xl: 32px;
        --space-2xl: 40px;
        --space-3xl: 48px;
        --space-4xl: 60px;
    }

    .container {
        padding: 0 var(--space-md);
        /* Smaller side padding */
    }

    h1,
    .hero-title .title-name {
        font-size: 2.5rem;
        /* Cap huge fonts */
    }

    .section-title {
        font-size: 2rem;
    }

    .nav-logo {
        font-size: 1.2rem;
    }
}

/* ========================================
   CRITICAL MOBILE BREAKPOINT (< 550px)
   Matches user report "500px" issue
======================================== */
@media (max-width: 550px) {
    .hero-container {
        display: flex;
        flex-direction: column;
        text-align: center;
        width: 100%;
        padding: 0 var(--space-lg);
    }

    .hero-visual {
        order: -1;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: var(--space-xl);
    }

    .hero-image-wrapper {
        width: 100%;
        max-width: 280px;
        /* Safer for iPhone SE (320px broke layout) */
        margin: 0 auto;
    }

    .hero-content {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
        gap: var(--space-md);
    }

    .btn {
        width: 100%;
        /* Full width buttons for easy touch */
        justify-content: center;
    }

    .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-lg);
    }
}

/* ========================================
   UI/UX ENHANCEMENTS - Premium Details
======================================== */

/* Botão de loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading span {
    opacity: 0;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hover glow nos cards */
.service-card::before,
.project-card::before,
.testimonial-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(129, 112, 237, 0.06),
            transparent 40%);
    pointer-events: none;
}

.service-card:hover::before,
.project-card:hover::before,
.testimonial-card:hover::before {
    opacity: 1;
}

/* Link underline animation */
.footer-links a {
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width 0.3s;
}

.footer-links a:hover::after {
    width: 100%;
}

/* Form label float animation */
.form-group {
    position: relative;
}

.form-group label {
    transition: var(--transition-normal);
}

/* Selection color */
::selection {
    background: rgba(129, 112, 237, 0.3);
    color: var(--color-text);
}

/* Scrollbar custom */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
    border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Focus visible outline para acessibilidade */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

/* Smooth image loading */
img {
    background: var(--color-bg-tertiary);
}

/* Active state para botões mobile */
@media (hover: none) {
    .btn:active {
        transform: scale(0.98);
    }

    .nav-link:active,
    .filter-btn:active {
        opacity: 0.8;
    }
}

/* Typed cursor color */
.typed-cursor {
    color: var(--color-accent);
}

/* Pulse animation para badges */
.hero-badge .badge-dot,
.logo-dot {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Tooltip simples para ícones sociais */
.social-links a,
.footer-social a {
    position: relative;
}

/* Glassmorphism para nav scrolled */
[data-theme="dark"] #nav.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="light"] #nav.scrolled {
    background: rgba(250, 251, 252, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========================================
   BACK TO TOP BUTTON
======================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition-normal);
    box-shadow: 0 4px 20px rgba(129, 112, 237, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(129, 112, 237, 0.5);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* ========================================
   PAGE LOADER
======================================== */

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========================================
   SKELETON LOADING
======================================== */

.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg-tertiary) 25%,
            var(--color-bg-secondary) 50%,
            var(--color-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-image {
    aspect-ratio: 16/10;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   CURSOR TEXT ON PROJECT CARDS
======================================== */

.project-card .view-project {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transform: translateY(10px);
    transition: var(--transition-normal);
}

.project-card:hover .view-project {
    transform: translateY(0);
}

.project-card .view-project::before {
    content: '👁️';
    font-size: 0.9rem;
}

/* Cursor expand on cards */
body.cursor-active .project-card:hover~.cursor-outline,
body.cursor-active .service-card:hover~.cursor-outline {
    transform: scale(1.5);
}

/* ========================================
   PAGE TRANSITIONS
======================================== */

.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s, transform 0.4s;
}

/* Seções aparecem gradualmente */
.section {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.section:nth-child(1) {
    animation-delay: 0s;
}

.section:nth-child(2) {
    animation-delay: 0.1s;
}

.section:nth-child(3) {
    animation-delay: 0.2s;
}

.section:nth-child(4) {
    animation-delay: 0.3s;
}

.section:nth-child(5) {
    animation-delay: 0.4s;
}

.section:nth-child(6) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   INTERACTIVE ENHANCEMENTS
======================================== */

/* Magnetic hover effect preparação */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Subtle bounce on hero image */
.hero-image-wrapper {
    animation: subtleBounce 3s ease-in-out infinite;
}

@keyframes subtleBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Stats counter glow */
.stat-number.counted {
    animation: countGlow 0.5s ease-out;
}

@keyframes countGlow {
    0% {
        text-shadow: 0 0 20px rgba(129, 112, 237, 0.8);
    }

    100% {
        text-shadow: none;
    }
}

/* Hover scale on skill tags */
.skill-tag {
    cursor: default;
}

/* Project card image zoom */
.project-card:hover .project-image img {
    transform: scale(1.05);
}

/* ========================================
   PROJECT DETAILS MODAL (Premium Redesign)
   ======================================== */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    /* Wider for better split */
    height: 85vh;
    /* Fixed height for consistency */
    background: #121212;
    /* Darker premium bg */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.95) translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2001;
}

.modal-body {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}

.project-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    z-index: 100;
    font-size: 1.5rem;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.modal-close:hover {
    background: var(--color-primary);
    transform: rotate(90deg);
    border-color: var(--color-primary);
}

/* Image Side (Left) */
.modal-image-wrapper {
    width: 55%;
    /* More space for image */
    height: 100%;
    position: relative;
    background: #000;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Crucial for aspect ratio */
    opacity: 0.9;
}

.modal-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 80%, #121212 100%);
    pointer-events: none;
}

.modal-category-badge {
    position: absolute;
    top: 25px;
    left: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    color: #fff;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Content Side (Right) */
.modal-info {
    width: 45%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Scroll only text side */
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    background: linear-gradient(90deg, #fff, #aaa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.modal-tags span {
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #bbb;
    margin-bottom: 40px;
    flex-grow: 1;
    /* Pushes content down */
}

.modal-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spec-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    font-weight: 600;
}

.spec-value {
    font-size: 0.95rem;
    color: #e0e0e0;
    font-family: 'Fira Code', monospace;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: auto;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .modal-content {
        height: 90vh;
        width: 95%;
    }

    .modal-body {
        flex-direction: column;
    }

    .modal-image-wrapper {
        width: 100%;
        height: 250px;
        flex-shrink: 0;
    }

    .modal-image::after {
        background: linear-gradient(to bottom, transparent 80%, #121212 100%);
    }

    .modal-info {
        width: 100%;
        padding: 25px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }
}

/* Light Mode Overrides */
[data-theme="light"] .modal-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .modal-image-wrapper {
    background: #f0f0f0;
}

[data-theme="light"] .modal-image::after {
    background: linear-gradient(to right, transparent 80%, #ffffff 100%);
}

[data-theme="light"] .modal-title {
    background: linear-gradient(90deg, #333, #666);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .modal-description {
    color: #555;
}

[data-theme="light"] .spec-label {
    color: #888;
}

[data-theme="light"] .spec-value {
    color: #333;
}

[data-theme="light"] .modal-tags span {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
}

[data-theme="light"] .modal-close {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    border-color: #ddd;
}

/* Old styles to remove/override */
.modal-image-wrapper {
    /* ensure no conflicting styles */
    position: relative;
}



.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: var(--space-sm);
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
}

.modal-tag {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: rgba(129, 112, 237, 0.1);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 500;
}

.modal-description {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
    font-size: 0.95rem;
}

.modal-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.spec-value {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.9rem;
}

.modal-actions {
    margin-top: auto;
    display: flex;
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
        max-height: 85vh;
    }

    .modal-image-wrapper {
        height: 250px;
        min-height: auto;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-specs {
        grid-template-columns: 1fr;
    }
}

.project-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            transparent 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover .project-image::after {
    opacity: 1;
}

/* Contact method icons pulse on hover */
.contact-method:hover .method-icon {
    animation: iconPulse 0.3s ease-out;
}

@keyframes iconPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Form field animations */
.form-group input:not(:placeholder-shown),
.form-group textarea:not(:placeholder-shown) {
    background: var(--color-bg-secondary);
}

/* Service card icon rotate on hover */
.service-card:hover .service-icon {
    animation: iconRotate 0.4s ease-out;
}

@keyframes iconRotate {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* ========================================
   DATA INFRASTRUCTURE SECTION
======================================== */
.data-section {
    position: relative;
    overflow: hidden;
    padding: var(--space-xl) 0;
}

.data-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-xl);
    align-items: center;
}

@media (max-width: 968px) {
    .data-wrapper {
        grid-template-columns: 1fr;
    }
}

.data-terminal {
    background: #1e1e1e;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Fira Code', 'Courier New', monospace;
}

.terminal-header {
    background: #2d2d2d;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.terminal-title {
    color: #999;
    font-size: 0.8rem;
    font-weight: 500;
}

.terminal-body {
    padding: 20px;
    color: #d4d4d4;
    font-size: 0.9rem;
    height: 320px;
    overflow-y: auto;
}

.code-line {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.prompt {
    color: var(--color-primary);
    font-weight: bold;
}

.cmd {
    color: #569cd6;
}

.str {
    color: #ce9178;
}

.flag {
    color: #9cdcfe;
}

.code-output {
    margin-bottom: 20px;
    padding-left: 20px;
    color: #b5cea8;
    opacity: 0.9;
}

.terminal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 8px;
}

.terminal-table th {
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    color: #569cd6;
}

.terminal-table td {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-table .success {
    color: #4ec9b0;
}

.terminal-table .warning {
    color: #dcdcaa;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #d4d4d4;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ========================================
   INTERFACE ENGINEERING SECTION
   ======================================== */
.interface-section {
    padding: var(--space-xl) 0;
    overflow: hidden;
}

.interface-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-xl);
    align-items: center;
}

@media (max-width: 968px) {
    .interface-wrapper {
        grid-template-columns: 1fr;
    }
}

.interface-content .skill-tags-cloud {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.skill-tag {
    background: var(--color-bg-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.interface-card {
    background: #1e1e1e;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    font-family: 'Fira Code', monospace;
}

.card-header-browser {
    background: #2d2d2d;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.browser-dots {
    display: flex;
    gap: 6px;
    margin-right: 16px;
}

.browser-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #555;
}

.browser-dots span:nth-child(1) {
    background: #ff5f56;
}

.browser-dots span:nth-child(2) {
    background: #ffbd2e;
}

.browser-dots span:nth-child(3) {
    background: #27c93f;
}

.browser-address {
    background: #1e1e1e;
    color: #888;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    flex: 1;
    text-align: center;
}

.card-body-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 300px;
}

.code-pane {
    padding: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #d4d4d4;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.code-row {
    line-height: 1.6;
    white-space: nowrap;
}

.indent-1 {
    padding-left: 15px;
}

.indent-2 {
    padding-left: 30px;
}

.indent-3 {
    padding-left: 45px;
}

/* Syntax Highlighting */
.c-pink {
    color: #c586c0;
}

.c-blue {
    color: #569cd6;
}

.c-cyan {
    color: #4ec9b0;
}

.c-orange {
    color: #ce9178;
}

.c-green {
    color: #b5cea8;
}

.c-purple {
    color: #dcdcaa;
}

.preview-pane {
    background: #ffffff;
    /* Always light for preview */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-image: radial-gradient(#ddd 1px, transparent 1px);
    background-size: 20px 20px;
}

.demo-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
    animation: btnBreath 3s infinite;
    transform: scale(1);
}

@keyframes btnBreath {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.cursor-demo {
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="black"><path d="M7 2l12 11.2-5.8.5 3.3 7.3-2.2.9-3.2-7.4-4.4 4V2z"/></svg>') no-repeat;
    position: absolute;
    top: 70%;
    left: 70%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: moveCursor 3s infinite;
}

@keyframes moveCursor {
    0% {
        top: 70%;
        left: 70%;
        transform: scale(1);
    }

    40% {
        top: 50%;
        left: 50%;
        transform: scale(1);
    }

    /* Hover */
    50% {
        transform: scale(0.8);
    }

    /* Click */
    60% {
        transform: scale(1);
    }

    100% {
        top: 70%;
        left: 70%;
    }
}

/* Light Mode Overrides for Interface Section */
[data-theme="light"] .interface-card {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .card-header-browser {
    background: #e9ecef;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .browser-address {
    background: #fff;
    color: #666;
}

[data-theme="light"] .code-pane {
    background: #fff;
    /* Code on light? Or keep dark? */
    border-right-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Re-style code for light mode if needed, effectively simpler to keep code dark but let's try light code blocks */
[data-theme="light"] .c-pink {
    color: #af00db;
}

[data-theme="light"] .c-blue {
    color: #0000ff;
}

[data-theme="light"] .c-cyan {
    color: #008080;
}

[data-theme="light"] .c-orange {
    color: #a31515;
}

[data-theme="light"] .c-green {
    color: #098658;
}

[data-theme="light"] .preview-pane {
    background: #f0f0f0;
}

/* ========================================
   AUTOMATION WORKFLOW SECTION
   ======================================== */
.automation-section {
    padding: var(--space-xl) 0;
    position: relative;
}

.automation-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

@media (max-width: 968px) {
    .automation-wrapper {
        grid-template-columns: 1fr;
    }

    .automation-wrapper .automation-visual {
        order: -1;
    }
}

.workflow-canvas {
    background: #1e1e1e;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 380px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.canvas-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
    background-size: 20px 20px;
}

.nodes-container {
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 2;
    padding: 20px;
}

.workflow-node {
    background: #2d2d2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.workflow-node:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.node-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #999;
    font-weight: 500;
}

.node-header i {
    font-size: 1.1rem;
    color: var(--color-primary);
}

.node-body {
    font-size: 0.85rem;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.node-port {
    width: 10px;
    height: 10px;
    background: #444;
    border-radius: 50%;
    position: absolute;
    border: 2px solid #2d2d2d;
}

.node-port.output {
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
}

.node-port.input {
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    background: #666;
}

/* Connectors */
.workflow-connector {
    width: 60px;
    height: 2px;
    background: #444;
    position: relative;
}

.connector-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 20px;
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
    animation: flowLine 2s infinite linear;
    border-radius: 2px;
}

.delay-1 {
    animation-delay: 1s;
}

@keyframes flowLine {
    0% {
        left: 0;
        width: 0;
        opacity: 1;
    }

    20% {
        width: 20px;
    }

    80% {
        left: 100%;
        width: 0;
        opacity: 0;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Logic Node Pulse */
.workflow-node.logic {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.1);
}

.active-pulse::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 16px;
    border: 1px solid var(--color-primary);
    opacity: 0;
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

.workflow-status {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #4ec9b0;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ec9b0;
}

/* Tech Stack Mini */
.tech-stack-mini {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    transition: transform 0.2s;
}

.tech-item:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    color: var(--color-text);
}

/* UI List specific tweaks */
.ui-list li {
    margin-bottom: 8px;
}

/* Light Mode Overrides for Automation Section */
[data-theme="light"] .workflow-canvas {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .canvas-grid {
    background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.05) 1px, transparent 0);
}

[data-theme="light"] .workflow-node {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .node-body {
    color: #333;
}

[data-theme="light"] .node-header {
    color: #666;
}

[data-theme="light"] .workflow-connector {
    background: #e0e0e0;
}

[data-theme="light"] .node-port.input {
    background: #ccc;
    border-color: #fff;
}

[data-theme="light"] .node-port.output {
    border-color: #fff;
}

[data-theme="light"] .active-pulse::after {
    border-color: var(--color-primary);
}

[data-theme="light"] .workflow-status {
    background: rgba(255, 255, 255, 0.8);
    color: #666;
    border-color: rgba(0, 0, 0, 0.05);
}

/* ========================================
   ARCHITECTURE SECTION (DevOps)
   ======================================== */
.architecture-section {
    padding: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.architecture-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-xl);
    align-items: center;
}

@media (max-width: 968px) {
    .architecture-wrapper {
        grid-template-columns: 1fr;
    }
}

.architecture-visual {
    position: relative;
}

.system-monitor {
    background: #0a0e17;
    border: 1px solid #1f293a;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 30px rgba(0, 212, 240, 0.1);
    padding: 20px;
    font-family: 'Fira Code', monospace;
    position: relative;
}

/* Sci-fi scanner line */
.system-monitor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 212, 240, 0.5);
    box-shadow: 0 0 10px rgba(0, 212, 240, 0.8);
    animation: scanLine 4s linear infinite;
    opacity: 0.3;
}

@keyframes scanLine {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f293a;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.monitor-title {
    color: #00d4f0;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.monitor-status {
    font-size: 0.75rem;
    color: #27c93f;
    animation: blinkText 2s infinite;
}

@keyframes blinkText {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.monitor-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.monitor-node {
    background: rgba(31, 41, 58, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.3s;
}

.monitor-node:hover {
    background: rgba(31, 41, 58, 0.8);
    border-color: rgba(0, 212, 240, 0.3);
}

.node-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 212, 240, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d4f0;
    font-size: 1.2rem;
}

.node-info {
    flex: 1;
}

.node-name {
    display: block;
    font-size: 0.85rem;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.node-metric {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 6px;
}

.metric-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #00d4f0;
    border-radius: 2px;
    position: relative;
}

/* Animate bar width slightly */
.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27c93f;
    box-shadow: 0 0 5px #27c93f;
    animation: blink 2s infinite;
    /* Defined previously */
}

.monitor-footer {
    margin-top: 20px;
    border-top: 1px solid #1f293a;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
}

.monitor-footer span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Light Mode Overrides for Architecture */
[data-theme="light"] .system-monitor {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .system-monitor::before {
    display: none;
    /* Hide scanline in light mode */
}

[data-theme="light"] .monitor-header,
[data-theme="light"] .monitor-footer {
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .monitor-node {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .monitor-node:hover {
    border-color: var(--color-primary);
}

[data-theme="light"] .node-name {
    color: #333;
}

[data-theme="light"] .node-icon {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
}

[data-theme="light"] .bar-fill {
    background: var(--color-primary);
}

/* ========================================
   ANALYTICS & BI SECTION
   ======================================== */
.analytics-section {
    padding: var(--space-xl) 0;
    overflow: hidden;
}

.analytics-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

@media (max-width: 968px) {
    .analytics-wrapper {
        grid-template-columns: 1fr;
    }

    .analytics-visual {
        order: -1;
    }
}

.dashboard-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Light border */
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: #333;
    position: relative;
    padding: 24px;
}

/* Dark mode specific for dashboard - keeping it light/clean usually looks best for BI, 
   but let's adapt to dark mode to match site */
[data-theme="dark"] .dashboard-card {
    background: #1e1e1e;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.dash-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.dash-subtitle {
    display: block;
    font-size: 0.85rem;
    color: #888;
}

.dash-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-badge {
    background: rgba(39, 201, 63, 0.1);
    color: #27c93f;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.chart-area {
    height: 180px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
}

.bar-chart {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.chart-bar {
    flex: 1;
    background: #e0e0e0;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 1s ease-out, background 0.3s;
    cursor: pointer;
}

[data-theme="dark"] .chart-bar {
    background: #333;
}

.chart-bar.active,
.chart-bar:hover {
    background: var(--color-primary);
}

.chart-bar span {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #888;
}

.tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

[data-theme="dark"] .tooltip {
    background: #fff;
    color: #000;
}

.chart-bar:hover .tooltip,
.chart-bar.active .tooltip {
    opacity: 1;
    top: -35px;
}

.kpi-row {
    display: flex;
    gap: 16px;
}

.kpi-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.03);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .kpi-card {
    background: rgba(255, 255, 255, 0.05);
}

.kpi-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.kpi-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.positive {
    color: #27c93f;
}

.kpi-trend.negative {
    color: #ff5f56;
}

/* ========================================
   CHATBOT SECTION
   ======================================== */
.chatbot-section {
    padding: var(--space-xl) 0;
}

.chatbot-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-xl);
    align-items: center;
}

@media (max-width: 968px) {
    .chatbot-wrapper {
        grid-template-columns: 1fr;
    }
}

.chat-phone {
    width: 300px;
    height: 500px;
    background: #000;
    border-radius: 40px;
    border: 10px solid #1a1a1a;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 25px;
    background: #1a1a1a;
    border-radius: 0 0 15px 15px;
    z-index: 10;
}

.chat-screen {
    width: 100%;
    height: 100%;
    background: #121212;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 40px 20px 15px;
    background: #1f1f1f;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-header .avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #27c93f;
}

.chat-info {
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.chat-status {
    font-size: 0.7rem;
    color: #27c93f;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.received {
    background: #2d2d2d;
    align-self: flex-start;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.sent {
    background: var(--color-primary);
    align-self: flex-end;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 15px;
    background: #1f1f1f;
    display: flex;
    gap: 10px;
    align-items: center;
}

.fake-input {
    flex: 1;
    height: 36px;
    background: #121212;
    border-radius: 18px;
}

.send-btn {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    margin: 0 1px;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delayed-msg {
    animation-delay: 1.5s;
}

/* Light Mode Overrides for Chatbot */
[data-theme="light"] .chat-phone {
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .phone-notch {
    background: #ddd;
}

[data-theme="light"] .chat-screen {
    background: #f5f5f5;
}

[data-theme="light"] .chat-header,
[data-theme="light"] .chat-input-area {
    background: #fff;
    border-color: #eee;
}

[data-theme="light"] .fake-input {
    background: #f0f0f0;
}

[data-theme="light"] .chat-name {
    color: #333;
}

[data-theme="light"] .received {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}