/*
================================================
TABLE OF CONTENTS
================================================
1.  Setup & Variables
2.  Base & Typography
3.  Header & Navigation
4.  Buttons & Utility Classes
5.  Hero Section
6.  Services Section
7.  Process Section & SVG Animation
8.  Case Studies Section (Tabs)
9.  Testimonial Section
10. Footer
11. Contact & Legal Pages
12. Glitch Hover Effect
13. Animations & Scroll Effects
14. Responsive Design
================================================
*/

/* 1. Setup & Variables
------------------------------------------------ */
:root {
    --purple: #f8a7ff;
    --teal: #319795;
    --dark-bg: #4d2c4a;
    --light-bg: #F7FAFC;
    --card-bg: #2D3748;
    --light-text: #E2E8F0;
    --dark-text: #2D3748;
    --border-color-dark: rgba(255, 255, 255, 0.1);
    --border-color-light: #E2E8F0;
    --heading-font: 'Inter', sans-serif;
    --mono-font: 'IBM Plex Mono', monospace;
    --body-font: 'Inter', sans-serif;
    --transition: 0.3s ease-out;
    --border-radius: 6px;
}

/* 2. Base & Typography
------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background-color: var(--dark-bg);
    color: var(--light-text);
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--heading-font);
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 900;
}

h2 {
    font-size: clamp(2.2rem, 5vw, 3rem);
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--purple);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    filter: brightness(1.2);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 3. Header & Navigation
------------------------------------------------ */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background-color: var(--dark-bg);
    border-bottom: 1px solid var(--border-color-dark);
    transition: transform var(--transition);
}

#main-header.hide {
    transform: translateY(-100%);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo img {
    height: 40px;
    filter:  invert(1);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--light-text);
    font-family: var(--mono-font);
    font-size: 0.9rem;
}

.nav-link.active,
.nav-link:hover {
    color: var(--purple);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #fff;
    margin: 6px 0;
    transition: var(--transition);
}

/* 4. Buttons & Utility Classes
------------------------------------------------ */
.section-padding {
    padding: 100px 0;
}

.dark-section {
    background-color: var(--dark-bg);
    color: var(--light-text);
}

.light-section {
    background-color: var(--light-bg);
    color: var(--dark-text);
}

.light-section h1,
.light-section h2,
.light-section h3,
.light-section h4 {
    color: var(--dark-text);
}

.light-section p {
    color: #4A5568;
}

.text-center {
    text-align: center;
}

.highlight {
    color: var(--purple);
}

.section-title {
    margin-bottom: 60px;
}

.section-title p {
    max-width: 600px;
}

.text-center p {
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    font-family: var(--mono-font);
    font-weight: 700;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--purple);
    color: #fff;
}

.btn-primary:hover {
    background-color: #6B46C1;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--purple);
    color: var(--purple);
}

.btn-secondary:hover {
    background-color: var(--purple);
    color: #fff;
}

/* 5. Hero Section
------------------------------------------------ */
#hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text p {
    font-size: 1.1rem;
    max-width: 500px;
    margin: 1.5rem 0 2.5rem;
}

.hero-actions .btn {
    margin-right: 1rem;
}

.hero-visual img {
    max-width: 100%;
}

/* 6. Services Section
------------------------------------------------ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color-dark);
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--purple);
}

.service-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.service-id {
    font-family: var(--mono-font);
    color: var(--teal);
}

/* 7. Process Section & SVG Animation
------------------------------------------------ */
.process-flow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    position: relative;
}

.flow-path {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.flow-path path {
    fill: none;
    stroke: var(--purple);
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.is-visible .flow-path path {
    animation: draw-path 3s ease-out forwards;
}

.process-step {
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-icon {
    width: 60px;
    height: 60px;
    border: 2px solid var(--purple);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: grid;
    place-items: center;
    font-family: var(--mono-font);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--purple);
    background-color: var(--light-bg);
}

.process-step p {
    font-size: 0.9rem;
}

.process-step:nth-child(2) {
    margin-top: -60px;
}

.process-step:nth-child(3) {
    margin-top: 140px;
}

/* 8. Case Studies Section (Tabs)
------------------------------------------------ */
.casestudy-tabs {
    max-width: 900px;
    margin: 0 auto;
}

.tab-nav {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border-color-dark);
    margin-bottom: 2rem;
}

.tab-link {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--light-text);
    font-family: var(--mono-font);
    cursor: pointer;
    position: relative;
}

