/*
    Theme: CTS Productions — studio grid
    Colors:
    - Carbon Black: #1a1a1a
    - Teal: #00f0ff
    - Lime: #aaff00
    - Light Grey: #cccccc
    - White: #ffffff
    - Dark Grey: #2c2c2c
*/

:root {
    --carbon-black: #121212;
    --dark-grey: #1e1e1e;
    --teal: #00f0ff;
    --lime: #aaff00;
    --light-grey: #cccccc;
    --text-color: #e0e0e0;
    --white: #ffffff;
    --header-height: 80px;
    --font-primary: 'Orbitron', sans-serif;
    --font-secondary: 'Roboto Mono', monospace;
    --transition-speed: 0.4s;
}

/* --- Base & Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--carbon-black);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    color: var(--white);
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--light-grey);
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--lime);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 100px 0;
}

/* --- Animated grid background --- */
#grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
    grid-template-rows: repeat(auto-fill, minmax(20px, 1fr));
    z-index: -1;
    opacity: 0.5;
}

.grid-cell {
    width: 20px;
    height: 20px;
    background-color: var(--teal);
    opacity: 0;
    transition: opacity 1s ease, background-color 0.5s ease;
}

.grid-cell.pulse {
    animation: pulse 4s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.05;
    }

    50% {
        opacity: 0.15;
    }
}

.grid-cell.wave {
    animation: wave 1.5s ease-out forwards;
}

@keyframes wave {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 0.3;
        background-color: var(--lime);
        transform: scale(1.2);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* --- Preloader --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--carbon-black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-logo img {
    height: 100px;
    filter: invert(1);
    animation: logo-pulse 2s infinite ease-in-out;
}

.loader-logo {
    text-align: center;
}

.loader-text {
    margin-top: 1rem;
    font-family: var(--font-secondary);
    color: var(--teal);
    letter-spacing: 2px;
}

.loader-bar {
    width: 150px;
    height: 3px;
    background-color: var(--dark-grey);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.loader-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: var(--lime);
    animation: loading-bar 2s ease-in-out forwards;
}

@keyframes logo-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes loading-bar {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

/* --- Header --- */
.header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color var(--transition-speed) ease, padding var(--transition-speed) ease;
    padding: 1.5rem 0;
}

.header.scrolled {
    background-color: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(10px);
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--white);
    font-weight: 700;
}

.nav-logo img, .footer-logo img {
    height: 100px;
    filter: brightness(0) invert(1);
    margin-right: 10px;
    transition: transform 0.5s ease;
}

.nav-logo:hover img {
    transform: rotate(360deg);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--light-grey);
    font-family: var(--font-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--lime);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-speed) ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-link.active,
.nav-link:hover {
    color: var(--white);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* --- Buttons --- */
.btn {
    padding: 12px 28px;
    border-radius: 5px;
    font-family: var(--font-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background-color: var(--teal);
    color: var(--carbon-black);
    border-color: var(--teal);
}

.btn-primary:hover {
    background-color: var(--lime);
    border-color: var(--lime);
    color: var(--carbon-black);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(170, 255, 0, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--teal);
    border-color: var(--teal);
}

.btn-secondary:hover {
    background-color: var(--teal);
    color: var(--carbon-black);
}

/* --- Hamburger Menu --- */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--white);
    transition: all 0.3s ease-in-out;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: var(--header-height);
}

.hero-content {
    max-width: 900px;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

.hero-title .highlight {
    color: var(--lime);
    text-shadow: 0 0 15px rgba(170, 255, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    color: var(--light-grey);
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-down-indicator a {
    color: var(--teal);
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-7px);
    }
}

/* --- Section Header --- */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header .subtitle {
    display: block;
    font-family: var(--font-secondary);
    color: var(--lime);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    margin-bottom: 1rem;
}

/* --- Services Section --- */
.services-section {
    background-color: rgba(0, 0, 0, 0.3);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--dark-grey);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 10px;
    padding: 2.5rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    transform-style: preserve-3d;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.3);
}

.service-card-inner {
    transform: translateZ(20px);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--teal);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--white);
}

.service-card p {
    color: var(--light-grey);
    margin-bottom: 1.5rem;
}

.card-link {
    font-family: var(--font-secondary);
    color: var(--lime);
    font-weight: 700;
}

.card-link i {
    transition: transform 0.3s ease;
    margin-left: 5px;
}

.card-link:hover i {
    transform: translateX(5px);
}

/* --- About Section --- */
.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.stats-counter {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    border-top: 1px solid rgba(0, 240, 255, 0.1);
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    padding: 1.5rem 0;
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--lime);
}

.stat-item h3 span {
    color: var(--lime);
    font-size: 2rem;
    margin-left: 2px;
}

.stat-item p {
    color: var(--light-grey);
    margin: 0;
    font-size: 0.9rem;
}

.about-image {
    perspective: 1500px;
}

.image-cube {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate-cube 20s infinite linear;
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(0, 240, 255, 0.3);
    background: rgba(30, 30, 30, 0.5);
}

.cube-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.front {
    transform: rotateY(0deg) translateZ(calc(100% / 2));
}

.back {
    transform: rotateY(180deg) translateZ(calc(100% / 2));
}

.right {
    transform: rotateY(90deg) translateZ(calc(100% / 2));
}

.left {
    transform: rotateY(-90deg) translateZ(calc(100% / 2));
}

.top {
    transform: rotateX(90deg) translateZ(calc(100% / 2));
}

.bottom {
    transform: rotateX(-90deg) translateZ(calc(100% / 2));
}

@keyframes rotate-cube {
    from {
        transform: rotateY(0deg) rotateX(0deg);
    }

    to {
        transform: rotateY(360deg) rotateX(360deg);
    }
}


