/* 
  Theme: Zoanthus Deep Sea
  Color Palette: Deep ocean blues, dark backgrounds, bioluminescent greens, purples, and coral accents.
*/

:root {
    --bg-color: #020617; /* Very deep ocean blue */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Bioluminescent accents */
    --accent-green: #10b981; /* Glowing coral green */
    --accent-purple: #8b5cf6; /* Deep sea purple */
    --accent-cyan: #06b6d4;
    
    /* UI Elements */
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-hover: rgba(30, 41, 59, 0.8);
    
    /* Typography */
    --font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    position: relative;
}

/* Glass Panel Utility (Liquid Glass Effect) */
.glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.005));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 3rem;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* Abstract Background Motifs (Zoanthus Coral Inspired) */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    top: -200px;
    right: -200px;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-green) 0%, transparent 70%);
    bottom: -100px;
    left: -150px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    100% { transform: translate(-30px, 50px) scale(1.1); opacity: 0.5; }
}

/* Decorative Motifs */
.bg-motif {
    position: fixed;
    z-index: -1;
    opacity: 0.25; /* Increased opacity to make it bolder */
    pointer-events: none; /* Let clicks pass through */
    filter: brightness(1.2); /* Adjust brightness since it's already white lines */
    mix-blend-mode: screen; /* Drops any black background remaining from the inversion */
    animation: slowSpin 120s linear infinite;
}

.motif-top-left {
    top: -125px;
    left: -125px;
    width: 350px;
}

.motif-bottom-right {
    bottom: -150px;
    right: -150px;
    width: 400px;
    animation-direction: reverse;
}

.motif-center-left {
    top: 40%;
    left: -200px;
    width: 450px;
    opacity: 0.15;
}

@keyframes slowSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Layout */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 8rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to left, var(--text-main), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 0;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseDot 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulseDot {
    to { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}

.hero-title {
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: 0.1em; /* Only slight tracking for premium feel, not huge untracked */
    margin-bottom: 3rem;
    
    /* Shine Effect */
    background: linear-gradient(
        90deg, 
        var(--accent-cyan) 0%, 
        var(--accent-purple) 25%, 
        #ffffff 50%, 
        var(--accent-purple) 75%, 
        var(--accent-cyan) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(139, 92, 246, 0.2);
    
    animation: shineText 4s linear infinite;
    will-change: background-position;
}

@keyframes shineText {
    to { background-position: -200% center; }
}

.hero-bio {
    max-width: 800px;
    font-size: 1.25rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
}

.hero-bio p {
    transition: color 0.3s ease;
}

.hero-bio p:hover {
    color: var(--text-main);
}

/* Portfolio Section */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.app-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.005));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    
    /* Hardware Acceleration & Optimized Transitions */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    will-change: transform;
    
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 2px 6px rgba(255, 255, 255, 0.1);
}

/* Ensure contents sit above the hover pseudo-element */
.app-card > * {
    position: relative;
    z-index: 1;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

/* Performance-Optimized Lighting Layer */
.app-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 25px rgba(16, 185, 129, 0.2), inset 0 2px 10px rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.app-card:hover {
    transform: translateY(-4px) translateZ(0);
}

.app-card:hover::after {
    opacity: 1;
}

.app-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    object-fit: cover;
}

.card-content {
    flex-grow: 1;
    margin-bottom: 2rem;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    min-height: 48px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-download:hover {
    background: var(--text-main);
    color: var(--bg-color);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* Contact Section */
.contact-section {
    padding-bottom: 10rem;
}

.contact-terminal {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.005));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.1);
}

