:root {
    --rr-color-theme-primary: #FF6B00;
    /* Braga Orange */
    --rr-color-theme-primary-rgb: 255, 107, 0;
    /* Approximate RGB for orange if needed */
    --rr-color-theme-secondary: #003D82;
    /* Braga Blue */

    /* Update text selection color */
    --rr-color-selection-bg: #FF6B00;
}

/* Universal Button Overrides to ensure Orange standout */
.rr-primary-btn {
    background-color: var(--rr-color-theme-primary) !important;
    border-color: var(--rr-color-theme-primary) !important;
    color: #fff !important;
}

.rr-primary-btn:hover {
    background-color: var(--rr-color-theme-secondary) !important;
    border-color: var(--rr-color-theme-secondary) !important;
}

/* Section Headings - Subheading Color */
.section-heading .sub-heading {
    color: var(--rr-color-theme-primary) !important;
}

/* Running Text Background */
.running-text {
    background-color: var(--rr-color-theme-primary) !important;
}

/* Scroll Percentage */
#scroll-percentage {
    background-color: var(--rr-color-theme-primary) !important;
}

#scroll-percentage-value {
    color: #fff !important;
}

/* Footer Background - Dark Blue nuance */
.footer-section.bg-dark-1 {
    background-color: #02050a !important;
    /* Keep it dark or slight blue tint */
}

/* Accordion Active State */
.accordion-button:not(.collapsed) {
    color: var(--rr-color-theme-primary) !important;
    background-color: rgba(255, 107, 0, 0.1) !important;
    /* Light Orange Tint */
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23FF6B00'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
}

/* Text Selection */
::selection {
    background: var(--rr-color-theme-primary) !important;
    color: #fff !important;
}

/* Fallback for reveal and fade animations - ensures visibility if scripts fail */
.reveal,
.reveal img,
[data-text-animation],
.fade-top,
.fade-wrapper,
.animate-on-scroll {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
}

/* Ensure images take up space */
.reveal {
    width: 100% !important;
    height: auto !important;
}

.reveal img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Fix Preloader Branding in CSS fallback */
.loading::after {
    content: attr(data-loading-text) !important;
}

/* Scroll mockup (site rolando) */
.scroll-mockup {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0b0f16;
    height: 520px;
}

.scroll-mockup img {
    width: 100%;
    height: auto;
    display: block;
    animation: scrollPreview 14s ease-in-out infinite;
}

@keyframes scrollPreview {
    0% {
        transform: translateY(0);
    }
    10% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-45%);
    }
    90% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .scroll-mockup {
        height: 440px;
        margin: 40px auto 0;
    }
}

@media (max-width: 576px) {
    .scroll-mockup {
        height: 360px;
        max-width: 100%;
    }
}

/* Portfolio marquee cards */
.portfolio-showcase .section-heading {
    margin-bottom: 30px;
}

.portfolio-marquee {
    overflow: hidden;
    position: relative;
    border-radius: 18px;
    padding: 10px 0;
}

.portfolio-marquee::before,
.portfolio-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    width: 70px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.portfolio-marquee::before {
    left: 0;
    background: linear-gradient(to right, #040a14 0%, rgba(4, 10, 20, 0) 100%);
}

.portfolio-marquee::after {
    right: 0;
    background: linear-gradient(to left, #040a14 0%, rgba(4, 10, 20, 0) 100%);
}

.portfolio-track {
    display: flex;
    align-items: stretch;
    gap: 22px;
    width: max-content;
    animation: portfolioScroll 60s linear infinite;
}

.portfolio-card {
    --portfolio-frame-h: 260px;
    width: 360px;
    border-radius: 14px;
    overflow: hidden;
    background: #0b1324;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
    flex: 0 0 auto;
}

.portfolio-card-thumb {
    height: var(--portfolio-frame-h);
    overflow: hidden;
    background: #0a111e;
}

.portfolio-card img {
    display: block;
    width: 100%;
    height: auto;
    min-height: var(--portfolio-frame-h);
    object-fit: contain;
    object-position: top center;
    transform: translateY(0);
    transition: transform 14s ease-in-out;
}

.portfolio-card:hover img {
    transform: translateY(calc(-100% + var(--portfolio-frame-h)));
}

.portfolio-card-title {
    display: block;
    padding: 14px 16px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.2px;
}

.portfolio-marquee:hover .portfolio-track {
    animation-play-state: paused;
}

@keyframes portfolioScroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-50% - 11px));
    }
}

@media (max-width: 767px) {
    .portfolio-card {
        --portfolio-frame-h: 210px;
        width: 280px;
    }
}

@media (max-width: 991px) {
    .portfolio-marquee {
        overflow: hidden;
        padding-bottom: 0;
    }

    .portfolio-marquee::before,
    .portfolio-marquee::after {
        display: none;
    }

    .portfolio-track {
        width: max-content;
        animation: portfolioScrollMobile 45s linear infinite;
        padding: 0;
    }

    .portfolio-card {
        scroll-snap-align: unset;
    }
}

