/* --- BRANDING & CSS VARIABLES --- */
:root {
    --bg-dark: #05070a;
    --bg-card: rgba(15, 18, 28, 0.55);
    --bg-card-hover: rgba(20, 24, 39, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --brand-primary: #8b5cf6;
    --brand-secondary: #06b6d4;
    --brand-accent: #f43f5e;
    --glow-color: rgba(139, 92, 246, 0.4);
    --glow-secondary: rgba(6, 182, 212, 0.4);
    --nav-height: 85px;
    
    /* Spacing scale */
    --section-pad-y: clamp(5rem, 10vw, 10rem);
    --border-radius-lg: 24px;
}

/* --- RESET & BASE STYLES --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Premium Background Grid Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    pointer-events: none;
}

h1, h2, h3, h4, .brand-text {
    font-family: 'Space Grotesk', sans-serif;
}

a { 
    text-decoration: none; 
    color: inherit; 
    transition: color 0.25s ease, transform 0.2s ease; 
}

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--brand-secondary);
    outline-offset: 4px;
}

/* --- ANIMATED GRADIENT ACCENTS --- */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.text-accent-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #38bdf8 30%, #a855f7 70%, #06b6d4 100%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease infinite;
    display: inline-block;
}

.text-accent-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #d8b4fe 30%, #06b6d4 70%, #8b5cf6 100%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease infinite;
    display: inline-block;
}

/* --- NAVIGATION --- */
nav {
    height: var(--nav-height);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(5, 7, 10, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 101;
}

.logo:hover { transform: scale(1.04); }

.nav-links {
    display: flex;
    gap: 2.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    align-items: center;
}

.nav-links a:not(.btn-primary) {
    position: relative;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.nav-links a:not(.btn-primary)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:not(.btn-primary):hover { color: #fff; }
.nav-links a:not(.btn-primary):hover::after { width: 100%; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    z-index: 101;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.mobile-menu-btn:hover { background: rgba(255, 255, 255, 0.05); }

/* --- BUTTONS --- */
.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    padding: 0.8rem 2rem;
    border-radius: 50px;
    color: #fff !important;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    font-size: 0.95rem;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px var(--glow-color), 0 0 0 1px rgba(255,255,255,0.3);
}

.btn-primary:hover::before { opacity: 1; }

.nav-links .btn-primary { white-space: nowrap; }

.btn-outline {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.18);
    color: var(--text-main) !important;
    box-shadow: none;
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.08);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.35);
}

/* --- HERO SECTION (Homepage) --- */
header.home-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    position: relative;
    overflow: hidden;
}

header.home-hero::before, header.home-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    animation: floatOrb 12s infinite alternate ease-in-out;
}

header.home-hero::before {
    top: 5%; left: 15%;
    width: 500px; height: 500px;
    background: rgba(139, 92, 246, 0.18);
}

header.home-hero::after {
    bottom: 5%; right: 15%;
    width: 600px; height: 600px;
    background: rgba(6, 182, 212, 0.15);
    animation-delay: -5s;
}

.hero-content {
    text-align: center;
    max-width: 980px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(3.2rem, 7vw, 6.5rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -2.5px;
    color: var(--text-main);
}

.hero-content p {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- JS MARQUEE --- */
.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(5,7,10,1) 0%, rgba(20,24,39,0.5) 50%, rgba(5,7,10,1) 100%);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 2.2rem 0;
    display: flex;
    white-space: nowrap;
    user-select: none;
    cursor: grab;
}
.marquee-wrapper:active { cursor: grabbing; }

.marquee-content {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 5rem;
    padding-right: 5rem; 
    /* Animation is now completely controlled via smooth momentum JS */
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.marquee-item:hover { color: var(--text-main); }
.marquee-item svg {
    color: var(--brand-secondary);
    width: 22px; height: 22px;
    filter: drop-shadow(0 0 10px var(--glow-secondary));
}

/* --- SECTION UTILS --- */
.section { padding: var(--section-pad-y) 0; position: relative; }

.section-header { text-align: center; margin-bottom: 5rem; }
.section-header h2 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 1rem; letter-spacing: -1.5px; line-height: 1.1; color: var(--text-main); }
.section-header p { color: var(--text-muted); max-width: 650px; margin: 0 auto; font-size: 1.15rem; line-height: 1.8; }

/* --- EXPERIENCE SECTION --- */
.experience-grid { display: grid; grid-template-columns: 1fr; gap: 4rem; align-items: center; }
@media (min-width: 900px) { .experience-grid { grid-template-columns: 1fr 1fr; gap: 6rem; } }

