/* ==========================================================================
   Avyay Intellitech — Main Design Tokens & Global Layout
   Inspired by Citian, Webflow Robotics & Deeptech, Tailark & Vengence UI
   ========================================================================== */

:root {
    /* Brand Primary Colors */
    --teal-primary: #0891b2;       /* Cyan 600 - Precision AI, machine vision */
    --teal-light: #06b6d4;         /* Cyan 500 - Active state, hover ring */
    --teal-dark: #0e7490;          /* Cyan 700 - Deep action buttons */
    --teal-subtle: rgba(8, 145, 178, 0.08); /* 8% tint for cards & badges */
    
    --blue-deep: #1e40af;          /* Blue 800 - Structural integrity, engineering trust */
    --blue-dark: #0f172a;          /* Slate 900 - High contrast text & dark elements */
    --blue-light: #3b82f6;         /* Blue 500 - Active accents */

    /* Functional Accents */
    --orange-accent: #f97316;      /* Orange 500 - High visibility alert & IFOS accent */
    --orange-subtle: rgba(249, 115, 22, 0.08);
    --green-success: #10b981;      /* Emerald 500 - Pass states, efficiency, metrics */
    --green-subtle: rgba(16, 185, 129, 0.08);
    --error-red: #ef4444;          /* Red 500 - Defect indicators */

    /* Typography & Contrast Neutrals */
    --text-dark: #0f172a;          /* Slate 900 - High contrast headings & body */
    --text-medium: #475569;        /* Slate 600 - Secondary text */
    --text-muted: #94a3b8;         /* Slate 400 - Captions, borders, inactive tabs */
    
    /* Surfaces */
    --bg-light: #f8fafc;          /* Slate 50 - Primary site background */
    --bg-white: #ffffff;          /* Pure white - Content cards */
    --bg-alt: #f1f5f9;            /* Slate 100 - Alternating section backgrounds */
    --bg-dark: #0b1120;           /* Ultra dark slate - Global footer & telemetry card */

    /* Borders & Precision Lines */
    --border-light: #e2e8f0;       /* Slate 200 - 1px crisp borders */
    --border-medium: #cbd5e1;      /* Slate 300 - Input borders */
    --border-active: #0891b2;

    /* Shadows (Tactile & Soft) */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 16px 36px rgba(8, 145, 178, 0.16);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, Monaco, monospace;
}

/* ==========================================================================
   Base Reset
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(2rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
h4 { font-size: 1.25rem; font-weight: 600; }

p {
    color: var(--text-medium);
    font-size: 1.05rem;
    line-height: 1.7;
}

.mono {
    font-family: var(--font-mono);
}

/* ==========================================================================
   Global Layout Containers
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 90px 0;
    position: relative;
}

.section-white {
    background-color: var(--bg-white);
}

.section-alt {
    background-color: var(--bg-alt);
}

.section-dark {
    background-color: var(--bg-dark);
    color: #ffffff;
}

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 3.5rem;
}

.section-header h2 {
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.15rem;
    color: var(--text-medium);
}

.section-header.text-left {
    text-align: left;
    margin-left: 0;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

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

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.bento-span-4 { grid-column: span 4; }
.bento-span-6 { grid-column: span 6; }
.bento-span-8 { grid-column: span 8; }
.bento-span-12 { grid-column: span 12; }

/* ==========================================================================
   Global Header & Navigation
   ========================================================================== */
.header-topbar {
    background: #0f172a;
    color: #94a3b8;
    font-size: 0.8125rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #38bdf8;
    font-weight: 600;
}

.header-main {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.25s ease;
}

.header-main.scrolled {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-brand img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.nav-brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--teal-primary), var(--blue-deep));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-medium);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--teal-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--teal-primary);
    border-radius: var(--radius-full);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hamburger for Mobile */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-drawer.open {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 82%;
    max-width: 380px;
    height: 100%;
    background: #ffffff;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
}

.mobile-drawer.open .mobile-drawer-content {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.mobile-drawer-close {
    background: var(--bg-alt);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
}

.mobile-nav-list {
    list-style: none;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mobile-nav-link {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

/* ==========================================================================
   Global Footer
   ========================================================================== */
.footer-main {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 80px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1.3fr;
    gap: 3.5rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    color: #94a3b8;
    margin-top: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

.footer-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(8, 145, 178, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 1.25rem;
}

.footer-column h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.925rem;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #38bdf8;
    transform: translateX(4px);
}

.footer-contact-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: #94a3b8;
    font-size: 0.925rem;
    margin-bottom: 0.85rem;
}

.footer-contact-item svg, .footer-contact-item span.icon {
    color: #38bdf8;
    flex-shrink: 0;
    margin-top: 3px;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
    .bento-span-4, .bento-span-6, .bento-span-8 { grid-column: span 6; }
}

@media (max-width: 768px) {
    .nav-menu, .nav-actions .btn-primary { display: none; }
    .nav-toggle { display: flex; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .bento-span-4, .bento-span-6, .bento-span-8, .bento-span-12 { grid-column: span 12; }
    .section { padding: 60px 0; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
