/* Import Google Fonts with subset optimization */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap&text=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.%7C-');

:root {
    --primary-color: #2c8ea3;
    --background-color: #ffffff;
    --text-color: #333333;
    --accent-color: #ffffff;
    --border-radius-sm: 8px;
    --border-radius-lg: 12px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --transition-speed: 0.3s;
    --page-padding: 10px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Accessibility: Improve focus styles */
*:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: var(--page-padding);
    overflow: hidden;
}

body {
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--page-padding);
    border: 5px solid var(--primary-color);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-box-pack: center;
    -webkit-box-align: center;
}

.card {
    max-width: 600px;
    width: 100%;
    padding: var(--spacing-xl);
    text-align: center;
    background-color: var(--background-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed) ease;
}

.card:hover {
    transform: translateY(-2px);
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    margin-bottom: var(--spacing-lg);
    object-fit: cover;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

h1 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
}

.role {
    font-size: clamp(1rem, 2vw, 1.1rem);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.location {
    color: #666;
    margin-bottom: var(--spacing-md);
    font-size: clamp(0.9rem, 1.8vw, 1rem);
}

.description {
    margin-bottom: var(--spacing-md);
}

.cv-link {
    margin-bottom: var(--spacing-xl);
}

.networks {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.social-link {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.75rem var(--spacing-md);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed) ease;
    min-width: 120px;
    font-weight: 500;
    will-change: transform, background-color;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.social-link:hover,
.social-link:focus {
    background-color: var(--primary-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Mobile optimization */
@media (max-width: 480px) {
    :root {
        --page-padding: 5px;
    }

    .networks {
        flex-direction: column;
        gap: calc(var(--spacing-sm) + 0.25rem);
    }

    .social-link {
        justify-content: center;
        width: 100%;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #006080;
        --text-color: #000000;
    }
}

.accent {
    color: #2c8ea3;
    text-decoration: none;
}

.accent:hover {
    text-decoration: underline;
}

.cv {
    font-weight: 500;
    background-color: var(--primary-color);
    border-radius: 500px;
    padding: 0 10px;
    white-space: nowrap;
    color: var(--accent-color);
    box-shadow: 0 0 0 0 rgba(44, 142, 163, 0.8);
    -webkit-animation: pulse 1.5s infinite cubic-bezier(0.33, 0, 0, 1);
    -moz-animation: pulse 1.5s infinite cubic-bezier(0.33, 0, 0, 1);
    -ms-animation: pulse 1.5s infinite cubic-bezier(0.33, 0, 0, 1);
    animation: pulse 1.5s infinite cubic-bezier(0.33, 0, 0, 1);
}

@keyframes pulse {
    to {
        box-shadow: 0 0 0 12px rgba(44, 142, 163, 0);
    }
}

@-webkit-keyframes pulse {
    to {
        box-shadow: 0 0 0 12px rgba(44, 142, 163, 0);
    }
}

.accent.cv:hover {
    text-decoration: none;
    opacity: 0.9;
}