/* =========================================================================
   CodyWood - Main Stylesheet (Black & White Theme)
   ========================================================================= */

:root {
    --bg-color: #000000;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --accent: #ffffff;
    --container-width: 1200px;
    --nav-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo-text {
    font-family: 'Space Grotesk', sans-serif;
}

/* =========================================================================
   ThreeJS Canvas
   ========================================================================= */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none; /* Mouse moves handled globally in window */
}

/* =========================================================================
   Utilities & Layout
   ========================================================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 5%;
}

.text-center { text-align: center; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-color);
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent);
}

.btn-outline {
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background-color: var(--accent);
    color: var(--bg-color);
}

/* =========================================================================
   Header & Nav
   ========================================================================= */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(51, 51, 51, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.7;
}

.nav-links .btn-outline {
    padding: 10px 20px;
    font-size: 0.85rem;
}

.mobile-menu-btn {
    display: none;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* =========================================================================
   Hero Section
   ========================================================================= */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--nav-height);
}

.hero-content {
    max-width: 800px;
    margin: 0;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-ctas {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 5%;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0.6;
}

.mouse {
    width: 20px;
    height: 30px;
    border: 1px solid var(--text-muted);
    border-radius: 10px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 10px); opacity: 0; }
}

/* =========================================================================
   Services Section
   ========================================================================= */
.services {
    padding: 160px 0;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
}

.section-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 60px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.service-card:hover::after {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: #ffffff;
    background: rgba(20, 20, 20, 0.8);
}

.card-icon {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: inline-block;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.service-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* =========================================================================
   Powered By (Marquee Section)
   ========================================================================= */
.powered-by {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
    background: #050505;
    overflow: hidden;
}

.powered-by .section-title {
    margin-bottom: 40px;
    font-size: 2rem;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 20px 0;
}

.marquee-container::before, .marquee-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
}

.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, #050505 0%, transparent 100%);
}

.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, #050505 0%, transparent 100%);
}

.marquee-track {
    display: inline-block;
    animation: marqueeScroll 45s linear infinite;
}

.marquee-item {
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.marquee-item:hover {
    color: #ffffff;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
    /* Translates by -50% because we duplicated the items in HTML for seamless looping */
}

/* =========================================================================
   R&D Section
   ========================================================================= */
.rnd {
    padding: 120px 0;
    border-top: 1px solid var(--border-color);
}

.rnd-header {
    max-width: 600px;
    margin-bottom: 80px;
}

.rnd-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.rnd-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.rnd-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.rnd-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--text-main);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.rnd-card:hover::before {
    transform: scaleX(1);
}

.rnd-card-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.rnd-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* =========================================================================
   Contact & Footer
   ========================================================================= */
.contact {
    padding: 120px 0 40px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(15,15,15,0.9) 100%);
}

.contact-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin: 20px auto 40px;
    max-width: 500px;
}

.contact-btn {
    padding: 18px 40px;
    font-size: 1.1rem;
}

.footer {
    margin-top: 120px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================================================
   Mobile Responsiveness
   ========================================================================= */
@media (max-width: 900px) {
    .rnd-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(10px);
        padding: 30px 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    }
    .nav-links.active {
        display: flex;
    }
    .mobile-menu-btn {
        display: block;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .footer {
        flex-direction: column;
        justify-content: center;
    }
}
