@font-face {
    font-family: 'SangBleuEmpire';
    src: url('assets/SangBleuEmpire-Medium-WebS.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables */
:root {
    --color-bg: #e9e9e2;
    --color-text: #16161d;
    --color-highlight: #6f645a;
    --font-serif: 'SangBleuEmpire', sans-serif;
    --font-sans: Arial, Helvetica, sans-serif;
}

/* Reset and base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    width: 100%;
    font-family: var(--font-serif);
    text-align: center;
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    padding-top: 2.5rem;
}

header .logo {
    display: block;
    margin: 0 auto;
    max-width: 200px;
    max-height: 6.5vh;
    height: auto;
}

/* Main layout */
main {
    flex: 1;
    display: flex;
    gap: 8rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

/* Desktop: Lower the baseline (adjusted here: padding-top) */
@media (min-width: 769px) {
    main {
        padding-top: 13vh;  /* Adjust this value for desired vertical placement */
    }
}

main a {
    text-decoration: none;
    color: inherit;
    flex: 1 1 280px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Section content */
section {
    padding: 1rem;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

section h2 {
    margin: 1rem 0 0.5rem;
    font-size: 1.5rem;
    font-weight: normal;
}

section p {
    font-size: 1rem;
}

/* Ratio wrapper and visual balance */
.clinic-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    max-width: 300px;
    height: 200px;
    margin: auto;
    position: relative;
    overflow: visible;
}

.clinic-wrapper.tall {
    transform: scale(1.2);
    transform-origin: center bottom;
}

/* Image styling */
.clinic-img {
    display: block;
    max-height: 150%;
    max-width: 150%;
    object-fit: contain;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    opacity: 0;
    animation: fadeInUp 1.8s ease-out forwards;
}

.clinic-wrapper:hover .clinic-img {
    transform: scale(1.05) translateY(-2.5%);
    opacity: 0.8;
}

/* Footer */
footer {
    font-size: 0.6rem;
    font-family: var(--font-sans);
    padding-top: 4rem;
    padding-bottom: 2.5rem;
    background: var(--color-bg);
    color: var(--color-text);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    main {
        gap: 3rem;
        padding-top: 0; /* Remove extra space for mobile */
    }

    header .logo {
        max-height: 5vh;
        margin-top: 1rem;
    }

    footer {
        padding-bottom: 3.5rem;
    }

    .clinic-img {
        max-width: 100% !important;
        max-height: 100% !important;
        width: 100%;
        height: auto;
    }
}

/* === Fade In and Shine Animation === */
@keyframes fadeInUp {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shine {
    0% {
        background-position: -200%;
    }

    100% {
        background-position: 200%;
    }
}

/* Animate only inline text elements */
h1,
h2,
h3,
p,
span {
    opacity: 0;
    animation-name: fadeInUp, shine;
    animation-duration: 1.8s, 2.5s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out, ease-in-out;
    background: linear-gradient(90deg, var(--color-text), var(--color-highlight), var(--color-text));
    background-size: 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

/* Alternate gradient direction for shared illusion */
h1:nth-of-type(even),
h2:nth-of-type(even),
p:nth-of-type(even),
span:nth-of-type(even) {
    background: linear-gradient(270deg, var(--color-text), var(--color-highlight), var(--color-text));
    background-size: 200%;
    background-clip: text;
    -webkit-background-clip: text;
}

/* Fix hover restoring solid color */
h1:hover,
h2:hover,
h3:hover,
p:hover,
span:hover {
    background: none;
    -webkit-background-clip: unset;
    color: var(--color-highlight);
    -webkit-text-fill-color: var(--color-highlight);
}

/* Staggered fade-in delays */
h1:nth-of-type(1) {
    animation-delay: 0.1s, 2.4s;
}

h2:nth-of-type(1) {
    animation-delay: 0.2s, 2.4s;
}

p:nth-of-type(1) {
    animation-delay: 0.3s, 2.4s;
}

h2:nth-of-type(2) {
    animation-delay: 0.4s, 2.4s;
}

p:nth-of-type(2) {
    animation-delay: 0.5s, 2.4s;
}

footer span {
    animation-delay: 0.6s, 2.4s;
}