/*
    styles.css
    Theme: Kinetic Typography Storm (FINAL CORRECTED VERSION)
    Author: Your Name
*/

/* ---------------------------------- */
/* 1. CSS Variables & Global Styles
/* ---------------------------------- */
:root {
    --primary-color: #00aaff;
    --primary-color-dark: #0088cc;
    --secondary-color: #0d2c4e;
    --background-color: #0a192f;
    --surface-color: #112240;
    --text-color: #ccd6f6;
    --text-color-light: #8892b0;
    --accent-color: #ff4d4d;
    --white-color: #e6f1ff;

    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Montserrat', sans-serif;

    --header-height: 80px;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --box-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-secondary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--white-color);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

p {
    margin-bottom: 1rem;
    color: var(--text-color-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--primary-color-dark);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

section {
    padding: 100px 0;
}

/* ---------------------------------- */
/* 2. Preloader
/* ---------------------------------- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    transition-delay: 0.5s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    display: flex;
    gap: 10px;
    font-size: 4rem;
    font-family: var(--font-secondary);
    font-weight: 800;
    color: var(--primary-color);
}

.loader-char {
    transform: translateY(100px);
    opacity: 0;
    animation: bounce-in 1.5s cubic-bezier(0.68, -0.6, 0.32, 1.6) forwards;
    animation-delay: calc(var(--char-index) * 0.1s);
}

@keyframes bounce-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ---------------------------------- */
/* 3. Header & Navigation
/* ---------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    z-index: 1000;
    padding: 10px 40px;
    align-items: center;
    background-color: transparent;
    justify-content: space-between;
    transition: background-color var(--transition-speed) ease, height var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.header.scrolled {
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
}

.logo img {
    height: 80px;
    transition: transform var(--transition-speed) ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links li {
    position: relative;
    padding: 5px 0;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    transition: color var(--transition-speed) ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-speed) ease-in-out;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger .line {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--white-color);
    margin: 6px 0;
    transition: all var(--transition-speed) ease-in-out;
}

/* ---------------------------------- */
/* 4. Buttons & CTA
/* ---------------------------------- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--background-color);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
    color: var(--background-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -10px var(--primary-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(0, 170, 255, 0.1);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.1rem;
}

/* ---------------------------------- */
/* 5. Hero Section
/* ---------------------------------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.8), rgba(17, 34, 64, 0.9));
    z-index: -1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at top left, rgba(0, 170, 255, 0.1), transparent 30%), radial-gradient(circle at bottom right, rgba(255, 77, 77, 0.1), transparent 30%);
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.hero-title {
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-color);
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
}

.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    color: var(--primary-color);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
    transform: translateX(-50%);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translate(-50%, 0);
    }

    40% {
        transform: translate(-50%, -15px);
    }

    60% {
        transform: translate(-50%, -7px);
    }
}

/* ---------------------------------- */
/* 6. Section Headers & General Layout
/* ---------------------------------- */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-color-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ---------------------------------- */
/* 7. Services Section
/* ---------------------------------- */
.services-section {
    background-color: var(--secondary-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    perspective: 1000px;
    height: 350px;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.service-card:hover .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front,
.service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 170, 255, 0.2);
}

.service-card-front {
    background-color: var(--surface-color);
}

.service-card-back {
    background: linear-gradient(135deg, var(--secondary-color), var(--surface-color));
    transform: rotateY(180deg);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ---------------------------------- */
/* 8. Industry Expertise Section
/* ---------------------------------- */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.industry-item {
    background-color: var(--surface-color);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
}

.industry-item:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px -15px rgba(2, 12, 27, 0.8);
}

.industry-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.industry-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* ---------------------------------- */
/* 9. Testimonials Section
/* ---------------------------------- */
.testimonials-section {
    background-color: var(--secondary-color);
}

.testimonial-slider-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.testimonial-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.testimonial-slide {
    min-width: 100%;
    padding: 40px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.testimonial-content {
    margin-bottom: 2rem;
}

.testimonial-content p {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-color);
    line-height: 1.7;
    position: relative;
    padding-left: 40px;
}

.testimonial-content p::before {
    content: '\f10d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.author-info h4 {
    color: var(--white-color);
    margin: 0;
}

.author-info span {
    color: var(--text-color-light);
    font-size: 0.9rem;
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.slider-controls button {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    pointer-events: all;
}

.slider-controls button:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}

.prev-btn {
    left: -70px;
    position: absolute;
}

.next-btn {
    right: -70px;
    position: absolute;
}

/* ---------------------------------- */
/* 10. ROI Calculator Section
/* ---------------------------------- */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background-color: var(--surface-color);
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.calculator-form .form-group {
    margin-bottom: 1.5rem;
}

.calculator-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color-light);
}

