* {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    color: rgb(55, 55, 55);
}

body {
    position: relative;
    height: 100vh;
    height: 100dvh;
    height: var(--real-vh, 100dvh);
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
}

.title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    z-index: 2;
    animation: fadeIn 0.6s ease-out;
}

.lang-switch {
    position: fixed;
    top: 1.2rem;
    left: 1.2rem;
    width: 3.5rem;
    height: 1.75rem;
    border-radius: 999px;
    cursor: pointer;
    padding: 0;
    z-index: 50;
    overflow: hidden;
    background-color: #006AA7;
    background-image:
        linear-gradient(#FECC02, #FECC02),
        linear-gradient(#FECC02, #FECC02);
    background-size: 100% 28%, 14% 100%;
    background-position: 0 44%, 33% 0;
    background-repeat: no-repeat;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: background-color 0.35s ease;
}

.lang-switch.is-en {
    background-color: #012169;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 36'%3E%3Crect width='60' height='36' fill='%23012169'/%3E%3Cpath d='M0 0 L60 36 M60 0 L0 36' stroke='white' stroke-width='7.2'/%3E%3Cpath d='M0 0 L60 36' stroke='%23C8102E' stroke-width='4.8'/%3E%3Cpath d='M60 0 L0 36' stroke='%23C8102E' stroke-width='4.8'/%3E%3Crect x='24' y='0' width='12' height='36' fill='white'/%3E%3Crect x='0' y='12' width='60' height='12' fill='white'/%3E%3Crect x='26' y='0' width='8' height='36' fill='%23C8102E'/%3E%3Crect x='0' y='14' width='60' height='8' fill='%23C8102E'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.lang-knob {
    position: absolute;
    top: 50%;
    left: 3px;
    width: calc(1.75rem - 12px);
    height: calc(1.75rem - 12px);
    border-radius: 50%;
    background: white;
    transform: translateY(-50%);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.lang-switch.is-en .lang-knob {
    left: calc(100% - 1.75rem + 9px);
}

@keyframes colorCycle {

    0%,
    100% {
        color: #ff8c00;
    }

    16.67% {
        color: #b4e600;
    }

    33.33% {
        color: #0ad2ff;
    }

    50% {
        color: #2962ff;
    }

    66.67% {
        color: #9500ff;
    }

    83.33% {
        color: #ff0059;
    }
}

.color-change {
    animation: colorCycle 15s infinite;
}

.circle-container {
    position: relative;
    width: clamp(250px, 30vw, 500px);
    height: clamp(250px, 30vw, 500px);
    animation: fadeIn 0.8s ease-out;
}

.circle {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.face-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(200px, 60%, 300px);
    height: clamp(200px, 60%, 300px);
    z-index: 10;
}

.face-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.nav-item {
    position: absolute;
    width: clamp(60px, 5vw, 80px);
    height: clamp(60px, 5vw, 80px);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;

}

.nav-item:hover {
    transform: scale(1.15);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.nav-item:active {
    transform: scale(1.1);
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--bg-color);
    z-index: -1;
}

.nav-item::after {
    content: attr(data-label);
    position: absolute;
    left: var(--label-left, auto);
    right: var(--label-right, auto);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    padding: 0.4rem 0.8rem 0.6rem 0.8rem;
    font-size: clamp(0.8rem, 1vw, 1rem);
    font-weight: 600;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);

    text-decoration: underline;
    text-decoration-color: var(--text-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: max-content;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
}

.nav-item:hover::after {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.nav-item.expand {
    transform: scale(var(--expand-scale, 30)) !important;
    z-index: 100;
    transition: transform 1s ease !important;
}

.nav-item.expand::after {
    opacity: 0;
    display: none;
    transition: none !important;
}

/* Navigation item colors and positioning */
.nav-item:nth-child(1) {
    --bg-color: linear-gradient(135deg, #b4e600, #8bc34a);
    --text-color: #7cb342;
    --label-left: calc(100% + 0.8rem);
}

.nav-item:nth-child(2) {
    --bg-color: linear-gradient(135deg, #0ad2ff, #00bcd4);
    --text-color: #0097a7;
    --label-left: calc(100% + 0.8rem);
}

.nav-item:nth-child(3) {
    --bg-color: linear-gradient(135deg, #2962ff, #1976d2);
    --text-color: #1565c0;
    --label-right: calc(100% + 0.8rem);
}

.nav-item:nth-child(4) {
    --bg-color: #9500ff;
    --text-color: #6a1b9a;
    --label-right: calc(100% + 0.8rem);
}

.nav-item:nth-child(5) {
    --bg-color: linear-gradient(135deg, #ff0059, #e91e63);
    --text-color: #da256d;
    --label-right: calc(100% + 0.8rem);
}

.nav-item:nth-child(6) {
    --bg-color: linear-gradient(135deg, #ff8c00, #ff9800);
    --text-color: #f57c00;
    --label-left: calc(100% + 0.8rem);
}

.email {
    position: fixed;
    right: 1em;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.email-text {
    writing-mode: vertical-lr;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.05), transparent);
    transition: all 0.3s ease;
    padding: 2rem 1rem;
    letter-spacing: 0.1em;
}

.email:hover .email-text {
    background: linear-gradient(to bottom, #000, #333, #000);
    color: white;
    transform: scale(1.05);
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile layout */
@media (max-width: 768px) {
    /* Push content to top, near the language switch */
    body {
        justify-content: flex-start;
        gap: clamp(0.5rem, 2svh, 1.5rem);
        padding: 4rem 1rem clamp(3rem, 5svh, 4rem); /* top clears lang switch; bottom clears fixed email */
    }

    .title {
        font-size: clamp(1.4rem, 5.5vw, 2rem);
    }

    /* Stack face + nav grid vertically */
    .circle-container {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: clamp(0.5rem, 2.5svh, 1.5rem);
    }

    /* Face icon: pull out of absolute context, show inline */
    .face-container {
        position: static;
        transform: none;
        width: clamp(70px, 12.5svh, 100px);
        height: clamp(70px, 12.5svh, 100px);
    }

    /* Nav: 2-column grid, 3 rows */
    .circle {
        position: static;
        width: 80%;
        max-width: 240px;
        height: auto;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        row-gap: clamp(2.5rem, 8svh, 4.5rem);
        column-gap: 1.5rem;
        justify-items: center;
        padding-bottom: clamp(1.25rem, 3svh, 2.5rem);
    }

    /* Override JS-injected left/top; keep the float transform for subtle animation */
    .nav-item {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: clamp(52px, 9svh, 70px);
        height: clamp(52px, 9svh, 70px);
    }

    /* Labels centered below each button */
    .nav-item::after {
        left: 50% !important;
        right: auto !important;
        top: calc(100% + 0.4rem) !important;
        transform: translateX(-50%) !important;
        font-size: 0.68rem;
        padding: 0.25rem 0.55rem 0.35rem 0.55rem;
    }

    /* Email: pinned to the bottom of the screen */
    .email {
        position: fixed;
        bottom: 1.5rem;
        left: 0;
        right: 0;
        top: auto;
        display: flex;
        justify-content: center;
    }

    .email-text {
        writing-mode: horizontal-tb !important;
        font-size: 0.8rem !important;
        font-weight: 400;
        letter-spacing: 0.05em;
        padding: 0.3rem 1rem !important;
        text-align: center;
        opacity: 0.55;
    }
}