/* Base Variables - Refined for richer contrast and depth */
:root {
    --primary: #4F8CFF;
    --primary-light: rgba(79, 140, 255, 0.15);
    --secondary: #7B61FF;
    --text-dark: #0F172A;
    /* Darker for better contrast */
    --text-muted: #64748B;
    --bg-light: #F8FAFC;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-glass-card: rgba(255, 255, 255, 0.65);
    --white: #FFFFFF;
    --card-shadow: 0 12px 40px -10px rgba(31, 38, 135, 0.08);
    --card-shadow-hover: 0 20px 40px -10px rgba(79, 140, 255, 0.15);
    --border: rgba(255, 255, 255, 0.5);
    --border-card: rgba(255, 255, 255, 0.7);
}

/* Rest/Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
    scroll-behavior: smooth;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar for a native app feel */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: rgba(79, 140, 255, 0.3);
    border-radius: 10px;
    border: 2px solid var(--bg-light);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 140, 255, 0.6);
}

/* Background Blobs for Glassmorphism Context */
.bg-blob-1 {
    position: fixed;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    animation: float 15s ease-in-out infinite;
}

.bg-blob-2 {
    position: fixed;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: var(--secondary);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
    0% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(50px) scale(1.1);
    }

    100% {
        transform: translateY(0px) scale(1);
    }
}

h1,
h2,
h3,
h4 {
    font-family: 'Sora', sans-serif;
}

/* Navigation - Glassmorphism */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -1px;
    text-decoration: none;
}

.hamburger {
    display: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.btn {
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    box-shadow: 0 8px 24px -6px rgba(123, 97, 255, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px -8px rgba(123, 97, 255, 0.5);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px -4px rgba(123, 97, 255, 0.3);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.4);
    border: 1.5px solid rgba(79, 140, 255, 0.3);
    color: var(--primary);
    backdrop-filter: blur(8px);
}

.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    border-color: rgba(79, 140, 255, 0.6);
    box-shadow: 0 8px 20px -6px rgba(79, 140, 255, 0.15);
}

.btn-outline:active {
    transform: translateY(0);
}

/* Glass Cards - Polished */
.glass-card {
    background: var(--bg-glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid var(--border);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--card-shadow);
    padding: 40px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s;
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(255, 255, 255, 0.8);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.glass-card:hover::before {
    opacity: 1;
}

/* General Sections */
section {
    padding: 40px 5%;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 44px;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.section-header p {
    font-size: 18px;
    color: var(--text-muted);
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

/* Typography */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(79, 140, 255, 0.3);
}

/* Animations for scroll (handled by JS intersection observer) */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    margin-top: auto;
}

/* Forms */
.form-group {
    margin-bottom: 22px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-dark);
    letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 18px;
    border-radius: 12px;
    border: 1.5px solid rgba(79, 140, 255, 0.15);
    background: rgba(255, 255, 255, 0.85);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #A0AEC0;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--primary-light), inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

@media (max-width: 860px) {

    /* Layouts */
    .grid-2,
    .grid-3,
    .grid-4,
    .feature-row,
    .stats-row,
    .contact-grid,
    .layer-grid,
    .use-case-grid,
    .founders-grid,
    .company-stats,
    .tech-stack-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    section {
        padding: 40px 6%;
    }

    /* Typography */
    .section-header h2,
    h2,
    h3,
    .custom-hero h1 {
        font-size: 32px !important;
        line-height: 1.3 !important;
    }

    .hero h1,
    .arch-hero h1,
    .tools-hero h1,
    .team-hero h1,
    .custom-hero h1,
    section.section-header h1 {
        font-size: 40px !important;
        line-height: 1.15 !important;
        letter-spacing: -1px !important;
    }

    .hero .hero-desc,
    .arch-hero p,
    .tools-hero p,
    .team-hero p,
    .custom-hero p {
        font-size: 16px !important;
        line-height: 1.5 !important;
        padding: 0 10px;
    }

    .big-quote {
        font-size: 20px !important;
        padding: 30px !important;
    }

    .form-card-header h2 {
        font-size: 24px !important;
    }

    /* Navigation - Hamburger Menu */
    nav {
        flex-direction: row;
        align-items: center;
        padding: 20px 5%;
        justify-content: space-between;
    }

    .logo {
        margin-bottom: 0px;
        z-index: 101;
        position: relative;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        z-index: 101;
        position: relative;
    }

    .hamburger div {
        width: 30px;
        height: 3px;
        background-color: var(--text-dark);
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    .hamburger.active div:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .hamburger.active div:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active div:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .nav-links {
        display: flex !important;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 100px 30px 40px;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        margin: 0;
        z-index: 100;
        gap: 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 18px;
        margin-bottom: 20px;
        width: 100%;
        transition: color 0.2s;
        display: block;
    }

    .nav-links .btn {
        margin-left: 0 !important;
        margin-top: 10px;
        width: 100%;
        text-align: center;
    }

    /* Buttons */
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px !important;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    /* Components */
    .flow-container,
    .vs-comparison {
        grid-template-columns: 1fr !important;
    }

    .vs-col {
        padding: 30px 20px !important;
    }

    .component-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .form-container {
        padding: 30px 20px !important;
    }

    .contact-info {
        padding: 30px 24px !important;
    }

    /* Special Elements */
    .router-flow {
        flex-direction: column;
        gap: 24px;
        padding: 30px 20px !important;
    }

    .router-step::after {
        content: '↓' !important;
        right: auto !important;
        left: 50% !important;
        bottom: -22px !important;
        transform: translateX(-50%) !important;
    }

    .routing-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .founder-card-top {
        padding: 30px 20px 24px !important;
    }

    .founder-card-body {
        padding: 24px 20px !important;
    }
}