:root {
    /* Light Theme (Default, 8AM to 8PM) */
    --bg-color: #FAFAFA;
    --bg-alpha: rgba(250, 250, 250, 0.85);
    --surface-color: #FFFFFF;
    --surface-light: #F3F4F6;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --accent-primary: #4F8EF7;
    --accent-glow: rgba(79, 142, 247, 0.2);
    --accent-secondary: #8B5CF6;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

[data-theme="dark"] {
    /* Dark Theme (8PM to 8AM) */
    --bg-color: #0A0A0F;
    --bg-alpha: rgba(10, 10, 15, 0.85);
    --surface-color: #1A1A2E;
    --surface-light: #232336;
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --accent-primary: #4F8EF7;
    --accent-glow: rgba(79, 142, 247, 0.3);
    --accent-secondary: #8B5CF6;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease, background-color 0.5s ease;
}

.navbar.scrolled {
    background: var(--bg-alpha);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
}

.nav-logo-img {
    height: 75px;
    width: auto;
    object-fit: contain;
    display: block;
    mix-blend-mode: screen;
    /* Defaults to screen for dark mode */
    transition: transform 0.3s ease;
}

/* AUTOMATIC MAGIC: Swap and invert logo for Light Mode! */
:root:not([data-theme="dark"]) .nav-logo-img,
:root:not([data-theme="dark"]) .footer-brand img {
    mix-blend-mode: multiply;
    filter: invert(1) hue-rotate(180deg);
}

.nav-logo-img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.mobile-menu-btn span {
    width: 30px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.lang-toggle {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    background: var(--surface-light);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.nav-cta {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-heading);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: var(--surface-light);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 180px 0 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 50px 50px;
    background-image: linear-gradient(to right, rgba(99, 102, 241, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(139, 92, 246, 0.15) 1px, transparent 1px);
    z-index: -2;
    mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    animation: moveGrid 20s linear infinite;
}

@keyframes moveGrid {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 50px 50px;
    }
}

.hero-bg-glow {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    filter: blur(80px);
    z-index: -1;
    opacity: 0.8;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Gradient Shimmer on Headline */
.hero-content h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 24px;
    background: linear-gradient(to right,
            var(--text-primary) 20%,
            var(--text-secondary) 40%,
            var(--accent-secondary) 60%,
            var(--text-primary) 80%);
    background-size: 200% auto;
    color: var(--text-primary);
    /* fallback */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s linear infinite;
    letter-spacing: -1px;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
}

.hero-trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Sections */
.section {
    padding: 120px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Background Utilities */
.alt-bg {
    background-color: var(--surface-light);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.card-link {
    display: inline-block;
    margin-top: 24px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.card-link:hover {
    color: var(--accent-secondary);
}

.service-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    background: var(--surface-light);
    border-color: rgba(79, 142, 247, 0.3);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
    background: var(--bg-color);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(-5deg);
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.service-card p {
    color: var(--text-secondary);
    flex-grow: 1;
}

/* Timeline (How We Work) */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline-line {
    position: absolute;
    top: 50px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--border-color);
    z-index: 1;
}

.timeline-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.timeline-step {
    flex: 1;
    text-align: center;
    padding: 0 20px;
}

.step-blob {
    width: 50px;
    height: 50px;
    background: var(--surface-color);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
    transition: all 0.3s ease;
}

.timeline-step:hover .step-blob {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

.timeline-step h4 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.timeline-step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Results Section */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.result-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.result-metric {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-tag {
    background: var(--surface-light);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.result-card p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Why Valygen (2x2 Grid) */
.why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.why-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px;
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.why-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.why-item h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.why-item p {
    color: var(--text-secondary);
}

/* Tech Stack Marquee */
.tech {
    padding: 80px 0;
    overflow: hidden;
}

.tech-subtitle {
    font-family: var(--font-heading);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scrolling-tape-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
}

.scrolling-tape-container::before,
.scrolling-tape-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 200px;
    height: 100%;
    z-index: 2;
}

.scrolling-tape-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-color), transparent);
}

.scrolling-tape-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-color), transparent);
}

.scrolling-tape {
    display: flex;
    gap: 60px;
    align-items: center;
    animation: scrollTape 30s linear infinite;
    white-space: nowrap;
    padding: 20px 0;
}

.tech-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.tech-logo:hover {
    opacity: 1;
    color: var(--text-primary);
}

@keyframes scrollTape {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-100% / 2));
    }
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.testo-card {
    background: var(--surface-color);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.testo-quote {
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: Georgia, serif;
    font-size: 5rem;
    color: var(--surface-light);
    line-height: 1;
    z-index: 0;
}

.testo-text {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.testo-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.testo-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.testo-meta h4 {
    font-size: 1.1rem;
}

.testo-meta p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.blog-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-img-placeholder {
    height: 200px;
    background: var(--surface-light);
    border-bottom: 1px solid var(--border-color);
}

.blog-content {
    padding: 30px;
}

.blog-tag {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-primary);
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: inline-block;
}

.blog-content h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    line-height: 1.4;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.text-center {
    text-align: center;
}

/* Contact Flex Layout */
.contact-layout {
    display: flex;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-form-container {
    flex: 2;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 60px 48px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.contact-side-panel {
    flex: 1;
    padding: 40px 0;
}

.contact-form-container h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 16px 20px;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    appearance: none;
    /* For select */
}

/* Custom Select wrapper to add arrow */
.custom-select {
    position: relative;
}

.custom-select::after {
    content: '▼';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.8rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-secondary);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--surface-color);
}

.success-message {
    margin-top: 20px;
    padding: 20px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10B981;
    border-radius: 12px;
    color: #10B981;
    text-align: center;
    font-weight: 500;
}

/* Contact Side Panel */
.contact-side-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 30px;
}

.info-icon {
    font-size: 1.5rem;
    background: var(--surface-light);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.info-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-info-item a,
.contact-info-item span {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.contact-info-item a:hover {
    color: var(--accent-primary);
}

/* Footer Advanced */
.footer {
    padding: 80px 0 40px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.footer-layout {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand p {
    color: var(--text-secondary);
    max-width: 300px;
    margin-top: 16px;
}

.footer-links,
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links a,
.footer-contact a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--text-primary);
}

.footer-lang {
    font-size: 0.9rem;
    padding: 8px 16px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Fade-in Animation Classes (Triggered by JS) */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* Staggered delay for grid items */
.services-grid .fade-in-section:nth-child(1) {
    transition-delay: 0.1s;
}

.services-grid .fade-in-section:nth-child(2) {
    transition-delay: 0.2s;
}

.services-grid .fade-in-section:nth-child(3) {
    transition-delay: 0.3s;
}

/* Responsive */
@media (max-width: 900px) {
    .contact-layout {
        flex-direction: column;
    }

    .timeline-steps {
        flex-direction: column;
        gap: 40px;
    }

    .timeline-line {
        top: 0;
        bottom: 0;
        left: 50%;
        width: 3px;
        height: 100%;
        transform: translateX(-50%);
    }

    .why-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100px;
        left: 0;
        right: 0;
        background: var(--surface-color);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .form-row {
        flex-direction: column;
    }

    .contact-form-container {
        padding: 40px 24px;
    }
}