/* BACKGROUND BASE */
.portada {
    background: url('../img/fondo-hero.jpg') no-repeat center center;
    background-size: cover;
    background-color: #000000;
    background-attachment: scroll;
    min-height: 900px;
    height: auto;
    position: relative;
    padding-bottom: 100px;
    overflow: hidden;
    padding-top: 100px;
}

.copy {
    margin: 200px 100px 200px 100px;
    margin-left: 10px;
    position: relative;
    z-index: 10;
}

.copy h1 {
    margin-bottom: 0;
    font-size: 8rem;
    font-weight: 800;
    color: #FFFFFF;
    width: 100%;
    max-width: 700px;
    line-height: 1.1;
    letter-spacing: -0.05em;
    font-family: 'Figtree', sans-serif;
    margin-top: 40px;
    background: linear-gradient(to bottom, #FFFFFF 0%, #666666 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.copy h3 {
    margin-top: 20px;
    font-weight: 500;
    color: #CCCCCC;
    width: 100%;
    max-width: 700px;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.4;
    letter-spacing: -0.02em;
    font-family: 'Figtree', sans-serif;
}

.hero-image {
    position: relative;
    top: -150px;
    left: 600px;
    width: 300px;
}

.svg {
    position: absolute;
    top: -150px;
    left: 0;
    width: 300px;
    height: 453px;
}

.svg-fondo {
    position: absolute;
    top: -200px;
    left: -130px;
    width: 500px;
    height: 500px;
}

.hero-image-2 {
    position: absolute;
    top: -10px;
    left: 450px;
}

.hero-background {
    position: absolute;
    top: -50px;
    left: 300px;
    width: 500px;
}

.hero-background img {
    width: 100%;
}

/* --- FOCO & LUZ ANIMATIONS --- */
#Luz polygon,
#Luz ellipse,
#Foco polygon,
#Foco ellipse {
    transition: opacity 0.2s ease;
}

#Luz polygon,
#Luz ellipse {
    opacity: 0;
}

#Foco polygon,
#Foco ellipse {
    opacity: 0.5;
}

#Luz,
#Foco {
    transition: filter 0.2s ease;
}

#Foco g {
    stroke-width: 1px;
    transition: stroke-width 0.2s ease;
}

#Luz g {
    stroke-width: 1.5px;
    transition: stroke-width 0.2s ease;
}

#estela {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hero-image:hover #estela {
    opacity: 1;
    transition: opacity 1s ease;
}

.hero-image:hover #Luz polygon,
.hero-image:hover #Luz ellipse,
.hero-image:hover #Foco polygon,
.hero-image:hover #Foco ellipse {
    opacity: 1;
    transition: opacity 1s ease;
}

.hero-image:hover #Luz,
.hero-image:hover #Foco {
    transition: filter 1s ease;
}

.hero-image:hover #estela {
    transition-delay: 0s;
}

.hero-image:hover #Luz polygon:nth-child(1),
.hero-image:hover #Foco polygon:nth-child(1) {
    transition-delay: 0.1s;
}

.hero-image:hover #Luz polygon:nth-child(2),
.hero-image:hover #Foco polygon:nth-child(2) {
    transition-delay: 0.15s;
}

.hero-image:hover #Luz polygon:nth-child(3),
.hero-image:hover #Foco polygon:nth-child(3) {
    transition-delay: 0.2s;
}

.hero-image:hover #Luz polygon:nth-child(4),
.hero-image:hover #Foco polygon:nth-child(4) {
    transition-delay: 0.25s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+6) {
    transition-delay: 0.3s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+10) {
    transition-delay: 0.4s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+14) {
    transition-delay: 0.5s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+18) {
    transition-delay: 0.6s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+22) {
    transition-delay: 0.7s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+26) {
    transition-delay: 0.8s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+30) {
    transition-delay: 0.9s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+34) {
    transition-delay: 1.0s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+38) {
    transition-delay: 1.1s;
}

