/* --- DESIGN SYSTEM & TOKENS --- */
:root {
    --primary-dark: #0A1128;
    --primary-light: #1C2541;
    --copper-accent: #E07A5F;
    --copper-hover: #C55D42;
    --steel-accent: #5C6B73;
    --bg-canvas: #F8F9FB;
    --white: #FFFFFF;
    --text-dark: #1C1E21;
    --text-muted: #64748B;
    --border-grid: #E2E8F0;
    
    --font-title: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, Menlo, monospace;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- BASE & GRID BACKGROUNDS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-canvas);
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--bg-canvas);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Blueprint drafting paper grid effect */
.blueprint-grid {
    background-image: 
        linear-gradient(var(--border-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-grid) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center;
}

/* --- TOP CONTACT BAR --- */
.top-bar {
    background-color: var(--primary-dark);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-info span {
    margin-right: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.top-bar-info a {
    color: var(--copper-accent);
    text-decoration: none;
    transition: var(--transition);
}

.top-bar-info a:hover {
    color: var(--white);
}

/* --- STICKY NAVIGATION HEADER --- */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-grid);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-container {
    display: flex;
    flex-direction: column;
}

.logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
}

/* Fallback fallback when image not loaded */
.logo-text-fallback {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.logo-subtext-fallback {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

nav a {
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-light);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: relative;
    padding: 6px 0;
    transition: var(--transition);
}

nav a:hover, nav a.active {
    color: var(--copper-accent);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--copper-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

nav a:hover::after, nav a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- HERO SECTION --- */
#hero {
    background: linear-gradient(135deg, rgba(10, 17, 40, 0.95) 0%, rgba(28, 37, 65, 0.9) 100%), 
                url('https://images.unsplash.com/photo-1473341304170-971dccb5ac1e?auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10%;
    color: var(--white);
    position: relative;
    border-bottom: 1px solid var(--border-grid);
    overflow: hidden;
}

/* Technical drafting overlay elements */
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

#hero h2 {
    font-family: var(--font-title);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.15;
    max-width: 900px;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

#hero h2 span {
    color: var(--copper-accent);
    position: relative;
    display: inline-block;
}

#hero p {
    font-size: 1.2rem;
    font-weight: 300;
    max-width: 680px;
    margin-bottom: 40px;
    color: #CBD5E1;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    background-color: var(--copper-accent);
    color: var(--white);
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 36px;
    border: 1px solid var(--copper-accent);
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn:hover {
    background-color: transparent;
    color: var(--copper-accent);
    border-color: var(--copper-accent);
    box-shadow: 0 4px 20px rgba(224, 122, 95, 0.15);
}

/* --- SECTIONS ESTRUCTURALES --- */
section {
    padding: 100px 10%;
    position: relative;
    border-bottom: 1px solid var(--border-grid);
}

.section-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 50px;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-title::before {
    content: '// EST. 1996';
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--copper-accent);
    letter-spacing: 0.15rem;
}

/* --- ABOUT / HISTORIA --- */
#empresa {
    background-color: var(--white);
}

.about-text p {
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 24px;
    max-width: 900px;
    text-align: justify;
}

.about-text .history-highlight {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--primary-light);
    border-left: 3px solid var(--copper-accent);
    padding-left: 24px;
    margin: 40px 0;
    line-height: 1.4;
}

/* --- MISSION & VISION --- */
.mvv-section {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-grid);
}

.mvv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.mvv-card {
    background-color: var(--bg-canvas);
    padding: 48px;
    border: 1px solid var(--border-grid);
    border-radius: 2px;
    position: relative;
    transition: var(--transition);
}

.mvv-card:hover {
    border-color: var(--copper-accent);
    background-color: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

.mvv-card h3 {
    font-family: var(--font-title);
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mvv-card h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--copper-accent);
}

/* --- PORTFOLIO GALLERY --- */
#trabajos-realizados {
    background-color: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 30px;
}

.gallery-item {
    background-color: var(--white);
    border: 1px solid var(--border-grid);
    border-radius: 2px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}


.gallery-item:hover {
    border-color: var(--copper-accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(10, 17, 40, 0.06);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    filter: grayscale(10%) contrast(105%);
    transition: var(--transition);
    border-bottom: 1px solid var(--border-grid);
}

.gallery-item:hover img {
    filter: grayscale(0%) contrast(100%);
    transform: scale(1.03);
}

.item-info {
    padding: 24px;
    background-color: var(--white);
}

.item-info h4 {
    font-family: var(--font-title);
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.3;
}

.item-info p {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* --- CONTACT SECTION --- */
#contacto {
    background-color: var(--white);
}

.contact-container {
    max-width: 680px;
    margin: 0 auto;
    border: 1px solid var(--border-grid);
    padding: 48px;
    background-color: var(--bg-canvas);
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(10, 17, 40, 0.03);
}

.contact-info-box h3 {
    font-family: var(--font-title);
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 30px;
    font-weight: 700;
}

.info-link-item {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

.info-link-item label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.info-link-item p, .info-link-item a {
    font-size: 1.1rem;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
}

.info-link-item a {
    transition: var(--transition);
    color: var(--copper-accent);
}

.info-link-item a:hover {
    color: var(--copper-hover);
}

.contact-form {
    background-color: var(--bg-canvas);
    padding: 48px;
    border: 1px solid var(--border-grid);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-grid);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: var(--white);
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--copper-accent);
    box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.15);
}

/* --- FOOTER --- */
footer {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.4);
    padding: 60px 10%;
    text-align: center;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-logo {
    height: 48px;
    width: auto;
    opacity: 0.8;
    margin-bottom: 24px;
    transition: var(--transition);
}

.footer-logo:hover {
    opacity: 1;
}

/* --- TAB LAYOUT VIEWS --- */
.page-content {
    display: block;
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hidden-page {
    display: none;
    opacity: 0;
}

/* --- ADAPTABILIDAD (RESPONSIVE) --- */
@media (max-width: 1024px) {
    .mvv-grid, .contact-container {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    #hero h2 {
        font-size: 2.8rem;
    }
    section {
        padding: 80px 5%;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }
    header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 16px;
    }
    nav {
        gap: 20px;
    }
    #hero h2 {
        font-size: 2.2rem;
    }
    .section-title {
        font-size: 2rem;
    }
}

/* --- REVEALS & KEYFRAME ANIMATIONS --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

/* Scroll reveal styling */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}