.calculator-form input {
    width: 100%;
    padding: 12px;
    background-color: var(--background-color);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    color: var(--white-color);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.calculator-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.calculator-form button {
    width: 100%;
}

.calculator-results {
    background: linear-gradient(135deg, var(--secondary-color), var(--background-color));
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
}

.calculator-results h3 {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
    display: inline-block;
}

.result-item {
    margin-bottom: 2rem;
}

.result-item h4 {
    color: var(--text-color-light);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.result-item p {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.calculator-results small {
    color: var(--text-color-light);
    font-style: italic;
}

/* ---------------------------------- */
/* 11. CTA Section
/* ---------------------------------- */
.cta-section {
    background-color: var(--surface-color);
    text-align: center;
}

.cta-title {
    margin-bottom: 1.5rem;
}

.cta-subtitle {
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
    font-size: 1.1rem;
}

/* ---------------------------------- */
/* 12. Footer
/* ---------------------------------- */
.footer {
    background-color: var(--secondary-color);
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    color: var(--white-color);
    font-size: 1.1rem;
}

.footer-about .logo {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.footer-about p {
    font-size: 0.95rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-color-light);
    transition: color var(--transition-speed) ease, padding-left var(--transition-speed) ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    color: var(--text-color-light);
}

.footer-contact i {
    color: var(--primary-color);
    margin-right: 15px;
    margin-top: 5px;
    width: 20px;
    text-align: center;
}

.footer-contact a {
    color: var(--text-color-light);
}

.footer-contact a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid var(--surface-color);
    font-size: 0.9rem;
    color: var(--text-color-light);
}

.footer-legal a {
    margin: 0 10px;
    color: var(--text-color-light);
}

.footer-legal a:hover {
    color: var(--primary-color);
}

/* ---------------------------------- */
/* 13. Back to Top Button
/* ---------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--background-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-speed) ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-color-dark);
    transform: scale(1.1);
}

/* ---------------------------------- */
/* 14. Animations - JS will handle initial states
/* ---------------------------------- */
/* No more hiding rules here! This is a critical part of the fix. */
/* JavaScript will use gsap.from() to create the animation. */
.animate-text .char {
    display: inline-block;
}

/* Basic setup for JS */

/* ---------------------------------- */
/* 15. Legal & Contact Pages
/* ---------------------------------- */
.page-header {
    padding: 150px 0 80px;
    text-align: center;
}

.page-header h1 {
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-color);
}

.breadcrumbs {
    margin-top: 1rem;
    color: var(--text-color-light);
}

.breadcrumbs a {
    color: var(--primary-color);
}

.breadcrumbs span {
    color: var(--text-color);
}

.legal-content,
.content-section {
    padding: 80px 0;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--surface-color);
    padding: 50px;
    border-radius: var(--border-radius);
}

.content-wrapper h2 {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.content-wrapper ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 1.5rem;
}

.content-wrapper ul li {
    margin-bottom: 0.5rem;
    color: var(--text-color-light);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    align-items: start;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.contact-info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 20px;
    margin-top: 5px;
    width: 30px;
    text-align: center;
}

.contact-info-item h4 {
    margin-bottom: 0.25rem;
}

.contact-form-wrapper {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius);
}

.contact-form .form-group {
    position: relative;
    margin-bottom: 2rem;
}

.contact-form .form-control {
    width: 100%;
    padding: 15px;
    background-color: var(--background-color);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    color: var(--white-color);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.contact-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contact-form label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--text-color-light);
    pointer-events: none;
    transition: all var(--transition-speed) ease;
}

.contact-form .form-control:focus+label,
.contact-form .form-control:not(:placeholder-shown)+label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    background-color: var(--surface-color);
    padding: 0 5px;
    color: var(--primary-color);
}

.contact-form textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.contact-form select.form-control {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300aaff'%3E%3Cpath d='M6 9.5L.5 4h11L6 9.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.contact-form select.form-control:required:invalid {
    color: var(--text-color-light);
}

.contact-form option {
    background-color: var(--background-color);
    color: var(--text-color);
}

/* ---------------------------------- */
/* 16. Responsiveness
/* ---------------------------------- */
@media (max-width: 1024px) {
    .header {
        padding: 0 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-about {
        grid-column: 1 / -1;
    }

    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .prev-btn {
        left: -20px;
    }

    .next-btn {
        right: -20px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: min(75vw, 400px);
        height: 100vh;
        background-color: var(--surface-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transform: translateX(100%);
        transition: transform var(--transition-speed) ease-in-out;
        box-shadow: -10px 0 30px -15px rgba(2, 12, 27, 0.7);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .line1 {
        transform: rotate(-45deg) translate(-7px, 7px);
    }

    .hamburger.active .line2 {
        opacity: 0;
    }

    .hamburger.active .line3 {
        transform: rotate(45deg) translate(-7px, -7px);
    }

    .hero {
        padding-top: var(--header-height);
    }

    .slider-controls {
        display: none;
    }

    .testimonial-slider-wrapper {
        padding: 0;
    }

    .contact-grid,
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-contact li {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
    }
}