.hero-image:hover #Foco ellipse:nth-child(2n+42) {
    transition-delay: 1.2s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.5;
    }
}

/* --- MONITORING & RECOVERY ALIGNMENT --- */
.monitoring-header-text {
    padding: 0 10px;
    min-height: 110px;
    /* Min height for top alignment — grows if text wraps */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.monitoring-header-text h4 {
    font-size: 28px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 10px;
}

.monitoring-header-text p {
    color: #CCCCCC;
    font-size: 16px;
    line-height: 1.5;
}

/* --- PRODUCT SPECIFIC OVERRIDES --- */

/* Rhosonics (Left focus) */
.card-rhosonics {
    --card-glow: rgba(42, 148, 57, 0.5);
}

.card-rhosonics .card-content {
    gap: 24px;
}

.card-rhosonics .card-badge {
    background: #2A9439;
    border-color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0px;
}

.card-rhosonics .card-link {
    background: #2A9439;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    opacity: 1;
    transition: all 0.3s ease;
    display: inline-flex;
    width: fit-content;
}

.card-rhosonics .card-link:hover {
    background: #238031;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 148, 57, 0.3);
}

.card-rhosonics p {
    font-size: 1.6rem;
    margin-bottom: 0px;
    max-width: 480px;
    text-align: justify;
}

.card-rhosonics .card-image-container {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent),
        linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    mask-composite: intersect;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent),
        linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-composite: source-in;
}

.card-rhosonics::after {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
}

/* CiDRA */
.card-cidra {
    --card-glow: rgba(25, 55, 153, 0.6);
}

.card-cidra .card-content {
    gap: 24px;
}

.card-cidra .card-badge {
    background: #193799;
    border-color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0px;
}

.card-cidra .card-link {
    background: #193799;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    opacity: 1;
    transition: all 0.3s ease;
    display: inline-flex;
    width: fit-content;
}

.card-cidra .card-link:hover {
    background: #142d7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 55, 153, 0.3);
}

.card-cidra p {
    font-size: 1.6rem;
    margin-bottom: 0px;
    max-width: 480px;
    text-align: justify;
}

.card-cidra .card-image-container {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent),
        linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    mask-composite: intersect;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent),
        linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-composite: source-in;
}

/* UQOMM */
.card-uqomm {
    --card-glow: rgba(231, 69, 2, 0.5);
}

.card-uqomm .card-content {
    gap: 24px;
}

.card-uqomm .card-badge {
    background: #E74502;
    border-color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0px;
}

.card-uqomm .card-link {
    background: #E74502;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    opacity: 1;
    transition: all 0.3s ease;
    display: inline-flex;
    width: fit-content;
}

.card-uqomm .card-link:hover {
    background: #b53602;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 69, 2, 0.3);
}

.card-uqomm p {
    font-size: 1.6rem;
    margin-bottom: 0px;
    max-width: 480px;
    text-align: justify;
}

.card-uqomm .card-image-container {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent),
        linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    mask-composite: intersect;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent),
        linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-composite: source-in;
}

/* Reseye */
.card-reseye {
    height: 500px !important;
    --card-glow: rgba(11, 157, 28, 0.5);
}

.card-reseye .card-content {
    gap: 24px;
}

.card-reseye .card-badge {
    border-color: #0B9D1C;
    background: rgba(11, 157, 28, 0.1);
    margin-bottom: 0px;
}

.card-reseye .card-link {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: inline-flex;
    width: fit-content;
}

.card-reseye .card-link:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
}

.card-reseye .card-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    background: #000;
}

.card-reseye .card-image-container {
    height: 100%;
    width: 100%;
    mask-image: none !important;
    -webkit-mask-image: none !important;
}

.card-reseye::after {
    background: rgba(0, 0, 0, 0.3) !important;
    display: block !important;
}

