/*
Theme Name: Nexgrow Agency
Description: Engineered for Dominance. Digital Growth Agency Theme.
Author: Nexgrow
Version: 1.0
*/

:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --accent-color: #E10600;
    --accent-dark: #a90400;
    --accent-hover: #ff1f1f;
    --gray: #9CA3AF;
    --dark-gray: #1a1a1a;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Space Grotesk', monospace;
    --easing: cubic-bezier(0.25, 1, 0.5, 1);
    --transition: 0.6s var(--easing);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor */
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.loading {
    overflow: hidden;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loader-content {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
}

.loader-line {
    width: 0;
    height: 2px;
    background: var(--accent-color);
    margin-top: 20px;
    transition: width 0.5s ease;
}

/* Three.js Canvas */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: -1;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 200;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 201;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.footer-logo-img {
    height: 60px;
    margin-bottom: 20px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -1px;
    text-transform: uppercase;
    color: #fff;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: none;
    z-index: 201;
    /* Above overlay */
}

.menu-text {
    font-size: 0.8rem;
    letter-spacing: 2px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

.hamburger {
    width: 40px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: var(--transition);
}

.menu-btn:hover .hamburger span:first-child {
    transform: translateY(3px);
}

.menu-btn:hover .hamburger span:last-child {
    transform: translateY(-3px);
}

/* Menu Toggle State */
.menu-open .hamburger span:first-child {
    transform: translateY(9px) rotate(45deg);
    background: var(--accent-color);
}

.menu-open .hamburger span:last-child {
    transform: translateY(-9px) rotate(-45deg);
    background: var(--accent-color);
}

.menu-open .menu-text {
    opacity: 0;
}


/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 150;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    clip-path: circle(0% at 95% 5%);
    /* Starts hidden top right */
    transition: clip-path 0.8s cubic-bezier(0.7, 0, 0.3, 1);
}

.menu-overlay.active {
    clip-path: circle(150% at 95% 5%);
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.menu-link {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    text-decoration: none;
    position: relative;
    transition: all 0.4s ease;
    cursor: none;
}

.menu-link:hover {
    color: #fff;
    -webkit-text-stroke: 1px #fff;
    transform: scale(1.1);
}

.menu-link::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    color: var(--accent-color);
    -webkit-text-stroke: 0px;
    overflow: hidden;
    transition: width 0.4s ease-in-out;
    white-space: nowrap;
}

.menu-link:hover::before {
    width: 100%;
}

.menu-footer {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.accent {
    color: var(--accent-color);
}

/* Sections Common */
section {
    position: relative;
    width: 100%;
    padding: 8rem 4rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.04em;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* overflow: hidden; Removed to allow 3D background to be felt */
}

.hero-title {
    font-size: 8vw;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2rem;
    perspective: 1000px;
    z-index: 10;
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.line {
    display: block;
    transform-origin: bottom;
    opacity: 0;
    /* Hidden initially */
    transform: translateY(50px) rotateX(10deg);
}

.accent-text {
    /* Using outline effect for contrast */
    color: transparent;
    -webkit-text-stroke: 2px #fff;
    transition: color 0.4s ease;
}

.hero-title:hover .accent-text {
    color: var(--accent-color);
    -webkit-text-stroke: 0px;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0.6;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: #fff;
    opacity: 1;
    transform: none;
}

/* ---------------- MARQUEE (NEW) ---------------- */
.marquee-wrapper {
    width: 100%;
    background: var(--accent-color);
    color: #fff;
    overflow: hidden;
    padding: 1.5rem 0;
    transform: skewY(-2deg);
    position: relative;
    z-index: 10;
    margin: -4rem 0 4rem 0;
    /* Overlap slightly */
}

.marquee-track {
    display: flex;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
}

.marquee-track span {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 2rem;
}

.marquee-track .star {
    color: #000;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* To make infinite properly, content needs to be duplicated in HTML or JS. 
       In this case, HTML content is long enough to cover screen, but simple CSS loop is:
       translateX moves left. If content is long enough, we can just reset.
       Better approach: two copies of text.
    */
}

/* Buttons */
.magnetic-btn {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1.2rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    letter-spacing: 1px;
    font-size: 0.9rem;
    overflow: hidden;
    transition: border-color 0.3s;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    z-index: 1;
    cursor: none;
}

.magnetic-btn .btn-fill {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    padding-bottom: 150%;
    border-radius: 50%;
    background-color: var(--accent-color);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s var(--easing);
    z-index: -1;
}

.magnetic-btn:hover .btn-fill {
    transform: translate(-50%, -50%) scale(1);
}

.magnetic-btn:hover {
    border-color: transparent;
}

.large-btn {
    font-size: 1.5rem;
    padding: 1.5rem 4rem;
}

/* Brand Statement */
.brand-statement {
    text-align: left;
}

.statement-text {
    font-size: 5vw;
    font-weight: 500;
    max-width: 90%;
}

.highlight-text {
    color: var(--gray);
    transition: color 0.3s;
    position: relative;
    display: inline-block;
}

.highlight-text:hover {
    color: var(--accent-color);
}

.highlight-text::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 4px;
    background: var(--accent-color);
    transition: width 0.4s var(--easing);
}

.highlight-text:hover::after {
    width: 100%;
}

.subtitle {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 600px;
    line-height: 1.6;
}

.subtitle strong {
    color: #fff;
    font-weight: 500;
}

/* Services */
.section-header {
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.section-label {
    font-size: 0.9rem;
    color: var(--accent-color);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 0;
    transition: padding 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.service-item:hover {
    padding-left: 2rem;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.02);
}

.service-item .num {
    font-size: 1rem;
    color: var(--gray);
    font-family: var(--font-body);
    width: 50px;
}

.service-info {
    flex: 1;
    margin-left: 3rem;
}

.service-item h4 {
    font-size: 3rem;
    font-weight: 400;
    transition: color 0.3s;
    margin-bottom: 0.5rem;
}

.service-desc {
    color: var(--gray);
    font-size: 1rem;
    max-width: 400px;
    opacity: 0;
    /* Reveal on hover */
    transform: translateY(10px);
    transition: all 0.3s var(--easing);
    height: 0;
    overflow: hidden;
}

.service-item:hover .service-desc {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    margin-bottom: 10px;
}

.service-item:hover h4 {
    color: var(--accent-color);
}

.service-item .tags {
    font-size: 0.9rem;
    color: var(--gray);
    margin-right: 2rem;
    text-align: right;
}

.service-item .plus {
    font-size: 2rem;
    font-family: var(--font-heading);
    font-weight: 300;
    transition: transform 0.3s;
}

.service-item:hover .plus {
    transform: rotate(45deg);
    color: var(--accent-color);
}

/* Process */
.process {
    align-items: flex-start;
}

.process-line-container {
    position: absolute;
    left: 100px;
    top: 0;
    bottom: 0;
    width: 2px;
}

.process-line {
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    position: absolute;
}

.process-progress {
    width: 3px;
    background: var(--accent-color);
    height: 0%;
    position: absolute;
    left: -1px;
    top: 0;
}

.process-steps {
    margin-left: 15vw;
}

.step-card {
    margin-bottom: 15vh;
    opacity: 0.3;
    transform: translateX(50px);
    transition: all 0.5s ease;
}

.step-card.active {
    opacity: 1;
    transform: translateX(0);
}

.step-num {
    font-size: 4rem;
    font-weight: 800;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
    color: transparent;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.step-card.active .step-num {
    color: var(--accent-color);
    -webkit-text-stroke: 0px;
}

.step-card h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.step-card p {
    color: var(--gray);
    max-width: 400px;
    line-height: 1.6;
}

/* Results */
.results-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    padding: 2rem;
}

.stat-item .label {
    display: block;
    margin-bottom: 1rem;
    color: var(--gray);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.stat-item .number {
    display: inline-block;
    font-size: 6rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #fff;
    background: linear-gradient(180deg, #fff 20%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-item .suffix {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: 800;
    vertical-align: top;
    margin-left: 5px;
}

/* CTA */
.cta {
    text-align: center;
    min-height: 70vh;
}

.cta-subtitle {
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.cta-title {
    font-size: 5vw;
    margin-bottom: 4rem;
}

.interaction-form {
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    transition: border-color 0.3s;
}

.input-group:focus-within {
    border-color: var(--accent-color);
}

.input-group input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    flex: 1;
    outline: none;
    font-family: var(--font-body);
}

.input-group button {
    border: none;
}


/* Footer */
footer {
    padding: 6rem 4rem;
    background: #020202;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4rem;
}

.footer-content .brand {
    max-width: 300px;
}

.footer-content .brand p {
    color: var(--gray);
    margin-top: 1rem;
    line-height: 1.6;
}

.links {
    display: flex;
    gap: 4rem;
}

.links .col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.links h5 {
    color: var(--gray);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    position: relative;
    width: fit-content;
    cursor: none;
}

.links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.links a:hover::after {
    width: 100%;
}

.is-sending button span {
    opacity: 0.5;
}

.copyright {
    color: #444;
    text-align: center;
    border-top: 1px solid #111;
    padding-top: 2rem;
}

/* Custom Cursor */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
}

.cursor-circle {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out, width 0.3s, height 0.3s, border-color 0.3s, background-color 0.3s;
}

.cursor-text {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
}

.cursor.hovered .cursor-circle {
    width: 80px;
    height: 80px;
    background-color: rgba(225, 6, 0, 0.2);
    border-color: var(--accent-color);
}

.cursor.hovered .cursor-text {
    opacity: 1;
}

/* Media Queries for responsiveness */
@media (max-width: 768px) {
    nav {
        padding: 1.5rem 2rem;
    }

    .hero-title {
        font-size: 15vw;
    }

    .statement-text {
        font-size: 2.5rem;
    }

    .service-item {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 2rem;
    }

    .service-info {
        margin-left: 0;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .service-item h4 {
        margin-left: 0;
        font-size: 2rem;
    }

    .process-line-container {
        display: none;
    }

    .process-steps {
        margin-left: 0;
    }

    .results-grid {
        flex-direction: column;
        gap: 3rem;
    }

    .large-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .cursor {
        display: none;
    }

    * {
        cursor: auto;
    }

    .menu-link {
        font-size: 2.5rem;
    }

    .marquee-track span {
        font-size: 1.5rem;
    }
}