/* ============ VARIABLES ============ */
:root {
    --bronze: #CD7F32;
    --bronze-dark: #8B5A1E;
    --bronze-light: #E8A84A;
    --bg: #080808;
    --bg2: #111111;
    --bg3: #1a1a1a;
    --text: #ffffff;
    --text-muted: #888;
    --text-dim: #333;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ============ BODY ============ */
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
}

/* ============ NAV ============ */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 20px 40px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: linear-gradient(to bottom,
        rgba(8,8,8,1) 0%,
        rgba(8,8,8,0.95) 60%,
        rgba(8,8,8,0.8) 85%,
        transparent 100%);
}
.nav-links { display: flex; gap: 30px; list-style: none; justify-content: center; }
.nav-links a {
    color: var(--text-muted); text-decoration: none; font-size: 0.8em;
    letter-spacing: 2px; text-transform: uppercase; transition: color 0.3s;
    font-family: 'Orbitron', sans-serif;
}
.nav-links a:hover { color: var(--bronze); }
.nav-btn {
    background: var(--bronze); color: #000; padding: 10px 20px;
    border-radius: 4px; font-family: 'Orbitron', sans-serif; font-size: 0.7em;
    font-weight: 700; letter-spacing: 1px; text-decoration: none;
    transition: 0.3s; justify-self: end;
}
.nav-btn:hover { background: var(--bronze-light); }

/* Logo del nav: oculto hasta scroll o contracción del hero */
.nav-logo {
    transition: opacity 0.5s, transform 0.5s;
    opacity: 0; transform: translateY(-6px);
    pointer-events: none; max-height: 32px;
}
.nav-logo.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ============ HAMBURGER ============ */
.hamburger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    padding: 4px; position: fixed; top: 20px; right: 20px; z-index: 300;
}
.hamburger span { display: block; width: 24px; height: 2px; background: white; border-radius: 2px; transition: 0.3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--bronze); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--bronze); }

/* ============ MENÚ MÓVIL ============ */
.mobile-menu {
    display: none; position: fixed; inset: 0;
    background: rgba(8,8,8,0.98); z-index: 150;
    flex-direction: column; align-items: center; justify-content: center; gap: 36px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    color: var(--text-muted); text-decoration: none; font-family: 'Orbitron', sans-serif;
    font-size: 1em; letter-spacing: 3px; text-transform: uppercase; transition: color 0.3s;
}
.mobile-menu a:hover { color: var(--bronze); }
.mobile-menu .mobile-btn {
    background: var(--bronze); color: #000; padding: 16px 36px;
    border-radius: 4px; font-family: 'Orbitron', sans-serif; font-size: 0.85em;
    font-weight: 700; letter-spacing: 2px; text-decoration: none; margin-top: 10px;
}

/* ============ HERO ============ */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    padding: 80px 40px 140px; position: relative; overflow: hidden;
    transition: min-height 1s cubic-bezier(0.4, 0, 0.2, 1),
                padding 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero.contracted { min-height: 0; padding: 0; }
.hero::before {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(205,127,50,0.05) 0%, transparent 65%);
    pointer-events: none;
}