.experience-text p { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 1.8rem; line-height: 1.8; }

.stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
    margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid rgba(255,255,255,0.08);
}

.stat-item h4 { font-size: 3.5rem; color: var(--text-main); margin-bottom: 0.25rem; display: flex; align-items: center; gap: 5px; line-height: 1; }
.stat-item h4 span { font-size: 2.5rem; color: var(--brand-secondary); }
.stat-item p { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; margin: 0; font-weight: 600; }

.experience-visual { position: relative; animation: float 8s ease-in-out infinite; perspective: 1000px; }

.code-window {
    background: rgba(10, 12, 20, 0.9); padding: 2.5rem; border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 40px 80px -20px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(25px); transform: rotateY(-5deg) rotateX(5deg);
    transform-style: preserve-3d; transition: transform 0.5s ease;
}
.code-window:hover { transform: rotateY(0deg) rotateX(0deg) translateY(-5px); }

.browser-dots { display: flex; gap: 8px; margin-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 1.5rem; }
.dot { width:12px; height:12px; border-radius:50%; }
.dot.r { background:#ef4444; box-shadow: 0 0 10px rgba(239,68,68,0.5); }
.dot.y { background:#eab308; box-shadow: 0 0 10px rgba(234,179,8,0.5); }
.dot.g { background:#22c55e; box-shadow: 0 0 10px rgba(34,197,94,0.5); }
.code-line { height: 12px; border-radius: 6px; margin-bottom: 20px; }

/* --- SERVICES SECTION --- */
.services-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .services-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; } }

.service-card {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06); padding: 3.5rem 3rem;
    border-radius: var(--border-radius-lg); backdrop-filter: blur(16px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); position: relative;
    overflow: hidden; z-index: 1; display: flex; flex-direction: column; text-align: left; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.service-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, -20%), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0; transition: opacity 0.5s ease; z-index: -1; pointer-events: none;
}

.service-card-number {
    position: absolute; top: -5px; right: 0px; font-size: 8rem; font-weight: 800;
    font-family: 'Space Grotesk', sans-serif; color: rgba(255, 255, 255, 0.03);
    z-index: -1; line-height: 1; pointer-events: none; transition: color 0.5s ease, transform 0.5s ease;
}

.service-card:hover {
    transform: translateY(-8px); background: var(--bg-card-hover);
    border-color: rgba(139, 92, 246, 0.3); box-shadow: 0 25px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(139, 92, 246, 0.2);
}
.service-card:hover::before { opacity: 1; }
.service-card:hover .service-card-number { color: rgba(6, 182, 212, 0.08); transform: scale(1.05) translate(-10px, 10px); }

.service-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; position: relative; }

.service-icon {
    width: 60px; height: 60px; flex-shrink: 0; background: rgba(15, 18, 28, 0.9); border-radius: 16px;
    display: flex; align-items: center; justify-content: center; color: var(--brand-secondary);
    border: 1px solid rgba(255,255,255,0.08); transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: inset 0 0 20px rgba(255,255,255,0.02);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(-5deg); color: var(--brand-primary);
    border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.15); box-shadow: 0 0 25px var(--glow-color);
}

.service-card h3 { font-size: 1.5rem; color: var(--text-main); line-height: 1.2; letter-spacing: -0.5px; }
.service-card p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.75; }

/* --- FULL WIDTH TRANSITION DIVIDER --- */
.transition-banner { width: 100%; padding: 3rem 0; position: relative; }
.full-width-divider { width: 100%; height: 1px; background: linear-gradient(90deg, transparent 0%, rgba(139, 92, 246, 0.5) 50%, transparent 100%); position: relative; }
.full-width-divider::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 300px; height: 120px; background: rgba(6, 182, 212, 0.12); filter: blur(50px); border-radius: 50%; pointer-events: none;
}

/* --- CONTACT SECTION --- */
.contact-section { padding: 5rem 0 8rem 0; position: relative; text-align: center; }
.contact-box {
    background: linear-gradient(180deg, rgba(20, 24, 39, 0.7) 0%, rgba(7,9,15,0.2) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 25px 50px -12px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 40px; padding: 5rem 2rem;
    max-width: 900px; margin: 0 auto; position: relative; overflow: hidden; backdrop-filter: blur(12px);
}
@media (min-width: 768px) { .contact-box { padding: 8rem 4rem; } }
.contact-box::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.8), transparent); opacity: 0.8;
}
.contact-box h2 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 1.5rem; letter-spacing: -1.5px; color: var(--text-main); }
.contact-box p { color: var(--text-muted); font-size: 1.15rem; margin-bottom: 3.5rem; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.8; }
.contact-cta { font-size: 1.1rem; padding: 1.1rem 3rem; }
@media (max-width: 600px) { .contact-cta { font-size: 1rem; padding: 1rem 1.5rem; width: 100%; justify-content: center; } }

