@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --bg: #ffffff;
    --text: #222222;
    --card-bg: #fbf9ff;
    --border: #ece9f6;
    --primary: #D153C2;
    --accent-start: #D153C2;
    --accent-end: #8a2be2;
    --muted: #77747f;
    --ripple-duration: 600ms;

    --pad-card: 32px;
    --gap-grid: 32px;
    --title-size: 32px;
    --sub-size: 22px;
    --h2-size: 35px;
    --icon-size: 52px;
    --container-padding: 48px;
}

body.dark-mode {
    --bg: #0f0f12;
    --text: #eae8ef;
    --card-bg: #141317;
    --border: #2a2832;
    --primary: #FF63ED;
    --muted: #9a98a6;
    --accent-start: #FF63ED;
    --accent-end: #9b6bff;
}


* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Roboto', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: var(--container-padding);
}

.container {
    max-width: 980px;
    margin: 0 auto;
}


.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

h2 {
    margin: 0;
    font-weight: 700;
    font-size: var(--h2-size);
    line-height: 1.05;
}

.header-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* visually hidden */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.lang-flag {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    padding: 6px 10px;
    font-size: 20px;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 180ms ease, box-shadow 220ms ease;
}

.lang-flag .flag-emoji {
    font-size: 20px;
    line-height: 1;
}

.lang-flag:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(209, 83, 194, 0.06);
}


.toggle-theme {
    position: relative;
    background: none;
    left: 50%;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    overflow: hidden;
}


.toggle-theme .material-icons {
    font-size: 28px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-grid);
}

@media (max-width: 760px) {
    .nav-grid {
        grid-template-columns: 1fr;
        gap: calc(var(--gap-grid) / 1.5);
        padding: 0 6px;
    }
}


.os-gradient {
    background: linear-gradient(270deg, var(--accent-start), var(--accent-end), var(--accent-start));
    background-size: 600% 600%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 12s linear infinite;
    display: inline-block;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


a.nav-card {
    display: flex;
    gap: 20px;
    align-items: center;
    text-decoration: none;
    background: var(--card-bg);
    border-radius: 14px;
    padding: var(--pad-card);
    color: var(--primary);
    box-shadow: 0 18px 44px rgba(20, 20, 30, 0.07);
    transition: transform 220ms cubic-bezier(.2, .9, .3, 1), box-shadow 220ms, filter 220ms;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    min-height: calc(var(--icon-size) + 24px);
    will-change: transform, box-shadow;
    z-index: 0;
}

a.nav-card::before {
    content: "";
    position: absolute;
    right: -10%;
    top: -30%;
    width: 180%;
    height: 120%;
    background: radial-gradient(closest-side, rgba(209, 83, 194, 0.16), rgba(138, 43, 226, 0.06) 40%, transparent 60%);
    transform: scale(0.98) rotate(-12deg);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 260ms ease;
}

.nav-card:not(.selected):hover {
    animation: floatShadow 4500ms ease-in-out infinite;
    z-index: 2;
}

.nav-card:not(.selected):hover::before {
    animation: glowPulse 4500ms ease-in-out infinite;
}

.nav-card .material-icons {
    font-size: var(--icon-size);
    color: var(--accent-start);
    flex: 0 0 auto;
    line-height: 1;
    z-index: 2;
}


.card-title {
    font-size: var(--title-size);
    font-weight: 700;
    margin: 0 0 6px 0;
    color: inherit;
    z-index: 2;
}

.card-sub {
    font-size: var(--sub-size);
    color: var(--muted);
    margin: 0;
    z-index: 2;
}

span.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple var(--ripple-duration) cubic-bezier(.22, .9, .27, 1) forwards;
    background-color: rgba(255, 255, 255, 0.75);
    pointer-events: none;
    z-index: 3;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.nav-card.selected {
    transform: translateY(-6px);
    border: none;
    color: #fff;
    background-image: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.18),
        0 0 14px hsla(290 90% 60% / 0.26),
        0 0 36px hsla(270 90% 60% / 0.14);
    animation: pulseGlowCard 3.0s ease-in-out infinite;
    will-change: box-shadow, transform;
    z-index: 3;
}

@keyframes pulseGlowCard {
    0% {
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16), 0 0 10px hsla(290 90% 60% / 0.20);
        transform: translateY(-4px);
    }

    50% {
        box-shadow: 0 22px 54px rgba(0, 0, 0, 0.20), 0 0 26px hsla(290 90% 60% / 0.38);
        transform: translateY(-8px);
    }

    100% {
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16), 0 0 10px hsla(290 90% 60% / 0.20);
        transform: translateY(-4px);
    }
}

body.dark-mode .nav-card.selected {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48), 0 0 20px hsla(300 90% 65% / 0.30);
}

.nav-card.selected .material-icons {
    color: #fff;
}

a.nav-card:focus-visible {
    outline: 3px solid rgba(129, 57, 140, 0.18);
    outline-offset: 4px;
}


@keyframes floatShadow {
    0% {
        transform: translateY(0);
        box-shadow: 0 18px 44px rgba(20, 20, 30, 0.07), 0 0 6px hsla(300 90% 60% / 0.05);
    }

    50% {
        transform: translateY(-14px);
        box-shadow: 0 40px 110px rgba(20, 20, 30, 0.14),
            0 0 28px hsla(300 90% 60% / 0.30),
            0 0 56px hsla(270 90% 60% / 0.18);
    }

    100% {
        transform: translateY(0);
        box-shadow: 0 18px 44px rgba(20, 20, 30, 0.07), 0 0 6px hsla(300 90% 60% / 0.05);
    }
}


@keyframes glowPulse {
    0% {
        opacity: 0.08;
        transform: scale(0.98) rotate(-12deg);
    }

    50% {
        opacity: 0.42;
        transform: scale(1) rotate(-12deg);
    }

    100% {
        opacity: 0.08;
        transform: scale(0.98) rotate(-12deg);
    }
}


.fade-out {
    opacity: 0;
    transform: translateY(6px) scale(0.995);
    transition: opacity 200ms ease, transform 200ms ease;
}

.fade-in {
    opacity: 1;
    transform: none;
    transition: opacity 260ms ease, transform 260ms ease;
}


@media (max-width: 520px) {
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-controls {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
    }
}