/* --- Process Section --- */
.process-section {
    background-color: rgba(0, 0, 0, 0.3);
}

.process-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--dark-grey);
    transform: translateX(-50%);
}

.process-step {
    position: relative;
    padding: 2rem 0;
    display: flex;
    align-items: center;
    width: 50%;
}

.process-step:nth-child(odd) {
    left: 0;
    padding-right: 50px;
    justify-content: flex-end;
    text-align: right;
}

.process-step:nth-child(even) {
    left: 50%;
    padding-left: 50px;
}

.process-icon-wrapper {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.process-step:nth-child(odd) .process-icon-wrapper {
    right: -25px;
}

.process-step:nth-child(even) .process-icon-wrapper {
    left: -25px;
}

.process-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--carbon-black);
    border: 3px solid var(--lime);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--lime);
    transition: all 0.4s ease;
}

.process-step:hover .process-icon {
    background-color: var(--lime);
    color: var(--carbon-black);
    transform: scale(1.1);
}

.process-content {
    background: var(--dark-grey);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 240, 255, 0.1);
    width: 100%;
}

/* --- Testimonials Section --- */
.testimonial-slider-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.testimonial-slider {
    display: flex;
    overflow: hidden;
}

.testimonial-slide {
    min-width: 100%;
    transition: transform 0.5s ease-in-out;
}

.testimonial-content {
    background-color: var(--dark-grey);
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    border-left: 5px solid var(--teal);
}

.quote-icon {
    font-size: 2rem;
    color: var(--teal);
    margin-bottom: 1.5rem;
}

.testimonial-content p {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 2rem;
}

.testimonial-author h4 {
    color: var(--lime);
    margin: 0;
}

.testimonial-author span {
    color: var(--light-grey);
    font-size: 0.9rem;
}

.slider-controls {
    position: absolute;
    top: 50%;
    width: 110%;
    left: -5%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
}

.slider-controls button {
    background-color: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--teal);
    color: var(--teal);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-controls button:hover {
    background-color: var(--teal);
    color: var(--carbon-black);
}

/* --- CTA Section --- */
.cta-section {
    background: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 0.8)), url('https://images.unsplash.com/photo-1485846234645-a62644f84728?q=80&w=1470') no-repeat center center/cover;
    text-align: center;
}

.cta-content h2 {
    margin-bottom: 1rem;
    font-size: 2.8rem;
}

.cta-content p {
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* --- Footer --- */
.footer {
    background-color: #0c0c0c;
    padding-top: 80px;
    border-top: 1px solid rgba(0, 240, 255, 0.1);
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding-bottom: 40px;
}

.footer-logo {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.footer-about p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--dark-grey);
    border-radius: 50%;
    color: var(--light-grey);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background-color: var(--teal);
    color: var(--carbon-black);
    border-color: var(--teal);
}

.footer-links h3,
.footer-contact h3 {
    margin-bottom: 1.5rem;
    color: var(--white);
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links ul a {
    color: var(--light-grey);
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.75rem;
    color: var(--light-grey);
}

.footer-contact ul i {
    color: var(--teal);
    margin-top: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--dark-grey);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.footer-legal a {
    margin: 0 10px;
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background-color: var(--lime);
    color: var(--carbon-black);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Page Header (for subpages) --- */
.page-header {
    padding: 180px 0 100px;
    text-align: center;
    background: linear-gradient(rgba(18, 18, 18, 0.7), rgba(18, 18, 18, 0.7));
}

.page-header h1 {
    color: var(--lime);
}

/* --- Contact Page --- */
.contact-page-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    background: var(--dark-grey);
    padding: 3rem;
    border-radius: 10px;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-icon {
    font-size: 1.5rem;
    color: var(--lime);
    margin-top: 5px;
}

.info-text h4 {
    color: var(--white);
    margin-bottom: 0.5rem;
}

.contact-form {
    background-color: var(--carbon-black);
    padding: 2.5rem;
    border-radius: 8px;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--light-grey);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: var(--dark-grey);
    border: 1px solid #333;
    border-radius: 5px;
    color: var(--white);
    font-family: var(--font-secondary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
}

/* --- Success Popup --- */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: var(--dark-grey);
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    position: relative;
    max-width: 450px;
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.popup.show .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

.popup-icon {
    font-size: 4rem;
    color: var(--lime);
    margin-bottom: 1.5rem;
}

/* --- Legal Pages --- */
.legal-content .content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: var(--dark-grey);
    padding: 3rem;
    border-radius: 10px;
}

.legal-content h2 {
    color: var(--lime);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--dark-grey);
    padding-bottom: 0.5rem;
}

.legal-content ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 1rem;
}

/* --- Animations --- */
.animate-fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .about-wrapper {
        grid-template-columns: 1fr;
    }

    .about-image {
        margin-top: 3rem;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .contact-page-wrapper {
        grid-template-columns: 1fr;
    }

    .process-step {
        width: 100%;
        left: 0 !important;
        padding-left: 50px !important;
        padding-right: 0 !important;
        text-align: left !important;
    }

    .process-step:nth-child(odd) {
        justify-content: flex-start;
    }

    .process-icon-wrapper {
        left: -25px !important;
        right: auto !important;
    }

    .timeline-line {
        left: 0;
        transform: none;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--carbon-black);
        flex-direction: column;
        align-items: center;
        padding-top: 3rem;
        gap: 2.5rem;
        transition: right 0.4s ease-in-out;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .header-actions .btn {
        display: none;
    }

    .footer-main {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }

    .form-row {
        flex-direction: column;
    }

    .slider-controls {
        display: none;
    }
}