/* ================================================
   AUTOMAZY — ULTRA PREMIUM DARK SITE (STABLE V3)
   ================================================ */

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── TOKENS ─── */
:root {
    --black: #000000;
    --surface: #0a0a0a;
    --surface-2: #121212;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text: #ffffff;
    --text-dim: #a1a1a1;
    --text-3: #616161;
    --cyan: #00f2ff;
    --purple: #bf40ff;
    --amber: #ffaa00;
    --white: #ffffff;
    --radius: 24px;
    --radius-sm: 12px;
    --font-head: 'Space Grotesk', sans-serif;
    --font-main: 'Inter', sans-serif;
}

html { 
    scroll-behavior: smooth; 
    font-size: 62.5%; 
    background: var(--black);
}

body {
    background: var(--black);
    color: var(--text);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.5;
    font-weight: 300;
}

/* ─── PERFORMANCE LAYER ─── */
section:not(.hero) { 
    content-visibility: auto; 
    contain-intrinsic-size: 0 100vh;
}
.hero, .nav { content-visibility: visible; }
.marquee__track, .orb { will-change: transform; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    /* Subtle Technical Grid Overlay — Pre-rendered logic */
    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: 80px 80px;
    pointer-events: none;
}

h1, h2, h3, h4, .nav__brand, .eyebrow {
    font-family: var(--font-head);
    letter-spacing: -0.04em;
    font-weight: 700;
}

a { text-decoration: none; color: inherit; }

.container { 
    max-width: 1320px; 
    margin: 0 auto; 
    padding: 0 4rem; 
}

/* ─── AMBIENT ORBS (GPU Accelerated) ─── */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { 
    position: absolute; 
    border-radius: 50%; 
    opacity: 0.15;
    will-change: transform;
    pointer-events: none;
    /* Using radial gradient instead of expensive blur filter */
}
.orb-cyan { 
    width: 600px; height: 600px; 
    background: radial-gradient(circle, var(--cyan) 0%, transparent 70%); 
    top: -300px; left: -200px; 
}
.orb-purple { 
    width: 500px; height: 500px; 
    background: radial-gradient(circle, var(--purple) 0%, transparent 70%); 
    bottom: -200px; right: -150px; 
}

/* ─── REVEAL ─── */
.reveal { opacity: 0; transform: translateY(30px); transition: all 1s cubic-bezier(0.2, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── NAV ─── */
.nav {
    position: fixed; top: 2.5rem; left: 0; right: 0;
    z-index: 1000; display: flex; justify-content: center;
}

.nav__inner {
    width: min(90%, 1100px);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 1rem 1.2rem 1rem 3rem;
    display: flex; align-items: center; justify-content: space-between;
}

.nav__brand { font-size: 2rem; font-weight: 700; letter-spacing: 0.3em; color: var(--white); font-family: var(--font-head); }
.nav__links { display: flex; gap: 4rem; }
.nav__links a { font-size: 1.2rem; font-weight: 600; color: var(--text-dim); transition: 0.3s; }
.nav__links a:hover { color: var(--white); }

.nav__cta {
    font-size: 1.2rem; font-weight: 700; padding: 1.2rem 2.5rem;
    background: var(--white); color: var(--black); border-radius: 100px;
}

/* ─── HERO ─── */
.hero {
    position: relative; 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    padding: 12rem 0;
    isolation: isolate;
}

.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__video { width: 100%; height: 100%; object-fit: cover; opacity: 0.3; mix-blend-mode: lighten; }
.hero__veil { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent, var(--black) 80%); }

.hero__badge {
    display: inline-flex; align-items: center; gap: 1rem;
    padding: 0.6rem 2rem; border-radius: 100px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    font-size: 1rem; font-weight: 700; letter-spacing: 0.1em; color: var(--cyan);
    margin-bottom: 4rem;
}

.hero__title {
    font-size: clamp(4.5rem, 10vw, 9rem);
    line-height: 0.88; margin-bottom: 40px;
}

.gradient-text {
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero__sub { font-size: clamp(1.6rem, 2vw, 2.2rem); color: var(--text-dim); max-width: 600px; margin-bottom: 60px; }
.hero__actions { display: flex; gap: 2rem; }

.btn-glow, .btn-ghost, .nav__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), background 0.4s, color 0.4s, border-color 0.4s, box-shadow 0.4s;
    will-change: transform;
    cursor: pointer;
}

.btn-glow {
    padding: 1.6rem 3.5rem; font-size: 1.4rem; font-weight: 800;
    background: var(--white); color: var(--black); border-radius: 12px;
}

