:root {
    --primary: #007BFF;
    --primary-glow: rgba(0, 123, 255, 0.4);
    --bg: #000000;
    --card-bg: rgba(10, 10, 10, 0.8);
    --border: rgba(255, 255, 255, 0.05);
    --text: #FFFFFF;
    --text-muted: #888888;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Ambient Light */
.ambient-light {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
    opacity: 0.8;
    transition: transform 0.1s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.pulsing-spot {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: 0;
    animation: pulse 8s infinite ease-in-out;
    pointer-events: none;
}

/* Hero */
#hero {
    height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 0;
}

.hero-name {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem 3rem;
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(30px);
    animation: reveal 0.8s 0.2s forwards;
    width: 100%;
}

.name-part {
    white-space: nowrap;
    display: inline-block;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-logo {
    width: clamp(80px, 15vw, 150px);
    height: auto;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
}

@keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
}

main {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.section-title {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    margin-bottom: 2.5rem;
    display: block;
}

/* Project Cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary);
    background: rgba(0, 123, 255, 0.05);
    transform: translateY(-10px);
}

.project-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #000;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-title {
    font-size: 2rem;
    font-weight: 800;
}

.card-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
    min-height: 80px;
}

.card-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    transition: var(--transition);
    cursor: pointer;
    font-size: inherit;
    position: relative;
    z-index: 50;
}

.btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn-secondary {
    border-color: #333 !important;
    color: #888 !important;
}

.btn-secondary:hover {
    background: #333 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.btn-disabled {
    opacity: 0.2;
    pointer-events: none;
    background: transparent !important;
    color: var(--primary) !important;
}

/* Social Grid */
.social-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.social-link {
    font-size: 2.5rem;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    position: relative;
    z-index: 50;
}

.social-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 0 30px var(--primary-glow);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #050505;
    border: 1px solid var(--border);
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 123, 255, 0.1);
}

.modal-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.agreement-label {
    display: flex;
    align-items: center;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 2.5rem;
    cursor: pointer;
    gap: 1rem;
}

.agreement-label input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Legal Links (in Medhat modal) */
.legal-links {
    margin-bottom: 2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.legal-links a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.legal-links a:hover {
    text-decoration: underline;
}

.legal-links span {
    color: #444;
}

/* Email Reveal */
.email-display {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.95rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 2rem;
    word-break: break-all;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Legal Page Isolation */
.legal-page .ambient-light,
.legal-page .pulsing-spot {
    display: none !important;
}

.legal-page * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Footer */
.footer-simple {
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

/* Mobile & Tablet Optimization */
@media (max-width: 991px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .card {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    #hero {
        height: auto;
        padding: 6rem 1.5rem 3rem;
    }

    .hero-name {
        flex-direction: column;
        font-size: clamp(2.5rem, 12vw, 4rem);
        gap: 1rem;
        letter-spacing: -0.02em;
    }

    .hero-logo {
        width: 100px;
        order: -1; /* Place logo above names on narrow screens */
        margin-bottom: 1rem;
    }

    .section-title {
        text-align: center;
        margin-bottom: 2rem;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .card-desc {
        font-size: 0.95rem;
        margin-bottom: 2rem;
        min-height: auto;
    }

    .card-actions {
        flex-direction: column;
    }

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

    .social-grid {
        gap: 1rem;
    }

    .social-link {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    /* Disable cursor-spot on touch devices to prevent layout shifts */
    .ambient-light#cursor-spot {
        display: none !important;
    }

    .pulsing-spot {
        width: 300px;
        height: 300px;
        top: -5%;
        right: -5%;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .modal-content {
        padding: 2rem 1.5rem;
    }
}
