html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
    background-color: #ADC3D1;
    color: black;
    font-family: sans-serif;
}

#page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Full-width About Me Icon */
.icon-item.full-width {
    display: block;
    text-align: center;  /* center text below icon */
}

.icon-item.full-width img {
    height: 200px;   /* bigger than before */
    width: 100%;      /* spans most of the page */
    max-width: none; /* optional limit */
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.icon-item.full-width .static-text {
    margin-top: 0.25rem; /* smaller gap from the icon */
    font-size: 1.05rem;
    line-height: 1.2;
    text-align: center;
    max-width: none;
}

/* Contact icon - bottom right rotated */
.contact-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    text-align: center;
    transform: rotate(45deg);
    z-index: 1000; /* make sure it’s on top */
    cursor: pointer;
}

.contact-icon img {
    height: 40px;
    width: 25px;
}

/* Horizontal Zig-Zag Icons 3,4,5 */
.icon-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin: 3rem 0;
    position: relative;
    z-index: 1; /* ensure it’s above background but below icon 2 if necessary */
    margin-bottom: 120px; /* leave space for icon 2 */
}

.icon-grid .icon-item:nth-child(1) {
    transform: translateY(-40px); /* raise first in zig-zag */
}

.icon-grid .icon-item:nth-child(2) {
    transform: translateY(20px); /* middle zig-zag lower */
}

.icon-grid .icon-item:nth-child(3) {
    transform: translateY(-40px); /* last zig-zag higher */
}

/* Icon base styling */
.icon-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.4s ease;
}

.icon-item img {
    height: 200px;
    width: auto;
    max-width: none;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
    transition: transform 0.3s ease;
}

/* Active state for icons 3-5 */
.icon-item.active {
    transform: scale(1.4);
    z-index: 10;
    opacity: 1;
}

.static-text {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-top: 0rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Content for clickable icons */
.icon-content {
    display: none;
    margin-top: 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
}

.icon-item.active .icon-content {
    display: block;
}

/* Legend bottom horizontal */
#number-legend {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1.5rem;
    background-color: rgba(255, 255, 255, 0.1); /* subtle transparent */
    color: black;
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-weight: 500;
    line-height: 1.5;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(0,0,0,0.1);
}

#number-legend p {
    margin: 0;
}

.email-text {
    position: fixed;           /* relative to viewport */
    left: 50%;                 /* starting reference point */
    top: 90%;                  /* bottom-ish of viewport */
    transform: translate(-50%, -50%) scale(1);
    z-index: 1000;
    pointer-events: none;

    offset-path: path(
        "M 0 0
         C -150 -100, -200 -100, -200 0
         C -200 150, 0 200, 0 200
         C 0 200, 200 150, 200 0
         C 200 -100, 150 -100, 0 0"
    );
    -webkit-offset-path: path(
        "M 0 0
         C -150 -100, -200 -100, -200 0
         C -200 150, 0 200, 0 200
         C 0 200, 200 150, 200 0
         C 200 -100, 150 -100, 0 0"
    );
    offset-distance: 0%;
}

/* Flying along heart path */
.email-text.fly {
    animation: heart-flight 5s ease-in-out forwards;
}

@keyframes heart-flight {
    0% { offset-distance: 0%; transform: translate(-50%, -50%) scale(1); opacity: 1; }
    40% { offset-distance: 40%; transform: translate(-50%, -50%) scale(1.3); }
    50% { offset-distance: 50%; transform: translate(-50%, -50%) scale(1.5); }
    60% { offset-distance: 60%; transform: translate(-50%, -50%) scale(1.3); }
    100% { offset-distance: 100%; transform: translate(-50%, -50%) scale(1); opacity: 0; }
}


/* Media query for mobile */
@media (max-width: 768px) {
    .icon-grid {
        flex-direction: column;
        gap: 2rem;
    }

    .icon-grid .icon-item:nth-child(1),
    .icon-grid .icon-item:nth-child(2),
    .icon-grid .icon-item:nth-child(3) {
        transform: translateY(0);
    }

    .icon-item.active {
        transform: scale(1.3);
    }

    .contact-icon {
        position: fixed;
        bottom: 20px;
        right: 20px;
        text-align: center;
        transform: rotate(45deg);
        z-index: 10; /* ensure it's on top */
        cursor: pointer;
    }
}
