@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* ============================================
   LIQUID GLASS DESIGN - SHANGHAI ELITE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bar-height: 70px;

    /* Тёмная палитра жидкого стекла */
    --bg-primary: #000000;
    --bg-secondary: #050505;
    --glass-dark: rgba(255, 255, 255, 0.02);
    --glass-medium: rgba(255, 255, 255, 0.04);
    --glass-light: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.1);

    /* Акцентные цвета */
    --accent-primary: #4A7C7E;
    --accent-secondary: #6B46C1;
    --accent-glow: #00D9FF;
    --accent-purple: #8B5CF6;
    --accent-pink: #EC4899;

    /* Текст */
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-dim: rgba(255, 255, 255, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   LIQUID GLASS BACKGROUND
   ============================================ */
.container {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background:
        radial-gradient(circle at 20% 50%, rgba(74, 124, 126, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(107, 70, 193, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 60% 40%, rgba(0, 217, 255, 0.05) 0%, transparent 60%);
    filter: blur(60px);
    animation: liquidFlow 20s ease-in-out infinite;
}

@keyframes liquidFlow {
    0%, 100% { transform: rotate(0deg) scale(1) translate(0, 0); }
    33% { transform: rotate(120deg) scale(1.1) translate(-10%, 10%); }
    66% { transform: rotate(240deg) scale(0.95) translate(10%, -10%); }
}

/* Glass Orbs */
.container::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    top: 10%;
    left: -5%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.02) 40%,
            transparent 70%);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: floatOrb1 25s infinite ease-in-out;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, -50px) scale(1.1); }
}

/* Noise Texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.02;
    z-index: 3;
    pointer-events: none;
    mix-blend-mode: overlay;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255,255,255,.03) 2px, rgba(255,255,255,.03) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(255,255,255,.02) 2px, rgba(255,255,255,.02) 4px);
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================ */
.body-content {
    position: relative;
    z-index: 10;
    padding-top: calc(var(--bar-height) + 40px);
    padding-bottom: calc(var(--bar-height) + 40px);
    min-height: 100vh;
    animation: fadeIn 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 380px));
    gap: 2.5rem;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    justify-content: center;
}

/* ============================================
   GLASSMORPHISM КАРТОЧКИ
   ============================================ */
.card-link {
    text-decoration: none;
    display: block;
}

.outer {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.outer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--glass-hover) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s;
}

.outer::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(
        45deg,
        var(--accent-glow),
        transparent,
        var(--accent-purple),
        transparent,
        var(--accent-pink)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}

.card-link:hover .outer,
.card-link:active .outer {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(74, 124, 126, 0.1);
}

.card-link:hover .outer::before,
.card-link:active .outer::before {
    opacity: 1;
}

.card-link:hover .outer::after,
.card-link:active .outer::after {
    opacity: 0.3;
    animation: borderGlow 4s linear infinite;
}

@keyframes borderGlow {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

/* Touch feedback для мобильных */
@media (hover: none) and (pointer: coarse) {
    .card-link:active .outer {
        transform: translateY(-5px) scale(1.01);
    }
}

.card {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(
        135deg,
        var(--glass-light) 0%,
        var(--glass-medium) 50%,
        var(--glass-dark) 100%
    );
    backdrop-filter: blur(30px) saturate(120%);
    -webkit-backdrop-filter: blur(30px) saturate(120%);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 217, 255, 0.5) 50%,
        transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-link:hover .card::before,
.card-link:active .card::before {
    opacity: 1;
}

.card-link:hover .card,
.card-link:active .card {
    background: linear-gradient(
        135deg,
        var(--glass-hover) 0%,
        var(--glass-light) 50%,
        var(--glass-medium) 100%
    );
    border-color: var(--accent-glow);
}

/* ============================================
   ЗАГОЛОВОК КАРТОЧКИ
   ============================================ */
.card h2 {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-align: center;
    position: relative;
    z-index: 2;
    background: linear-gradient(90deg,
        var(--text-primary) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        var(--text-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    transition: all 0.3s;
}

.card-link:hover .card h2,
.card-link:active .card h2 {
    background-position: 200% center;
}

/* ============================================
   ИЗОБРАЖЕНИЕ В КАРТОЧКЕ
   ============================================ */
.card img {
    width: calc(100% - 20px);
    margin: 0 10px;
    height: auto;
    max-height: calc(100% - 80px);
    object-fit: cover;
    border-radius: 12px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.card-link:hover .card img,
.card-link:active .card img {
    border-color: var(--glass-hover);
}

/* ============================================
   COUNTRY LABEL
   ============================================ */
.country-label {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0.5rem 10px 0;
    padding: 0;
    color: var(--text-secondary);
    letter-spacing: -0.3px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
    line-height: 1.4;
}

.card-link:hover .country-label,
.card-link:active .country-label {
    color: var(--text-primary);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 768px) {
    .home-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }

    .outer {
        max-width: 500px;
        margin: 0 auto;
    }

    .card h2 {
        font-size: 1.2rem;
    }

    .body-content {
        padding-top: calc(var(--bar-height) + 20px);
        padding-bottom: calc(var(--bar-height) + 20px);
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1rem;
    }

    .card h2 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
}