:root {
    /* Colors */
    --bg-color: #0B0D10;
    --surface-color: #11151A;
    --surface-elevated: #171C22;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --primary-color: #00D1FF; /* Modern Cyan/Blue */
    --primary-glow: rgba(0, 209, 255, 0.3);
    
    --text-primary: #F5F7FA;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    /* System */
    --max-width: 1280px;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    /* Spacing */
    --section-padding: 8rem;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Subtile Background Elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 209, 255, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(0, 209, 255, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1, .h1 { 
    font-size: clamp(2.5rem, 8vw, 5rem); 
    margin-bottom: 2rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: false;
}

h2, .h2 { 
    font-size: clamp(2rem, 5vw, 3rem); 
    margin-bottom: 3rem;
}

h3, .h3 { 
    font-size: 1.75rem; 
    margin-bottom: 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, #FFF 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-base);
    border: 1px solid transparent;
    gap: 0.75rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #000;
}

.btn-primary:hover {
    background-color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 209, 255, 0.05);
}

.btn-primary:disabled {
    background-color: var(--surface-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled:hover {
    background-color: var(--surface-elevated);
    transform: none;
    box-shadow: none;
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-base);
    padding: 1.5rem 0;
    overflow-x: clip;
}

.header.scrolled {
    background: rgba(11, 13, 16, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.footer-logo {
    margin-bottom: 1.5rem;
    display: inline-flex;
}

.footer-logo .logo-img {
    height: 50px;
}

.nav-list {
    display: flex;
    list-style: none;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link-whatsapp {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.whatsapp-icon {
    width: 1.1rem;
    height: 1.1rem;
    transition: transform var(--transition-fast);
}

.nav-link-whatsapp:hover .whatsapp-icon {
    transform: scale(1.1);
}

.nav-cta {
    margin-left: 1rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.nav-toggle span {
    width: 28px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-base);
}

/* Hero Section */
.hero {
    position: relative;
    padding-top: 12rem;
    padding-bottom: 8rem;
    overflow: hidden;
}

.hero-visual {
    position: absolute;
    top: 50%;
    right: -10%;
    transform: translateY(-50%);
    width: 50%;
    height: 80%;
    z-index: -1;
    opacity: 0.4;
    background-image: 
        radial-gradient(circle at center, var(--primary-glow) 0%, transparent 70%),
        linear-gradient(rgba(0, 209, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 209, 255, 0.1) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    mask-image: radial-gradient(circle at center, black, transparent);
    pointer-events: none;
    max-width: 100%;
}

.hero-content {
    max-width: 800px;
}

.hero-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.hero-logo-display {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo-display img {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 0 30px var(--primary-glow));
}

.hero .intro {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
}

/* Sections */
section {
    padding: var(--section-padding) 0;
}

.section-header {
    max-width: 700px;
    margin-bottom: 4rem;
}

.section-label {
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: block;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 2rem;
}

.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px -20px var(--primary-glow);
}

.card:hover h3 {
    color: var(--primary-color);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--surface-elevated);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.card-price {
    margin-top: auto;
    padding-top: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Portfolio editorial layout */
.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-card {
    grid-column: span 6;
}

.project-card.featured {
    grid-column: span 12;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.project-visual {
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    aspect-ratio: 16/9;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-base);
}

.project-card:hover .project-visual img {
    transform: scale(1.05);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 20px;
}

.project-visual-fullwidth {
    margin-top: 4rem;
    width: 100%;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.featured-projects .project-info {
    padding: 2rem 0;
}

.featured-projects .project-card.featured .project-info {
    padding: 0;
}

/* Footer */
.footer {
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 6rem 0 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer h4 {
    margin-bottom: 2rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-info p {
    max-width: 300px;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 0.75rem;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Chatbot */
.chatbot-widget {
    display: none;
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 2000;
}

@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

.chatbot-button {
    background: var(--surface-elevated);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-base);
}

.chatbot-button:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.chatbot-window {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 3rem);
    height: 550px;
    max-height: 80vh;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .chatbot-window {
        max-width: calc(100vw - 3rem);
        right: 0;
        width: calc(100vw - 3rem);
    }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chatbot-window.hidden {
    display: none;
}

.chatbot-header {
    background: var(--surface-elevated);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 1rem;
    border-radius: var(--radius-md);
    max-width: 85%;
    font-size: 0.95rem;
}

.message.bot {
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    align-self: flex-start;
}

.message.user {
    background: var(--primary-color);
    color: #000;
    align-self: flex-end;
}

.chatbot-input {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

.chatbot-input input {
    flex: 1;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    outline: none;
}

.chatbot-input input:focus {
    border-color: var(--primary-color);
}

.chatbot-input button {
    background: var(--primary-color);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

/* Forms */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-elevated);
}

/* Responsive */
@media (max-width: 1024px) {
    .portfolio-grid {
        gap: 1.5rem;
    }
    .project-card, .project-card.featured {
        grid-column: span 12;
    }
    .project-card.featured {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .featured-projects .project-info,
    .featured-projects .project-card.featured .project-info {
        padding: 2rem 0;
    }

    :root {
        --section-padding: 5rem;
    }
    
    .nav-list {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        background: var(--surface-color);
        flex-direction: column;
        padding: 8rem 2.5rem;
        z-index: 999;
        border-left: 1px solid var(--border-color);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        overflow-x: hidden;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1000;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(4px) rotate(45deg);
    }

    .nav-toggle.active span:nth-child(2) {
        transform: translateY(-4px) rotate(-45deg);
    }
    
    .hero {
        padding-top: 10rem;
        overflow: hidden;
    }

    .hero-visual {
        width: 100%;
        right: 0;
        top: 0;
        height: 100%;
        transform: none;
        opacity: 0.2;
        max-width: 100vw;
    }

    .hero-container {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .hero-content {
        order: 2;
    }

    .hero-logo-display {
        order: 1;
        margin-bottom: 2rem;
    }

    .hero-logo-display img {
        max-width: 200px !important;
    }

    .hero h1 {
        font-size: clamp(2rem, 10vw, 3rem);
        margin-bottom: 1.5rem;
    }

    .cta-group {
        justify-content: center !important;
    }

    .project-visual-fullwidth {
        width: 100%;
        border-radius: var(--radius-md);
        margin-top: 2rem;
    }
    
    .project-detail header {
        margin-bottom: 2rem !important;
    }

    .project-detail header h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
        overflow-wrap: break-word;
    }

    .project-detail header .intro {
        font-size: 1.25rem !important;
    }

    .project-detail > .container > div {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
        width: 100%;
    }

    .rich-text {
        overflow-x: hidden;
    }

    .rich-text img {
        max-width: 100%;
        height: auto;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .contact-section .card {
        padding: 2rem;
    }

    .contact-section form div {
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    .project-detail > .container > div {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
        width: 100%;
    }
}

.rich-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.rich-text img {
    max-width: 100%;
    height: auto;
}

.rich-text pre, .rich-text code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