.tab-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--purple);
    transition: var(--transition);
}

.tab-link.active,
.tab-link:hover {
    color: #fff;
}

.tab-link.active::after {
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 2rem;
    align-items: center;
    animation: fadeIn 0.5s;
}

.cs-metric {
    text-align: center;
    border-right: 1px solid var(--border-color-dark);
    padding-right: 2rem;
}

.cs-metric span {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--teal);
    display: block;
}

.cs-summary {
    padding-left: 2rem;
}

.cs-summary p {
    margin: 0;
}

/* 9. Testimonial Section
------------------------------------------------ */
.testimonial-wrapper {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.quote {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.author h4 {
    font-weight: 500;
}

.author span {
    color: #718096;
}

/* 10. Footer
------------------------------------------------ */
#main-footer {
    padding-top: 40px;
    border-top: 1px solid var(--border-color-dark);
}

.footer-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    margin-bottom: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 4rem;
}

.footer-logo img {
    height: 40px;
    filter:  invert(1);
    margin-bottom: 1rem;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col p,
.footer-col ul a {
    color: #A0AEC0;
}

.footer-bottom {
    border-top: 1px solid var(--border-color-dark);
    padding: 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p,
.legal-links a {
    color: #A0AEC0;
    font-size: 0.9rem;
}

.legal-links {
    display: flex;
    gap: 1rem;
}

/* 11. Contact & Legal Pages
------------------------------------------------ */
#contact-page,
#legal-page {
    padding-top: 140px;
    padding-bottom: 100px;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
}

.contact-form-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    font-family: var(--body-font);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(128, 90, 213, 0.2);
}

.full-width {
    grid-column: 1 / -1;
}

.contact-info-container h3 {
    margin-bottom: 1.5rem;
}

.contact-info-container ul li {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.contact-info-container ul li strong {
    font-family: var(--mono-font);
    color: var(--purple);
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h2 {
    margin: 2rem 0 1rem;
}

/* 12. Glitch Hover Effect
------------------------------------------------ */
[data-glitch] {
    position: relative;
}

[data-glitch]:hover::before,
[data-glitch]:hover::after {
    content: attr(data-glitch);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
}

[data-glitch]:hover::before {
    animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: var(--teal);
    z-index: -2;
}

[data-glitch]:hover::after {
    animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
    color: var(--purple);
    z-index: -1;
}

/* 13. Animations & Keyframes
------------------------------------------------ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes draw-path {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-3px, 3px);
    }

    40% {
        transform: translate(-3px, -3px);
    }

    60% {
        transform: translate(3px, 3px);
    }

    80% {
        transform: translate(3px, -3px);
    }

    100% {
        transform: translate(0);
    }
}

.animate-on-load {
    animation: 0.8s ease-out both;
}

.fade-in-up {
    animation-name: fadeInUp;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up {
    transform: translateY(50px);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* 14. Responsive Design
------------------------------------------------ */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 75px;
        right: 0;
        width: 100%;
        background: var(--dark-bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        border-top: 1px solid var(--border-color-dark);
        transform: translateY(-120%);
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        order: 2;
    }

    .hero-visual {
        order: 1;
        margin: 0 auto 2rem;
        max-width: 400px;
    }

    .hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    .process-flow {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .process-step:nth-child(n) {
        margin-top: 0 !important;
    }

    .flow-path {
        display: none;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .footer-cta {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }

    .tab-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cs-metric {
        border-right: none;
        border-bottom: 1px solid var(--border-color-dark);
        padding: 0 0 1rem 0;
    }

    .cs-summary {
        padding: 1rem 0 0 0;
    }
}