:root {
    --color-primary: #588bc7;
    --color-secondary: #5db0b4;
    --color-white: #ffffff;
    --gradient: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 2rem;
    --spacing-xl: 8rem;
    --max-width: 60rem;
}

/* Font faces with preload hints */
@font-face {
    font-display: swap;
    font-family: "Work Sans";
    font-style: normal;
    font-weight: 200;
    src: url("../fonts/work-sans-v19-latin-200.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: "Work Sans";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/work-sans-v19-latin-regular.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: "Work Sans";
    font-style: normal;
    font-weight: 600;
    src: url("../fonts/work-sans-v19-latin-600.woff2") format("woff2");
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Work Sans", sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    //padding-bottom: calc(var(--spacing-xl) + 2rem);
    background: var(--gradient);
    overflow-x: hidden;
    position: relative;
}

.background-image {
    position: fixed;
    top: 0;
    right: -15%;
    width: 150%;
    height: 100%;
    background: url('../images/bg_image.svg') no-repeat;
    background-position: right center;
    background-size: 50%;
    z-index: 0;
    pointer-events: none;
}

/* Ensure content stays above background */
.center-content, header, footer {
    position: relative;
    z-index: 1;
}

/* Margin utility classes */
.mb-0 {
    margin-bottom: 0 !important;
}

.mb-sm {
    margin-bottom: var(--spacing-sm) !important;
}

.mb-md {
    margin-bottom: var(--spacing-md) !important;
}

.mb-lg {
    margin-bottom: var(--spacing-lg) !important;
}

.mb-xl {
    margin-bottom: var(--spacing-xl) !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-sm {
    margin-top: var(--spacing-sm) !important;
}

.mt-md {
    margin-top: var(--spacing-md) !important;
}

.mt-lg {
    margin-top: var(--spacing-lg) !important;
}

.mt-xl {
    margin-top: var(--spacing-xl) !important;
}

/* Header styles */
header {
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.logo img {
    max-width: 280px;
    height: auto;
    transition: transform 0.3s ease;
}

.logo:hover img,
.logo:focus img {
    transform: scale(1.05);
}

/* Main Navigation */
.main-nav {
    max-width: var(--max-width);
    margin: var(--spacing-md) auto 0;
    padding: calc(var(--spacing-md) * 0.5);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: calc(var(--spacing-md) * 0.5);
}

.main-nav li {
    display: flex;
    align-items: center;
}

.main-nav li:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: url('../images/dot.svg') center/6px 6px no-repeat;
    margin-left: calc(var(--spacing-md) * 0.5);
}

.main-nav a {
    color: var(--color-white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
    border-bottom-color: var(--color-white);
}

/* Main content styles */
.center-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm) var(--spacing-xl);
}

.text {
    color: var(--color-white);
    margin-top: var(--spacing-lg);
}

/* Typography */
h1, h2, h3 {
    color: var(--color-white);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 0;
    line-height: 1.2;
    font-weight: 400;
}

h1 + h2 {
    font-size: 1.2em;
    text-align: center;
    margin-top: 0;
    margin-bottom: var(--spacing-lg);
    font-weight: 400;
}

h2 {
    font-size: 1.4em;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

h3 {
    font-size: 1.2em;
}

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

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.text a {
    color: var(--color-white);
    border-bottom: 1px solid transparent;
    padding: 2px 0;
}

.text a:hover,
.text a:focus {
    border-bottom-color: var(--color-white);
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--color-white);
    outline-offset: 4px;
}

/* Layout components */
.row {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-md);
}

.row > div {
    flex: 1;
}

/* Sections spacing */
section {
    margin-bottom: var(--spacing-lg);
}

section:last-child {
    margin-bottom: 0;
}

/* Contact info specific styles */
.contact-info {
    margin-bottom: var(--spacing-lg);
}

.contact-info .row > div,
.location-info {
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

/* Footer styles */
footer {
    //position: fixed;
    bottom: 0;
    width: 100%;
    padding: var(--spacing-sm) 0;
    color: var(--color-white);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo img {
    width: 140px;
    height: auto;
    transition: transform 0.3s ease;
}

.footer-logo:hover img,
.footer-logo:focus img {
    transform: scale(1.05);
}

footer nav {
    display: flex;
    gap: var(--spacing-md);
}

footer a {
    color: var(--color-white);
    padding: var(--spacing-sm);
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-white);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

footer a:hover::after,
footer a:focus::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.contact-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-lg);
    align-items: start;
}

.portrait-container {
    flex: 0 0 25%;
}

.portrait {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
}

.contact-info-container {
    flex: 1;
}

@media screen and (max-width: 600px) {
    .contact-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .portrait-container {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* Media Queries */
@media screen and (min-width: 800px) {
    .contact-info .row > div,
    .location-info {
        padding: var(--spacing-lg);
    }
}

@media screen and (min-width: 1024px) {
    .text {
        padding: 0;
    }
    
    h1 {
        font-size: 3em;
    }
}

@media screen and (max-width: 600px) {
    .row {
        flex-direction: column;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .main-nav li:not(:last-child)::after {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    footer nav {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    body {
        background: none;
        color: #000;
        padding: 2cm;
    }

    .text {
        color: #000;
    }

    section {
        background: none;
        padding: 0;
        margin-bottom: var(--spacing-md);
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        color: #000;
        page-break-after: avoid;
    }

    footer {
        position: static;
        background: none;
        border-top: 1px solid #000;
        box-shadow: none;
    }

    footer a {
        color: #000;
    }

    a[href^="http"]:after,
    a[href^="mailto"]:after,
    a[href^="tel"]:after {
        content: " (" attr(href) ")";
    }
}
