:root {
    --primary-color: #312e81;
    /* Primary Deep Purple */
    --secondary-color: #10b981;
    /* Accent Green */
    --navy-blue: #1e293b;
    --soft-gray: #94a3b8;
    --off-white: #f8fafc;
    --text-color: #334155;
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(-45deg, #312e81, #1e293b, #262468, #0f172a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-color);
    line-height: 1.6;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: transparent;
    /* Make transparent to show gradient */
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.2rem;
    color: var(--soft-gray);
    opacity: 0.9;
}

.modal-header p {
    color: #1e293b;
    /* Darker text for better readability */
    font-size: 1.1rem;
    /* Slightly larger */
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: #262468;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* App Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    perspective: 1000px;
    /* Enable 3D perspective */
}

.app-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.1s ease-out, box-shadow 0.3s;
    /* Faster transform for tilt */
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
    will-change: transform;
}

.app-card:hover {
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.app-thumbnail {
    height: 200px;
    overflow: hidden;
    background-color: var(--navy-blue);
}

.app-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.app-card:hover .app-thumbnail img {
    transform: scale(1.05);
}

.app-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.app-content h2 {
    color: var(--navy-blue);
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.app-content p {
    color: #0f172a;
    /* Dark Navy for high contrast */
    margin-bottom: 24px;
    flex-grow: 1;
    font-size: 1.05rem;
    /* Increased font size */
    line-height: 1.6;
    /* Better spacing */
    font-weight: 500;
    /* Medium weight */
}

.btn-block {
    display: block;
    width: 100%;
}

/* Footer */
footer {
    background-color: var(--navy-blue);
    color: var(--soft-gray);
    padding: 40px 0;
    text-align: center;
    margin-top: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: slideIn 0.3s;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 25px;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-header {
    margin-bottom: 24px;
    text-align: center;
}

.modal-header h2 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    /* Bold */
    color: #0f172a;
    /* Dark Navy */
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1.1rem;
    /* Larger input text */
    transition: border-color var(--transition-speed);
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 2px;
    padding: 16px;
    position: fixed;
    z-index: 1001;
    left: 50%;
    bottom: 30px;
    font-size: 17px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@-webkit-keyframes fadeout {
    from {
        bottom: 30px;
        opacity: 1;
    }

    to {
        bottom: 0;
        opacity: 0;
    }
}

@keyframes fadeout {
    from {
        bottom: 30px;
        opacity: 1;
    }

    to {
        bottom: 0;
        opacity: 0;
    }
}

/* Highlight Strategy Call Card */
.app-card[data-id="strategy-call"] {
    border: 2px solid #fbbf24;
    /* Gold/Amber border */
    animation: pulse-border 2s infinite;
}

.app-card[data-id="strategy-call"] .view-app-btn {
    background-color: #fbbf24;
    color: #000000;
    font-weight: 700;
}

.app-card[data-id="strategy-call"] .view-app-btn:hover {
    background-color: #f59e0b;
    transform: translateY(-2px);
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(251, 191, 36, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

/* Spinner for Loading State */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Social Proof Ticker */
#social-ticker {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: auto;
    max-width: 350px;
    background-color: rgba(15, 23, 42, 0.95);
    /* Darker, less transparent */
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    /* Pill shape */
    text-align: left;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    /* Ensure it's on top */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    transition: all 0.3s ease;
}

#social-ticker:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    border-color: var(--secondary-color);
}

.ticker-item {
    animation: fadeTicker 0.5s ease-in-out;
}

@keyframes fadeTicker {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typewriter Cursor */
.cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--secondary-color);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Glowing Orb Container */
#orb-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    /* Behind particles */
    pointer-events: none;
    /* Let clicks pass through */
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .app-grid {
        grid-template-columns: 1fr;
    }

    #social-ticker {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}