/* Reset y estilos base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0F4C81;
    --accent: #6B48FF;
    --accent-red: #FF3366;
    --accent-orange: #FF6B6B;
    --accent-teal: #4ECDC4;
    --dark: #000;
    --light: #fff;
    --gray: #999;
    --transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    line-height: 1.6;
    overflow-x: hidden;
    font-family: "Roboto Mono", monospace, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    transition: var(--transition);
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header & Navigation Shared */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.95);
    padding: 1rem 5%;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

header.scrolled {
    background-color: rgba(0, 0, 0, 0.98);
    padding: 0.7rem 5%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    transition: var(--transition);
}

.logo a {
    color: var(--light);
    text-decoration: none;
}

/* Specific Logo underline effect if not overridden */
.logo:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--light);
    transition: width 0.3s ease;
}

.logo:hover:after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--light);
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.menu-toggle:hover,
.menu-toggle.active {
    transform: rotate(90deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav ul li {
    position: relative;
    transition: transform 0.3s ease;
}

nav ul li:hover {
    transform: translateY(-3px);
}

nav ul li a {
    color: var(--light);
    font-size: 1.05rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

nav ul li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--light);
    transition: var(--transition);
    transform: translateX(-50%);
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--light);
}

nav ul li a:hover:after,
nav ul li a.active:after {
    width: 100%;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Footer Shared */
footer {
    text-align: center;
    padding: 2rem 5%;
    background-color: rgba(0, 0, 0, 0.95);
    font-size: 0.9rem;
    color: var(--light);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Back to Top Shared */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
    z-index: 999;
}

#back-to-top:hover {
    background: #2d2f30;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#back-to-top.visible {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility & Animations */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.reveal-section {
    opacity: 0;
    transform: translateY(100px);
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Nav Shared Breakdown */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }

    .nav-menu.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    nav ul li {
        transform: translateX(50px);
        opacity: 0;
        transition: all 0.5s ease;
    }

    nav ul li.visible {
        transform: translateX(0);
        opacity: 1;
    }

    nav ul li:nth-child(1) {
        transition-delay: 0.1s;
    }

    nav ul li:nth-child(2) {
        transition-delay: 0.2s;
    }

    nav ul li:nth-child(3) {
        transition-delay: 0.3s;
    }

    nav ul li:nth-child(4) {
        transition-delay: 0.4s;
    }

    nav ul li:nth-child(5) {
        transition-delay: 0.5s;
    }

    nav ul li a {
        font-size: 1.5rem;
        display: block;
        padding: 0.5rem 2rem;
    }
}

/* Shared Section Styles */
.about {
    padding: 5rem 5%;
    text-align: center;
}

.about p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
}

.video-container {
    width: 100%;
    height: auto;
    overflow: hidden;
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact {
    padding: 5rem 5%;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.contact-info h3:first-child {
    margin-top: 0;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-icons a {
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.contact-form textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    border-radius: 2rem;
}

/* Animations restored */
.contact-form {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.contact-form.active,
.contact-info.active {
    opacity: 1;
    transform: translateX(0);
}

.contact-info {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.service-item {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.service-item.active {
    opacity: 1;
    transform: scale(1);
}