/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    /* Ensure safe area insets are properly calculated */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    color: #f8fafc;
    overflow-x: hidden;
    position: relative;
    background: #1a1a1a;
}

/* 
 * Safe Area Insets - Viewport Requirements
 * Make sure your HTML includes:
 * <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
 * The viewport-fit=cover is crucial for safe area insets to work properly
 */

/* IMMEDIATE THEME APPLICATION - Prevents flash on mobile */
/* Apply light theme immediately if system prefers light mode */
@media (prefers-color-scheme: light) {
    body {
        background: #f8fafc;
        color: #1a1a1a;
    }
    
    .avatar,
    .avatar-fallback {
        border: 3px solid #1a1a1a;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
    
    .profile-name {
        color: #1a1a1a;
    }
    
    .profile-bio {
        color: #2a2a2a;
    }
    
    .social-icon {
        color: #2a2a2a;
    }
    
    .social-icon:hover {
        color: #1a1a1a;
    }
    
    .link-item {
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(107, 114, 128, 0.3);
        color: #1a1a1a;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }
    
    .link-item:hover {
        background: rgba(248, 250, 252, 0.95);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }
    
    .link-icon {
        color: #3a3a3a;
    }
    
    .link-item:hover .link-icon {
        color: #1a1a1a;
    }
    
    .link-description {
        color: #3a3a3a;
    }
    
    .link-item:hover .link-description {
        color: #2a2a2a;
    }
    
    .link-arrow {
        color: #1a1a1a;
    }
    
    .iframe-container {
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(107, 114, 128, 0.3);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }
    
    .iframe-container:hover {
        background: rgba(248, 250, 252, 0.95);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }
    
    .menu-separator {
        background: rgba(107, 114, 128, 0.3);
    }
    
    .menu-item {
        background: rgba(248, 250, 252, 0.7);
        border: 1px solid rgba(107, 114, 128, 0.2);
        color: #1a1a1a;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .menu-item:hover {
        background: rgba(241, 245, 249, 0.8);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }
    
    .menu-icon {
        color: #3a3a3a;
    }
    
    .menu-item:hover .menu-icon {
        color: #1a1a1a;
    }
    
    .menu-description {
        color: #3a3a3a;
    }
    
    .menu-item:hover .menu-description {
        color: #2a2a2a;
    }
    
    .footer p {
        color: #3a3a3a;
    }
    
    .theme-toggle {
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(107, 114, 128, 0.4);
        color: #1a1a1a;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }
    
    .theme-toggle:hover {
        background: rgba(248, 250, 252, 0.95);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    .theme-toggle:focus-visible {
        outline: 2px solid rgba(58, 58, 58, 0.8);
        outline-offset: 2px;
    }
    
    /* Light mode - show sun, hide moon */
    .sun-icon {
        opacity: 1;
        transform: rotate(0deg) scale(1);
        pointer-events: auto;
    }
    
    .moon-icon {
        opacity: 0;
        transform: rotate(-180deg) scale(0.3);
        pointer-events: none;
    }
    
    /* Modal light mode styles - Fix remaining blue colors */
    .modal-close {
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(107, 114, 128, 0.3);
        color: #1a1a1a;
    }
    
    .modal-close:hover {
        background: rgba(248, 250, 252, 0.95);
    }
    
    .modal-header h2 {
        color: #1a1a1a;
    }
    
    .modal-body p {
        color: #2a2a2a;
    }
    
    .highlight-item {
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    .highlight-item::before {
        background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    }
    
    .highlight-item:hover {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.15);
        box-shadow: 
            0 16px 64px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    
    .highlight-text {
        color: #1a1a1a;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    }
    
    .value-item {
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    .value-item::before {
        background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    }
    
    .value-item:hover {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.15);
        box-shadow: 
            0 16px 64px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    
    .value-item h3 {
        color: #1a1a1a;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    }
    
    .value-item p {
        color: #2a2a2a;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    }
    
    .contact-method {
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 0, 0, 0.1);
        color: #1a1a1a;
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    .contact-method::before {
        background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    }
    
    .contact-method:hover {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.15);
        color: #1a1a1a;
        box-shadow: 
            0 16px 64px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    
    .contact-icon {
        background: rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 
            0 4px 16px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    
    .contact-icon svg {
        color: #1a1a1a;
        filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.3));
    }
    
    .contact-title {
        color: #1a1a1a;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    }
    
    .contact-subtitle {
        color: #3a3a3a;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    }
    
    .contact-note {
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-left: 4px solid rgba(0, 0, 0, 0.2);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    
    .contact-note::before {
        background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    }
    
    .contact-note p {
        color: #1a1a1a;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    }
    
    .quote-text {
        color: #7d7d7d;
    }
    
    .quote-author {
        color: #5d5e5f;
    }
}

/* Background Pattern - Removed for solid color */
.background-pattern {
    display: none;
}

/* Container */
.container {
    max-width: 580px;
    margin: 0 auto;
    padding: 5rem 1.5rem 2rem;
    /* Add safe area padding to prevent content from being cut off */
    padding-top: calc(5rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    padding-left: calc(1.5rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1.5rem + env(safe-area-inset-right, 0px));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Profile Section */
.profile {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease-out;
}

.profile-image {
    margin-bottom: 0.75rem;
    position: relative;
}

.avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    border: 3px solid #ffffff;
}

.avatar-fallback {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #4a5568;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    margin: 0 auto;
    border: 3px solid #ffffff;
}

.avatar:hover,
.avatar-fallback:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.profile-name {
    font-size: 1.625rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.025em;
}

.profile-bio {
    font-size: 1rem;
    color: #b5b5b5;
    font-weight: 400;
    white-space: nowrap;
}

/* Social Icons Section */
.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.social-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.social-icon:hover {
    transform: translateY(-2px);
    color: #f1f5f9;
}

.social-icon svg {
    width: 28px;
    height: 28px;
}

/* Links Section */
.links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Newsletter Card */
.newsletter-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem;
    background: rgba(35, 35, 35, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(75, 85, 99, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.newsletter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    background: rgba(45, 45, 45, 0.95);
}

.newsletter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.newsletter-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    flex-shrink: 0;
}

.newsletter-icon svg {
    width: 24px;
    height: 24px;
}

.newsletter-content {
    flex: 1;
}

.newsletter-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.25rem 0;
}

.newsletter-subtitle {
    font-size: 0.875rem;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.4;
}

.newsletter-cta {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.newsletter-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.newsletter-card:hover .newsletter-button {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.link-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(35, 35, 35, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    text-decoration: none;
    color: #f8fafc;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(75, 85, 99, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    background: rgba(45, 45, 45, 0.95);
}

/* Image Card Styles */
.link-item.image-card {
    padding: 0;
    height: 200px;
    flex-direction: column;
}

.card-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.link-item.image-card:hover .card-image img {
    transform: scale(1.02);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        transparent 100%
    );
    padding: 1.5rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    color: white;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: white;
}

.card-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.card-arrow {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
    opacity: 0.8;
}

.link-item.image-card:hover .card-arrow {
    transform: translateX(4px);
}

.contact-method:hover .card-arrow {
    transform: translateX(4px);
    color: rgba(255, 255, 255, 1);
    opacity: 1;
}

/* Regular Link Styles */
.link-icon {
    width: 22px;
    height: 22px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #cbd5e1;
    transition: color 0.3s ease;
}

.link-item:hover .link-icon {
    color: #ffffff;
}

.link-icon svg {
    width: 100%;
    height: 100%;
}

.link-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.link-text {
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.link-description {
    font-size: 0.875rem;
    color: #a1a1aa;
    transition: color 0.3s ease;
    font-weight: 400;
    margin-top: -0.125rem;
}

.link-item:hover .link-description {
    color: #e4e4e7;
}

.link-arrow {
    font-size: 1.125rem;
    color: #ffffff;
    transition: transform 0.3s ease;
    margin-left: 1rem;
    font-weight: 600;
}

.link-item:hover .link-arrow {
    transform: translateX(3px);
}

/* Menu Separator */
.menu-separator {
    width: 100%;
    height: 1px;
    background: rgba(75, 85, 99, 0.3);
    margin: 0.75rem 0 1rem;
}

/* Menu Section */
.menu {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    justify-content: center;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(25, 25, 25, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    text-decoration: none;
    color: #f8fafc;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(75, 85, 99, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    flex: 1;
    max-width: 140px;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.menu-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    background: rgba(35, 35, 35, 0.8);
}

.menu-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #cbd5e1;
    transition: color 0.3s ease;
}

.menu-item:hover .menu-icon {
    color: #ffffff;
}

.menu-icon svg {
    width: 100%;
    height: 100%;
}

.menu-text-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
}

.menu-text {
    font-weight: 600;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    line-height: 1.2;
}

.menu-description {
    font-size: 0.7rem;
    color: #a1a1aa;
    transition: color 0.3s ease;
    font-weight: 400;
    line-height: 1.3;
    display: none;
}

.menu-item:hover .menu-description {
    color: #e4e4e7;
}

.menu-arrow {
    display: none;
}

/* Quote Section */
.quote-section {
    text-align: center;
    margin: 2rem 0;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.quote-text {
    font-size: 0.9rem;
    color: #b7b7b7;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    font-weight: 400;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.quote-author {
    font-size: 0.8rem;
    color: #7b7c7c;
    font-weight: 500;
    letter-spacing: 0.025em;
    margin: 0;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 2rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.footer-content {
    text-align: center;
}

.footer p {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0;
}

/* Theme Toggle - Bottom Right of Page */
.theme-toggle {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(35, 35, 35, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.4);
    color: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    background: rgba(45, 45, 45, 0.95);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.theme-toggle:focus-visible {
    outline: 2px solid rgba(156, 163, 175, 0.8);
    outline-offset: 2px;
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Theme Icons */
.theme-icon {
    width: 24px;
    height: 24px;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

/* Dark mode (default) - show moon, hide sun */
.moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.sun-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.3);
    pointer-events: none;
}

/* Light Mode Styles */
body.light-mode {
    background: #f8fafc;
    color: #1a1a1a;
}

body.light-mode .avatar,
body.light-mode .avatar-fallback {
    border: 3px solid #1a1a1a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.light-mode .profile-name {
    color: #1a1a1a;
}

body.light-mode .profile-bio {
    color: #2a2a2a;
}

body.light-mode .social-icon {
    color: #2a2a2a;
}

body.light-mode .social-icon:hover {
    color: #1a1a1a;
}

body.light-mode .link-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(107, 114, 128, 0.3);
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.light-mode .link-item:hover {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body.light-mode .link-icon {
    color: #3a3a3a;
}

body.light-mode .link-item:hover .link-icon {
    color: #1a1a1a;
}

body.light-mode .link-description {
    color: #3a3a3a;
}

body.light-mode .link-item:hover .link-description {
    color: #2a2a2a;
}

body.light-mode .link-arrow {
    color: #1a1a1a;
}

body.light-mode .iframe-container {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(107, 114, 128, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.light-mode .iframe-container:hover {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body.light-mode .menu-separator {
    background: rgba(107, 114, 128, 0.3);
}

body.light-mode .menu-item {
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(107, 114, 128, 0.2);
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-mode .menu-item:hover {
    background: rgba(241, 245, 249, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body.light-mode .menu-icon {
    color: #3a3a3a;
}

body.light-mode .menu-item:hover .menu-icon {
    color: #1a1a1a;
}

body.light-mode .menu-description {
    color: #3a3a3a;
}

body.light-mode .menu-item:hover .menu-description {
    color: #2a2a2a;
}

body.light-mode .footer p {
    color: #3a3a3a;
}

body.light-mode .quote-text {
    color: #7f7f7f;
}

body.light-mode .quote-author {
    color: #5e5e5e;
}

body.light-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(107, 114, 128, 0.4);
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.light-mode .theme-toggle:hover {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

body.light-mode .theme-toggle:focus-visible {
    outline: 2px solid rgba(58, 58, 58, 0.8);
    outline-offset: 2px;
}

/* Light mode - show sun, hide moon */
body.light-mode .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    pointer-events: auto;
}

body.light-mode .moon-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.3);
    pointer-events: none;
}

/* Modal Light Mode Styles */
body.light-mode .modal-overlay {
    /* Match light mode background (#f8fafc) with opacity for seamless safe area blending */
    background: rgba(248, 250, 252, 0.85);
}

body.light-mode .modal-close {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(107, 114, 128, 0.3);
    color: #1a1a1a;
}

body.light-mode .modal-close:hover {
    background: rgba(248, 250, 252, 0.95);
}

body.light-mode .modal-header h2 {
    color: #1a1a1a; /* Change from #f8fafc (white) to dark */
}

body.light-mode .modal-body p {
    color: #2a2a2a; /* Change from #e2e8f0 (light gray) to dark gray */
}

body.light-mode .highlight-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 4px solid rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-mode .highlight-item::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

body.light-mode .highlight-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-mode .highlight-text {
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

body.light-mode .highlight-subtitle {
    color: rgba(26, 26, 26, 0.8);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

body.light-mode .highlight-description {
    color: rgba(26, 26, 26, 0.6);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

body.light-mode .card-arrow {
    color: rgba(26, 26, 26, 0.6);
    opacity: 0.7;
}

body.light-mode .contact-method:hover .card-arrow {
    color: rgba(26, 26, 26, 0.8);
    opacity: 1;
}

body.light-mode .value-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.light-mode .value-item::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

body.light-mode .value-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

body.light-mode .value-item h3 {
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

body.light-mode .value-item p {
    color: #2a2a2a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    margin: 0 0 1.2rem 0;
}

body.light-mode .contact-method {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.light-mode .contact-method::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

body.light-mode .contact-method:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

body.light-mode .contact-icon {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light-mode .contact-icon svg {
    color: #1a1a1a;
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.3));
}

body.light-mode .contact-title {
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

body.light-mode .contact-subtitle {
    color: #3a3a3a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

body.light-mode .contact-note {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 4px solid rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-mode .contact-note::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

body.light-mode .contact-note p {
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 4rem 1rem 1.5rem;
        /* Add safe area padding for mobile */
        padding-top: calc(4rem + env(safe-area-inset-top, 0px));
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
        padding-left: calc(1rem + env(safe-area-inset-left, 0px));
        padding-right: calc(1rem + env(safe-area-inset-right, 0px));
        max-width: 100%;
    }
    
    .avatar,
    .avatar-fallback {
        width: 100px;
        height: 100px;
        font-size: 2.25rem;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .profile-bio {
        font-size: 0.9rem;
    }
    
    .social-icons {
        gap: 1.25rem;
        margin-bottom: 2rem;
    }
    
    .social-icon {
        width: 32px;
        height: 32px;
    }
    
    .social-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .link-item {
        padding: 0.6rem 0.875rem;
        font-size: 0.95rem;
    }
    
    .iframe-container {
        max-width: 100%;
        padding: 0.6rem;
    }
    
    .iframe-container iframe {
        height: 280px;
    }
    
    .link-item.image-card {
        height: 180px;
    }
    
    .menu {
        gap: 0.75rem;
    }
    
    .menu-item {
        padding: 0.875rem 1rem;
        font-size: 0.8rem;
        max-width: 120px;
    }
    
    .card-overlay {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .link-icon {
        width: 20px;
        height: 20px;
        margin-right: 0.875rem;
    }
    
    .links {
        gap: 0.875rem;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .theme-icon {
        width: 20px;
        height: 20px;
    }
    
    .quote-text {
        font-size: 0.85rem;
        max-width: 300px;
    }
    
    .quote-author {
        font-size: 0.75rem;
    }

}

@media (max-width: 480px) {
    .container {
        padding: 2.5rem 0.75rem 1.25rem;
        /* Add safe area padding for small mobile */
        padding-top: calc(2.5rem + env(safe-area-inset-top, 0px));
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
        padding-left: calc(0.75rem + env(safe-area-inset-left, 0px));
        padding-right: calc(0.75rem + env(safe-area-inset-right, 0px));
    }
    
    .avatar,
    .avatar-fallback {
        width: 90px;
        height: 90px;
        font-size: 2rem;
    }
    
    .profile-name {
        font-size: 1.375rem;
    }
    
    .profile-bio {
        font-size: 0.85rem;
    }
    
    .social-icons {
        gap: 1rem;
    }
    
    .social-icon {
        width: 28px;
        height: 28px;
    }
    
    .social-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .link-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .iframe-container {
        padding: 0.5rem;
    }
    
    .iframe-container iframe {
        height: 240px;
    }
    
    .link-item.image-card {
        height: 160px;
    }
    
    .menu {
        gap: 0.5rem;
    }
    
    .menu-item {
        padding: 0.75rem 0.875rem;
        font-size: 0.75rem;
        max-width: 100px;
    }
    
    .card-overlay {
        padding: 1rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        bottom: 0.75rem;
        right: 0.75rem;
    }
    
    .theme-icon {
        width: 18px;
        height: 18px;
    }
    
    .quote-text {
        font-size: 0.8rem;
        max-width: 280px;
    }
    
    .quote-author {
        font-size: 0.7rem;
    }

}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .link-item,
    .social-icon,
    .menu-item {
        border: 2px solid rgba(156, 163, 175, 0.8);
    }
    
    body {
        background: #000;
    }
    
    .link-item:hover,
    .social-icon:hover,
    .menu-item:hover {
        background: #2a2a2a;
    }
}

/* Print styles */
@media print {
    .background-pattern {
        display: none;
    }
    
    body {
        background: white !important;
        color: #000 !important;
    }
    
    .link-item,
    .social-icon,
    .menu-item {
        background: white !important;
        border: 1px solid #4a4a4a !important;
        box-shadow: none !important;
        color: #000 !important;
    }
    
    .profile-name,
    .profile-bio,
    .link-text,
    .link-description,
    .menu-text,
    .menu-description {
        color: #000 !important;
    }
}

/* Focus styles for accessibility */
.link-item:focus-visible,
.social-icon:focus-visible,
.menu-item:focus-visible {
    outline: 2px solid rgba(156, 163, 175, 0.8);
    outline-offset: 2px;
}

/* Loading state */
.container {
    opacity: 0;
    animation: containerFadeIn 0.5s ease-out 0.1s forwards;
}

@keyframes containerFadeIn {
    to {
        opacity: 1;
    }
}

/* Improved spacing for larger screens */
@media (min-width: 768px) {
    .container {
        padding: 6rem 2rem 3rem;
        /* Add safe area padding for desktop */
        padding-top: calc(6rem + env(safe-area-inset-top, 0px));
        padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
        padding-left: calc(2rem + env(safe-area-inset-left, 0px));
        padding-right: calc(2rem + env(safe-area-inset-right, 0px));
    }
    
    .profile {
        margin-bottom: 2rem;
    }
    
    .social-icons {
        gap: 2rem;
        margin-bottom: 3rem;
    }
    
    .social-icon {
        width: 32px;
        height: 32px;
    }
    
    .social-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .links {
        gap: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .link-item {
        padding: 0.875rem 1.25rem;
        font-size: 1.05rem;
    }
    
    .link-item.image-card {
        height: 220px;
    }
    
    .menu {
        gap: 1.25rem;
    }
    
    .menu-item {
        padding: 1.25rem 1.5rem;
        font-size: 0.9rem;
        max-width: 160px;
    }
    

} 

/* Modal System - iOS-style animations */
.modal-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.modal-overlay {
    position: fixed;
    /* Simple approach - fills entire viewport including safe areas */
    inset: 0;
    /* Match dark mode background (#1a1a1a) with opacity for seamless safe area blending */
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    z-index: 999; /* Lower than modal content */
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: transparent;
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    overflow: hidden;
    visibility: hidden;
    z-index: 1000; /* Higher than overlay */
}

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

.modal-close {
    position: absolute;
    /* Position relative to safe area */
    top: calc(1.5rem + env(safe-area-inset-top, 0px));
    right: calc(1.5rem + env(safe-area-inset-right, 0px));
    width: 40px;
    height: 40px;
    background: rgba(35, 35, 35, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 50%;
    color: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.5) translateY(-20px);
    z-index: 1001; /* Above modal content */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.modal.active .modal-close {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition-delay: 0s;
}

.modal-close:hover {
    background: rgba(45, 45, 45, 0.95);
    transform: scale(1.1) translateY(0);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-content {
    padding: 6rem 2rem 6rem;
    /* Add safe area padding to prevent content from being cut off */
    padding-top: calc(6rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
    padding-left: calc(2rem + env(safe-area-inset-left, 0px));
    padding-right: calc(2rem + env(safe-area-inset-right, 0px));
    min-height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Ensure proper scrolling behavior on mobile */
    position: relative;
    box-sizing: border-box;
}

.modal.active .modal-content {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.modal-body {
    max-width: 600px;
    margin: 0 auto;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 3rem;
}

.modal-body p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
}

/* About Modal Styles */
.modal-highlights {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.highlight-item {
    display: flex;
    align-items: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.highlight-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.highlight-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.highlight-icon {
    font-size: 2rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.highlight-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.highlight-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.highlight-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.highlight-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Mission Modal Styles */
.mission-values {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
}

.value-item {
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.value-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.value-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.value-item:last-child {
    margin-bottom: 0;
}

.value-item h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.value-item p {
    font-size: 1.125rem;
    color: #e2e8f0;
    line-height: 1.7;
    margin: 0 0 1.2rem 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Contact Modal Styles */
.contact-methods {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.contact-method {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-decoration: none;
    color: #ffffff;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Fix layout for Contact modal (with icons) */
#modal-contact .contact-method {
    justify-content: flex-start;
    gap: 1.5rem;
}

.contact-method::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.contact-method:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.contact-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin-right: 1.5rem;
    flex-shrink: 0;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.contact-icon svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.contact-subtitle {
    font-size: 1rem;
    color: #cbd5e1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.contact-note {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.contact-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.contact-note p {
    margin: 0;
    font-size: 1.125rem;
    color: #ffffff;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
}

/* Responsive Design for Modals */
@media (max-width: 640px) {
    .modal-content {
        padding: 5rem 1.5rem 6rem;
        /* Add safe area padding for mobile */
        padding-top: calc(5rem + env(safe-area-inset-top, 0px));
        padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
        padding-left: calc(1.5rem + env(safe-area-inset-left, 0px));
        padding-right: calc(1.5rem + env(safe-area-inset-right, 0px));
    }
    
    .modal-header h2 {
        font-size: 1.75rem;
    }
    
    .modal-close {
        /* Position relative to safe area on mobile */
        top: calc(1rem + env(safe-area-inset-top, 0px));
        right: calc(1rem + env(safe-area-inset-right, 0px));
        width: 36px;
        height: 36px;
    }
    
    .modal-close svg {
        width: 18px;
        height: 18px;
    }
    
    .highlight-item,
    .value-item,
    .contact-method {
        padding: 1.25rem;
    }
    
    .contact-icon {
        width: 40px;
        height: 40px;
    }
    
    .contact-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 4rem 1rem 6rem;
        /* Add safe area padding for small mobile */
        padding-top: calc(4rem + env(safe-area-inset-top, 0px));
        padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
        padding-left: calc(1rem + env(safe-area-inset-left, 0px));
        padding-right: calc(1rem + env(safe-area-inset-right, 0px));
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body p {
        font-size: 1rem;
    }
    
    .highlight-item,
    .value-item,
    .contact-method {
        padding: 1rem;
    }
    
    .highlight-icon {
        font-size: 1.5rem;
    }
    
    .highlight-text {
        font-size: 1rem;
    }
}

/* Desktop optimizations */
@media (min-width: 768px) {
    .modal-content {
        padding: 8rem 3rem 3rem;
        /* Add safe area padding for desktop */
        padding-top: calc(8rem + env(safe-area-inset-top, 0px));
        padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
        padding-left: calc(3rem + env(safe-area-inset-left, 0px));
        padding-right: calc(3rem + env(safe-area-inset-right, 0px));
    }
    
    .modal-header h2 {
        font-size: 2.5rem;
    }
    
    .modal-body {
        max-width: 700px;
        padding-bottom: 3rem;
    }
    
    .modal-highlights {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .mission-values {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .contact-methods {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Animation states for menu items during modal opening */
.menu-item.modal-opening .menu-text-content,
.menu-item.modal-opening .menu-icon,
.menu-item.modal-opening .menu-arrow {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

/* Ensure smooth animations on all devices */
.modal * {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* Improve rendering performance */
.modal-system.active {
    pointer-events: all;
}

.modal-system.active .modal {
    transform: translateZ(0);
}

/* Focus styles for modal elements */
.modal-close:focus-visible,
.contact-method:focus-visible {
    outline: 2px solid rgba(156, 163, 175, 0.8);
    outline-offset: 2px;
}

/* Ensure modal content is scrollable on mobile */
.modal-content::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.modal-content {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Mobile-specific modal fixes */
@media (max-width: 768px) {
    .modal {
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height where supported */
    }
    
    .modal-content {
        /* Ensure content doesn't exceed viewport on mobile */
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        /* Add momentum scrolling for iOS */
        -webkit-overflow-scrolling: touch;
        /* Prevent zoom on iOS */
        touch-action: pan-y;
    }
    
    .modal-body {
        /* Ensure modal body can flex and scroll properly */
        flex: 1 1 auto;
        min-height: 0;
        overflow: visible;
        padding-bottom: 3rem;
    }
} 