/* --- Переменные и сброс --- */
:root {
    /* Dark Theme (Default) */
    --bg: #030014;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(255, 255, 255, 0.06);
    --primary: #7000ff;
    --primary-glow: #a259ff;
    --secondary: #00c6ff;
    --text: #ffffff;
    --text-muted: #94a3b8;
    --gold: #fbbf24;
    --orb-opacity: 0.4;
    --nav-bg: rgba(3, 0, 20, 0.7);
    --btn-control-bg: rgba(255,255,255,0.05);
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Адаптивные отступы */
    --container-padding: clamp(16px, 5vw, 24px);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.6);
    --card-border: rgba(0, 0, 0, 0.05);
    --card-hover: rgba(255, 255, 255, 0.9);
    --text: #0f172a;
    --text-muted: #64748b;
    --orb-opacity: 0.15;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --btn-control-bg: rgba(0, 0, 0, 0.05);
    --primary: #6366f1;
    --primary-glow: #818cf8;
}

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

body {
    background-color: var(--bg); color: var(--text); font-family: var(--font-body);
    line-height: 1.6; overflow-x: hidden; min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; } 
ul { list-style: none; }
button { border: none; outline: none; background: none; font-family: inherit; }

/* --- Фон --- */
.background-gradient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; overflow: hidden; background: var(--bg);
    transition: background 0.3s;
}
.orb { 
    position: absolute; border-radius: 50%; filter: blur(80px); 
    opacity: var(--orb-opacity); 
    animation: float 20s infinite alternate ease-in-out; 
    transition: opacity 0.3s; 
    will-change: transform; 
}
.orb-1 { width: 600px; height: 600px; background: var(--primary); top: -100px; left: -100px; animation-duration: 25s; }
.orb-2 { width: 500px; height: 500px; background: var(--secondary); bottom: -100px; right: -100px; animation-duration: 30s; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: #ff0055; top: 40%; left: 30%; opacity: 0.2; animation-duration: 20s; animation-delay: -10s; }

@media (max-width: 768px) {
    .orb { filter: blur(60px); opacity: calc(var(--orb-opacity) * 0.7); }
}

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

.grid-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(128, 128, 128, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(128, 128, 128, 0.05) 1px, transparent 1px);
    background-size: 40px 40px; z-index: -1; 
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--container-padding); }

/* --- Navbar --- */
.navbar {
    padding: 16px 0; position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    background: var(--nav-bg); transition: all 0.3s;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.nav-right { display: flex; align-items: center; gap: 12px; }

.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.5px; color: var(--text); }
.logo-img { width: 32px; height: 32px; border-radius: 8px; }

.control-group { display: flex; gap: 8px; align-items: center; }

.nav-btn-pill {
    background: var(--btn-control-bg); border: 1px solid var(--card-border); color: var(--text);
    padding: 6px 12px; border-radius: 99px; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; font-family: var(--font-heading); font-weight: 600;
    transition: all 0.2s;
}
.nav-btn-pill:hover, .nav-btn-pill.active { background: var(--card-hover); border-color: var(--primary); color: var(--primary); }

.nav-btn-circle {
    background: var(--btn-control-bg); border: 1px solid var(--card-border); color: var(--text);
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; transition: all 0.2s;
}
.nav-btn-circle:hover { background: var(--card-hover); border-color: var(--text); color: var(--text); }

.lang-wrapper { position: relative; }
.lang-dropdown {
    position: absolute; top: 140%; right: 0; left: auto;
    background: var(--nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border); border-radius: 12px; padding: 6px;
    min-width: 150px; opacity: 0; visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); transform: translateY(-10px);
}
.lang-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px;
    color: var(--text); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.lang-option:hover { background: var(--card-hover); }
.lang-option.active { background: var(--card-hover); color: var(--primary); }
.flag { font-size: 1.1rem; }

.btn-primary {
    padding: 10px 20px; background: var(--text); color: var(--bg); border-radius: 99px;
    font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px;
    transition: transform 0.2s, background 0.3s; white-space: nowrap;
}
.btn-primary:hover { transform: scale(1.05); }