/* Oil Skimmers */
.card-oilskimmers {
    height: 500px !important;
    --card-glow: rgba(210, 190, 59, 0.5);
}

.card-oilskimmers .card-content {
    gap: 24px;
}

.card-oilskimmers .card-image-container {
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent),
        linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

.card-oilskimmers .card-badge {
    background: #D2BE3B;
    color: #000;
    border-color: rgba(0, 0, 0, 0.1);
    margin-bottom: 0px;
}

.card-oilskimmers .card-link {
    background: #D2BE3B;
    color: #000;
    padding: 12px 28px;
    border-radius: 8px;
    opacity: 1;
    transition: all 0.3s ease;
    display: inline-flex;
    width: fit-content;
}

.card-oilskimmers .card-link:hover {
    background: #b8a632;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(210, 190, 59, 0.3);
}

/* Spacing Fix for Secondary Cards */
.card-reseye .card-content p,
.card-oilskimmers .card-content p {
    font-size: 1.6rem;
    margin-bottom: 16px !important;
}

/* --- OFFSHORE CARDS --- */
.offshore-specialty-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto 120px auto;
    padding: 0 5%;
}

.offshore-card {
    min-height: 350px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: grid;
    grid-template-areas: "stack";
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.offshore-card>* {
    grid-area: stack;
}

.offshore-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.offshore-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    pointer-events: none;
}

.offshore-card .card-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-self: end;
}

.offshore-card .card-badge {
    margin-bottom: 16px;
}

.offshore-card h4 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.offshore-card p {
    font-size: 1.4rem;
    color: #CCCCCC;
    line-height: 1.5;
    margin: 0;
    text-align: justify;
}

@media (max-width: 1100px) {
    .offshore-specialty-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .offshore-specialty-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive hero positioning */
@media (max-width: 1400px) {
    .hero-image {
        left: 40vw;
    }

    .hero-image-2 {
        left: 30vw;
    }

    .hero-background {
        left: 22vw;
    }
}

@media (max-width: 900px) {
    .portada {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-top: 60px;
        /* Space for the fixed header */
        min-height: 100vh;
        text-align: center;
    }

    .copy {
        margin: 40px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .copy h1 {
        font-size: 4.2rem;
        text-align: center;
        margin-top: 0;
    }

    .copy h3 {
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 40px;
    }

    /* Center lightbulbs behind/under text */
    .hero-image {
        position: absolute;
        top: 55%;
        left: 10%;
        /* Adjusted for the perfect balance per request */
        transform: translate(-50%, -50%) scale(0.9);
        margin: 0;
        z-index: 1;
    }

    .hero-image-2 {
        display: none;
        /* Hide secondary bulb */
    }

    .hero-background {
        position: absolute;
        top: 55%;
        left: 50%;
        transform: translate(-50%, -50%) scale(1);
        width: 100%;
        max-width: 450px;
        z-index: 0;
    }

    /* Reset alignment for Monitoring Section on Mobile */
    .monitoring-header-text {
        height: auto;
        margin-bottom: 20px;
    }

    .card-reseye,
    .card-oilskimmers {
        height: 400px !important;
        /* Balanced height for mobile */
    }
}

/* CLIENT LOGOS GRID */
.clients-section {
    padding: 20px 0 80px 0;
    position: relative;
    z-index: 10;
    width: 100%;
}

.clients-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.clients-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px 60px;
}

.client-logo-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 180px;
    height: 60px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.client-logo-item img {
    max-width: 100%;
    max-height: 45px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.client-logo-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* SECTION DIVIDER */
.section-divider {
    max-width: 1200px;
    width: 90%;
    margin: 80px auto;
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.08) 20%, rgba(255, 255, 255, 0.08) 80%, transparent);
}

@media (max-width: 900px) {
    .clients-grid {
        gap: 30px 40px;
    }
    .client-logo-item {
        width: 130px;
        height: 50px;
    }
    .client-logo-item img {
        max-height: 35px;
    }
}