:root {
    --page-bg: #3fe0d0;
    --top-bg: #34b6aa;
    --text: #333;
    --button: #333;
    --button-hover: #555;
    --container-max: 560px;
    --container-pad: 20px;
    --image-max-width: 420px;
    
    /* Mobile-first: make image taller on phones for better presence */
    --image-height: clamp(420px, 108vw, 620px);
}

/* Very small phones */
@media (max-width: 360px) {
    :root {
        --container-pad: 16px;
        --image-max-width: 342px;
        --image-height: clamp(420px, 140vw, 640px);
        /* --title-font-size: clamp(32px, 8vw, 48px); */
        --title-font-size: 32px;
        --title-margin-top: 42px;
        --title2-margin-top: 4px;
        --tagline-font-size: clamp(12px, 3.8vw, 15px);
    }
}

/* Larger phones/tablet */
@media (min-width: 480px) and (max-width: 767px) and (max-resolution: 2dppx) {
    :root {
        --image-max-width: 342px;
        --image-height: clamp(420px, 90vw, 620px);
        /* --title-font-size: clamp(32px, 8vw, 48px); */
        --title-font-size: 32px;
        --title-margin-top: 42px;
        --title2-margin-top: 4px;
        --tagline-font-size: clamp(12px, 3.8vw, 15px);
    }
}

/* Desktop */
@media (min-width: 768px) {
    :root {
        --container-pad: 16px;
        --image-max-width: 342px;
        --image-height: clamp(0px, 22vw, 640px);
        --title-font-size: 12px;
        --title-margin-top: 10px;
        --title2-margin-top: 4px;
        --tagline-font-size: 10px;
    }
}

/* High-DPI displays */
@media (min-width: 480px) and (max-width: 767px) and (min-resolution: 3dppx) {
    :root {
        --container-pad: 16px;
        --image-max-width: 80px;
        --image-height: clamp(0px, 22vw, 640px);
        --title-font-size: 20px;
        --title-margin-top: 10px;
        --title2-margin-top: 4px;
        --tagline-font-size: 10px;
    }
}

body {
    margin: 0;
    font-family: "Playfair Display", serif;
    background-color: var(--page-bg);
    text-align: center;
    color: var(--text);
}

.top {
    height: calc(var(--image-height) / 2);
    background-color: var(--top-bg);
}

.container {
    max-width: var(--container-max);
    margin: auto;
    padding: var(--container-pad);
}

.profile-img {
    /* Use viewport width so image fills small screens better */
    width: min(86vw, var(--image-max-width));
    height: var(--image-height); 
    object-fit: cover;
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
    display: block;
    margin: 0 auto;
    margin-top: calc(-1 * var(--image-height) / 2);

    border: 15px solid #3fe0d0;
}

h1 {
    font-weight: 400;
    margin: 0;    
}

.title {
    font-size: clamp(32px, 8vw, 48px);
    line-height: 1.2;
    margin-top: var(--title-margin-top);    
}

.title2 {
    font-size: clamp(32px, 8vw, 48px);    
    line-height: 1.2;
    margin-top: var(--title2-margin-top);
}

p.tagline {
    font-size: clamp(12px, 3.8vw, 15px);
    font-weight: 500;
    margin: 12px 0 28px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button {
    display: block;
    background-color: var(--button);
    color: white;
    text-decoration: none;
    padding: 16px 18px;
    margin: 12px auto;
    border-radius: 90px;
    width: min(94%, 520px);
    font-size: clamp(16px, 4.5vw, 18px);
    transition: background-color 0.3s ease;
    text-align: left;
}

.button:hover {
    background-color: var(--button-hover);
}

@media (prefers-reduced-motion: reduce) {
    .button {
        transition: none;
    }
}

.button-img {
    width: clamp(52px, 14vw, 64px);
    height: clamp(52px, 14vw, 64px);
    vertical-align: middle;
    margin-right: 12px;
    padding: 0px;
}

.footer-link {
    margin-top: 30px;
    font-size: 0.9em;
    color: var(--text);
    text-decoration: none;
}

/* Services Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #76ece1;
    margin: 1% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.close:hover {
    opacity: 0.7;
    background-color: rgba(255, 255, 255, 1);
}

.services-timeline {
    padding: 24px;
    max-height: 95vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.service-item {
    position: relative;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    background-color: #34b6aa;
    border: 2px solid #34b6aa;
}

.service-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.service-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    min-height: 100px;
    background-color: #34b6aa;
    border-radius: 12px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1% auto;
    }
    
    .services-timeline {
        gap: 16px;
        padding: 16px;
    }
    
    .close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

/* Animation for modal appearance */
.modal.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content.show {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