/* --- Hero Section --- */
.hero { 
    padding-top: clamp(120px, 15vh, 160px); 
    padding-bottom: 60px; 
    text-align: center; 
    overflow: visible; 
}
.hero-badge { 
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; 
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 99px; 
    font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; 
}
.pulse { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3); }
.hero-title { 
    font-family: var(--font-heading); 
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700; line-height: 1.1; margin-bottom: 24px; letter-spacing: -0.02em; color: var(--text); 
}
.text-gradient { background: linear-gradient(135deg, var(--text) 0%, var(--primary-glow) 50%, var(--secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: clamp(1rem, 3vw, 1.2rem); color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; padding: 0 10px; }

.hero-buttons { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.btn-glow { 
    padding: 16px 32px; background: linear-gradient(135deg, var(--primary), var(--secondary)); 
    color: #fff; border-radius: 99px; font-weight: 600; font-size: 1.1rem; 
    display: flex; align-items: center; gap: 10px; 
    box-shadow: 0 0 40px rgba(112, 0, 255, 0.4); transition: all 0.3s; 
}
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 0 60px rgba(112, 0, 255, 0.6); }

/* Звезды рейтинга */
.users-rating { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.9rem; }
@media(min-width: 600px) { .users-rating { flex-direction: row; gap: 12px; } }
.stars-row { display: flex; gap: 4px; color: var(--gold); font-size: 1.1rem; filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.3)); }
.stars-row i { opacity: 0; transform: scale(0); animation: starPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.stars-row i:nth-child(1) { animation-delay: 1.2s; } .stars-row i:nth-child(2) { animation-delay: 1.3s; } .stars-row i:nth-child(3) { animation-delay: 1.4s; } .stars-row i:nth-child(4) { animation-delay: 1.5s; } .stars-row i:nth-child(5) { animation-delay: 1.6s; }
@keyframes starPop { to { opacity: 1; transform: scale(1); } }

/* --- 3D Mockup (Optimized) --- */
.hero-mockup-wrapper {
    margin-top: 60px;
    perspective: 1200px;
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

.browser-window {
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    background: rgba(20, 20, 35, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 20px 50px -10px rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

[data-theme="light"] .browser-window {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.5) inset,
        0 30px 60px -20px rgba(50, 50, 93, 0.15);
}

.glass-reflection { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.05) 50%, transparent 60%); pointer-events: none; }

.window-header {
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    flex-shrink: 0;
}
.dots { display: flex; gap: 8px; flex-shrink: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; position: relative; }
.dot::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%; box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
.red { background: #ff5f57; } .yellow { background: #febc2e; } .green { background: #28c840; }

.address-bar {
    flex: 1; height: 32px; background: rgba(0, 0, 0, 0.15); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
    color: var(--text-muted); max-width: 460px; margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.05); transition: 0.2s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px;
}
[data-theme="light"] .address-bar { background: rgba(255, 255, 255, 0.5); border-color: rgba(0, 0, 0, 0.05); color: var(--text); font-weight: 500; }

.window-content { flex: 1; display: flex; position: relative; overflow: hidden; }

.app-sidebar {
    width: 72px; border-right: 1px solid rgba(255, 255, 255, 0.05); background: rgba(0, 0, 0, 0.02);
    display: flex; flex-direction: column; align-items: center; padding: 24px 0; gap: 16px; flex-shrink: 0;
}
.sidebar-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    color: var(--text-muted); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); cursor: default;
}
.sidebar-icon.active { background: var(--primary); color: #fff; box-shadow: 0 8px 20px -4px var(--primary-glow); }
.sidebar-divider { width: 24px; height: 1px; background: var(--card-border); margin: 4px 0; }
.sidebar-icon.add { border: 1px dashed var(--text-muted); background: transparent; }

.app-main {
    flex: 1; padding: 40px; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-start; overflow-y: auto; position: relative; width: 100%;
}

.app-widgets { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 30px; }
.widget-clock {
    font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 700; font-family: var(--font-heading);
    line-height: 1; letter-spacing: -2px;
    background: linear-gradient(180deg, var(--text) 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 10px;
}
[data-theme="light"] .widget-clock { background: linear-gradient(180deg, var(--text) 0%, rgba(0,0,0,0.6) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.widget-weather { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 32px; display: flex; align-items: center; gap: 8px; }

.app-search {
    width: 100%; max-width: 520px; height: 52px;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px;
    display: flex; align-items: center; padding: 0 24px; gap: 16px;
    color: var(--text-muted); margin-bottom: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.app-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px;
    width: 100%; max-width: 640px;
}
.dial-card {
    aspect-ratio: 1/1; background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border); border-radius: 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; transition: 0.3s; cursor: default;
    opacity: 0; animation: popIn 0.5s forwards; animation-delay: var(--delay);
}
.dial-card:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-4px); }
.dial-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.dial-name { font-size: 0.7rem; font-weight: 500; color: var(--text); }
.youtube { background: #ff0000; } .telegram { background: #229ED9; } .github { background: #333; } .figma { background: #F24E1E; }
.add-dial { border: 1px dashed var(--card-border); color: var(--text-muted); }
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* --- Bento Grid (Improved) --- */
.features { padding: 80px 0; }
.section-title { font-size: clamp(2rem, 5vw, 2.5rem); margin-bottom: 40px; text-align: center; font-family: var(--font-heading); color: var(--text); }

.bento-grid { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; 
}
.bento-card { 
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 24px; 
    padding: 32px; display: flex; flex-direction: column; justify-content: space-between; 
    transition: 0.3s; overflow: hidden; position: relative; min-height: 280px;
}
.bento-card:hover { border-color: rgba(128,128,128,0.2); background: var(--card-hover); transform: translateY(-5px); }

@media (min-width: 768px) { .bento-card.wide { grid-column: span 2; } }

.icon-box { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; background: rgba(128,128,128,0.1); }
.purple { color: #d946ef; } .green { color: #22c55e; } .blue { color: #3b82f6; } .orange { color: #f97316; }
.yellow { color: #f59e0b; } .pink { color: #ec4899; } .cyan { color: #06b6d4; }

.bento-card h3 { font-size: 1.3rem; margin-bottom: 8px; font-weight: 600; color: var(--text); }
.bento-card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
.card-visual { position: absolute; bottom: 20px; right: 20px; display: flex; gap: 10px; opacity: 0.7; pointer-events: none; }

.folders-visual .mini-folder { padding: 6px 12px; background: rgba(128,128,128,0.1); border-radius: 8px; font-size: 0.8rem; color: var(--text); }
.folders-visual .mini-folder.active { background: var(--primary); color: #fff; }
.stats-visual { align-items: flex-end; height: 60px; }
.stats-visual .bar { width: 10px; background: var(--secondary); border-radius: 4px; }
.widgets-visual { gap: 8px; }
.mini-widget { padding: 8px 14px; background: rgba(128,128,128,0.1); border-radius: 20px; font-size: 0.8rem; display: flex; align-items: center; gap: 6px; color: var(--text); }
.search-visual { width: 70%; height: 40px; right: 15%; bottom: 30px; }
.mini-search-bar { width: 100%; height: 100%; background: rgba(128,128,128,0.1); border-radius: 20px; display: flex; align-items: center; padding: 0 15px; gap: 10px; font-size: 18px; color: var(--text-muted); }
.mini-search-bar .line { height: 4px; width: 40%; background: rgba(128,128,128,0.2); border-radius: 2px; }
.bg-visual { align-items: center; }
.bg-circle { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); margin-left: -10px; }
[data-theme="light"] .bg-circle { border-color: rgba(0,0,0,0.1); }
.c1 { background: linear-gradient(45deg, #ff00cc, #333399); }
.c2 { background: linear-gradient(45deg, #00dbde, #fc00ff); }
.c3 { background: linear-gradient(45deg, #f8b500, #fceabb); }

/* --- Footer --- */
.footer { border-top: 1px solid var(--card-border); padding: 40px 0; margin-top: 80px; font-size: 0.9rem; color: var(--text-muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--primary); }

/* --- Mobile Specific Adjustments --- */
@media (max-width: 768px) {
    .browser-window { aspect-ratio: unset; min-height: 500px; border-radius: 12px; }
    .window-header { padding: 0 12px; height: 44px; }
    .address-bar { font-size: 0.75rem; margin: 0 10px; }
    .app-sidebar { width: 56px; padding: 16px 0; }
    .sidebar-icon { width: 32px; height: 32px; font-size: 16px; }
    .app-main { padding: 24px 16px; }
    .widget-clock { font-size: 3rem; }
    .app-search { height: 44px; margin-bottom: 24px; }
    .app-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .dial-card { border-radius: 16px; }
    .dial-icon { width: 36px; height: 36px; font-size: 20px; }
}

@media (max-width: 600px) {
    .btn-primary span { display: none; }
    .btn-primary i { margin: 0; font-size: 1.2rem; }
    .btn-primary { padding: 8px 12px; }
    .current-lang { font-size: 0.8rem; }
    
    .hero-mockup-wrapper { margin-top: 40px; }
    .browser-window { box-shadow: 0 10px 30px -10px rgba(0,0,0,0.2); }
    
    .bento-grid { grid-template-columns: 1fr; }
    .bento-card.wide { grid-column: auto; }
    .bento-card { min-height: auto; padding: 24px; }
    .card-visual { position: relative; bottom: auto; right: auto; margin-top: 20px; justify-content: flex-start; }
    
    .footer-inner { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 480px) {
    .app-grid { grid-template-columns: repeat(2, 1fr); }
    .app-sidebar { display: none; }
}

/* --- Utils --- */
.fade-in { opacity: 0; transform: translateY(20px); transition: 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; } .delay-2 { transition-delay: 0.2s; } .delay-3 { transition-delay: 0.3s; } .delay-4 { transition-delay: 0.4s; }

/* --- Стили для страницы 404 --- */
.error-screen { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 100px 20px; }
.error-card { background: var(--nav-bg); backdrop-filter: blur(20px); border: 1px solid var(--card-border); border-radius: 32px; padding: 60px 40px; text-align: center; width: 100%; max-width: 600px; margin: 0 auto; position: relative; overflow: hidden; box-shadow: 0 50px 100px -20px rgba(0,0,0,0.2); transform-style: preserve-3d; transition: transform 0.1s; }
[data-theme="light"] .error-card { background: rgba(255,255,255,0.8); }
.error-code { font-family: var(--font-heading); font-size: clamp(5rem, 15vw, 8rem); line-height: 1; font-weight: 700; margin: 0; color: var(--text); position: relative; display: inline-block; letter-spacing: -5px; background: linear-gradient(135deg, var(--text) 30%, var(--primary-glow) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.error-title { font-size: 2rem; margin-top: 20px; margin-bottom: 16px; background: linear-gradient(to right, var(--text), var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.error-desc { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; line-height: 1.6; }
.error-actions { display: flex; justify-content: center; }
.error-code::before, .error-code::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg); opacity: 0.8; transition: background 0.3s; }
.error-code::before { color: #0ff; z-index: -1; animation: glitch-effect 3s infinite; -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 2px 0 #0ff; clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%); }
.error-code::after { color: #f0f; z-index: -2; animation: glitch-effect 2s infinite reverse; -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: -2px 0 #f0f; clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%); }
@keyframes glitch-effect { 0% { transform: translate(0); } 20% { transform: translate(-2px, 2px); } 40% { transform: translate(-2px, -2px); } 60% { transform: translate(2px, 2px); } 80% { transform: translate(2px, -2px); } 100% { transform: translate(0); } }