.terminal-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot:nth-child(1) { background-color: #ff5f56; }
.dot:nth-child(2) { background-color: #ffbd2e; }
.dot:nth-child(3) { background-color: #27c93f; }

.terminal-body {
    padding: 3rem 2rem;
    text-align: center;
}

.terminal-body p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.social-placeholders {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.social-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
}

.social-icon:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(6, 182, 212, 0.2);
}

/* Click-to-copy Email Pill */
.contact-email {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.005));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    padding: 0.5rem 1.5rem 0.5rem 0.5rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.contact-email:hover {
    transform: translateY(-3px);
    border-color: var(--accent-cyan);
    box-shadow: 0 5px 15px rgba(6, 182, 212, 0.2);
}

.contact-email .social-icon {
    margin: 0;
}

.contact-email:hover .social-icon {
    transform: none;
    box-shadow: none;
    color: var(--accent-cyan);
}

.email-text {
    font-family: monospace, system-ui, sans-serif;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 500;
}

.copy-tooltip {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--accent-green);
    color: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.copy-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* Entrance Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

/* Responsive Design & Mobile Optimizations */
@media (max-width: 1024px) {
    main {
        padding: 0 1.5rem;
    }

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

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    main {
        padding: 0 1rem;
    }

    section {
        padding: 4.5rem 0;
    }

    /* Background & Motifs on Mobile */
    .bg-glow-1 {
        width: 320px;
        height: 320px;
        top: -100px;
        right: -100px;
        filter: blur(80px);
    }

    .bg-glow-2 {
        width: 280px;
        height: 280px;
        bottom: -50px;
        left: -80px;
        filter: blur(80px);
    }

    .bg-motif {
        opacity: 0.15;
    }

    .motif-top-left {
        top: -80px;
        left: -80px;
        width: 220px;
    }

    .motif-bottom-right {
        bottom: -100px;
        right: -100px;
        width: 240px;
    }

    .motif-center-left {
        display: none; /* Hide middle motif on mobile to reduce rendering workload */
    }

    /* Glassmorphism Mobile Performance (Lighter blur for smooth GPU performance) */
    .glass-panel,
    .contact-terminal {
        padding: 2rem 1.25rem;
        border-radius: 20px;
        backdrop-filter: blur(8px) saturate(120%);
        -webkit-backdrop-filter: blur(8px) saturate(120%);
    }

    .app-card {
        padding: 1.75rem 1.25rem;
        border-radius: 18px;
        backdrop-filter: blur(8px) saturate(120%);
        -webkit-backdrop-filter: blur(8px) saturate(120%);
        text-align: center;
        align-items: center;
    }

    /* Hero Section Mobile */
    .hero-section {
        min-height: auto;
        padding-top: 6rem;
        padding-bottom: 3rem;
    }

    .status-badge {
        font-size: 0.85rem;
        padding: 0.45rem 1rem;
        margin-bottom: 1.5rem;
        gap: 0.5rem;
    }

    .hero-title {
        font-size: clamp(2.75rem, 13vw, 4.5rem);
        letter-spacing: 0.04em;
        margin-bottom: 2rem;
        line-height: 1.15;
    }

    .hero-bio {
        font-size: 1.05rem;
        line-height: 1.85;
        padding: 1.75rem 1.25rem;
        gap: 1.25rem;
        width: 100%;
    }

    /* Portfolio Section Mobile */
    .section-header {
        margin-bottom: 2.5rem;
    }

    .section-header h2 {
        font-size: 1.85rem;
    }

    .subtitle {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .card-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 1.25rem;
    }

    .card-content {
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .card-content h3 {
        font-size: 1.35rem;
        margin-bottom: 0.5rem;
    }

    .card-content p {
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .btn-download {
        min-height: 48px;
        font-size: 1rem;
    }

    /* Contact Section Mobile */
    .contact-section {
        padding-bottom: 6rem;
    }

    .terminal-header {
        padding: 0.75rem 1.25rem;
    }

    .terminal-body {
        padding: 2.25rem 1.25rem;
    }

    .terminal-body p {
        font-size: 0.98rem;
        line-height: 1.7;
        margin-bottom: 1.75rem;
    }

    .social-placeholders {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .contact-email {
        width: 100%;
        max-width: 320px;
        justify-content: center;
        padding: 0.5rem 1rem;
        min-height: 48px;
    }

    .email-text {
        font-size: 0.95rem;
    }

    .social-icon {
        min-width: 48px;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0 0.85rem;
    }

    .glass-panel,
    .contact-terminal {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .hero-title {
        font-size: clamp(2.4rem, 12vw, 3.2rem);
        letter-spacing: 0.02em;
    }

    .hero-bio {
        font-size: 0.95rem;
        line-height: 1.8;
        padding: 1.35rem 0.9rem;
        gap: 1rem;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .card-icon {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .card-content h3 {
        font-size: 1.25rem;
    }

    .card-content p {
        font-size: 0.88rem;
    }

    .email-text {
        font-size: 0.88rem;
    }
}