@media (hover: none) {
    .portfolio-card img {
        transition: none;
        animation: portfolioPreviewAuto 12s ease-in-out infinite;
    }
}

@keyframes portfolioScrollMobile {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-50% - 11px));
    }
}

@keyframes portfolioPreviewAuto {
    0% {
        transform: translateY(0);
    }
    12% {
        transform: translateY(0);
    }
    60% {
        transform: translateY(calc(-100% + var(--portfolio-frame-h)));
    }
    88% {
        transform: translateY(calc(-100% + var(--portfolio-frame-h)));
    }
    100% {
        transform: translateY(0);
    }
}

/* Disable theme toggle button in this project */
#theme-toogle {
    display: none !important;
}

/* Mobile layout tuning for this landing page */
@media (max-width: 1199px) {
    .hero-section .hero-images,
    .hero-section .hero-pattern-bg {
        display: none !important;
    }

    .hero-content {
        max-width: 100%;
        padding: 120px 0 90px !important;
        text-align: center;
    }

    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 767px) {
    .header .primary-header-inner {
        padding: 14px 16px !important;
    }

    .header .primary-header-inner .header-logo img {
        max-width: 120px !important;
        height: auto !important;
    }

    .header .primary-header-inner .header-right-wrap .header-right .sidebar-trigger {
        width: 52px;
        height: 52px;
    }

    .hero-content {
        padding: 90px 12px 70px !important;
        overflow: visible;
    }

    .hero-content .anim-text,
    .hero-content .anim-text > * {
        max-width: 100%;
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        visibility: visible !important;
        white-space: normal !important;
    }

    .hero-content .anim-text span,
    .hero-content .anim-text div {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        white-space: normal !important;
    }

    .hero-content .sub-title {
        font-size: clamp(16px, 4.6vw, 20px) !important;
        line-height: 1.2;
        max-width: 100%;
        overflow: visible;
        overflow-wrap: anywhere;
    }

    .hero-content .title {
        display: block;
        width: 100%;
        max-width: 100%;
        font-size: clamp(36px, 11vw, 48px) !important;
        line-height: 0.95;
        overflow: visible;
        overflow-wrap: anywhere;
    }

    .hero-content .bottom-title {
        font-size: clamp(26px, 8vw, 34px) !important;
        margin-bottom: 24px !important;
        line-height: 1.15;
        overflow: visible;
    }

    .hero-content p {
        font-size: 13px !important;
        max-width: 285px !important;
        margin-top: 14px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        line-height: 1.55;
        overflow: visible;
        overflow-wrap: break-word;
    }

    .hero-content .rr-primary-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 320px;
        padding: 16px 18px;
        font-size: 14px;
        line-height: 1.25;
        text-align: center;
    }

    .pt-130 {
        padding-top: 80px !important;
    }

    .pb-130 {
        padding-bottom: 80px !important;
    }

    .process-section .section-heading,
    .about-content .section-heading,
    .service-section .section-heading,
    .faq-content .section-heading,
    .portfolio-showcase .section-heading,
    .cta-section .section-heading {
        margin-bottom: 26px;
    }

    .section-heading .section-title br {
        display: none;
    }

    .section-heading .section-title,
    .section-heading .section-title * {
        max-width: 100%;
        white-space: normal !important;
        overflow: visible;
        transform: none !important;
        clip-path: none !important;
    }

    .section-heading .section-title {
        font-size: clamp(26px, 7vw, 32px) !important;
        line-height: 1.15;
    }

    .process-item,
    .service-item {
        padding: 26px 20px;
    }

    .portfolio-track {
        gap: 14px;
        animation-duration: 38s;
    }

    .portfolio-card {
        width: 86vw;
        max-width: 320px;
    }

    .portfolio-card:nth-child(2n) img {
        animation-delay: -2.5s;
    }

    .portfolio-card:nth-child(3n) img {
        animation-delay: -5s;
    }

    .portfolio-card-title {
        font-size: 15px;
        padding: 12px 14px;
    }

    .side-menu-contact .side-menu-list li a {
        overflow-wrap: anywhere;
    }

    .footer-section .footer-wrap {
        row-gap: 28px;
    }
}

@media (max-width: 420px) {
    .hero-content .title {
        font-size: clamp(34px, 10.5vw, 40px) !important;
    }

    .hero-content .bottom-title {
        font-size: clamp(24px, 7.5vw, 30px) !important;
    }

    .hero-content p {
        max-width: 270px !important;
    }

    .hero-content .rr-primary-btn {
        max-width: 100%;
    }

    .portfolio-card {
        width: 88vw;
    }

    .portfolio-track {
        animation-duration: 34s;
    }
}