@keyframes logoAppear {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-logo {
    max-width: 280px; height: auto; position: relative; z-index: 1;
    opacity: 0; animation: logoAppear 0.8s ease-out 0.4s forwards;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.hero.contracted .hero-logo { display: none !important; }

/* ============ TAGLINE CON EFECTO CHISPA ============ */
.hero-tagline {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65em; letter-spacing: 3px; text-transform: uppercase;
    margin-top: 16px; position: relative; z-index: 1;
    color: transparent;
    display: inline-block; text-align: center;
    transition: opacity 0.6s ease-out;
}
.hero.contracted .hero-tagline { display: none !important; }
.mobile-break { display: none; }

.hero-tagline::after {
    content: attr(data-text);
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    color: transparent;
    background: linear-gradient(110deg, var(--bronze) 0%, var(--bronze) 42%, #fff 48%, #fff 52%, rgba(205,127,50,0.9) 58%, transparent 63%, transparent 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text;
    opacity: 0;
    animation: brutalSpark 1.8s cubic-bezier(0.4,0,0.2,1) 1.0s forwards;
}
.hero-tagline::before {
    content: attr(data-text);
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    color: transparent;
    background: linear-gradient(110deg, transparent 0%, transparent 42%, var(--bronze-light) 50%, transparent 58%, transparent 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text;
    filter: blur(4px); opacity: 0; pointer-events: none;
    animation: brutalSparkGlow 1.8s cubic-bezier(0.4,0,0.2,1) 1.0s forwards;
}
@keyframes brutalSpark {
    0%   { background-position: 100% 50%; opacity: 0; }
    1%   { opacity: 1; }
    100% { background-position: 0% 50%; opacity: 0.85; }
}
@keyframes brutalSparkGlow {
    0%   { background-position: 100% 50%; opacity: 0; }
    10%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { background-position: 0% 50%; opacity: 0; }
}

/* ============ QUÉ ES KORD ============ */
.ingenieria {
    padding: 100px 40px;
    background: var(--bg2);
    border-top: 1px solid #151515;
    border-bottom: 1px solid #151515;
}

.que-es-hero {
    max-width: 1240px; margin: 0 auto 70px;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 60px; align-items: center;
}
.que-es-hero-img {
    width: 100%; height: auto; aspect-ratio: 4 / 3;
    object-fit: cover; border-radius: 8px; display: block;
}
.que-es-hero-content { text-align: left; }
.que-es-hero-content .section-label { margin-bottom: 18px; }
.que-es-hero-content .section-title {
    font-size: clamp(1.6em, 2.8vw, 2.6em);
    margin-bottom: 0; text-align: left;
}
.que-es-hero-content .divider { margin: 28px 0; }
.que-es-hero-content .section-text { text-align: left; margin: 0 0 24px 0; }
.que-es-hero-cierre {
    color: var(--text); font-weight: 700; font-size: 1.05em;
    line-height: 1.6; display: block; margin-top: 8px;
}

.section-label {
    font-size: 0.65em; letter-spacing: 5px; color: var(--bronze);
    text-transform: uppercase; margin-bottom: 20px; display: block;
    font-family: 'Orbitron', sans-serif;
}
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.4em, 3vw, 2.2em);
    font-weight: 700; line-height: 1.2; margin-bottom: 24px;
}
.section-text {
    color: var(--text-muted); font-size: 1.15em; line-height: 1.9;
    font-weight: 300; max-width: 660px; margin: 0 auto; text-align: left;
}
.section-text.highlight { color: var(--text); }
.section-text strong { color: var(--text); font-weight: 500; }
.divider { width: 50px; height: 1px; background: var(--bronze); margin: 30px auto; opacity: 0.4; }
.accent { color: var(--bronze); }

.ingenieria-subtitle {
    font-family: 'Orbitron', sans-serif; font-size: 0.75em;
    letter-spacing: 4px; color: var(--bronze); text-transform: uppercase;
    text-align: center; margin: 0 auto 50px; font-weight: 400; display: block;
}

/* ============ GRID DE TARJETAS ============ */
.ingenieria-grid {
    display: flex; gap: 28px;
    max-width: 1240px; margin: 0 auto;
}
.ing-card {
    flex: 1; min-width: 0; border-radius: 12px; overflow: hidden;
    position: relative; border: 1px solid #222;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    background: #1a1a1a; display: flex; flex-direction: column;
}
@media (hover: hover) {
    .ing-card:hover {
        border-color: var(--bronze-dark); transform: translateY(-6px);
        box-shadow: 0 12px 32px rgba(205,127,50,0.2);
    }
    .ing-card:hover .ing-card-img { filter: brightness(0.7); transform: scale(1.04); }
    .ing-card:hover .ing-card-icon { background: var(--bronze-dark); box-shadow: 0 0 16px rgba(205,127,50,0.4), 0 0 0 4px var(--bg2); }
    .ing-card:hover .ing-card-icon svg { stroke: #fff; }
    .ing-card:hover::after { opacity: 1; }
    .ing-card:hover::before { left: 100%; }
}
.ing-card-img { width: 100%; height: 200px; object-fit: cover; display: block; filter: brightness(0.55); transition: filter 0.4s, transform 0.4s; }
.ing-card-icon {
    position: absolute; top: 160px; left: 50%; transform: translateX(-50%);
    width: 56px; height: 56px; background: var(--bg2);
    border: 2px solid var(--bronze); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 2; transition: background 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 0 4px var(--bg2);
}
.ing-card-icon svg { width: 26px; height: 26px; stroke: var(--bronze); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s; }
.ing-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(to right, transparent, var(--bronze), transparent);
    opacity: 0; transition: opacity 0.3s; z-index: 1;
}
.ing-card::before {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(205,127,50,0.08), transparent);
    transition: left 0.6s ease-out; pointer-events: none; z-index: 1;
}
.ing-card-body { padding: 36px 24px 28px; flex: 1; display: flex; flex-direction: column; }
.ing-icon { font-family: 'Orbitron', sans-serif; font-size: 0.6em; letter-spacing: 3px; color: var(--bronze); text-transform: uppercase; margin-bottom: 10px; display: block; }
.ing-title { font-family: 'Orbitron', sans-serif; font-size: 0.9em; font-weight: 600; color: var(--text); margin-bottom: 12px; letter-spacing: 1px; }
.ing-desc { color: #bbbbbb; font-size: 0.95em; line-height: 1.7; font-weight: 400; flex: 1; }
.ing-desc strong { color: var(--text); }
.ing-cierre { color: var(--text); font-size: 0.95em; font-weight: 600; margin-top: 16px; display: block; border-top: 1px solid #2a2a2a; padding-top: 14px; }

/* ============ SPARK TRIGGER (sección "no falla") ============ */
.spark-trigger { position: relative; display: inline-block; }
.spark-trigger::after {
    content: attr(data-text);
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    color: transparent;
    background: linear-gradient(110deg, transparent 0%, transparent 42%, #fff 48%, #fff 52%, transparent 58%, transparent 100%);
    background-size: 300% 100%; background-position: 100% 50%;
    -webkit-background-clip: text; background-clip: text;
    opacity: 0; pointer-events: none;
}
.spark-trigger.spark-active::after { animation: sparkHighlight 1.5s cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes sparkHighlight {
    0%   { background-position: 100% 50%; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { background-position: 0% 50%; opacity: 0; }
}

/* ============ CTA ============ */
.cta-verificar { padding: 100px 40px; text-align: center; border-top: 1px solid #151515; }
.cta-verificar .section-text { text-align: center; margin-bottom: 0; color: #bbbbbb; font-weight: 400; font-size: 1em; line-height: 1.7; }
.btn-primary {
    display: inline-block; background: var(--bronze); color: #000;
    padding: 18px 42px; border: none; border-radius: 4px;
    font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 0.85em;
    letter-spacing: 2px; cursor: pointer; text-decoration: none;
    transition: 0.3s; margin-top: 36px; margin-bottom: 24px;
}
.btn-primary:hover { background: var(--bronze-light); transform: translateY(-2px); }

/* ============ FOOTER ============ */
footer { padding: 32px 40px; border-top: 1px solid #151515; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-logo { max-width: 80px; height: auto; opacity: 0.6; }
.footer-center { text-align: center; flex: 1; }
.footer-text { font-size: 0.7em; color: var(--text-dim); letter-spacing: 1px; font-family: 'Orbitron', sans-serif; }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.footer-social { font-size: 0.75em; color: var(--bronze); letter-spacing: 2px; font-family: 'Orbitron', sans-serif; text-decoration: none; transition: color 0.3s; }
.footer-social:hover { color: var(--bronze-light); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    nav { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
    .nav-links { display: none; }
    .nav-btn { display: none; }
    .hamburger { display: flex; }
    .hero { padding: 40px 20px 100px; }
    .hero-logo { max-width: 200px; }
    .mobile-break { display: inline; }
    .ingenieria { padding: 70px 20px; }
    .cta-verificar { padding: 70px 20px; }
    .que-es-hero { grid-template-columns: 1fr; gap: 32px; margin-bottom: 50px; }
    .que-es-hero-img { aspect-ratio: 16 / 10; }
    .que-es-hero-content .section-title { font-size: 1.6em; }
    .ingenieria-grid {
        flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
        gap: 16px; padding: 10px 24px 24px 11vw; margin: 0 -20px;
    }
    .ingenieria-grid::-webkit-scrollbar { display: none; }
    .ing-card {
        min-width: 78vw; max-width: 78vw; flex-shrink: 0;
        scroll-snap-align: center; scroll-snap-stop: always;
        transform: none !important;
    }
    .ing-card.card-visible { border-color: var(--bronze-dark); box-shadow: 0 8px 20px rgba(205,127,50,0.15); }
    .ing-card.card-visible .ing-card-img { filter: brightness(0.7); }
    .ing-card.card-visible .ing-card-icon { background: var(--bronze-dark); box-shadow: 0 0 16px rgba(205,127,50,0.4), 0 0 0 4px var(--bg2); }
    .ing-card.card-visible .ing-card-icon svg { stroke: #fff; }
    .ing-card.card-visible::after { opacity: 1; }
    footer { padding: 24px 20px; flex-direction: column; text-align: center; }
    .footer-right { align-items: center; }
    .ingenieria-subtitle { font-size: 0.7em; letter-spacing: 3px; margin-bottom: 36px; }
}