.btn-ghost {
    padding: 1.6rem 3.5rem; font-size: 1.4rem; font-weight: 600;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 12px;
}

.btn-glow:hover { box-shadow: 0 0 30px rgba(255,255,255,0.25); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: var(--border-hover); }

/* ─── MARQUEE ─── */
.marquee-section { padding: 10rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden; }
.marquee__label { text-align: center; margin-bottom: 6rem; position: relative; z-index: 2; }
.marquee__label p { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 20px rgba(0,242,255,0.3); }

.marquee__mask { 
    overflow: hidden; 
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); 
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); 
}
.marquee__track { 
    display: flex; 
    gap: 8rem; 
    animation: scrollMarquee 40s linear infinite; 
    width: max-content;
    padding: 2rem 8rem 2rem 0; /* Vertical buffer for hover + perfect loop padding */
}

.mlogo { 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; 
    opacity: 0.25; 
    filter: grayscale(1); 
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); 
    cursor: default;
    flex-shrink: 0;
    min-width: 220px; /* Uniform base width for consistent spacing */
    justify-content: center;
    white-space: nowrap;
}

/* Marquee brand colors and glows */
.mlogo:hover { opacity: 1; filter: grayscale(0); transform: translateY(-10px); }
.m-openai:hover { filter: drop-shadow(0 0 15px rgba(16,163,127,0.5)); }
.m-anthropic:hover { filter: drop-shadow(0 0 15px rgba(212,165,116,0.5)); }
.m-gemini:hover { filter: drop-shadow(0 0 15px rgba(138,180,248,0.5)); }
.m-aws:hover { filter: drop-shadow(0 0 15px rgba(255,153,0,0.5)); }
.m-n8n:hover { filter: drop-shadow(0 0 15px rgba(255,109,90,0.5)); }

.mlogo .iconify { font-size: 3.5rem; transition: transform 0.5s; }
.mlogo:hover .iconify { transform: scale(1.1); }
.mname { font-size: 1.4rem; font-weight: 700; color: var(--text); letter-spacing: 0.05em; }

@keyframes scrollMarquee { 
    0% { transform: translate3d(0,0,0); } 
    100% { transform: translate3d(calc(-50% - 4rem), 0, 0); } 
}

/* ─── AGENTS ─── */
.agents { padding: 18rem 0; }
.agents__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10rem; align-items: start; }

.agents__left { position: sticky; top: 15rem; }
.eyebrow { font-size: 1.2rem; color: var(--cyan); letter-spacing: 0.3em; display: block; margin-bottom: 2.5rem; }
.agents__title { font-size: clamp(3.5rem, 6vw, 6rem); line-height: 1.05; margin-bottom: 3.5rem; }
.agents__desc { font-size: 1.8rem; color: var(--text-dim); line-height: 1.8; }

/* Shared Card Logic */
.acard, .bento__card, .infra__card { 
    position: relative;
    padding: 4rem; background: var(--surface); 
    border: 1px solid var(--border); border-radius: var(--radius);
    transition: 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    overflow: hidden;
}

.acard::before, .bento__card::before, .infra__card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(
        600px circle at var(--x, 50%) var(--y, 50%),
        rgba(255, 255, 255, 0.04),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.acard:hover::before, .bento__card:hover::before, .infra__card:hover::before {
    opacity: 1;
}

.acard:hover, .bento__card:hover, .infra__card:hover { 
    transform: translateY(-10px); 
    border-color: var(--border-hover); 
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.acard { padding: 4rem; }

.acard__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3rem; }
.acard__num { font-size: 1.2rem; color: var(--text-3); font-weight: 800; }
.acard__tag { font-size: 1.1rem; font-weight: 800; background: rgba(0,242,255,0.1); color: var(--cyan); padding: 0.6rem 1.5rem; border-radius: 100px; }

.acard h3 { font-size: 2.8rem; margin-bottom: 1.5rem; }
.acard p { font-size: 1.6rem; color: var(--text-dim); }

/* ─── METRICS ─── */
.metrics { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.01); }
.metrics__row { display: grid; grid-template-columns: repeat(4, 1fr); }
.mblock { padding: 8rem 4rem; text-align: center; border-right: 1px solid var(--border); transition: 0.3s ease; }
.mblock:last-child { border-right: none; }
.mblock:hover { background: rgba(255,255,255,0.02); }
.mblock__num { font-size: min(5rem, 6vw); font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; color: var(--white); font-family: var(--font-head); overflow-wrap: break-word; }
/* Scaling for very long text */
.mblock:nth-child(2) .mblock__num { font-size: min(3.2rem, 5vw); }
.mblock__num span { color: var(--cyan); font-size: 2.5rem; margin-left: 0.2rem; vertical-align: middle; }
.mblock__label { font-size: 1.3rem; font-weight: 800; text-transform: uppercase; color: var(--white); letter-spacing: 0.1em; margin-bottom: 0.8rem; }
.mblock__sub { font-size: 1.4rem; color: var(--text-dim); line-height: 1.4; max-width: 200px; margin: 0 auto; }