/* --- LEGAL PAGES & CONTENT FORMATTING --- */
.legal-header {
    padding-top: calc(var(--nav-height) + 6rem);
    padding-bottom: 3rem;
    text-align: center;
    position: relative;
}

.legal-header::before {
    content: ''; position: absolute; top: -50%; left: 50%; transform: translateX(-50%);
    width: 600px; height: 600px; background: rgba(139, 92, 246, 0.1); border-radius: 50%;
    filter: blur(120px); z-index: -1; pointer-events: none;
}

.legal-title { font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -1.5px; margin-bottom: 1rem; }
.legal-subtitle { color: var(--text-muted); font-size: 1.1rem; }

.legal-content-wrapper {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 1.5rem 8rem;
}

.legal-content-box {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .legal-content-box { padding: 2rem 1.5rem; }
}

.legal-content-box h2 {
    font-size: 1.75rem; color: var(--text-main); margin: 3rem 0 1rem;
    padding-bottom: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); letter-spacing: -0.5px;
}
.legal-content-box h2:first-child { margin-top: 0; }

.legal-content-box h3 { font-size: 1.25rem; color: var(--brand-secondary); margin: 2rem 0 1rem; }

.legal-content-box p, .legal-content-box ul {
    color: var(--text-muted); font-size: 1.1rem; line-height: 1.8; margin-bottom: 1.5rem;
}
.legal-content-box ul { padding-left: 1.5rem; }
.legal-content-box li { margin-bottom: 0.5rem; position: relative; }
.legal-content-box a { color: var(--brand-secondary); text-decoration: underline; text-decoration-color: rgba(6, 182, 212, 0.4); text-underline-offset: 4px; }
.legal-content-box a:hover { color: var(--brand-primary); text-decoration-color: var(--brand-primary); }

/* --- FOOTER --- */
footer { border-top: 1px solid rgba(255,255,255,0.06); background: rgba(5, 7, 10, 0.95); position: relative; z-index: 10; }
.footer-top { padding: 5rem 0 3rem; display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 768px) { .footer-top { grid-template-columns: 2fr 1fr 1fr; gap: 4rem; } }
.footer-brand p { color: var(--text-muted); margin-top: 1.5rem; max-width: 350px; font-size: 1rem; line-height: 1.7; }
.footer-col h4 { color: var(--text-main); font-size: 1.1rem; font-weight: 600; margin-bottom: 1.5rem; letter-spacing: 0.5px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col ul a { color: var(--text-dim); font-size: 0.95rem; transition: color 0.3s ease; }
.footer-col ul a:hover { color: var(--brand-secondary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.06); padding: 2rem 0; display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 1rem; }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; } }
.footer-bottom p { color: var(--text-dim); font-size: 0.9rem; }
.external-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 0.9rem; background: rgba(255,255,255,0.03); padding: 0.6rem 1.2rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); transition: all 0.3s ease; }
.external-link:hover { color: #fff; background: rgba(255,255,255,0.07); border-color: rgba(6, 182, 212, 0.4); box-shadow: 0 5px 15px rgba(6, 182, 212, 0.15); }

/* --- ANIMATIONS & UTILS --- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
@keyframes float { 0% { transform: translateY(0px) rotateY(-5deg) rotateX(5deg); } 50% { transform: translateY(-15px) rotateY(-2deg) rotateX(2deg); } 100% { transform: translateY(0px) rotateY(-5deg) rotateX(5deg); } }
@keyframes floatOrb { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(40px, -40px) scale(1.1); } }

/* --- MOBILE MENU OVERRIDES --- */
@media (max-width: 900px) {
    .mobile-menu-btn { display: block; }
    .mobile-menu-btn svg { transition: transform 0.3s ease; }
    .mobile-menu-btn[aria-expanded="true"] svg { transform: rotate(90deg); }
    .nav-links {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(5, 7, 10, 0.98);
        backdrop-filter: blur(24px); flex-direction: column; justify-content: center; gap: 2.5rem;
        opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 100;
    }
    .nav-links.active { opacity: 1; pointer-events: auto; }
    .nav-links a:not(.btn-primary) { font-size: 1.8rem; font-weight: 600; padding: 0; }
    .nav-links .btn-primary { font-size: 1.2rem; margin-top: 1rem; padding: 1rem 2.5rem;}
}