/* AB Digital - Advanced Tech Aesthetic (Bento & Glassmorphism) */
:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --accent: #f0abfc;
    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --grad: linear-gradient(135deg, var(--primary), var(--secondary));
    --font: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
}

/* Loader */
#loader {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

span {
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(15px);
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-right: 3%;
    margin-left: 3%;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.btn-nav {
    background: var(--grad);
    padding: 10px 24px;
    border-radius: 12px;
    color: white !important;
    font-weight: 600 !important;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background-image: url('images/header.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    height: 101vh;
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--bg-dark) -30%, transparent 100%),
                linear-gradient(to left, var(--bg-dark) -30%, transparent 100%),
                linear-gradient(to top, var(--bg-dark) 5%, transparent 40%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    gap: 16px;
}

.btn-primary, .btn-secondary {
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.btn-primary {
    background: var(--grad);
    color: white;
    border: 1px;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-main);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--border);
}

/* Bento Grid Expertise */
section {
    padding: 100px 0;
    overflow-x: clip;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    letter-spacing: -1px;
}

.expertise-layout {
    position: relative;
    display: block; /* Removed grid to let bento take full width */
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Back to 4 columns */
    grid-template-rows: repeat(2, 220px);
    gap: 20px;
}

.bento-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: 0.4s;
    flex-direction: column;
    justify-content: flex-end;
}

.bento-item:hover {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-5px);
}

.bento-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.bento-item h3 { margin-bottom: 10px; font-size: 1.25rem; }
.bento-item p { color: var(--text-muted); font-size: 0.9rem; }

.main-ai {
    grid-column: span 2;
    grid-row: span 2;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 172, 254, 0.05));
    justify-content: center;
    align-items: center;
    text-align: center;
}

.main-ai i { font-size: 4rem; margin-bottom: 16px; }
.main-ai h3 { font-size: 2rem; }

.robotics { grid-column: span 2; }

/* Mobile Parallax Area - Absolute Positioned */
.mobile-parallax-area {
    position: absolute;
    top: 50%;
    right: -55%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    z-index: 10;
}

.parallax-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.mobile-img {
    position: absolute;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.1s ease-out;
}

.base {
    z-index: 1;
}

.layer-2 {
    z-index: 2;
    top: -22%;
    right: -3%;
}

.layer-1 {
    z-index: 3;
    top: -43%;
    right: -9%;
}

#tech {
    position: relative;
    padding-top: 0%;
}

.robot-parallax-area {
    position: absolute;
    /* 400px width. -120px means 120px (30%) can be hidden, 280px (70%) showing */
    left: -120px;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 600px;
    z-index: 5;
    pointer-events: none;
}

.robot-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.robot-img {
    position: absolute;
    height: auto;
    object-fit: contain;
}

/* robot3 is the base, stationary. */
.robot3 {
    width: 90%;
    bottom: -52%;
    left: 30%;
    z-index: 2;
}

/* robot2: bottom right next to top left of robot3, stationary */
.robot2 {
    width: 11%;
    bottom: -17.2%;
    left: 96.3%;
    z-index: 3;
}

/* robot1: left is next to top of robot3, rotates */
.robot1 {
    width: 100%;
    bottom: -9%;
    left: 3%;
    z-index: 1;
    transform-origin: right center;  /* pivot on the right */
    transition: transform 0.1s ease-out;
}

/* Tech Stack */
.tech-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 50px;
}

.tech-box {
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    transition: 0.3s;
}

.tech-box:hover {
    background: var(--border);
    transform: translateY(-5px);
}

.tech-box i { font-size: 2.5rem; display: block; margin-bottom: 10px; color: var(--primary); }
.tech-box span { font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }

/* UX Architecture */
.featured-showcase {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: center;
    padding: 60px;
    border-radius: 40px;
    position: relative;
    overflow: hidden;
}

.featured-desc h3 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.featured-desc p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.featured-video-container {
    padding: 1px;
    position: relative;
    border-radius: 60px;
    box-shadow: 40px 40px 40px 40px rgba(2, 6, 23, 0.8);
}

.featured-video {
    width: 100%;
    display: block;
    border-radius: 24px;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--bg-dark) 0%, transparent 25%),
                linear-gradient(to left, var(--bg-dark) 0%, transparent 25%),
                linear-gradient(to top, var(--bg-dark) 0%, transparent 25%),
                linear-gradient(to bottom, var(--bg-dark) 0%, transparent 25%);
    z-index: 1;
}

/* Footer */
footer { padding: 100px 0 40px; border-top: 1px solid var(--border); }

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-bottom: 60px;
}

.footer-form {
    background: var(--glass);
    padding: 40px;
    border-radius: 30px;
    border: 1px solid var(--border);
}

.footer-form input, .footer-form textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 14px;
    color: white;
    margin-bottom: 16px;
    outline: none;
    font-family: inherit;
}

.footer-form input:focus { border-color: var(--primary); }

.copyright { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding-top: 40px; border-top: 1px solid var(--glass); }

.socials a { color: var(--text-muted); font-size: 1.5rem; margin-right: 20px; transition: 0.3s; }
.socials a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 1800px) {
    .mobile-parallax-area {
        left: 85%;
        opacity: 0.6;
        top: 20%;
        height: 760px;
    }
}

@media (max-width: 1700px) {
    .robot-parallax-area {
        left: -12%;
        top: 40%;
    }
}

@media (max-width: 1500px) {
    .robot-parallax-area {
        left: -18%;
    }
}

@media (max-width: 1400px) {
    .mobile-parallax-area {
        left: 75%;
        top: 15%;
    }
    .robot-parallax-area {
        display: none;
    }
}

@media (max-width: 1200px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; }
    .mobile-parallax-area {
        position: relative;
        right: unset;
        left: unset;
        top: auto;
        transform: none;
        margin: 40px auto 40px;
        height: 250px;
        opacity: 1;
    }
    .parallax-images {
        position: relative;
        width: 85%;
        height: 0%;
        top: 50%;
    }
    .featured-showcase {
        grid-template-columns: 1fr;
        padding: 40px;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 3.5rem; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .mobile-parallax-area {
        right: 20%;
    }
}