/* ─── BENTO ─── */
.solutions { padding: 18rem 0; }
.solutions__head { text-align: center; margin-bottom: 10rem; }
.solutions__head h2 { font-size: 5rem; line-height: 1.1; margin-bottom: 2.5rem; }
.solutions__head p { font-size: 2rem; color: var(--text-dim); }

.bento {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.bento__card { display: flex; flex-direction: column; justify-content: flex-end; }
.bento--hero { grid-column: span 2; min-height: 450px; background: linear-gradient(135deg, #090909, #000); }
.bento--hero h3 { font-size: 4rem; }
.bento--hero p { font-size: 2.2rem; max-width: 600px; }

.bento--tall { grid-row: span 2; min-height: 600px; }

.bento__num { font-size: 1.2rem; color: var(--text-3); margin-bottom: 3rem; font-weight: 800; }
.bento__card h3 { font-size: 3.2rem; margin-bottom: 2rem; }
.bento__card p { font-size: 1.8rem; color: var(--text-dim); line-height: 1.6; }

/* ─── INFRA ─── */
.infra { padding-bottom: 18rem; }
.infra__head { text-align: center; margin-bottom: 10rem; }
.infra__head h2 { font-size: 5rem; margin-bottom: 2.5rem; }

.infra__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
/* Infra styles merged in shared card logic */
.infra__card h3 { font-size: 2.5rem; margin-bottom: 2rem; }
.infra__card p { font-size: 1.7rem; color: var(--text-dim); line-height: 1.7; }

/* ─── CTA ─── */
.cta { padding: 15rem 0; text-align: center; position: relative; overflow: hidden; }
.cta__title { font-size: 6rem; line-height: 1; margin: 3rem 0; }
.cta__glow-bg { position: absolute; top: 100%; left: 50%; transform: translate(-50%, -100%); width: 80vw; height: 80vw; background: radial-gradient(circle, rgba(0,242,255,0.06), transparent 70%); border-radius: 50%; z-index: -1; }

/* ─── LEAD FORM ─── */
.lead-form {
    max-width: 900px;
    margin: 5rem auto 0;
    padding: 6rem;
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(20px);
    text-align: left;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group label {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
}

.form-group input, 
.form-group select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--text);
    font-size: 1.4rem;
    font-family: inherit;
    transition: 0.3s;
}

.form-group input:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--cyan);
    background: rgba(0, 242, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.1);
}

/* Custom Select Styling */
.form-group select option {
    background: var(--surface);
    color: var(--text);
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .lead-form { padding: 3rem; }
    .cta__title { font-size: 4rem; }
}

.footer { padding: 6rem 0 3rem; border-top: 1px solid var(--border); background: var(--black); position: relative; z-index: 2; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; }
.footer__brand { font-size: 2.8rem; font-weight: 700; letter-spacing: 0.3em; color: var(--white); font-family: var(--font-head); }
.footer__copy { font-size: 1.2rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }

@media (max-width: 1024px) {
    .container { padding: 0 2.5rem; }
    .agents__grid, .infra__grid, .bento, .metrics__row { grid-template-columns: 1fr; }
    .bento__card { grid-column: span 1 !important; grid-row: span 1 !important; padding: 4rem; }
    .mblock { border-right: none; border-bottom: 1px solid var(--border); }
    
    /* Nav Mobile Optimization */
    .nav { top: 1.5rem; }
    .nav__inner { 
        padding: 0.8rem 1rem 0.8rem 2rem; 
        border-radius: 50px;
    }
    .nav__links { display: none; } /* Hide secondary links to favor CTA space */
    .nav__brand { font-size: 1.6rem; letter-spacing: 0.15em; }
    .nav__cta { padding: 1rem 1.8rem; font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .hero__title { font-size: 4rem; }
    .hero__actions { flex-direction: column; width: 100%; }
    .btn-glow, .btn-ghost { width: 100%; }
    .nav__inner { width: 95%; }
}
